Re: [css3-writing-modes] fit-content equation is backwards from the CSS2.1 spec

(12/06/14 3:20), Elliott Sprehn wrote:
> I'm trying to implement the writing mode width and height keywords in
> webkit and I realized the equation is backwards in the spec from the
> one it references.
>
> http://dev.w3.org/csswg/css3-writing-modes/#intrinsic-sizing
>
> max(min-content, min(max-content, fill-available))
>
> http://www.w3.org/TR/CSS21/visudet.html#float-width
>
> min(max(preferred minimum width, available width), preferred width)
>
> which seems to be equivalent with the new keywords to:
>
> min(max-content, max(min-content, fill-available))

(12/06/14 4:11), Elliott Sprehn wrote:
> On Wed, Jun 13, 2012 at 1:01 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:
> 
>> ..
>>
>> The two orderings are functionally identical, no?
> 
> 
> Hmm, yeah they are since max-content >= min-content, if that wasn't true
> they're different.

If I understand how browsers calculate max-content/min-content measure
correctly, this invariant doesn't even hold in CSS 2.1. Test case:

  data:text/html,<div style="word-spacing: -3em; border: red solid;
float: left;">A B</div>

If "max(min-content, min(max-content, fill-available))" were used, the
'width' would be 'min-content' and the red border would be surrounding A
and B, not collapsed to a line as what's shown in Chrome20 and Firefox
13 (Opera12alpha has certain limit to negative 'word-spacing' so this
can't show the difference and I don't have IE to test with at the moment).


But even if I am doing something wrong with this experiment, I agree
with Ojan because this difference confused me too.


Cheers,
Kenny

Received on Monday, 16 July 2012 15:27:29 UTC