Skip to content

Commit 0238d1a

Browse files
committed
Specify rate limiter for navigation, history traversal, and pushState/replaceState
This returns instead of throws for web compat. Fixes #11108. Fixes #11410.
1 parent 9b5f1b3 commit 0238d1a

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

source

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99000,6 +99000,10 @@ interface <dfn interface>History</dfn> {
9900099000
<li><p>If <var>document</var> is not <span>fully active</span>, then throw a
9900199001
<span>"<code>SecurityError</code>"</span> <code>DOMException</code>.</p></li>
9900299002

99003+
<li><p>If <var>history</var>'s <span>relevant global object</span>'s <span
99004+
data-x="window-navigable">navigable</span> is not <span>allowed to perform a navigation or
99005+
history update</span>, then return.</p></li>
99006+
9900399007
<li><p>If <var>delta</var> is 0, then <span>reload</span> <var>document</var>'s <span>node
9900499008
navigable</span>, and return.</p></li>
9900599009

@@ -99037,10 +99041,9 @@ interface <dfn interface>History</dfn> {
9903799041
<li><p>If <var>document</var> is not <span>fully active</span>, then throw a
9903899042
<span>"<code>SecurityError</code>"</span> <code>DOMException</code>.</p></li>
9903999043

99040-
<li><p>Optionally, throw a <span>"<code>SecurityError</code>"</span> <code>DOMException</code>.
99041-
(For example, the user agent might disallow calls to these methods that are invoked on a timer,
99042-
or from event listeners that are not triggered in response to a clear user action, or that are
99043-
invoked in rapid succession.)</p></li>
99044+
<li><p>If <var>history</var>'s <span>relevant global object</span>'s <span
99045+
data-x="window-navigable">navigable</span> is not <span>allowed to perform a navigation or
99046+
history update</span>, then return.</p></li>
9904499047

9904599048
<li><p>Let <var>serializedData</var> be
9904699049
<span>StructuredSerializeForStorage</span>(<var>data</var>). Rethrow any exceptions.</p></li>
@@ -104282,6 +104285,11 @@ interface <dfn interface>NotRestoredReasons</dfn> {
104282104285

104283104286
<p class="note">This is only ever set to true in cases where the navigable's <span
104284104287
data-x="nav-parent">parent</span> is non-null.</p>
104288+
</li>
104289+
104290+
<li><p>An <dfn>allowed to perform a navigation or history update</dfn> algorithm, which
104291+
<span>implementation-defined</span>. It returns true if the operation is allowed to proceed, and
104292+
false otherwise.</p></li>
104285104293
</ul>
104286104294

104287104295
<p>The <span data-x="nav-current-history-entry">current session history entry</span> and the
@@ -107474,6 +107482,9 @@ location.href = '#foo';</code></pre>
107474107482
intersection-observing a lazy loading element</span> <var>container</var> and set
107475107483
<var>container</var>'s <span>lazy load resumption steps</span> to null.</p></li>
107476107484

107485+
<li><p>If <var>navigable</var> is not <span>allowed to perform a navigation or history
107486+
update</span>, then return.</p></li>
107487+
107477107488
<li id="navigate-convert-to-replace">
107478107489
<p>If <var>historyHandling</var> is "<code
107479107490
data-x="NavigationHistoryBehavior-auto">auto</code>":</p>

0 commit comments

Comments
 (0)