mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision ee82278e15570e573d87fb80179ff8231b6db61a
This commit is contained in:
parent
d23bc4f1a4
commit
83e2dc11b0
278 changed files with 13348 additions and 10515 deletions
|
@ -1,82 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<embed>'s browsing context is discarded on 'src' attribute change.
|
||||
</title>
|
||||
<link rel="author" title="Ehsan Karamad" href="ekaramad@chromium.org">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
let url1 = "../resources/test_page.html";
|
||||
let url2 = "../resources/should-load.html";
|
||||
function onLoadPromise(el) {
|
||||
return new Promise((resolve) => {
|
||||
function onLoad() {
|
||||
resolve();
|
||||
el.removeEventListener("load", onLoad);
|
||||
}
|
||||
el.addEventListener("load", onLoad);
|
||||
});
|
||||
}
|
||||
|
||||
promise_test(async() => {
|
||||
let old_windows = [];
|
||||
|
||||
let embed = document.createElement("embed");
|
||||
embed.type = "text/html";
|
||||
embed.src = url1;
|
||||
let onEmbedLoad = onLoadPromise(embed);
|
||||
document.body.appendChild(embed);
|
||||
await onEmbedLoad;
|
||||
old_windows.push(window[0]);
|
||||
assert_equals(
|
||||
window[0].frameElement,
|
||||
embed,
|
||||
"<embed> is attached and loaded with html content.");
|
||||
|
||||
let iframe = document.createElement("iframe");
|
||||
iframe.src = url1;
|
||||
let onIframeLoad = onLoadPromise(iframe);
|
||||
document.body.appendChild(iframe);
|
||||
await onIframeLoad;
|
||||
old_windows.push(window[1]);
|
||||
assert_equals(
|
||||
window[1].frameElement,
|
||||
iframe,
|
||||
"<iframe> is attached and loaded with html content after <embed>.");
|
||||
assert_equals(
|
||||
window[0],
|
||||
old_windows[0],
|
||||
"The first window is that of <embed>'s frame.");
|
||||
|
||||
// Now navigate the embed element again.
|
||||
onEmbedLoad = onLoadPromise(embed);
|
||||
embed.src = url2;
|
||||
await onEmbedLoad;
|
||||
assert_equals(
|
||||
window[0].frameElement,
|
||||
iframe,
|
||||
"<embed>'s previous frame must have been destroyed.");
|
||||
|
||||
assert_equals(
|
||||
window[1].frameElement,
|
||||
embed,
|
||||
"<embed>'s new window should be appended after navigation.");
|
||||
|
||||
assert_not_equals(
|
||||
old_windows[0],
|
||||
window[1],
|
||||
"The old window and new window are different for <embed>.");
|
||||
|
||||
assert_equals(
|
||||
old_windows[1],
|
||||
window[0],
|
||||
"The old and new window are the same for <iframe>.");
|
||||
}, "Verify that changing 'src' attribute of an <embed> element discards" +
|
||||
" the old browsing context and creates a new browsing context.");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue