Skip to content

Commit 13e6c1b

Browse files
authored
Fix url and src in NotRestoredReasons
url was previously listed as a DOMString, but it should be a USVString. This change is not observable since it always contained a serialized URL anyway. src was previously listed as containing the literal value of the src="" content attribute. However, the intended behavior was to contain the parsed-then-serialized value of the src IDL attribute, i.e., the result after content/IDL attribute reflection. Fix the spec to reflect that, which allows also changing it to USVString. Finally, also account for the fact that sometimes content attributes can be missing, in which case these properties need to return the empty string. (Not null, which is reserved for the top level or non-iframe child cases.) Closes whatwg#10895.
1 parent d035517 commit 13e6c1b

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

source

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96936,10 +96936,10 @@ interface <dfn interface>NotRestoredReasonDetails</dfn> {
9693696936

9693796937
[Exposed=Window]
9693896938
interface <dfn interface>NotRestoredReasons</dfn> {
96939-
readonly attribute DOMString? <span data-x="dom-not-restored-reasons-src">src</span>;
96939+
readonly attribute USVString? <span data-x="dom-not-restored-reasons-src">src</span>;
9694096940
readonly attribute DOMString? <span data-x="dom-not-restored-reasons-id">id</span>;
9694196941
readonly attribute DOMString? <span data-x="dom-not-restored-reasons-name">name</span>;
96942-
readonly attribute DOMString? <span data-x="dom-not-restored-reasons-url">url</span>;
96942+
readonly attribute USVString? <span data-x="dom-not-restored-reasons-url">url</span>;
9694396943
readonly attribute FrozenArray&lt;<span>NotRestoredReasonDetails</span>&gt;? <span data-x="dom-not-restored-reasons-reasons">reasons</span>;
9694496944
readonly attribute FrozenArray&lt;<span>NotRestoredReasons</span>&gt;? <span data-x="dom-not-restored-reasons-children">children</span>;
9694596945
[Default] object toJSON();
@@ -97383,7 +97383,8 @@ interface <dfn interface>NotRestoredReasons</dfn> {
9738397383
the following <span data-x="struct item">items</span>:</p>
9738497384

9738597385
<ul>
97386-
<li><p><dfn data-x="nrr-src">src</dfn>, a string or null, initially null.</p></li>
97386+
<li><p><dfn data-x="nrr-src">src</dfn>, a <span>scalar value string</span> or null, initially
97387+
null.</p></li>
9738797388

9738897389
<li><p><dfn data-x="nrr-id">id</dfn>, a string or null, initially null.</p></li>
9738997390

@@ -104738,22 +104739,38 @@ location.href = '#foo';</code></pre>
104738104739
<li><p>Set <var>notRestoredReasonsForDocument</var>'s <span data-x="nrr-url">URL</span> to
104739104740
<var>document</var>'s <span data-x="concept-document-url">URL</span>.</p></li>
104740104741

104742+
<li><p>Let <var>container</var> be <var>document</var>'s <span>node navigable</span>'s <span
104743+
data-x="nav-container">container</span>.</p></li>
104744+
104741104745
<li>
104742-
<p>If <var>document</var>'s <span>node navigable</span>'s <span
104743-
data-x="nav-container">container</span> is an <code>iframe</code> element, then:</p>
104746+
<p>If <var>container</var> is an <code>iframe</code> element:</p>
104744104747

104745104748
<ol>
104749+
<li><p>Let <var>src</var> be the empty string.</p></li>
104750+
104751+
<li>
104752+
<p>If <var>container</var> has a <code data-x="dom-iframe-src">src</code> attribute:</p>
104753+
104754+
<ol>
104755+
<li><p>Let <var>src</var> be the result of <span>encoding-parsing-and-serializing a
104756+
URL</span> given <var>container</var>'s <code data-x="attr-iframe-src">src</code> attribute's
104757+
value, relative to <var>container</var>'s <span>node document</span>.</p></li>
104758+
104759+
<li><p>If <var>src</var> is failure, then set <var>src</var> to <var>container</var>'s <code
104760+
data-x="attr-iframe-src">src</code> attribute's value.</p></li>
104761+
</ol>
104762+
</li>
104763+
104746104764
<li><p>Set <var>notRestoredReasonsForDocument</var>'s <span data-x="nrr-src">src</span> to
104747-
the value of <var>document</var>'s <span>node navigable</span>'s <span
104748-
data-x="nav-container">container</span>'s <code data-x="attr-iframe-src">src</code> attribute.</p></li>
104765+
<var>src</var>.</p></li>
104749104766

104750104767
<li><p>Set <var>notRestoredReasonsForDocument</var>'s <span data-x="nrr-id">id</span> to
104751-
the value of <var>document</var>'s <span>node navigable</span>'s <span
104752-
data-x="nav-container">container</span>'s <code data-x="attr-id">id</code> attribute.</p></li>
104768+
<var>container</var>'s <code data-x="attr-id">id</code> attribute's value, or the empty string
104769+
if it has no such attribute.</p></li>
104753104770

104754-
<li><p>Set <var>notRestoredReasonsForDocument</var>'s <span data-x="nrr-name">name</span>
104755-
to the value of <var>document</var>'s <span>node navigable</span>'s <span
104756-
data-x="nav-container">container</span>'s <code data-x="attr-iframe-name">name</code> attribute.</p></li>
104771+
<li><p>Set <var>notRestoredReasonsForDocument</var>'s <span data-x="nrr-name">name</span> to
104772+
<var>container</var>'s <code data-x="attr-iframe-name">name</code> attribute's value, or the
104773+
empty string if it has no such attribute.</p></li>
104757104774
</ol>
104758104775
</li>
104759104776

0 commit comments

Comments
 (0)