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

[WPT] <iframe srcdoc>'s base URL when parent's base URL is dynamically updated #23130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<meta charset=utf-8>
<title>base element added in the parent Document should be reflect insrcdoc document's base URL</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fallback-base-url">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<iframe srcdoc=""></iframe>
<script>
var t = async_test();
addEventListener("load", t.step_func_done(function() {
var doc = frames[0].document;
var b = doc.createElement("base");
b.setAttribute("href", "test");
var newBaseValue = location.href.replace(/\/[^/]*$/, "/") + "test";
assert_equals(b.href, newBaseValue);
assert_equals(doc.baseURI, location.href);
// This <base> is added to the parent Document.
document.head.appendChild(b);
// And is reflected in <iframe srcdoc>'s base URI.
assert_equals(doc.baseURI, newBaseValue);
}));
</script>