aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/document.rs4
-rw-r--r--components/script/dom/window.rs15
-rw-r--r--tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/001.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/002.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/003.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-history-interface/004.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign.html.ini5
-rw-r--r--tests/wpt/metadata/html/browsers/history/the-location-interface/location_replace.html.ini5
-rw-r--r--tests/wpt/metadata/html/dom/interfaces.html.ini6
-rw-r--r--tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/028.html.ini2
11 files changed, 12 insertions, 50 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index fac64cbc965..7819c6e0d83 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -591,7 +591,7 @@ impl Document {
// Step 6
.or_else(|| self.get_anchor_by_name(fragid))
// Step 7
- .or_else(|| if fragid.to_lowercase() == "top" {
+ .or_else(|| if fragid.eq_ignore_ascii_case("top") {
self.GetDocumentElement()
} else {
// Step 8
@@ -607,7 +607,7 @@ impl Document {
// Step 1
self.set_target_element(target.r());
- let point = if fragment.is_empty() || fragment.to_lowercase() == "top" {
+ let point = if fragment.is_empty() || fragment.eq_ignore_ascii_case("top") {
// FIXME(stshine): this should be the origin of the stacking context space,
// which may differ under the influence of writing mode.
Some((0.0, 0.0))
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index f2c7e48fbde..a57ed1061e9 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -1335,13 +1335,14 @@ impl Window {
let referrer_policy = referrer_policy.or(doc.get_referrer_policy());
// https://html.spec.whatwg.org/multipage/#navigating-across-documents
- if !force_reload && url.as_url().unwrap()[..Position::AfterQuery] == doc.url().as_url().unwrap()[..Position::AfterQuery] {
- // Step 5
- if let Some(fragment) = url.fragment() {
- doc.check_and_scroll_fragment(fragment);
- doc.set_url(url.clone());
- return
- }
+ if !force_reload && url.as_url().unwrap()[..Position::AfterQuery] ==
+ doc.url().as_url().unwrap()[..Position::AfterQuery] {
+ // Step 5
+ if let Some(fragment) = url.fragment() {
+ doc.check_and_scroll_fragment(fragment);
+ doc.set_url(url.clone());
+ return
+ }
}
self.main_thread_script_chan().send(
diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/001.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/001.html.ini
deleted file mode 100644
index 1f5d9f6e261..00000000000
--- a/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/001.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[001.html]
- type: testharness
- [Fragment Navigation: Updating document address]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/002.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/002.html.ini
deleted file mode 100644
index 2e690611068..00000000000
--- a/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/002.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[002.html]
- type: testharness
- [Fragment Navigation: Updating document address twice]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/003.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/003.html.ini
deleted file mode 100644
index 23e4a811c3d..00000000000
--- a/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/003.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[003.html]
- type: testharness
- [Fragment Navigation: Updating scroll position]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html.ini
deleted file mode 100644
index d71a0024381..00000000000
--- a/tests/wpt/metadata/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[scroll-to-anchor-name.html]
- type: testharness
- [Fragment Navigation: scroll to anchor name is lower priority than equal id]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/004.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/004.html.ini
index fa42d1a0762..c442d6da7e9 100644
--- a/tests/wpt/metadata/html/browsers/history/the-history-interface/004.html.ini
+++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/004.html.ini
@@ -1,11 +1,10 @@
[004.html]
type: testharness
- [.go commands should be queued until the thread has ended]
- expected: FAIL
-
[browser needs to support hashchange events for this testcase]
expected: FAIL
[queued .go commands should all be executed when the queue is processed]
expected: FAIL
+ [history position should be calculated when executing, not when calling the .go command]
+ expected: FAIL
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign.html.ini
deleted file mode 100644
index c9e2281c872..00000000000
--- a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_assign.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[location_assign.html]
- type: testharness
- [location assign]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_replace.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/location_replace.html.ini
deleted file mode 100644
index 1b879fa71ac..00000000000
--- a/tests/wpt/metadata/html/browsers/history/the-location-interface/location_replace.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[location_replace.html]
- type: testharness
- [location replace]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini
index 2384531b235..bea6ff2acb4 100644
--- a/tests/wpt/metadata/html/dom/interfaces.html.ini
+++ b/tests/wpt/metadata/html/dom/interfaces.html.ini
@@ -5646,9 +5646,6 @@
[HTMLDirectoryElement interface: document.createElement("dir") must inherit property "compact" with the proper type (0)]
expected: FAIL
- [Location interface: window.location must have own property "replace"]
- expected: FAIL
-
[HTMLOptionElement must be primary interface of new Option()]
expected: FAIL
@@ -6282,9 +6279,6 @@
[HTMLAreaElement interface: document.createElement("area") must inherit property "hash" with the proper type (19)]
expected: FAIL
- [Location interface: calling replace(USVString) on window.location with too few arguments must throw TypeError]
- expected: FAIL
-
[Location interface: window.location must have own property "ancestorOrigins"]
expected: FAIL
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/028.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/028.html.ini
index 27d41fdb5e2..85e7b6ce91b 100644
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/028.html.ini
+++ b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/028.html.ini
@@ -1,6 +1,4 @@
[028.html]
- type: testharness
- expected: ERROR
[ scheduler: javascript: URL]
expected: FAIL