W3C home > Mailing lists > Public > www-style@w3.org > February 2013

Re: [css3-sizing] intrinsic widths of replaced elements inside flexboxes

From: L. David Baron <dbaron@dbaron.org>
Date: Tue, 12 Feb 2013 16:25:58 -0800
To: Ojan Vafai <ojan@chromium.org>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <20130213002558.GA24501@crum.dbaron.org>
On Tuesday 2013-02-12 16:13 -0800, Ojan Vafai wrote:
> TL;DR: I think we need to add something like the following to the
> css3-sizing spec: The min-measure *contribution* of a replaced element with
> a percentage width to the min-content measure of a table cell is 0.

I think the "contribution" idea here is correct; the 'width',
'min-width', and 'max-width' properties on an element do not affect
its own min-content width, but they do affect the min-content width
of its parent.  When I wrote http://dbaron.org/css/intrinsic/ I used
the term "outer minimum intrinsic width" for what you call
"contribution" (though it also involved adjusting from content-box
to margin-box widths).

> Also, this quirk only applies to percentage width, not percentage
> min-width/max-width (e.g. <img style="min-width: 100%"> does not apply this
> quirk).

I'd actually suggest avoiding the word "quirk" here, since it's not
a quirks-mode behavior.

> DETAILS:
> There's a bit of an obscure quirk on the intrinsic size of replaced
> elements with a percentage width. Their min content measure is set to 0. I
> believe it only applies to replaced elements inside table cells, but I'm
> not 100% sure.

In Gecko it applies to all replaced elements with percentage
widths or calc() widths containing a percentage (for our internal
definition of "replaced element" which probably doesn't exactly
match the spec's).

The code is here:
http://hg.mozilla.org/mozilla-central/file/fdf15fa098d9/layout/base/nsLayoutUtils.cpp#l2871

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Wednesday, 13 February 2013 00:26:23 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:05 GMT