Skip to content

Commit 7ec1488

Browse files
committed
Avoid running img-environment-changes algo when not in a document. Fixes #257
1 parent 2340eca commit 7ec1488

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source

+2
Original file line numberDiff line numberDiff line change
@@ -1972,6 +1972,7 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
19721972

19731973
<p class=note>User agents are encouraged to run this algorithm in particular when the user changes the viewport's size
19741974
(e.g. by resizing the window or changing the page zoom),
1975+
and when an <code>img</code> element is <span>inserted into a document</span>,
19751976
so that the <span>density-corrected intrinsic width and height</span> match the new viewport,
19761977
and so that the correct image is chosen when <span>art direction</span> is involved.</p>
19771978

@@ -1985,6 +1986,7 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
19851986
<li><p>&#x231B; If the <code>img</code> element does not have a
19861987
<code data-x="attr-img-srcset">srcset</code> attribute specified and
19871988
it either has no parent or it is not a <code>picture</code> element,
1989+
it is not <span>in a <code>Document</code></span>,
19881990
has image data whose resource type is <code>multipart/x-mixed-replace</code>,
19891991
or the <span>pending request</span> is not null,
19901992
then abort this algorithm.</p></li>

0 commit comments

Comments
 (0)