Skip to content

Commit

Permalink
Bug 1944223 [wpt PR 50329] - Revert "Check use of NavigateEvent.sourc…
Browse files Browse the repository at this point in the history
…eElement", a=testonly

Automatic update from web-platform-tests
Revert "Check use of NavigateEvent.sourceElement (#46072)" (#50329)

This reverts commit 6c91fbce8312c431a1e0a6db5d001438f96531e9 (#46072) as part of whatwg/html#10898.
--

wpt-commits: 765e5eec7bda0828ba73b3b0d28a7d661eeceb17
wpt-pr: 50329
  • Loading branch information
noamr authored and moz-wptsync-bot committed Jan 29, 2025
1 parent d75038c commit 40d495e
Show file tree
Hide file tree
Showing 34 changed files with 37 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@
assert_equals(event.downloadRequest, downloadRequest);
assert_equals(event.info, info);
assert_equals(event.hasUAVisualTransition, hasUAVisualTransition);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(event.sourceElement, sourceElement);
assert_equals(event.sourceElement, sourceElement);
});
history.pushState(2, null, "#2");
}, "all properties are reflected back");
Expand All @@ -99,8 +98,7 @@
assert_equals(event.formData, null);
assert_equals(event.downloadRequest, null);
assert_equals(event.info, undefined);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(event.sourceElement, null);
assert_equals(event.sourceElement, null);
});
history.pushState(3, null, "#3");
}, "defaults are as expected");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
assert_equals(e.sourceElement, document.getElementById("a"));
e.preventDefault();
});
a.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
assert_equals(e.sourceElement, document.getElementById("a"));
e.preventDefault();
t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, a);
assert_equals(e.sourceElement, a);
e.preventDefault();
});
a.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
assert_equals(e.sourceElement, document.getElementById("a"));
e.preventDefault();
t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
assert_equals(e.sourceElement, document.getElementById("a"));
e.preventDefault();
});
a.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
assert_equals(e.sourceElement, document.getElementById("a"));
e.preventDefault();
t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
assert_equals(new URL(e.destination.url).pathname,
"/navigation-api/navigate-event/foo.html");
assert_false(e.destination.sameDocument);
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.preventDefault();
});
a.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});
navigation.back();
}), 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});
navigation.navigate("#foo", { state: navState });
}, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.intercept();
});
navigation.updateCurrentEntry({ state: navState });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

// Because it's a GET, not a POST
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, form);
assert_equals(e.sourceElement, form);
});
window.onload = t.step_func(() => form.submit());
}, "<form> submission with GET method fires navigate event but with formData null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
iframe.contentWindow.navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_not_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);

iframe.onload = t.step_func(() => {
iframe.contentWindow.navigation.onnavigate = t.step_func_done(e => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
iframe.contentWindow.navigation.onnavigate = t.step_func(e => {
assert_equals(e.navigationType, "push");
assert_not_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);

iframe.onload = t.step_func(() => {
// Avoid the replace behavior that occurs if you navigate during the load handler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_not_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, submit);
assert_equals(e.sourceElement, submit);
});
window.onload = t.step_func(() => test_driver.click(submit));
}, "<form> submission fires navigate event");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_not_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});
form.submit();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_not_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, form);
assert_equals(e.sourceElement, form);
});
window.onload = t.step_func(() => form.submit());
}, "<form> submission fires navigate event");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
assert_equals(e.destination.id, target_id);
assert_equals(e.destination.index, start_index);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});

history.back();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
assert_equals(e.destination.id, target_id);
assert_equals(e.destination.index, start_index);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});

history.back();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
assert_equals(e.destination.index, 0);
assert_equals(e.formData, null);
assert_equals(e.info, undefined);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});
assert_true(i.contentWindow.navigation.canGoBack);
i.contentWindow.history.back();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.preventDefault();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.preventDefault();
t.step_timeout(t.step_func_done(() => {
assert_equals(location.hash, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.preventDefault();
t.step_timeout(t.step_func_done(() => {
assert_equals(location.hash, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.preventDefault();
t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});
location.href = "#1";
}, "location API fires navigate event");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.preventDefault();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
assert_equals(e.destination.index, 0);
assert_equals(e.formData, null);
assert_equals(e.info, "hi");
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});
i.contentWindow.onbeforeunload = () => beforeunload_called = true;
assert_true(i.contentWindow.navigation.canGoBack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
assert_equals(e.destination.index, 0);
assert_equals(e.formData, null);
assert_equals(e.info, "hi");
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
}
await i.contentWindow.navigation.back({ info: "hi" }).finished;
}, "navigate event for navigation.back() - same-document in an iframe");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
assert_equals(e.formData, null);
assert_equals(e.info, "hi");
assert_not_equals(e.hasUAVisualTransition, undefined);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});
assert_true(navigation.canGoBack);
navigation.back({ info: "hi" });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
});
navigation.navigate("#foo");
}, "navigate event for navigation.navigate()");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
assert_equals(e.destination.key, "");
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, document.getElementById("a"));
assert_equals(e.sourceElement, document.getElementById("a"));
e.preventDefault();
t.step_timeout(t.step_func_done(() => assert_equals(location.hash, "")), 0);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.preventDefault();

// Make sure it doesn't navigate anyway.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.preventDefault();
});
window.onload = t.step_func(() => window.open("#1", "_self"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
assert_equals(e.destination.id, "");
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
// NavigateEvent sourceElement is still in development, so test whether it is available.
if ("sourceElement" in e) assert_equals(e.sourceElement, null);
assert_equals(e.sourceElement, null);
e.preventDefault();
});

Expand Down

0 comments on commit 40d495e

Please sign in to comment.