W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2020

Re: [csswg-drafts] [CSS21] error in 10.3.2 Inline, replaced elements (#5583)

From: davidsgrogan via GitHub <sysbot+gh@w3.org>
Date: Mon, 02 Nov 2020 22:44:09 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-720766799-1604357048-sysbot+gh@w3.org>
Actually, I think the case I posted in the last comment is controlled by https://www.w3.org/TR/CSS2/visudet.html#min-max-widths, is it not? I.e.

Start with

<img src="https://placekitten.com/300/300" style="max-height:50px; width: max-content;">

1. https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes dictates its width of to be the width of
<div style="width: 9999"><img src="https://placekitten.com/300/300" style="max-height:50px; float: left;">

2. which https://www.w3.org/TR/CSS2/visudet.html#float-replaced-width defines to be the width of
<div style="width: 9999"><img src="https://placekitten.com/300/300" style="max-height:50px;">

3. Which https://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width dictates is 300 because of
> If 'height' and 'width' both have computed values of 'auto' and the element also has an intrinsic width, then that intrinsic width is the used value of 'width'.

So, as of here the used width is 300.

4. But then in applying the `max-height` https://www.w3.org/TR/CSS2/visudet.html#min-max-heights says
> for replaced elements with both 'width' and 'height' computed as 'auto', use the algorithm under [Minimum and maximum widths](https://www.w3.org/TR/CSS2/visudet.html#min-max-widths) above to find the used width and height.

5. For [Minimum and maximum widths](https://www.w3.org/TR/CSS2/visudet.html#min-max-widths), the 3rd line of the table, _h > max-height_, applies. Using its rules of `resolved width = max(max-height * w/h, min-width)` and `resolved height = max-height`, used width = used height = 50.

Where did I go wrong?

GitHub Notification of comment by davidsgrogan
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5583#issuecomment-720766799 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 2 November 2020 22:44:10 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:22 UTC