Skip to content

Commit

Permalink
Bail out location.hash setter when set to the current hash
Browse files Browse the repository at this point in the history
This adds a special case which is necessary for compatibility with deployed content, and implemented in 2/3 engines. Closes #7386.
  • Loading branch information
domenic committed Jan 7, 2022
1 parent 0777f6d commit d990a90
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -86979,6 +86979,19 @@ interface <dfn interface>Location</dfn> { // but see also <a href="#the-location
state</span> as <span data-x="basic url parser state override"><i>state
override</i></span>.</p></li>

<li>
<p>If <var>copyURL</var>'s <span data-x="concept-url-fragment">fragment</span> equals
<span>this</span>'s <span data-x="concept-location-url">url</span>'s <span
data-x="concept-url-fragment">fragment</span>, then return.</p>

<p class="note">This bailout is necessary for compatibility with deployed content, which <a
href="https://bugzilla.mozilla.org/show_bug.cgi?id=1733797#c2">redundantly sets <code
data-x="dom-location-hash">location.hash</code> on scroll</a>. It does not apply to other
mechanisms of fragment navigation, such as the <code
data-x="dom-location-href">location.href</code> setter or <code
data-x="dom-location-assign">location.assign()</code>.</p>
</li>

<li><p><span><code>Location</code>-object navigate</span> to <var>copyURL</var>.</p></li>
</ol>

Expand Down

0 comments on commit d990a90

Please sign in to comment.