Re: [css21][css-sizing][web compat] max-width and intrinsic sizes in a table scenario

On Tue, Dec 8, 2015 at 6:51 PM, L. David Baron <dbaron@dbaron.org> wrote:
> On Tuesday 2015-10-27 09:44 +0900, Karl Dubost wrote:
>> Gecko (Firefox) has a Webcompat issue related to the use of `max-width` inside `table`. I put an example on Codepen [1].
>>
>> For Webcompat reasons with Blink and WebKit, we will probably need to modify Gecko code (see Bugzilla [2]). In the seeAlso section of this bug, you will find some of the reported Web Compat issues.
>>
>> What I would like to know is if the CSS specification needs to be changed to reflect the reality.
> [...]
>> Currently Blink and Safari are reducing the image so it fits the viewport.
>> You can see this in recent Web Compat bugs
>> https://webcompat.com/issues/1838
>> https://webcompat.com/issues/1837
>>
>> I summarized the issue in the webcompat space [4].
>
> So the underlying behavior here that needs to be specified is (using
> css-sizing terminology) that when either 'width' or 'max-width' on a
> replaced element is a percentage, that element's min-content
> contribution is zero.  Note that given that this occurs for
> 'max-width', this needs to override the rule that the min-content
> contribution is determined by the specified size, since a replaced
> element with "width: 100px; max-width: 50%" has a min-content
> contribution of 0.


Hi David.

So would be the width of outer div here:

<container of width 100px>

<div style="width:100%; max-width:min-content; ">

    <div style="width: 100px; max-width: 50%" />

</div>

</container>

?

As for me it should be 50px. But it appears as you are saying it should be zero?


>
> The relevant section of the specification is:
> http://dev.w3.org/csswg/css-sizing/#replaced-intrinsic
>
> At least, that's the relevant specification assuming a relatively
> strict definition of replaced element.  This rule should not apply
> to form controls and similar things that aren't explained by CSS.
> It should only apply to things that do replaced element sizing such
> as images, plugins, videos, and iframes.
>
> I'm not sure if we have a clear enough definition of replaced
> element, or whether we perhaps need two definitions.
>
> -David
>
>> [1]: http://codepen.io/anon/pen/rOdpdW
>> [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=823483
>> [3]: https://drafts.csswg.org/css2/visudet.html#propdef-max-width
>> [4]: https://github.com/whatwg/compat/issues/12
>
> --
> 𝄞   L. David Baron                         http://dbaron.org/   𝄂
> 𝄢   Mozilla                          https://www.mozilla.org/   𝄂
>              Before I built a wall I'd ask to know
>              What I was walling in or walling out,
>              And to whom I was like to give offense.
>                - Robert Frost, Mending Wall (1914)


-- 
Andrew Fedoniouk.

http://sciter.com

Received on Wednesday, 9 December 2015 05:01:03 UTC