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

Re: [css3-intrinsic-sizing] sizing percentage width content in quirks mode

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 5 Sep 2012 17:02:16 -0700
Message-ID: <CAAWBYDDbkyMD_sJ5_MV4JHscvQTdUMLM40GGGaUfBzU2sTKiQA@mail.gmail.com>
To: Ojan Vafai <ojan@chromium.org>
Cc: "L. David Baron" <dbaron@dbaron.org>, www-style@w3.org
On Wed, Sep 5, 2012 at 3:24 PM, Ojan Vafai <ojan@chromium.org> wrote:
> On Wed, Aug 8, 2012 at 3:03 PM, L. David Baron <dbaron@dbaron.org> wrote:
>>
>> On Wednesday 2012-08-08 14:25 -0700, Ojan Vafai wrote:
>> > Before I start fixing bugs, what should we do in these cases? It seems
>> > to
>> > me that respecting min-content/max-content is a no-brainer.
>>
>> I presume you're talking about respecting
>> width:min-content/max-content on an element E when computing one of
>> the intrinsic widths of E's parent P.
>
>
> Correct.
>
> Here's a better example of case 3 where WebKit and Gecko disagree:
> <div style="width: 100px; background-color: salmon">
> <div style="display:inline-block; border: 5px solid orange; width:
> min-content;">
>     <div style="display:inline-block; width: max-content;">abcdefg
> hijklmndop</div>
> </div>
> </div>
>
> The Gecko behavior is clearly better. I'd just like to see it clearly
> specced. I'll file a bug to fix this in WebKit.

Gecko's behavior (where the text is on one line) is actually specced
now.  You have to follow some definitions, but it's all there and (I
think) reasonably clear:

# The min-content measure of a block container box
# is the measure of the box after layout, if all children
# are sized under a min-size constraint.
#
# min-size constraint
#    A sizing constraint imposed by the box's containing block
#    that causes it to produce its min-size contribution.
#
# If the computed measure of a block-level box is ‘min-content’,
# ‘max-content’, or a definite size, its min-measure contribution
# is that size plus any inline-axis margin, border, and padding.
# Otherwise, if the computed measure of the block is ‘fit-content’,
# ‘auto’, or ‘fill-available’, its min-measure contribution is its
# min-content measure plus any inline-axis margin, border, and
# padding.

In other words, for the purposes of shrinkwrapping or max-sizing,
min/max-content is treated the same as a definite size, in that it
figures out it's size by itself and the sizing algorithm doesn't
recurse further into the list of children.


> Maybe the best thing to do for percentages is to treat intrinsic sizes the
> same way we do auto as that adds the least complexity and does something
> reasonable-ish?

Yeah, I'm fine with that.  We do need to specify this.

~TJ
Received on Thursday, 6 September 2012 00:03:03 GMT

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