Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Check use of NavigateEvent.sourceElement" #50329

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions navigation-api/navigate-event/event-constructor.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-anchor-download.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-anchor-fragment.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-form-get.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-form-reload.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-form-traverse.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-form-with-target.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-form.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-history-go-0.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-iframe-location.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-location.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-meta-refresh.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-to-srcdoc.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-window-open-self.html
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
3 changes: 1 addition & 2 deletions navigation-api/navigate-event/navigate-window-open.html
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