W3C home > Mailing lists > Public > www-style@w3.org > July 2012

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

From: Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Date: Mon, 16 Jul 2012 23:26:59 +0800
Message-ID: <500432C3.8020003@csail.mit.edu>
To: Elliott Sprehn <esprehn@gmail.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, WWW Style <www-style@w3.org>
(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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:56 GMT