Skip to content

Commit 1df3282

Browse files
authored
Make <img src> optional in presence of srcset
Fixes #9181.
1 parent 47f854c commit 1df3282

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

source

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29384,13 +29384,16 @@ interface <dfn interface>HTMLImageElement</dfn> : <span>HTMLElement</span> {
2938429384
any previous sibling <code>source</code> elements' <code data-x="attr-source-srcset">srcset</code>
2938529385
attributes if the parent is a <code>picture</code> element, is the embedded content; the value of
2938629386
the <dfn element-attr for="img" data-x="attr-img-alt"><code>alt</code></dfn> attribute provides
29387-
equivalent content for those who cannot process images or who have image loading disabled (i.e. it
29388-
is the <code>img</code> element's <span>fallback content</span>).</p>
29387+
equivalent content for those who cannot process images or who have image loading disabled (i.e.,
29388+
it is the <code>img</code> element's <span>fallback content</span>).</p>
2938929389

2939029390
<p>The requirements on the <code data-x="attr-img-alt">alt</code> attribute's value are described
2939129391
<a href="#alt">in a separate section</a>.</p>
2939229392

29393-
<p>The <code data-x="attr-img-src">src</code> attribute must be present, and must contain a
29393+
<p>At least one of the <code data-x="attr-img-src">src</code> and <code
29394+
data-x="attr-img-srcset">srcset</code> attributes must be present.</p>
29395+
29396+
<p>If the <code data-x="attr-img-src">src</code> attribute is present, it must contain a
2939429397
<span>valid non-empty URL potentially surrounded by spaces</span> referencing a non-interactive,
2939529398
optionally animated, image resource that is neither paged nor scripted.</p>
2939629399

@@ -29400,10 +29403,10 @@ interface <dfn interface>HTMLImageElement</dfn> : <span>HTMLElement</span> {
2940029403
<span>document element</span> that use declarative SMIL animation), and so forth. However, these
2940129404
definitions preclude SVG files with script, multipage PDF files, interactive MNG files, HTML
2940229405
documents, plain text documents, and the like. <ref>PNG</ref> <ref>GIF</ref> <ref>JPEG</ref>
29403-
<ref>PDF</ref> <ref>XML</ref> <ref>APNG</ref> <ref>SVG</ref> <ref>MNG</ref> </p>
29406+
<ref>PDF</ref> <ref>XML</ref> <ref>APNG</ref> <ref>SVG</ref> <ref>MNG</ref></p>
2940429407

29405-
<p>The <code data-x="attr-img-srcset">srcset</code> attribute may also be present, and is a
29406-
<span>srcset attribute</span>.</p>
29408+
<p>The <code data-x="attr-img-srcset">srcset</code> attribute is a <span>srcset
29409+
attribute</span>.</p>
2940729410

2940829411
<p>The <code data-x="attr-img-srcset">srcset</code> attribute and the <code
2940929412
data-x="attr-img-src">src</code> attribute (if <span data-x="width descriptor">width

0 commit comments

Comments
 (0)