@@ -6866,13 +6866,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
6866
6866
<li><p>Return false.</p></li>
6867
6867
</ol>
6868
6868
6869
- <p>Each <code>img</code> element has associated <dfn>lazy load resumption steps</dfn>, initially
6870
- null.</p>
6869
+ <p>Each <code>img</code> and <code>iframe</code> element has associated <dfn>lazy load resumption
6870
+ steps</dfn>, initially null.</p>
6871
6871
6872
- <p class="note">For <code>img</code> elements that <span data-x="will lazy load element
6873
- steps">will lazy load</span>, this can be set to true in the <span>lazy load intersection
6874
- observer</span>'s callback, which causes the image to load by continuing the <span>update the
6875
- image data</span> steps.</p>
6872
+ <p class="note">For <code>img</code> and <code>iframe</code> elements that <span data-x="will lazy
6873
+ load element steps">will lazy load</span>, these steps are run from the <span>lazy load
6874
+ intersection observer</span>'s callback or when their <span>lazy loading attribute</span> is set
6875
+ to the <span data-x="attr-loading-eager-state">Eager</span> state. This causes the element to
6876
+ continue loading.</p>
6876
6877
6877
6878
<p>Each <code>Document</code> has a <dfn>lazy load intersection observer</dfn>, initially set to
6878
6879
null but can be set to an <code>IntersectionObserver</code> instance.</p>
@@ -26117,8 +26118,9 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
26117
26118
loading attribute</span>. Its purpose is to indicate the policy for loading images that are
26118
26119
outside the viewport.</p>
26119
26120
26120
- <p>When the <code data-x="attr-img-loading">loading</code> attribute is set to the <span
26121
- data-x="attr-loading-eager-state">Eager</span> state, the user agent must run these steps:</p>
26121
+ <p>When the <code data-x="attr-img-loading">loading</code> attribute's state is changed to the
26122
+ <span data-x="attr-loading-eager-state">Eager</span> state, the user agent must run these
26123
+ steps:</p>
26122
26124
26123
26125
<ol>
26124
26126
<li><p>Let <var>resumptionSteps</var> be the <code>img</code> element's <span>lazy load
@@ -27919,7 +27921,7 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</code
27919
27921
27920
27922
<ol>
27921
27923
<li><p>Set the <code>img</code>'s <span>lazy load resumption steps</span> to the rest of this
27922
- algorithm.</p></li>
27924
+ algorithm starting with the step labeled <i>fetch the image</i> .</p></li>
27923
27925
27924
27926
<li><p><span>Start intersection-observing a lazy loading element</span> for the
27925
27927
<code>img</code> element.</p></li>
@@ -27930,8 +27932,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</code
27930
27932
27931
27933
<li>
27932
27934
<!--FETCH-->
27933
- <p><span data-x="concept-fetch">Fetch</span> <var>request</var>. Let this instance of the <span
27934
- data-x="concept-fetch">fetching</span> algorithm be associated with <var>image request</var>.
27935
+ <p><i>Fetch the image</i>: <span data-x="concept-fetch">Fetch</span> <var>request</var>. Let
27936
+ this instance of the <span data-x="concept-fetch">fetching</span> algorithm be associated with
27937
+ <var>image request</var>.
27935
27938
<!-- TODO "Interaction with the Preload Scanner" from the picture spec --></p>
27936
27939
27937
27940
<p>The resource obtained in this fashion, if any, is <var>image request</var>'s <span
@@ -29706,6 +29709,7 @@ href="?audio">audio</a> test instead.)</p></code></pre>
29706
29709
<dd><code data-x="attr-dim-width">width</code></dd>
29707
29710
<dd><code data-x="attr-dim-height">height</code></dd>
29708
29711
<dd><code data-x="attr-iframe-referrerpolicy">referrerpolicy</code></dd>
29712
+ <dd><code data-x="attr-iframe-loading">loading</code></dd>
29709
29713
<dt><span
29710
29714
data-x="concept-element-accessibility-considerations">Accessibility considerations</span>:</dt>
29711
29715
<dd><a href="https://w3c.github.io/html-aria/#el-iframe">For authors</a>.</dd>
@@ -29726,6 +29730,7 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
29726
29730
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-dim-width">width</span>;
29727
29731
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-dim-height">height</span>;
29728
29732
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-iframe-referrerPolicy">referrerPolicy</span>;
29733
+ [<span>CEReactions</span>] attribute DOMString <span data-x="dom-iframe-loading">loading</span>;
29729
29734
readonly attribute <span>Document</span>? <span data-x="dom-iframe-contentDocument">contentDocument</span>;
29730
29735
readonly attribute <span>WindowProxy</span>? <span data-x="dom-iframe-contentWindow">contentWindow</span>;
29731
29736
<span>Document</span>? <span data-x="dom-media-getSVGDocument">getSVGDocument</span>();
@@ -29892,21 +29897,48 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
29892
29897
<dt>If the <code data-x="attr-iframe-srcdoc">srcdoc</code> attribute is specified</dt>
29893
29898
29894
29899
<dd>
29895
- <p><span>Navigate</span><!--DONAV iframe--> the element's <span>nested browsing context</span>
29896
- to a new <span data-x="concept-response">response</span> whose <span
29897
- data-x="concept-response-url-list">url list</span> consists of <code>about:srcdoc</code>, <span
29898
- data-x="concept-response-header-list">header list</span> consists of `<code
29899
- data-x="">Content-Type</code>`/`<code>text/html</code>`, <span
29900
- data-x="concept-response-body">body</span> is the value of the attribute, <span
29901
- data-x="concept-response-csp-list">CSP list</span> is a <span data-x="list clone">clone</span>
29902
- of the <code>iframe</code> element's <span>node document</span>'s <span
29903
- data-x="concept-document-csp-list">CSP list</span>, <span
29904
- data-x="concept-response-https-state">HTTPS state</span> is the <span
29905
- data-x="concept-document-https-state">HTTPS state</span> of the <code>iframe</code> element's
29906
- <span>node document</span>.
29900
+ <ol>
29901
+ <li><p>Set the <code>iframe</code>'s <span>current navigation was lazy loaded</span> boolean
29902
+ to false.</p></li>
29903
+
29904
+ <li>
29905
+ <p>If the <span>will lazy load element steps</span> given the <code>iframe</code> element
29906
+ return true, then:</p>
29907
29907
29908
- <p>The resulting <code>Document</code> must be considered <span>an <code>iframe</code> <code
29909
- data-x="attr-iframe-srcdoc">srcdoc</code> document</span>.</p>
29908
+ <ol>
29909
+ <li><p>Set the <code>iframe</code>'s <span>lazy load resumption steps</span> to the rest of
29910
+ this algorithm starting with the step labeled
29911
+ <i>navigate to the srcdoc resource</i>.</p></li>
29912
+
29913
+ <li><p>Set the <code>iframe</code>'s <span>current navigation was lazy loaded</span> boolean
29914
+ to true.</p></li>
29915
+
29916
+ <li><p><span>Start intersection-observing a lazy loading element</span> for the
29917
+ <code>iframe</code> element.</p></li>
29918
+
29919
+ <li><p>Return.</p></li>
29920
+ </ol>
29921
+ </li>
29922
+
29923
+ <li>
29924
+ <p><i>Navigate to the srcdoc resource</i>: <span>Navigate</span><!--DONAV iframe--> the
29925
+ element's <span>nested browsing context</span> to a new <span
29926
+ data-x="concept-response">response</span> whose <span data-x="concept-response-url-list">url
29927
+ list</span> consists of <code>about:srcdoc</code>, <span
29928
+ data-x="concept-response-header-list">header list</span> consists of `<code
29929
+ data-x="">Content-Type</code>`/`<code>text/html</code>`, <span
29930
+ data-x="concept-response-body">body</span> is the value of the attribute, <span
29931
+ data-x="concept-response-csp-list">CSP list</span> is a <span data-x="list clone">clone</span>
29932
+ of the <code>iframe</code> element's <span>node document</span>'s <span
29933
+ data-x="concept-document-csp-list">CSP list</span>, <span
29934
+ data-x="concept-response-https-state">HTTPS state</span> is the <span
29935
+ data-x="concept-document-https-state">HTTPS state</span> of the <code>iframe</code> element's
29936
+ <span>node document</span>.
29937
+
29938
+ <p>The resulting <code>Document</code> must be considered <span>an <code>iframe</code> <code
29939
+ data-x="attr-iframe-srcdoc">srcdoc</code> document</span>.</p>
29940
+ </li>
29941
+ </ol>
29910
29942
</dd>
29911
29943
29912
29944
<dt>Otherwise, if the element has no <code data-x="attr-iframe-src">src</code> attribute
@@ -29956,8 +29988,29 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
29956
29988
element's <code data-x="attr-iframe-referrerpolicy">referrerpolicy</code> content
29957
29989
attribute.</p></li>
29958
29990
29959
- <li><p><span>Navigate</span><!--DONAV iframe--> the element's <span>nested browsing
29960
- context</span> to <var>resource</var>.</p></li>
29991
+ <li><p>Set the <code>iframe</code>'s <span>current navigation was lazy loaded</span> boolean to
29992
+ false.</p></li>
29993
+
29994
+ <li>
29995
+ <p>If the element is an <code>iframe</code> element, and the <span>will lazy load element
29996
+ steps</span> given the element return true, then:</p>
29997
+
29998
+ <ol>
29999
+ <li><p>Set the <code>iframe</code>'s <span>lazy load resumption steps</span> to the rest of
30000
+ this algorithm starting with the step labeled <i>navigate to the resource</i>.</p></li>
30001
+
30002
+ <li><p>Set the <code>iframe</code>'s <span>current navigation was lazy loaded</span> boolean
30003
+ to true.</p></li>
30004
+
30005
+ <li><p><span>Start intersection-observing a lazy loading element</span> for the
30006
+ <code>iframe</code> element.</p></li>
30007
+
30008
+ <li><p>Return.</p></li>
30009
+ </ol>
30010
+ </li>
30011
+
30012
+ <li><p><i>Navigate to the resource</i>: <span>Navigate</span><!--DONAV iframe--> the element's
30013
+ <span>nested browsing context</span> to <var>resource</var>.</p></li>
29961
30014
</ol>
29962
30015
29963
30016
<p>Any <span data-x="navigate">navigation</span> required of the user agent in the <span>process
@@ -30032,7 +30085,12 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
30032
30085
<var>element</var>'s <span>nested browsing context</span> is again <span
30033
30086
data-x="navigate">navigated</span>, that will further <span>delay the load event</span>.</p>
30034
30087
30035
- <p>The <code>iframe</code> element <span>potentially delays the load event</span>.</p>
30088
+ <p>Each <code>iframe</code> element has an associated <dfn>current navigation was lazy
30089
+ loaded</dfn> boolean, initially false. It is set and unset in the <span>process the
30090
+ <code>iframe</code> attributes</span> algorithm.</p>
30091
+
30092
+ <p>An <code>iframe</code> element whose <span>current navigation was lazy loaded</span> boolean is
30093
+ false <span>potentially delays the load event</span>.</p>
30036
30094
30037
30095
</div>
30038
30096
@@ -30324,6 +30382,25 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
30324
30382
used when <span data-x="process the iframe attributes">processing the <code>iframe</code>
30325
30383
attributes</span>. <ref spec=REFERRERPOLICY></p>
30326
30384
30385
+ <p>The <dfn data-x="attr-iframe-loading"><code>loading</code></dfn> attribute is a <span>lazy
30386
+ loading attribute</span>. Its purpose is to indicate the policy for loading <code>iframe</code>
30387
+ elements that are outside the viewport.</p>
30388
+
30389
+ <p>When the <code data-x="attr-iframe-loading">loading</code> attribute's state is changed to the
30390
+ <span data-x="attr-loading-eager-state">Eager</span> state, the user agent must run these
30391
+ steps:</p>
30392
+
30393
+ <ol>
30394
+ <li><p>Let <var>resumptionSteps</var> be the <code>iframe</code> element's <span>lazy load
30395
+ resumption steps</span>.</p></li>
30396
+
30397
+ <li><p>If <var>resumptionSteps</var> is null, then return.</p></li>
30398
+
30399
+ <li><p>Set the <code>iframe</code>'s <span>lazy load resumption steps</span> to null.</p></li>
30400
+
30401
+ <li><p>Invoke <var>resumptionSteps</var>.</p></li>
30402
+ </ol>
30403
+
30327
30404
<hr> <!-- FALLBACK -->
30328
30405
30329
30406
<p>Descendants of <code>iframe</code> elements represent nothing. (In legacy user agents that do
@@ -30362,6 +30439,10 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
30362
30439
must <span>reflect</span> the <code data-x="attr-iframe-referrerpolicy">referrerpolicy</code>
30363
30440
content attribute, <span>limited to only known values</span>.</p>
30364
30441
30442
+ <p>The <dfn><code data-x="dom-iframe-loading">loading</code></dfn> IDL attribute must
30443
+ <span>reflect</span> the <code data-x="attr-iframe-loading">loading</code> content attribute,
30444
+ <span>limited to only known values</span>.</p>
30445
+
30365
30446
<p>The <dfn><code data-x="dom-iframe-contentDocument">contentDocument</code></dfn> IDL attribute,
30366
30447
on getting, must return the <code>iframe</code> element's <span
30367
30448
data-x="concept-bcc-content-document">content document</span>.</p>
@@ -117754,7 +117835,8 @@ interface <dfn>External</dfn> {
117754
117835
<code data-x="attr-iframe-allowpaymentrequest">allowpaymentrequest</code>;
117755
117836
<code data-x="attr-dim-width">width</code>;
117756
117837
<code data-x="attr-dim-height">height</code>;
117757
- <code data-x="attr-iframe-referrerpolicy">referrerpolicy</code></td>
117838
+ <code data-x="attr-iframe-referrerpolicy">referrerpolicy</code>;
117839
+ <code data-x="attr-iframe-loading">loading</code></td>
117758
117840
<td><code>HTMLIFrameElement</code></td>
117759
117841
</tr>
117760
117842
@@ -119367,7 +119449,8 @@ interface <dfn>External</dfn> {
119367
119449
"<code data-x="attr-img-decoding-auto">auto</code>"
119368
119450
<tr>
119369
119451
<th> <code data-x="">loading</code>
119370
- <td> <code data-x="attr-img-loading">img</code>
119452
+ <td> <code data-x="attr-img-loading">img</code>;
119453
+ <code data-x="attr-iframe-loading">iframe</code>
119371
119454
<td> Used when determining loading deferral
119372
119455
<td> "<code data-x="attr-loading-lazy">lazy</code>";
119373
119456
"<code data-x="attr-loading-eager">eager</code>"
0 commit comments