Skip to content

Commit

Permalink
Matches about:blank WPTs
Browse files Browse the repository at this point in the history
This CL adds WPTs for whatwg/html#9558, which
uses the "matches about:blank" definition [1] in two places where
"about:blank" URL equivalence checks currently are.

[1]: https://html.spec.whatwg.org/#matches-about:blank

R=domenic@chromium.org

Bug: N/A
Change-Id: I840f445d3c7224f70a09e481f3e5727422ca2d83
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4718105
Reviewed-by: Domenic Denicola <domenic@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1175589}
  • Loading branch information
domfarolino authored and chromium-wpt-export-bot committed Jul 26, 2023
1 parent ed878e9 commit 9a32587
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Verify that an iframe whose URL "matches about:blank" [1] uses its about base
// URL and initiator/creator origin.
//
// [1]: https://html.spec.whatwg.org/#matches-about:blank
onload = () => {
async_test(t => {
const iframe = document.createElement('iframe');
// Navigate the iframe away from the initial about:blank Document [1] to
// isolate the effects of a "matches about:blank" URL.
//
// [1]: https://html.spec.whatwg.org/#is-initial-about:blank
iframe.src = '/common/blank.html';

iframe.addEventListener('load', e => {
assert_equals(iframe.contentWindow.location.pathname, '/common/blank.html');

// Navigate the iframe to a URL that "matches about:blank" but isn't exactly
// "about:blank".
iframe.onload = t.step_func_done(() => {
assert_equals(iframe.contentDocument.URL, 'about:blank?query#fragment');
assert_equals(iframe.contentWindow.origin, window.origin);
assert_equals(iframe.contentDocument.baseURI, document.baseURI);
});
iframe.src = 'about:blank?query#fragment';
}, {once: true});

document.body.appendChild(iframe);
}, "about:blank and about:blank?foo#bar both 'match about:blank'");
};

0 comments on commit 9a32587

Please sign in to comment.