Skip to content

Commit

Permalink
Replace the 0px rendered width check with a computed value check for …
Browse files Browse the repository at this point in the history
…'width' and 'min-width'
  • Loading branch information
zcorpan committed Aug 8, 2022
1 parent 1242fec commit fc651c8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3441,6 +3441,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x-href="https://drafts.csswg.org/css2/#flow-control">'clear'</dfn> property</li>
<li>The <dfn data-x-href="https://drafts.csswg.org/css2/#the-width-property">'width'</dfn> property</li>
<li>The <dfn data-x-href="https://drafts.csswg.org/css2/#the-height-property">'height'</dfn> property</li>
<li>The <dfn data-x-href="https://drafts.csswg.org/css2/#min-max-widths">'min-width'</dfn> property</li>
<li>The <dfn data-x-href="https://drafts.csswg.org/css2/#min-max-heights">'min-height'</dfn> property</li>
<li>The <dfn data-x-href="https://drafts.csswg.org/css2/#min-max-widths">'max-width'</dfn> property</li>
<li>The <dfn data-x-href="https://drafts.csswg.org/css2/#min-max-heights">'max-height'</dfn> property</li>
<li>The <dfn data-x-href="https://drafts.csswg.org/css2/#propdef-line-height">'line-height'</dfn> property</li>
Expand Down Expand Up @@ -29016,8 +29018,9 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
<p>The keyword <dfn data-x="valdef-sizes-auto">auto</dfn> means the rendered width of the
<code>img</code> element that initiated the image loading (with the <span>update the image
data</span> or <span data-x="img-environment-changes">react to environment changes</span>
algorithms), if any, in <span data-x="'px'">CSS pixels</span>, if that is not <code
data-x="">0px</code>, and that <code>img</code> element is <span>being rendered</span>, and the
algorithms), if any, in <span data-x="'px'">CSS pixels</span>, if that <code>img</code> element is
<span>being rendered</span>, and the element's <span>computed value</span> of the
<span>'width'</span> and <span>'min-width'</span> properties are not both 'auto', and the
<code>img</code> element's <code data-x="attr-img-loading">loading</code> attribute is in the
<span data-x="attr-loading-lazy-state">Lazy</span> state; otherwise, <code
data-x="">100vw</code>.</p>
Expand All @@ -29039,6 +29042,11 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
data-x="attr-loading-lazy-state">Lazy</span> state.</p></li>
</ul>

<p class="note">In addition, it is strongly encouraged to specify dimensions using the <code
data-x="attr-dim-width">width</code> and <code data-x="attr-dim-height">height</code> attributes
or with CSS. Without specified dimensions, the <span data-x="valdef-sizes-auto">auto</span>
keyword is equivalent to <code data-x="">100vw</code>.</p>

<p>The <span>&lt;source-size-value></span> gives the intended layout width of the image. The
author can specify different widths for different environments with
<span>&lt;media-condition></span>s.</p>
Expand Down Expand Up @@ -30343,8 +30351,9 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
<li><p>If <var>img</var> is null, or <var>img</var>'s <code
data-x="attr-img-loading">loading</code> attribute is not in the <span
data-x="attr-loading-lazy-state">Lazy</span> state, or <var>img</var> is not <span>being
rendered</span>, or <var>img</var>'s rendered width in <span data-x="'px'">CSS pixels</span> is
<code data-x="">0px</code>, then return <code data-x="">100vw</code>.</p></li>
rendered</span>, or <var>img</var>'s <span>computed value</span> of the <span>'width'</span> and
<span>'min-width'</span> properties are both 'auto', then return <code
data-x="">100vw</code>.</p></li>

<li><p>Return the rendered width of <var>img</var>, in <span
data-x="'px'">CSS pixels</span>.</p></li>
Expand Down

0 comments on commit fc651c8

Please sign in to comment.