@@ -3312,7 +3312,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
3312
3312
<dfn data-x="concept-node-clone-parent" data-x-href="https://dom.spec.whatwg.org/#clone-a-node-parent"><var>parent</var></dfn>, and
3313
3313
<dfn data-x="concept-node-clone-fallbackRegistry" data-x-href="https://dom.spec.whatwg.org/#clone-a-node-fallbackregistry"><var>fallbackRegistry</var></dfn>, and the concept of
3314
3314
<dfn data-x="concept-node-clone-ext" data-x-href="https://dom.spec.whatwg.org/#concept-node-clone-ext">cloning steps</dfn></li>
3315
- <li>The concept of <dfn>base URL change steps</dfn> and the definition of what happens when an element is <dfn>affected by a base URL change</dfn></li>
3316
3315
<li>The concept of an element's <dfn data-x="concept-id" data-x-href="https://dom.spec.whatwg.org/#concept-id">unique identifier (ID)</dfn></li>
3317
3316
<li>The concept of an element's <dfn data-x="concept-class" data-x-href="https://dom.spec.whatwg.org/#concept-class">classes</dfn></li>
3318
3317
<li>The term <dfn data-x="concept-supported-tokens" data-x-href="https://dom.spec.whatwg.org/#concept-supported-tokens">supported tokens</dfn></li>
@@ -7212,6 +7211,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
7212
7211
data-x="strip leading and trailing ASCII whitespace">stripping leading and trailing ASCII
7213
7212
whitespace</span> from it, it is a <span>valid non-empty URL</span>.</p>
7214
7213
7214
+ <hr>
7215
+
7215
7216
<p>This specification defines the URL <dfn><code>about:legacy-compat</code></dfn> as a reserved,
7216
7217
though unresolvable, <code data-x="about protocol">about:</code> URL, for use in <span
7217
7218
data-x="syntax-doctype">DOCTYPE</span>s in <span>HTML documents</span> when needed for
@@ -7227,46 +7228,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
7227
7228
document"><code>iframe</code> <code data-x="attr-iframe-srcdoc">srcdoc</code> documents</span>.
7228
7229
<ref>ABOUT</ref></p>
7229
7230
7230
- <p>The <dfn>fallback base URL</dfn> of a <code>Document</code> object <var>document</var> is the
7231
- <span>URL record</span> obtained by running these steps:</p>
7232
-
7233
- <ol>
7234
- <li>
7235
- <p>If <var>document</var> is <span data-x="an iframe srcdoc document">an <code>iframe</code>
7236
- <code data-x="attr-iframe-srcdoc">srcdoc</code> document</span>, then:</p>
7237
-
7238
- <ol>
7239
- <li><p><span>Assert</span>: <var>document</var>'s <span
7240
- data-x="concept-document-about-base-url">about base URL</span> is non-null.</p></li>
7241
-
7242
- <li><p>Return <var>document</var>'s <span data-x="concept-document-about-base-url">about base
7243
- URL</span>.</p></li>
7244
- </ol>
7245
- </li>
7246
-
7247
- <li><p>If <var>document</var>'s <span data-x="concept-document-url">URL</span> <span>matches
7248
- <code>about:blank</code></span> and <var>document</var>'s <span
7249
- data-x="concept-document-about-base-url">about base URL</span> is non-null, then return
7250
- <var>document</var>'s <span data-x="concept-document-about-base-url">about base URL</span>.</p></li>
7251
-
7252
- <!-- https://www.hixie.ch/tests/adhoc/dom/level0/history/pushState/001/ -->
7253
-
7254
- <li><p>Return <var>document</var>'s <span data-x="concept-document-url">URL</span>.</p></li>
7255
- </ol>
7256
-
7257
- <p>The <dfn export>document base URL</dfn> of a <code>Document</code> object is the
7258
- <span>URL record</span> obtained by running these steps:</p>
7259
-
7260
- <ol>
7261
- <li><p>If there is no <code>base</code> element that has an <code
7262
- data-x="attr-base-href">href</code> attribute in the <code>Document</code>, then return the
7263
- <code>Document</code>'s <span>fallback base URL</span>.</p></li>
7264
-
7265
- <li><p>Otherwise, return the <span>frozen base URL</span> of the first <code>base</code> element
7266
- in the <code>Document</code> that has an <code data-x="attr-base-href">href</code> attribute, in
7267
- <span>tree order</span>.</p></li>
7268
- </ol>
7269
-
7270
7231
<hr>
7271
7232
7272
7233
<p>A <span>URL</span> <dfn>matches <code>about:blank</code></dfn> if its <span
@@ -7374,58 +7335,82 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
7374
7335
7375
7336
<div w-nodev>
7376
7337
7377
- <h4>Dynamic changes to base URLs</h4>
7338
+ <h4>Document base URLs</h4>
7378
7339
7379
- <p>When a document's <span >document base URL</span> changes, all elements in that document are
7380
- <span>affected by a base URL change </span>. </p>
7340
+ <p>The <dfn export >document base URL</dfn> of a <code>Document</code> <var> document</var> is the
7341
+ <span>URL record </span> obtained by running these steps: </p>
7381
7342
7382
- <p>The following are <span>base URL change steps</span>, which run when an element is
7383
- <span>affected by a base URL change</span> (as defined by <cite>DOM</cite>):</p>
7343
+ <ol>
7344
+ <li><p>If <var>document</var> has no <span>descendant</span> <code>base</code> element that has
7345
+ an <code data-x="attr-base-href">href</code> attribute, then return <var>document</var>'s
7346
+ <span>fallback base URL</span>.</p></li>
7384
7347
7385
- <dl class="switch">
7348
+ <li><p>Otherwise, return the <span>frozen base URL</span> of the first <code>base</code> element
7349
+ in <var>document</var> that has an <code data-x="attr-base-href">href</code> attribute, in
7350
+ <span>tree order</span>.</p></li>
7351
+ </ol>
7386
7352
7387
- <dt>If the element creates a <span>hyperlink</span></dt>
7353
+ <p>The <dfn>fallback base URL</dfn> of a <code>Document</code> object <var>document</var> is the
7354
+ <span>URL record</span> obtained by running these steps:</p>
7388
7355
7389
- <dd>
7390
- <p>If the <span>URL</span> identified by the hyperlink is being shown to the user, or if any
7391
- data derived from that <span>URL</span> is affecting the display, then the <code
7392
- data-x="attr-hyperlink-href">href</code> attribute's value should be <span
7393
- data-x="encoding-parsing a URL">reparsed</span>, relative to the element's <span>node
7394
- document</span> and the UI updated appropriately.</p>
7356
+ <ol>
7357
+ <li>
7358
+ <p>If <var>document</var> is <span data-x="an iframe srcdoc document">an <code>iframe</code>
7359
+ <code data-x="attr-iframe-srcdoc">srcdoc</code> document</span>:</p>
7395
7360
7396
- <p class="example">For example, the CSS <code data-x="selector-link">:link</code>/<code
7397
- data-x="selector-visited">:visited</code> <span data-x="pseudo-class">pseudo-classes </span>
7398
- might have been affected .</p>
7361
+ <ol>
7362
+ <li><p> <span>Assert </span>: <var>document</var>'s <span
7363
+ data-x="concept-document-about-base-url">about base URL</span> is non-null .</p></li >
7399
7364
7400
- <p>If the hyperlink has a <code data-x="attr-hyperlink-ping">ping</code> attribute and its
7401
- <span data-x="URL">URL(s)</span> are being shown to the user, then the <code
7402
- data-x="attr-hyperlink-ping">ping</code> attribute's tokens should be <span
7403
- data-x="encoding-parsing a URL">reparsed</span>, relative to the element's <span>node
7404
- document</span> and the UI updated appropriately.</p>
7405
- </dd>
7365
+ <li><p>Return <var>document</var>'s <span data-x="concept-document-about-base-url">about base
7366
+ URL</span>.</p></li>
7367
+ </ol>
7368
+ </li>
7406
7369
7407
- <dt>If the element is a <code>q</code>, <code>blockquote</code>, <code>ins</code>, or
7408
- <code>del</code> element with a <code data-x="">cite</code> attribute</dt>
7370
+ <li><p>If <var>document</var>'s <span data-x="concept-document-url">URL</span> <span>matches
7371
+ <code>about:blank</code></span> and <var>document</var>'s <span
7372
+ data-x="concept-document-about-base-url">about base URL</span> is non-null, then return
7373
+ <var>document</var>'s <span data-x="concept-document-about-base-url">about base
7374
+ URL</span>.</p></li>
7409
7375
7410
- <dd>
7411
- <p>If the <span>URL</span> identified by the <code data-x="">cite</code> attribute is being
7412
- shown to the user, or if any data derived from that <span>URL</span> is affecting the display,
7413
- then the <code data-x="">cite</code> attribute's value should be <span data-x="encoding-parsing
7414
- a URL">reparsed</span>, relative to the element's <span>node document</span> and the UI updated
7415
- appropriately.</p>
7416
- </dd>
7376
+ <!-- https://www.hixie.ch/tests/adhoc/dom/level0/history/pushState/001/ -->
7417
7377
7418
- <dt>Otherwise</dt>
7378
+ <li><p>Return <var>document</var>'s <span data-x="concept-document-url">URL</span>.</p></li>
7379
+ </ol>
7419
7380
7420
- <dd>
7421
- <p>The element is not directly affected.</p>
7381
+ <hr>
7422
7382
7423
- <p class="example">For instance, changing the base URL doesn't affect the image displayed by
7424
- <code>img</code> elements, although subsequent accesses of the <code
7425
- data-x="dom-img-src">src</code> IDL attribute from script will return a new <span>absolute
7426
- URL</span> that might no longer correspond to the image being shown.</p>
7427
- </dd>
7428
- </dl>
7383
+ <p>To <dfn>set the URL</dfn> for a <code>Document</code> <var>document</var> to a <span>URL
7384
+ record</span> <var>url</var>:</p>
7385
+
7386
+ <ol>
7387
+ <li><p>Set <var>document</var>'s <span data-x="concept-document-url">URL</span> to
7388
+ <var>url</var>.</p></li>
7389
+
7390
+ <li><p><span>Respond to base URL changes</span> given <var>document</var>.</p></li>
7391
+ </ol>
7392
+
7393
+ <p id="dynamic-changes-to-base-urls">To <dfn>respond to base URL changes</dfn> for a
7394
+ <code>Document</code> <var>document</var>:</p>
7395
+
7396
+ <ol>
7397
+ <li><p>The user agent should update any user interface elements which are displaying affected
7398
+ URLs, or data derived from such URLs, to the user. Examples of such user interface elements would
7399
+ be a status bar that displays a <span>hyperlink</span>'s <span
7400
+ data-x="concept-hyperlink-url">url</span>, or some user interface which displays the URL
7401
+ specified by a <code>q</code>, <code>blockquote</code>, <code>ins</code>, or <code>del</code>
7402
+ element's <code data-x="">cite</code> attribute.</p></li>
7403
+
7404
+ <li><p>Ensure that the CSS <code data-x="selector-link">:link</code>/<code
7405
+ data-x="selector-visited">:visited</code>/etc. <span data-x="pseudo-class">pseudo-classes</span>
7406
+ are updated appropriately.</p></li>
7407
+ </ol>
7408
+
7409
+ <p class="example" id="example-base-url-change-img-unaffected">This means that changing the base
7410
+ URL doesn't affect, for example, the image displayed by <code>img</code> elements. Thus,
7411
+ subsequent accesses of the <code data-x="dom-img-src">src</code> IDL attribute from script will
7412
+ return a new <span>absolute URL</span> that might no longer correspond to the image being
7413
+ shown.</p>
7429
7414
7430
7415
</div>
7431
7416
@@ -15345,6 +15330,8 @@ interface <dfn interface>HTMLBaseElement</dfn> : <span>HTMLElement</span> {
15345
15330
</li>
15346
15331
15347
15332
<li><p>Set <var>element</var>'s <span>frozen base URL</span> to <var>urlRecord</var>.</p></li>
15333
+
15334
+ <li><p><span>Respond to base URL changes</span> given <var>document</var>.</p></li>
15348
15335
</ol>
15349
15336
15350
15337
<p>The <dfn attribute for="HTMLBaseElement"><code data-x="dom-base-href">href</code></dfn> IDL
@@ -103684,8 +103671,7 @@ location.href = '#foo';</code></pre>
103684
103671
state</span> given <var>document</var> and <var>newEntry</var>.</p></li>
103685
103672
103686
103673
<li>
103687
- <p>Set <var>document</var>'s <span data-x="concept-document-url">URL</span> to
103688
- <var>newURL</var>.</p>
103674
+ <p><span>Set the URL</span> given <var>document</var> to <var>newURL</var>.</p>
103689
103675
103690
103676
<p class="note">Since this is neither a <span data-x="navigate">navigation</span> nor a <span
103691
103677
data-x="traverse the history by a delta">history traversal</span>, it does not cause a <code
0 commit comments