@@ -2795,6 +2795,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
2795
2795
<li><dfn data-x="concept-request-method" data-x-href="https://fetch.spec.whatwg.org/#concept-request-method">method</dfn></li>
2796
2796
<li><dfn data-x="concept-request-header-list" data-x-href="https://fetch.spec.whatwg.org/#concept-request-header-list">header list</dfn></li>
2797
2797
<li><dfn data-x="concept-request-body" data-x-href="https://fetch.spec.whatwg.org/#concept-request-body">body</dfn></li>
2798
+ <li><dfn data-x="concept-request-add-range-header" data-x-href="https://fetch.spec.whatwg.org/#concept-request-add-range-header">add a range header</dfn></li>
2798
2799
<li><dfn data-x="concept-request-client" data-x-href="https://fetch.spec.whatwg.org/#concept-request-client">client</dfn></li>
2799
2800
<li><dfn data-x="concept-request-current-url" data-x-href="https://fetch.spec.whatwg.org/#concept-request-current-url">current URL</dfn></li>
2800
2801
<li><dfn data-x="concept-request-reserved-client" data-x-href="https://fetch.spec.whatwg.org/#concept-request-reserved-client">reserved client</dfn></li>
@@ -7211,6 +7212,42 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
7211
7212
<code>HTMLOrSVGElement</code> must set the <span>[[CryptographicNonce]]</span> slot on the copy
7212
7213
to the value of the slot on the element being cloned.</p>
7213
7214
7215
+ <h4>Lazy loading attributes</h4>
7216
+
7217
+ <p>A <dfn>lazy loading attribute</dfn> is an <span>enumerated attribute</span>. The following
7218
+ table lists the keywords and states for the attribute — the keywords in the left column map
7219
+ to the states in the cell in the second column on the same row as the keyword.</p>
7220
+
7221
+ <p>The attribute provides a hint to the user agent to aid in deciding whether to load an element
7222
+ immediately or to defer loading until the element will be viewable, according to the attribute's
7223
+ current state.</p>
7224
+
7225
+ <table>
7226
+ <thead>
7227
+ <tr>
7228
+ <th>Keyword
7229
+ <th>State
7230
+ <th>Description
7231
+ <tbody>
7232
+ <tr>
7233
+ <td><dfn><code data-x="attr-lazyload-on">on</code></dfn>
7234
+ <td><dfn data-x="attr-lazyload-on-state">On</dfn>
7235
+ <td>Indicates a strong preference to defer fetching the element's resource until it will be
7236
+ viewable.
7237
+ <tr>
7238
+ <td><dfn><code data-x="attr-lazyload-off">off</code></dfn>
7239
+ <td><dfn data-x="attr-lazyload-off-state">Off</dfn>
7240
+ <td>Indicates the element's resource must be fetched immediately, regardless of viewability.
7241
+ <tr>
7242
+ <td><dfn><code data-x="attr-lazyload-auto">auto</code></dfn>
7243
+ <td><dfn data-x="attr-lazyload-auto-state">Auto</dfn>
7244
+ <td>Indicates that the user agent may determine the fetching strategy (the default).
7245
+ </table>
7246
+
7247
+ <p>The attribute's <i data-x="missing value default">missing value default</i> and <i
7248
+ data-x="invalid value default">invalid value default</i> are both the <span
7249
+ data-x="attr-lazyload-auto-state">Auto</span> state.</p>
7250
+
7214
7251
7215
7252
<h3 split-filename="common-dom-interfaces">Common DOM interfaces</h3>
7216
7253
@@ -25711,6 +25748,7 @@ interface <dfn>HTMLSourceElement</dfn> : <span>HTMLElement</span> {
25711
25748
<dd><code data-x="attr-dim-height">height</code></dd>
25712
25749
<dd><code data-x="attr-img-referrerpolicy">referrerpolicy</code></dd>
25713
25750
<dd><code data-x="attr-img-decoding">decoding</code></dd>
25751
+ <dd><code data-x="attr-img-lazyload">lazyload</code></dd>
25714
25752
<dt><span data-x="concept-element-dom">DOM interface</span>:</dt>
25715
25753
<dd w-nodev>
25716
25754
<pre><code class="idl" data-x="">[Exposed=Window,
@@ -25732,6 +25770,7 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
25732
25770
readonly attribute USVString <span data-x="dom-img-currentSrc">currentSrc</span>;
25733
25771
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-img-referrerPolicy">referrerPolicy</span>;
25734
25772
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-img-decoding">decoding</span>;
25773
+ [<span>CEReactions</span>] attribute DOMString <span data-x="dom-img-lazyLoad">lazyLoad</span>;
25735
25774
25736
25775
Promise<void> <span data-x="dom-img-decode">decode</span>();
25737
25776
};</code></pre>
@@ -25807,6 +25846,10 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
25807
25846
default">missing value default</i> and <i data-x="invalid value default">invalid value
25808
25847
default</i> are both the <span data-x="attr-img-decoding-auto-state">auto</span> state.</p>
25809
25848
25849
+ <p>The <dfn data-x="attr-img-lazyload"><code>lazyload</code></dfn> attribute is a <span>lazy
25850
+ loading attribute</span>. Its purpose is to indicate the policy for loading images that are
25851
+ outside the viewport.
25852
+
25810
25853
<hr>
25811
25854
25812
25855
<p>The <code>img</code> element must not be used as a layout tool. In particular, <code>img</code>
@@ -25997,6 +26040,10 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
25997
26040
<span>reflect</span> the <code data-x="attr-img-decoding">decoding</code> content
25998
26041
attribute, <span>limited to only known values</span>.
25999
26042
26043
+ <p>The <dfn><code data-x="dom-img-lazyLoad">lazyLoad</code></dfn> IDL attribute must
26044
+ <span>reflect</span> the <code data-x="attr-img-lazyload">lazyload</code> content
26045
+ attribute, <span>limited to only known values</span>.
26046
+
26000
26047
</div>
26001
26048
26002
26049
<dl class="domintro">
@@ -26044,14 +26091,6 @@ interface <dfn>HTMLImageElement</dfn> : <span>HTMLElement</span> {
26044
26091
26045
26092
</dd>
26046
26093
26047
- <dt><var>image</var> . <code subdfn data-x="dom-img-decoding">decoding</code></dt>
26048
-
26049
- <dd>
26050
-
26051
- <p>Returns the <span>image decoding hint</span> set for this image.</p>
26052
-
26053
- </dd>
26054
-
26055
26094
<dt><var>image</var> . <code subdfn data-x="dom-img-decode">decode</code>()</dt>
26056
26095
26057
26096
<dd>
@@ -27257,7 +27296,12 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</code
27257
27296
<p>In a <span>browsing context</span> where <span data-x="concept-bc-noscript">scripting is
27258
27297
disabled</span>, user agents may obtain images immediately or on demand. In a <span>browsing
27259
27298
context</span> where <span data-x="concept-bc-noscript">scripting is enabled</span>, user agents
27260
- must obtain images immediately.</p>
27299
+ must obtain images immediately when the CSS boxes those images intersect the
27300
+ <span>viewport</span>, or when the corresponding <code>img</code> element's <code
27301
+ data-x="attr-img-lazyload">lazyload</code> attribute is in the <span
27302
+ data-x="attr-lazyload-off-state">Off</span> state. Otherwise, they may obtain images immediately
27303
+ or on demand, using the current state of the corresponding <code>img</code> element's <code
27304
+ data-x="attr-img-lazyload">lazyload</code> attribute to guide the decision.</p>
27261
27305
27262
27306
<p>A user agent that obtains images immediately must synchronously
27263
27307
<span>update the image data</span> of an <code>img</code> element,
@@ -27272,6 +27316,38 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...</code
27272
27316
obtains images on demand, the <code>img</code> element's <span>current request</span>'s <span
27273
27317
data-x="img-req-state">state</span> must return to <span data-x="img-none">unavailable</span>.</p>
27274
27318
27319
+ <p>If the <code>img</code> element's <code data-x="attr-img-lazyload">lazyload</code> attribute is
27320
+ not in the <span data-x="attr-lazyload-off-state">Off</span> state, the user agent may immediately
27321
+ fetch metadata from the image header. To fetch image metadata, the user agent must run the
27322
+ following steps:</p>
27323
+
27324
+ <ol>
27325
+ <li><p>Let <var>request</var> be the result of <span data-x="create a potential-CORS
27326
+ request">creating a potential-CORS request</span> given <var>urlString</var>, "<code
27327
+ data-x="">image</code>", and the current state of the element's <code
27328
+ data-x="attr-img-crossorigin">crossorigin</code> content attribute.</p></li>
27329
+
27330
+ <li><p>Set <var>request</var>'s <span data-x="concept-request-client">client</span> to the
27331
+ element's <span>node document</span>'s <code>Window</code> object's <span>environment settings
27332
+ object</span>.</p></li>
27333
+
27334
+ <li><p>If the element <span data-x="use srcset or picture">uses <code>srcset</code> or
27335
+ <code>picture</code></span>, set <var>request</var>'s <span
27336
+ data-x="concept-request-initiator">initiator</span> to "<code
27337
+ data-x="">imageset</code>".</p></li>
27338
+
27339
+ <li><p>Set <var>request</var>'s <span data-x="concept-request-referrer-policy">referrer
27340
+ policy</span> to the current state of the element's <code
27341
+ data-x="attr-img-referrerpolicy">referrerpolicy</code> attribute.</p></li>
27342
+
27343
+ <li><p>Then <span data-x="concept-request-add-range-header">add a range header</span> to
27344
+ <var>request</var> starting at byte 0 and ending with as many bytes of the image file as the
27345
+ user agent determines is reasonable to retrieve metatdata.</p></li>
27346
+
27347
+ <li><p><span data-x="concept-fetch">Fetch</span> <var>request</var>, and use the metadata
27348
+ contained in the response as appropriate for the image.</p></li>
27349
+ </ol>
27350
+
27275
27351
27276
27352
<h6>Reacting to DOM mutations</h6>
27277
27353
@@ -29500,6 +29576,7 @@ href="?audio">audio</a> test instead.)</p></code></pre>
29500
29576
<dd><code data-x="attr-dim-width">width</code></dd>
29501
29577
<dd><code data-x="attr-dim-height">height</code></dd>
29502
29578
<dd><code data-x="attr-iframe-referrerpolicy">referrerpolicy</code></dd>
29579
+ <dd><code data-x="attr-iframe-lazyload">lazyload</code></dd>
29503
29580
<dt><span data-x="concept-element-dom">DOM interface</span>:</dt>
29504
29581
<dd w-nodev>
29505
29582
<pre><code class="idl" data-x="">[Exposed=Window,
@@ -29515,6 +29592,7 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
29515
29592
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-dim-width">width</span>;
29516
29593
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-dim-height">height</span>;
29517
29594
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-iframe-referrerPolicy">referrerPolicy</span>;
29595
+ [<span>CEReactions</span>] attribute DOMString <span data-x="dom-iframe-lazyLoad">lazyLoad</span>;
29518
29596
readonly attribute <span>Document</span>? <span data-x="dom-iframe-contentDocument">contentDocument</span>;
29519
29597
readonly attribute <span>WindowProxy</span>? <span data-x="dom-iframe-contentWindow">contentWindow</span>;
29520
29598
<span>Document</span>? <span data-x="dom-media-getSVGDocument">getSVGDocument</span>();
@@ -29713,7 +29791,11 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
29713
29791
<dt>Otherwise</dt>
29714
29792
29715
29793
<dd><p>Run the <span>otherwise steps for <code>iframe</code> or <code>frame</code>
29716
- elements</span>.</p></dd>
29794
+ elements</span>. If the element's <code data-x="attr-iframe-lazyload">lazyload</code> attribute
29795
+ is in the <span data-x="attr-lazyload-on-state">On</span> or <span
29796
+ data-x="attr-lazyload-auto-state">Auto</span> states, and the element's CSS layout box does not
29797
+ intersect the <span>viewport</span>, then running these steps may be deferred until such
29798
+ intersection occurs.</p></dd>
29717
29799
29718
29800
</dl>
29719
29801
@@ -30119,6 +30201,12 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
30119
30201
used when <span data-x="process the iframe attributes">processing the <code>iframe</code>
30120
30202
attributes</span>. <ref spec=REFERRERPOLICY></p>
30121
30203
30204
+ <hr> <!-- LAZYLOAD ATTRIBUTE -->
30205
+
30206
+ <p>The <dfn data-x="attr-iframe-lazyload"><code>lazyload</code></dfn> attribute is a
30207
+ <span>lazy loading attribute</span>. It indicates the policy for loading <code>iframe</code>
30208
+ elements that are outside the viewport.
30209
+
30122
30210
<hr> <!-- FALLBACK -->
30123
30211
30124
30212
<p>Descendants of <code>iframe</code> elements represent nothing. (In legacy user agents that do
@@ -30157,6 +30245,10 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
30157
30245
must <span>reflect</span> the <code data-x="attr-iframe-referrerpolicy">referrerpolicy</code>
30158
30246
content attribute, <span>limited to only known values</span>.</p>
30159
30247
30248
+ <p>The <dfn><code data-x="dom-iframe-lazyLoad">lazyLoad</code></dfn> IDL attribute must
30249
+ <span>reflect</span> the <code data-x="attr-iframe-lazyload">lazyload</code> content
30250
+ attribute, <span>limited to only known values</span>.
30251
+
30160
30252
<p>The <dfn><code data-x="dom-iframe-contentDocument">contentDocument</code></dfn> IDL attribute,
30161
30253
on getting, must return the <code>iframe</code> element's <span
30162
30254
data-x="concept-bcc-content-document">content document</span>.</p>
@@ -118961,6 +119053,14 @@ interface <dfn>External</dfn> {
118961
119053
<td> "<code data-x="attr-img-decoding-sync">sync</code>";
118962
119054
"<code data-x="attr-img-decoding-async">async</code>";
118963
119055
"<code data-x="attr-img-decoding-auto">auto</code>"
119056
+ <tr>
119057
+ <th> <code data-x="">lazyload</code>
119058
+ <td> <code data-x="attr-img-lazyload">img</code>;
119059
+ <code data-x="attr-iframe-lazyload">iframe</code>
119060
+ <td> Hint to use when determining loading deferral
119061
+ <td> "<code data-x="attr-lazyload-on">on</code>";
119062
+ "<code data-x="attr-lazyload-off">off</code>";
119063
+ "<code data-x="attr-lazyload-auto">auto</code>"
118964
119064
<tr>
118965
119065
<th> <code data-x="">default</code>
118966
119066
<td> <code data-x="attr-track-default">track</code>
0 commit comments