mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #11934 - jdm:navigatefragment, r=emilio
Special-case setting location.hash to the empty string This avoids endless redirect loops on facebook and makes us compliant with https://github.com/whatwg/html/pull/1318. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #10952 - [X] There are tests for these changes OR <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11934) <!-- Reviewable:end -->
This commit is contained in:
commit
e30b288ed6
4 changed files with 45 additions and 2 deletions
|
@ -66,7 +66,10 @@ impl LocationMethods for Location {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-location-hash
|
||||
fn SetHash(&self, value: USVString) {
|
||||
fn SetHash(&self, mut value: USVString) {
|
||||
if value.0.is_empty() {
|
||||
value = USVString("#".to_owned());
|
||||
}
|
||||
self.set_url_component(value, UrlHelper::SetHash);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue