mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
implement opener, disowning
This commit is contained in:
parent
f408b798c4
commit
21bf5a3a4b
32 changed files with 273 additions and 143 deletions
|
@ -279733,6 +279733,11 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html/browsers/windows/browsing-context-names/resources/choose-_parent-001-iframe-1.html": [
|
||||
[
|
||||
{}
|
||||
|
@ -352032,6 +352037,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html": [
|
||||
[
|
||||
"/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.js": [
|
||||
[
|
||||
"/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.html",
|
||||
|
@ -587647,6 +587658,10 @@
|
|||
"f82aa6f0abe0d16a8b132e531d165988af0af99f",
|
||||
"testharness"
|
||||
],
|
||||
"html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html": [
|
||||
"85c52e0b42e19bdd78dda120320d66ddbb2103b4",
|
||||
"testharness"
|
||||
],
|
||||
"html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.js": [
|
||||
"6d540ce97c94bff5845023098d0960d51dad62b4",
|
||||
"testharness"
|
||||
|
@ -587675,6 +587690,10 @@
|
|||
"6f43a5188c790577c4a1a03da270317eedba0fb0",
|
||||
"support"
|
||||
],
|
||||
"html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html": [
|
||||
"4112dae0cee66138a309b202a8d09d6b256c6d4d",
|
||||
"support"
|
||||
],
|
||||
"html/browsers/windows/browsing-context-names/choose-_blank-001.html": [
|
||||
"a1416f2eb8437a8824a26a0e2e6aa6fdede37ffa",
|
||||
"testharness"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[005.html]
|
||||
type: testharness
|
||||
expected: ERROR
|
|
@ -2,4 +2,3 @@
|
|||
type: testharness
|
||||
[Link with onclick javascript url and href navigation ]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[opener-closed.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
expected: CRASH
|
||||
[An auxiliary browsing context should report `null` for `window.opener` when that browsing context is discarded]
|
||||
expected: TIMEOUT
|
||||
expected: CRASH
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[opener-multiple.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[An auxiliary browsing context should be able to open another auxiliary browsing context]
|
||||
expected: TIMEOUT
|
|
@ -1,6 +0,0 @@
|
|||
[opener-noreferrer.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[Auxiliary browsing context created with `rel="noreferrer"` should report `window.opener` `null`]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
[opener-setter.window.html]
|
||||
[Setting window.opener to undefined]
|
||||
expected: FAIL
|
||||
|
||||
[Setting window.opener to 42]
|
||||
expected: FAIL
|
||||
|
||||
[Setting window.opener to function () { return "hi" }]
|
||||
expected: FAIL
|
||||
|
||||
[Setting window.opener to hi]
|
||||
expected: FAIL
|
||||
|
||||
[Setting window.opener to [object Object\]]
|
||||
expected: FAIL
|
||||
|
||||
[Setting window.opener to ]
|
||||
expected: FAIL
|
||||
|
||||
[Setting window.opener to Symbol()]
|
||||
expected: FAIL
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
[opener.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[Newly-created auxiliary browsing context should report `window.opener`]
|
||||
expected: TIMEOUT
|
||||
[Browsing context created with `window.open` should report `window.opener`]
|
||||
expected: FAIL
|
|
@ -1,8 +0,0 @@
|
|||
[choose-_blank-001.html]
|
||||
type: testharness
|
||||
[window.open into `_blank` should create a new browsing context each time]
|
||||
expected: FAIL
|
||||
|
||||
[`_blank` should be ASCII case-insensitive]
|
||||
expected: FAIL
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[choose-_blank-002.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[Context for opened noreferrer link targeted to "_blank" should not have opener reference]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[choose-_blank-003.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[Context created by link targeting "_blank" should retain opener reference]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[choose-_parent-001.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[The parent browsing context must be chosen if the given name is `_parent`]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[choose-_parent-002.html]
|
||||
type: testharness
|
||||
expected: ERROR
|
||||
[choosing _parent context: multiple nested contexts]
|
||||
expected: FAIL
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[choose-_parent-003.html]
|
||||
type: testharness
|
||||
expected: ERROR
|
||||
[_parent should reuse window.parent context]
|
||||
expected: FAIL
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[choose-_parent-004.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[choosing _parent context should be case-insensitive]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[choose-_self-002.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[choosing _self context should be case-insensitive]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[choose-_top-001.html]
|
||||
type: testharness
|
||||
[Should choose current browsing context for "_top" if current is top]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[choose-_top-002.html]
|
||||
type: testharness
|
||||
[Should choose top browsing context for "_top" if current is not top]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[choose-_top-003.html]
|
||||
type: testharness
|
||||
[choosing _top context should be case-insensitive]
|
||||
expected: FAIL
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[noreferrer-null-opener.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[rel=noreferrer nullifies window.opener]
|
||||
expected: TIMEOUT
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
[targeting-cross-origin-nested-browsing-contexts.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[Targeting nested browsing contexts]
|
||||
expected: FAIL
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Auxiliary Browing Contexts: window.opener setter</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/PrefixedLocalStorage.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var prefixedLocalStorage;
|
||||
setup(() => prefixedLocalStorage = new PrefixedLocalStorageTest());
|
||||
async_test(t => {
|
||||
t.add_cleanup(() => prefixedLocalStorage.cleanup());
|
||||
prefixedLocalStorage.onSet('openerIsNull', t.step_func_done(e => {
|
||||
assert_equals(e.newValue, 'true');
|
||||
}));
|
||||
window.open(prefixedLocalStorage.url('resources/opener-setter.html'),
|
||||
'iShouldSetOpenerToNull');
|
||||
}, 'Auxiliary browsing context created via `window.open` and setting `window.opener` to `null` should report `window.opener` `null`');
|
||||
async_test(t => {
|
||||
t.add_cleanup(() => prefixedLocalStorage.cleanup());
|
||||
prefixedLocalStorage.onSet('openerIsTest', t.step_func_done(e => {
|
||||
assert_equals(e.newValue, 'true');
|
||||
}));
|
||||
window.open(prefixedLocalStorage.url('resources/opener-setter.html'),
|
||||
'iShouldSetOpenerToTest');
|
||||
}, 'Auxiliary browsing context created via `window.open` and setting `window.opener` to `test` should report `test`');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<html>
|
||||
<p>This window should set the window.opener attribute</p>
|
||||
<script src="/common/PrefixedLocalStorage.js"></script>
|
||||
<script>
|
||||
var prefixedLocalStorage = new PrefixedLocalStorageResource({
|
||||
close_on_cleanup: true
|
||||
});
|
||||
function checkOpener () {
|
||||
if (window.name == 'iShouldSetOpenerToNull') {
|
||||
window.opener = null;
|
||||
return prefixedLocalStorage.setItem('openerIsNull', window.opener === null);
|
||||
}
|
||||
if (window.name == 'iShouldSetOpenerToTest') {
|
||||
window.opener = 'test';
|
||||
return prefixedLocalStorage.setItem('openerIsTest', window.opener === "test");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<body onload="checkOpener()">
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue