Skip to content

Commit

Permalink
update "navigation within beforeunload" test to match the spec
Browse files Browse the repository at this point in the history
  • Loading branch information
gterzian committed May 20, 2018
1 parent a297e8f commit 9467543
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/window.rs
Expand Up @@ -1560,7 +1560,7 @@ impl Window {

let pipeline_id = self.upcast::<GlobalScope>().pipeline_id();

// Step 4
// Step 4 and 5
let window_proxy = self.window_proxy();
if let Some(active) = window_proxy.currently_active() {
if pipeline_id == active {
Expand Down
2 changes: 1 addition & 1 deletion tests/wpt/metadata/MANIFEST.json
Expand Up @@ -564742,7 +564742,7 @@
"support"
],
"html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html": [
"8e48ede5ef227e88a091f1d33b385d0b3dff713c",
"49a3e27670f5902309f45be654ad9e12d7f9c500",
"testharness"
],
"html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html": [
Expand Down

This file was deleted.

Expand Up @@ -15,7 +15,10 @@

iframe.onload = function() {
setTimeout(function() {iframe.contentWindow.location="navigation-within-beforeunload-2.html";}, 100);
iframe.onload = t.step_func(function() {assert_equals(counter, 1000); t.done()});
// Step 4 of https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigating-across-documents
// doesn't seem to allow navigation within a beforeunload handler,
// so the counter should not go beyond 1.
iframe.onload = t.step_func(function() {assert_equals(counter, 1); t.done()});
};

iframe.src = "navigation-within-beforeunload-1.html?" + Math.random();
Expand Down

0 comments on commit 9467543

Please sign in to comment.