mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Update web-platform-tests to revision 0f0b7a7e353421b600ee555bf354d3a98bb603ae
This commit is contained in:
parent
363073568e
commit
71dcf37d55
175 changed files with 2749 additions and 678 deletions
|
@ -0,0 +1,30 @@
|
|||
<!doctype html>
|
||||
<title>opener and embedded documents; using a and form</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<iframe name=matchesastring></iframe>
|
||||
<a href=/common/blank.html target=matchesastring><a></a>
|
||||
<form action=/common/blank.html target=matchesastring><input type=submit value="<form>"></form>
|
||||
<script>
|
||||
async_test(t => {
|
||||
const frame = document.querySelector("iframe");
|
||||
let counter = 0;
|
||||
frame.onload = t.step_func(() => {
|
||||
// Firefox and Chrome/Safari load differently
|
||||
if (frame.contentWindow.location.href === "about:blank") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Test bits
|
||||
assert_equals(frame.contentWindow.opener, null);
|
||||
if (counter === 0) {
|
||||
document.querySelector("input").click();
|
||||
} else {
|
||||
t.done();
|
||||
}
|
||||
counter++;
|
||||
});
|
||||
document.querySelector("a").click();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
<!doctype html>
|
||||
<title>opener and embedded documents; using window.open()</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<iframe name=matchesastring></iframe>
|
||||
<script>
|
||||
async_test(t => {
|
||||
const frame = document.querySelector("iframe");
|
||||
frame.onload = t.step_func(() => {
|
||||
// Firefox and Chrome/Safari load differently
|
||||
if (frame.contentWindow.location.href === "about:blank") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Test bits
|
||||
assert_equals(frame.contentWindow.opener, window, "opener before setting it to null");
|
||||
|
||||
const openerDesc = Object.getOwnPropertyDescriptor(frame.contentWindow, "opener"),
|
||||
openerGet = openerDesc.get;
|
||||
|
||||
assert_equals(openerGet(), window, "opener before setting it to null via directly invoking the getter");
|
||||
frame.contentWindow.opener = null;
|
||||
frame.contentWindow.opener = "immaterial";
|
||||
assert_equals(openerGet(), null, "opener after setting it to null via directly invoking the getter");
|
||||
assert_equals(frame.contentWindow.opener, "immaterial");
|
||||
|
||||
t.done();
|
||||
});
|
||||
window.open("/common/blank.html", "matchesastring");
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue