Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444

This commit is contained in:
Josh Matthews 2017-04-17 12:06:02 +10:00 committed by Anthony Ramine
parent 25e8bf69e6
commit 665817d2a6
35333 changed files with 1818077 additions and 16036 deletions

View file

@ -0,0 +1,31 @@
<!doctype html>
<meta charset="utf-8">
<html>
<head>
<title>Auxiliary Browing Contexts: window.opener when Opener Removed/Closed</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());
var a = document.createElement('a');
a.href = prefixedLocalStorage.url('resources/open-closer.html');
a.target = '_blank';
prefixedLocalStorage.onSet('openerIsNull', t.step_func_done(e => {
// The window for this auxiliary browsing context's opener
// has been closed and discarded, so the aux browsing context
// should now report `null` for `window.opener`
assert_equals(e.newValue, 'true');
}));
document.body.append(a);
a.click();
}, 'An auxiliary browsing context should report `null` for `window.opener` when that browsing context is discarded');
</script>
</body>
</html>

View file

@ -0,0 +1,35 @@
<!doctype html>
<html>
<head>
<title>Auxiliary Browing Contexts: window.opener, multiple</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());
var a = document.createElement('a');
a.href = prefixedLocalStorage.url('resources/multiple-opener.html');
a.target = 'multipleOpener';
window.name = 'topOpener';
document.body.appendChild(a);
window.addEventListener('message', t.step_func_done(e => {
var aux1 = e.data.aux1; // First opened context
var aux2 = e.data.aux2; // Context opened by first-opened context
assert_equals(aux1.name, 'multipleOpener');
assert_equals(aux1.openerName, window.name);
assert_equals(aux1.isTop, true);
assert_equals(aux2.name, 'multipleOpenee');
assert_equals(aux2.openerName, aux1.name);
assert_equals(aux2.isTop, true);
}));
a.click();
}, 'An auxiliary browsing context should be able to open another auxiliary browsing context');
</script>
</body>
</html>

View file

@ -0,0 +1,25 @@
<!doctype html>
<html>
<head>
<title>Auxiliary Browing Contexts: window.opener noopener</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/no-opener.html'),
'iShouldNotHaveAnOpener',
'noopener');
}, 'Auxiliary browsing context created via `window.open` setting `noopener` should report `window.opener` `null`');
</script>
</body>
</html>

View file

@ -0,0 +1,29 @@
<!doctype html>
<html>
<head>
<title>Auxiliary Browing Contexts: window.opener noreferrer</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());
var a = document.createElement('a');
a.href = prefixedLocalStorage.url('resources/no-opener.html');
a.target = '_blank';
a.rel = 'noreferrer';
window.name = 'topWindow';
document.body.appendChild(a);
prefixedLocalStorage.onSet('openerIsNull', t.step_func_done(e => {
assert_equals(e.newValue, 'true');
}));
a.click();
}, 'Auxiliary browsing context created with `rel="noreferrer"` should report `window.opener` `null`');
</script>
</body>
</html>

View file

@ -0,0 +1,55 @@
<!doctype html>
<html>
<head>
<title>Auxiliary Browing Contexts: window.opener</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 (() => {
window.name = 'topWindow';
prefixedLocalStorage = new PrefixedLocalStorageTest();
});
function cleanup () {
prefixedLocalStorage.setItem('closeAll', 'true');
prefixedLocalStorage.clear();
}
function testOpener (t, target) {
t.add_cleanup(cleanup);
window.addEventListener('message', t.step_func(e => {
if (e.data.name === target) {
// The opener IDL attribute...must return the WindowProxy object of the
// browsing context from which the current browsing context was created
assert_equals(e.data.openerName, 'topWindow');
// Auxiliary browsing contexts are always top-level browsing contexts
assert_equals(e.data.isTop, true);
t.done();
}
}));
}
async_test(t => {
var target = 'windowOpenerA';
var a = document.createElement('a');
a.href = prefixedLocalStorage.url('resources/message-window-opener.html');
a.target = target;
document.body.appendChild(a);
testOpener(t, target);
a.click();
}, 'Newly-created auxiliary browsing context should report `window.opener`');
async_test(t => {
var target = 'windowOpenerB';
testOpener(t, target);
window.open(prefixedLocalStorage.url('resources/message-window-opener.html'),
target);
}, 'Browsing context created with `window.open` should report `window.opener`');
</script>
</body>
</html>

View file

@ -0,0 +1,30 @@
<!doctype html>
<meta charset="utf-8">
<html>
<body onload="closeOpener()">
<p>This window should close its opener.</p>
<script src="/common/PrefixedLocalStorage.js"></script>
<script>
var prefixedLocalStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
var prefixedLocalStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
function closeOpener () {
if (window.opener) {
window.opener.close();
// Give the browsing context a chance to dispose of itself
function waitForContextDiscard () {
if (window.opener === null) {
return prefixedLocalStorage.setItem('openerIsNull', 'true');
}
return setTimeout(waitForContextDiscard, 0);
}
waitForContextDiscard();
}
}
</script>
</body>
</html>

View file

@ -0,0 +1,14 @@
<script src="/common/PrefixedLocalStorage.js"></script>
<script>
var prefixedLocalStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
if (window.opener) {
window.opener.postMessage ({
name : window.name,
openerName: window.opener.name,
isTop : window.top === window
}, '*');
}
</script>

View file

@ -0,0 +1,32 @@
<!doctype html>
<html>
<script src="/common/PrefixedLocalStorage.js"></script>
<body onload="openNested()">
<script>
var prefixedLocalStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
function openNested () {
// Listen for message from opened context and pass through to this
// context's opener
window.addEventListener('message', (e) => {
if (window.opener) {
window.opener.postMessage({
aux2: e.data, // From multipleOpenee
aux1: { // This context
name : window.name,
openerName : window.opener.name,
isTop : window.top === window
}
}, '*');
}
});
var a = document.createElement('a');
a.target = 'multipleOpenee';
a.href = prefixedLocalStorage.url('message-window-opener.html');
document.body.appendChild(a);
a.click();
}
</script>
</body>
</html>

View file

@ -0,0 +1,16 @@
<!doctype html>
<meta charset="utf-8">
<html>
<p>This window should have no opener.</p>
<script src="/common/PrefixedLocalStorage.js"></script>
<script>
var prefixedLocalStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
function checkOpener () {
return prefixedLocalStorage.setItem('openerIsNull', window.opener === null);
}
</script>
<body onload="checkOpener()">
</body>
</html>

View file

@ -0,0 +1,17 @@
<!doctype html>
<meta charset="utf-8">
<html>
<body onload="openAuxiliary()">
<a target="_blank">Open auxiliary context that will close this window (its opener)</a>
<script src="/common/PrefixedLocalStorage.js"></script>
<script>
function openAuxiliary () {
var prefixedLocalStorage = new PrefixedLocalStorageResource();
var a = document.body.querySelector('a');
a.href = prefixedLocalStorage.url('close-opener.html');
document.body.append(a);
a.click();
}
</script>
</body>
</html>

View file

@ -1,8 +0,0 @@
<!doctype html>
001-1
<script>
if (window.opener !== null) {
window.opener.postMessage("FAIL", "*");
}
window.close();
</script>

View file

@ -1,22 +0,0 @@
<!doctype html>
<title>Link with target=_blank, rel=noreferrer</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<a href="001-1.html" rel="noreferrer" target="_blank">Link</a>
<script>
var t = async_test();
var a;
t.step(function() {
a = document.getElementsByTagName("a")[0];
a.click();
//This is a bit hacky; if the test passes there isn't a link back to the parent
//window so we have to pass on a timeout. But opening the link could be slow in
//some cases, so there is some possibility of false passes
setTimeout(t.step_func(function() {
t.done();
}), 1000);
});
onmessage = t.step_func(function() {assert_unreached("Opened window had a reference to opener")});
</script>

View file

@ -1,8 +0,0 @@
<!doctype html>
002-1
<script>
if (window.opener !== null) {
window.opener.postMessage("PASS", "*");
}
window.close();
</script>

View file

@ -1,25 +0,0 @@
<!doctype html>
<title>Link with target=_blank, no rel</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<a href="002-1.html" target="_blank">Link</a>
<script>
var a;
async_test(function(t) {
a = document.getElementsByTagName("a")[0];
a.click();
// This is a bit hacky; if the test fails there isn't a link back to the parent
// window so we have to pass on a timeout. But opening the link could be slow in
// some cases, so there is some possibility of false fails
step_timeout(t.step_func(function() {
assert_unreached("Failed to get callback from opened window");
}), 5000);
onmessage = t.step_func(function(e) {
assert_equals(e.data, "PASS");
t.done()
});
});
</script>

View file

@ -1,25 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - the given name is same as an existing browsing context's name</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src="existing.html" style="display:none"></iframe>
<iframe name="existWin" style="display:none"></iframe>
<script>
var t = async_test("The browsing context must be chosen if the given name is same as its name");
window.addEventListener("message", function (e) {
t.step(function() {
assert_equals(e.data.name, "existWin", "The browsing context name should be 'existWin'.");
});
t.done();
}, false);
frames[0].onload = t.step_func(function(e) {
frames[0].do_test();
});
</script>

View file

@ -1,20 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - the given name is '_parent'</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src="parent1.html" name="parentWin" style="display:none"></iframe>
<script>
var t = async_test("The parent browsing context must be chosen if the given name is '_parent'");
window.addEventListener("message", function (e) {
t.step(function() {
assert_equals(e.data.name, "parentWin", "The browsing context name should be 'parentWin'.");
});
t.done();
}, false);
</script>

View file

@ -1,20 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - the given name is '_self'</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src="self1.html" style="display:none"></iframe>
<script>
var t = async_test("The current browsing context must be chosen if the given name is '_self'");
window.addEventListener("message", function (e) {
t.step(function () {
assert_equals(e.data.name, "selfWin1", "The browsing context name should be 'selfWin1'.");
});
t.done();
}, false);
</script>

View file

@ -1,20 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - the given name is empty string</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src="self2.html" style="display:none"></iframe>
<script>
var t = async_test("The current browsing context must be chosen if the given name is empty string");
window.addEventListener("message", function (e) {
t.step(function () {
assert_equals(e.data.name, "selfWin2", "The browsing context name should be 'selfWin2'.");
});
t.done();
}, false);
</script>

View file

@ -1,26 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Browsing context - Default name</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src="message.html" style="display:none"></iframe>
<script>
test(function () {
assert_equals(window.frames[0].name, "", "The browsing context should not have a default name.");
}, "A embedded browsing context has no default name");
test(function () {
var win = window.open("about:blank", "_blank");
assert_equals(win.name, "", "The browsing context should not have a name.");
win.close();
}, "A browsing context which is opened by window.open() method with '_blank' parameter has no default name");
//This test must be run when the current browsing context's name is not set
test(function () {
assert_equals(window.name, "", "The browsing context should not have a name.");
}, "A browsing context has no default name");
</script>

View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Browsing context - `_blank` name keyword</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(t => {
var window1 = window.open('about:blank', '_blank');
var window2 = window.open('about:blank', '_blank');
var window3 = window.open('about:blank', '_blank');
t.add_cleanup(() => {
window1.close();
window2.close();
window3.close();
});
assert_not_equals(window1, window2);
assert_not_equals(window2, window3);
assert_not_equals(window1, window3);
}, 'window.open into `_blank` should create a new browsing context each time');
test(t => {
var window1 = window.open('about:blank', '_bLAnk');
var window2 = window.open('about:blank', '_bLAnk');
var window3 = window.open('about:blank', '_bLAnk');
t.add_cleanup(() => {
window1.close();
window2.close();
window3.close();
});
assert_not_equals(window1, window2);
assert_not_equals(window2, window3);
assert_not_equals(window1, window3);
}, '`_blank` should be ASCII case-insensitive');
</script>

View file

@ -0,0 +1,21 @@
<!doctype html>
<title>Link with target=_blank, rel=noreferrer</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
<div id="log"></div>
<a href="resources/report-has-opener.html" rel="noreferrer" target="_blank">Link</a>
<script>
var prefixedStorage;
setup (() => prefixedStorage = new PrefixedLocalStorageTest());
async_test(t => {
t.add_cleanup(() => prefixedStorage.cleanup());
var a = document.getElementsByTagName('a')[0];
a.href = prefixedStorage.url(a.href);
prefixedStorage.onSet('hasOpener', t.step_func_done(e => {
assert_equals(e.newValue, 'false');
}));
a.click();
}, 'Context for opened noreferrer link targeted to "_blank" should not have opener reference');
</script>

View file

@ -0,0 +1,20 @@
<!doctype html>
<title>Link with target=_blank, no rel</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
<div id="log"></div>
<a href="resources/report-has-opener.html" target="_blank">Link</a>
<script>
var prefixedStorage;
setup(() => prefixedStorage = new PrefixedLocalStorageTest());
async_test(t => {
t.add_cleanup(() => prefixedStorage.cleanup());
prefixedStorage.onSet('hasOpener', t.step_func_done(e => {
assert_equals(e.newValue, 'true');
}));
var a = document.getElementsByTagName('a')[0];
a.href = prefixedStorage.url(a.href);
a.click();
}, 'Context created by link targeting "_blank" should retain opener reference');
</script>

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - '_parent'</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(t => {
window.addEventListener('message', t.step_func_done(e => {
assert_equals(e.data.name, 'parentWin');
}));
}, 'The parent browsing context must be chosen if the given name is `_parent`');
</script>
<iframe id="embedded" src="resources/choose-_parent-001-iframe-1.html" name="parentWin" style="display:none"></iframe>

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - '_parent' (nested contexts)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(t => {
var topWindow;
t.add_cleanup(() => topWindow.close());
window.addEventListener('message', t.step_func_done(e => {
assert_equals(e.data.name, 'iframeParent');
assert_false(e.data.isTop, 'window.parent is not top');
}));
topWindow = window.open('resources/choose-_parent-002-window.html', '_blank');
}, 'choosing _parent context: multiple nested contexts');
</script>

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - '_parent' (via window.open)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(t => {
var topWindow;
t.add_cleanup(() => topWindow.close());
window.addEventListener('message', t.step_func_done(e => {
assert_equals(e.data.name, 'parentTopReplace');
assert_equals(e.data.isTop, true);
}));
topWindow = window.open('resources/choose-_parent-003-window.html', 'parentTopReplace');
}, '_parent should reuse window.parent context');
</script>

View file

@ -0,0 +1,40 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - '_parent' (case-sensitivity)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
<body>
<div id="log"></div>
<script>
var prefixedStorage;
var iframe;
setup(() => prefixedStorage = new PrefixedLocalStorageTest());
async_test(t => {
t.add_cleanup(() => prefixedStorage.cleanup());
var testFunc = (function (t) {
var completed = 0;
var testCount = 2;
return function (actual, expected) {
assert_equals(actual, expected);
if (++completed >= testCount) {
t.done();
}
}
}(t));
prefixedStorage.onSet('isTop', t.step_func(e => {
testFunc(e.newValue, 'false');
}));
prefixedStorage.onSet('name', t.step_func(e => {
testFunc(e.newValue, 'parentWin');
}));
iframe = document.createElement('iframe');
iframe.src = prefixedStorage.url('resources/choose-_parent-004-iframe-1.html');
iframe.name = 'parentWin';
document.body.appendChild(iframe);
}, 'choosing _parent context should be case-insensitive');
</script>
</body>

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - the given name is '_self'</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src="resources/choose-_self-001-iframe.html" style="display:none"></iframe>
<script>
async_test(t => {
window.addEventListener('message', t.step_func_done(e => {
assert_equals(e.data.name, 'myownself');
}), false);
}, 'The current browsing context must be chosen if the given name is "_self"');
</script>

View file

@ -0,0 +1,46 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - '_self' (case-sensitivity)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
<body>
<div id="log"></div>
<script>
var prefixedStorage;
setup(() => prefixedStorage = new PrefixedLocalStorageTest());
async_test(t => {
var iframe;
var testFunc = (function (t) {
var completed = 0;
var testCount = 2;
return function (actual, expected) {
assert_equals(actual, expected);
if (++completed >= testCount) {
t.done();
}
}
}(t));
t.add_cleanup(() => prefixedStorage.cleanup());
prefixedStorage.onSet('isTop', t.step_func(e => {
testFunc(e.newValue, 'false');
}));
prefixedStorage.onSet('name', t.step_func(e => {
testFunc(e.newValue, 'testWin');
}));
iframe = document.createElement('iframe');
iframe.name = 'testWin';
iframe.src = prefixedStorage.url('resources/choose-_self-002-iframe.html');
document.body.appendChild(iframe);
}, 'choosing _self context should be case-insensitive');
</script>
</body>

View file

@ -0,0 +1,34 @@
<!doctype html>
<title>HTML Test: Browsing context name - _top (current is top)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
<div id="log"></div>
<script>
var prefixedStorage;
setup (() => prefixedStorage = new PrefixedLocalStorageTest());
async_test(t => {
t.add_cleanup(() => prefixedStorage.cleanup());
var testFunc = (function (t) {
var completed = 0;
var testCount = 2;
return function (actual, expected) {
assert_equals(actual, expected);
if (++completed >= testCount) {
t.done();
}
}
}(t));
prefixedStorage.onSet('isTop', t.step_func(e => {
testFunc(e.newValue, 'true');
}));
prefixedStorage.onSet('name', t.step_func(e => {
testFunc(e.newValue, 'topWin1');
}));
window.open(prefixedStorage.url('resources/open-in-_top.html'), '_blank');
}, 'Should choose current browsing context for "_top" if current is top');
</script>

View file

@ -0,0 +1,33 @@
<!doctype html>
<title>HTML Test: Browsing context name - _top</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
<div id="log"></div>
<script>
var prefixedStorage;
setup (() => prefixedStorage = new PrefixedLocalStorageTest());
async_test(t => {
t.add_cleanup(() => prefixedStorage.cleanup());
var testFunc = (function (t) {
var completed = 0;
var testCount = 2;
return function (actual, expected) {
assert_equals(actual, expected);
if (++completed >= testCount) {
t.done();
}
}
}(t));
prefixedStorage.onSet('isTop', t.step_func(e => {
testFunc(e.newValue, 'true');
}));
prefixedStorage.onSet('name', t.step_func(e => {
testFunc(e.newValue, 'topWin2');
}));
window.open(prefixedStorage.url('resources/choose-_top-002-window.html'), '_blank');
}, 'Should choose top browsing context for "_top" if current is not top');
</script>

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - '_top' (case-sensitivity)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/PrefixedLocalStorage.js"></script>
<body>
<div id="log"></div>
<script>
var prefixedStorage;
setup(() => prefixedStorage = new PrefixedLocalStorageTest());
async_test(t => {
var testFunc = (function (t) {
var completed = 0;
var testCount = 2;
return function (actual, expected) {
assert_equals(actual, expected);
if (++completed >= testCount) {
t.done();
}
}
}(t));
t.add_cleanup(() => prefixedStorage.cleanup());
prefixedStorage.onSet('isTop', t.step_func(e => {
testFunc(e.newValue, 'true');
}));
prefixedStorage.onSet('name', t.step_func(e => {
testFunc(e.newValue, 'topWin');
}));
window.open(prefixedStorage.url('resources/choose-_top-003-iframe-1.html'), '_blank');
}, 'choosing _top context should be case-insensitive');
</script>
</body>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Browsing context - Default name</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src="/common/blank.html" style="display:none"></iframe>
<object id="obj" type="text/html" data="about:blank"></object>
<embed id="embedded" type="image/svg+xml" src="/images/green.svg" width="0" height="0" />
<script>
test(t => {
assert_equals(window.frames[0].name, "");
assert_equals(document.getElementById("embedded").name, "");
assert_equals(window["obj"].name, "");
}, "A embedded browsing context has empty-string default name");
test(t => {
var win = window.open("about:blank", "_blank");
assert_equals(win.name, "");
win.close();
}, "A browsing context which is opened by window.open() method with '_blank' parameter has empty-string default name");
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Browsing context names - empty string</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(t => {
window.addEventListener('message', t.step_func_done(e => {
assert_equals(e.data.isTop, false);
assert_equals(e.data.name, 'hellothere', 'Empty-string browsing context should choose current context');
}), false);
}, 'The current browsing context must be chosen if the given name is empty string');
</script>
<iframe name="hellothere" src="resources/choose-default-002-iframe.html"></iframe>

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: Choose browsing context - the given name is same as an existing browsing context's name</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src="resources/choose-existing-001-iframe.html" style="display:none"></iframe>
<iframe name="iExist" style="display:none"></iframe>
<script>
async_test(t => {
window.addEventListener('message', t.step_func_done(e => {
assert_equals(e.data.name, 'iExist');
}), false);
}, 'An existing browsing context must be chosen if the given name is the same as its name');
</script>

View file

@ -2,4 +2,4 @@
<meta charset="utf-8">
<title>HTML Test: browsing context name - parent</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<iframe src="parent2.html"></iframe>
<iframe src="open-in-_parent.html"></iframe>

View file

@ -0,0 +1,4 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - parent: nested context</title>
<iframe name="iframeChild" src="open-in-_parent.html"></iframe>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - parent: top-level context</title>
<iframe name="iframeParent" src="choose-_parent-002-iframe.html"></iframe>
<script>
// Relay a message from child context to opener context
window.addEventListener('message', e => {
if (window.opener) {
window.opener.postMessage(e.data, '*');
}
});
</script>

View file

@ -0,0 +1,6 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - parent</title>
<script>
window.open("post-to-opener.html", "_parent");
</script>

View file

@ -0,0 +1,4 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - parent: top-level context (gets replaced)</title>
<iframe name="iframeOpener" src="choose-_parent-003-iframe.html"></iframe>

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - parent</title>
<script src="/common/PrefixedLocalStorage.js"></script>
<body>
<script>
var prefixedStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
var iframe = document.createElement('iframe');
iframe.src = prefixedStorage.url('choose-_parent-004-iframe-2.html');
document.body.appendChild(iframe);
</script>
</body>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - parent (case-insensitive)</title>
<script src="/common/PrefixedLocalStorage.js"></script>
<script>
var prefixedStorage = new PrefixedLocalStorageResource();
window.open(prefixedStorage.url('report-is-top.html'), '_pARent');
</script>

View file

@ -3,9 +3,7 @@
<title>HTML Test: browsing context name - self</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script>
window.name = "selfWin2";
var win = window.open("message.html", "");
window.name = 'myownself';
var win = window.open('post-to-top.html', '_self');
win.close();
</script>

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - self (case-insensitive)</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script src="/common/PrefixedLocalStorage.js"></script>
<script>
var prefixedStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
var win = window.open(prefixedStorage.url('report-is-top.html'), '_sElF');
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<meta charset="utf-8">
<script src="/common/PrefixedLocalStorage.js"></script>
<title>HTML Test: browsing context name - _top</title>
<body>
<script>
var prefixedStorage = new PrefixedLocalStorageResource({
close_on_cleanup:true
});
window.name = 'topWin2';
var iframe = document.createElement('iframe');
iframe.src = prefixedStorage.url('open-in-_top.html');
// Append iframe that will open another document into `_top` (this context)
document.body.appendChild(iframe);
</script>
</body>

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - top (case-insensitive)</title>
<script src="/common/PrefixedLocalStorage.js"></script>
<body>
</body>
<script>
var prefixedStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
window.name = 'topWin';
var iframe = document.createElement('iframe');
iframe.src = prefixedStorage.url('choose-_top-003-iframe-2.html');
document.body.appendChild(iframe);
</script>

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - top (case-insensitive)</title>
<script src="/common/PrefixedLocalStorage.js"></script>
<script>
var prefixedStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
window.open(prefixedStorage.url("report-is-top.html"), "_ToP");
</script>

View file

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - Empty string</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<body onload="followLink()">
</body>
<script>
function followLink() {
var a = document.createElement('a');
a.href = 'post-to-top.html';
a.target = ''; // Target is empty string
document.body.appendChild(a);
a.click();
}
</script>
</html>

View file

@ -3,9 +3,5 @@
<title>This is a test page</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script>
function do_test() {
window.open("message.html", "existWin");
}
window.open("post-to-top.html", "iExist");
</script>

View file

@ -4,6 +4,6 @@
<link rel="author" title="Intel" href="http://www.intel.com/">
<script>
window.open("message.html", "_parent");
window.open("post-to-top.html", "_parent");
</script>

View file

@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset="utf-8">
<script src="/common/PrefixedLocalStorage.js"></script>
<title>HTML Test: browsing context name - _top</title>
<script>
var prefixedStorage = new PrefixedLocalStorageResource();
window.name = 'topWin1';
window.open(prefixedStorage.url('report-is-top.html'), '_top');
</script>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: post window's name to top browsing context</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script>
if (window.opener) {
window.opener.postMessage({
name: window.name,
isTop: (window.top === window)
}, "*");
}
</script>

View file

@ -3,7 +3,8 @@
<title>HTML Test: post window's name to top browsing context</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script>
top.postMessage({name: window.name}, "*");
top.postMessage({
name: window.name,
isTop: (window.top === window)
}, "*");
</script>

View file

@ -0,0 +1,8 @@
<!doctype html>
<script src="/common/PrefixedLocalStorage.js"></script>
<script>
var prefixedStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
prefixedStorage.setItem('hasOpener', window.opener !== null);
</script>

View file

@ -0,0 +1,10 @@
<!doctype html>
<meta charset="utf-8">
<script src="/common/PrefixedLocalStorage.js"></script>
<script>
var prefixedStorage = new PrefixedLocalStorageResource({
close_on_cleanup: true
});
prefixedStorage.setItem('isTop', window === window.top);
prefixedStorage.setItem('name', window.name);
</script>

View file

@ -1,11 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Test: browsing context name - self</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<script>
window.name = "selfWin1";
var win = window.open("message.html", "_self");
win.close();
</script>

View file

@ -0,0 +1,37 @@
<!doctype html>
<html>
<head>
<title>HTML Test: Newly-Created browsing context Window and `this`</title>
<link rel="author" title="Intel" href="http://www.intel.com/" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
</head>
<body>
<div id="log"></div>
<script>
/**
* Test for creating a new browsing context, [Browsing Contexts](#windows).
* This test is separate from the rest of the browsing-content-creation tests
* because the `iframe` has a src and thus its document won't be `about:blank`.
*/
var doc, iframe;
setup(function () {
iframe = document.createElement("iframe");
iframe.src = get_host_info().HTTP_REMOTE_ORIGIN + "/html/browsers/windows/resources/browsing-context-window.html";
document.body.appendChild(iframe);
doc = iframe.contentDocument;
});
async_test(function (t) {
window.onmessage = t.step_func(function (e) {
assert_equals(e.data.thisWindowEquivalency, true, "The global `this` for the created browsing context should be a reference to Window through WindowProxy");
t.done();
});
});
</script>
</body>
</html>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<!doctype html>
<html>
<head>
<title>HTML Test: Browsing context is first created</title>
<link rel="author" title="Intel" href="http://www.intel.com/" />
@ -9,34 +9,25 @@
<body>
<div id="log"></div>
<script>
<![CDATA[
var doc, iframe;
setup(function () {
// Create new browsing context via iframe
iframe = document.createElement("iframe");
document.body.appendChild(iframe);
doc = iframe.contentDocument;
});
test(function () {
assert_equals(iframe.contentWindow.history.length, 1, "The history.length should be 1.");
}, "Check the history.length of the first created browsing context");
test(function () {
assert_equals(doc.compatMode, "BackCompat", "The compatMode of a document without a document type declaration should be 'BackCompat'."); // Quirksmode
assert_equals(doc.contentType, "text/html", "The document should be an HTML document.");
assert_equals(doc.readyState, "complete", "The readyState attribute should be 'complete'.");
// Document metadata...
assert_equals(doc.documentURI, "about:blank", "The document's address should be 'about:blank'.");
assert_equals(doc.URL, "about:blank", "The document's address should be 'about:blank'.");
assert_equals(doc.contentType, "text/html", "The document should be an HTML document.");
assert_equals(doc.doctype, null, "The docType of a document without a document type declaration should be null.");
assert_equals(doc.compatMode, "BackCompat", "The compatMode of a document without a document type declaration should be 'BackCompat'.");
assert_equals(doc.characterSet, "UTF-8", "The document's encoding should be 'UTF-8'.");
assert_equals(iframe.contentWindow.parent.document, document);
assert_equals(doc.referrer, document.URL, "The document's referrer should be its creator document's address.");
}, "Check the document's meta data");
test(function () {
assert_equals(doc.readyState, "complete", "The readyState attribute should be 'complete'.");
}, "Check the document's status");
}, "Check that browsing context has new, ready HTML document");
test(function () {
assert_equals(doc.childNodes.length, 1, "The document must have only one child.");
@ -46,9 +37,18 @@
assert_false(doc.documentElement.childNodes[0].hasChildNodes(), "The HEAD element should not have children.");
assert_equals(doc.documentElement.childNodes[1].tagName, "BODY", "The second child of HTML element should be a BODY element.");
assert_false(doc.documentElement.childNodes[1].hasChildNodes(), "The BODY element should not have children.");
}, "Check the document's content");
}, "Check that new document nodes extant, empty");
test(function () {
assert_equals(doc.origin, document.origin, "The document's origin should be its creator document's origin");
assert_equals(doc.referrer, document.URL, "The document's referrer should be its creator document's address.");
assert_equals(iframe.contentWindow.parent.document, document);
}, "Check the document properties corresponding to the creator browsing context");
test(function () {
assert_equals(iframe.contentWindow.history.length, 1, "The history.length should be 1.");
}, "Check the history.length of the created browsing context");
]]>
</script>
</body>
</html>

View file

@ -21,7 +21,7 @@ function on_load() {
"The frameElement attribute should be the embed element.");
assert_equals(document.getElementById("fr4").contentWindow[0].frameElement,
document.getElementById("fr4").contentDocument.getElementById("f1"),
"The frameElement attribute should be the frame element in 'test.html'.");
"The frameElement attribute should be the frame element in 'resources/frameElement-nested-frame.html'.");
});
t1.done();
@ -50,19 +50,19 @@ function on_load() {
<body onload="on_load()">
<div id="log"></div>
<iframe id="fr1"></iframe>
<iframe id="fr2" src="test.html"></iframe> <!-- cross origin -->
<iframe id="fr2" src="resources/frameElement-nested-frame.html"></iframe> <!-- cross origin -->
<iframe id="fr3" src="" style="display:none"></iframe>
<object id="obj" name="win2" type="text/html" data="about:blank"></object>
<embed id="emb" name="win3" type="image/svg+xml" src="/images/green.svg" />
<iframe id="fr4" src="test.html"></iframe> <!-- same origin -->
<iframe id="fr5" src="testcase3.html"></iframe> <!-- cross origin -->
<iframe id="fr4" src="resources/frameElement-nested-frame.html"></iframe> <!-- same origin -->
<iframe id="fr5" src="resources/frameElement-window-post.html"></iframe> <!-- cross origin -->
<script>
setup(function () {
var src_base = get_host_info().HTTP_REMOTE_ORIGIN;
src_base += document.location.pathname.substring(0, document.location.pathname.lastIndexOf("/") + 1);
document.getElementById("fr2").src = src_base + "test.html";
document.getElementById("fr5").src = src_base + "testcase3.html";
document.getElementById("fr2").src = src_base + "/resources/frameElement-nested-frame.html";
document.getElementById("fr5").src = src_base + "/resources/frameElement-window-post.html";
});
test(function () {

View file

@ -0,0 +1,7 @@
<script>
if (window.opener) {
window.opener.postMessage({
"parent_isTop": (window.parent === window)
}, "*");
}
</script>

View file

@ -0,0 +1,66 @@
<!doctype html>
<meta charset="utf-8">
<title>window.parent: `null`</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(t => {
var iframe = document.createElement('iframe');
iframe.onload = t.step_func_done(() => {
var iWindow = iframe.contentWindow;
assert_equals(iWindow.parent, window);
document.body.removeChild(iframe);
assert_equals(iWindow.parent, null);
});
document.body.appendChild(iframe);
}, '`window.parent` is null when browsing context container element removed');
async_test(t => {
var iframe = document.createElement('iframe');
var iframe2, removedEl;
var testFunc = t.step_func(() => {
var frameWindow = iframe.contentWindow;
var frame2Window = iframe2.contentWindow;
assert_equals(frameWindow.parent, window);
assert_equals(frame2Window.parent, frameWindow);
iframe.removeEventListener('load', nestFrame);
iframe2.removeEventListener('load', testFunc);
removedEl = document.body.removeChild(iframe);
assert_equals(frameWindow.parent, null);
assert_equals(frame2Window.parent, null);
removedEl.addEventListener('load', t.step_func_done(() => {
// reattached iframe's browsing context will report window.parent again
assert_equals(removedEl.contentWindow.parent, window);
// The following window s are no longer referenced by active browsing contexts
assert_equals(frameWindow.parent, null);
assert_equals(frame2Window.parent, null);
// Per #the-iframe-element, reattaching a removed iframe will result in the
// browser creating a new browsing context once again, with a fresh
// document in our case, so the second iframe or any other elements
// previously added to iframe.contentDocument will be gone
assert_equals(removedEl.contentDocument.querySelector('iframe'), null);
assert_equals(removedEl.contentDocument.querySelector('hr'), null);
}));
document.body.appendChild(removedEl);
});
var nestFrame = function () {
iframe.contentDocument.body.appendChild(document.createElement('hr'));
iframe2 = iframe.contentDocument.createElement('iframe');
// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1229707
iframe2.src = '/common/blank.html';
iframe2.addEventListener('load', testFunc);
iframe.contentDocument.body.appendChild(iframe2);
};
iframe.addEventListener('load', nestFrame);
document.body.appendChild(iframe);
}, '`window.parent` null when parent browsing context container removed');
</script>

View file

@ -0,0 +1,44 @@
<!doctype html>
<meta charset="utf-8">
<title>window.parent</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_equals(window, parent)
}, '`window.parent` for top-level browsing context');
async_test(t => {
var iframe = document.createElement('iframe');
iframe.onload = t.step_func_done(function () {
var iWindow = iframe.contentWindow;
assert_equals(iWindow.parent, window);
});
document.body.appendChild(iframe);
}, '`window.parent` on single nested browsing context');
async_test(t => {
var iframe = document.createElement('iframe');
var iframe2;
var testFunc = t.step_func_done(function () {
var frameWindow = iframe.contentWindow;
var frame2Window = iframe2.contentWindow;
assert_equals(frameWindow.parent, window);
assert_equals(frame2Window.parent, frameWindow);
assert_false(frame2Window.parent === window);
});
var nestFrame = function () {
iframe2 = iframe.contentDocument.createElement('iframe');
// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1229707
iframe2.src = '/common/blank.html';
iframe2.addEventListener('load', testFunc);
iframe.contentDocument.body.appendChild(iframe2);
};
iframe.addEventListener('load', nestFrame);
document.body.appendChild(iframe);
}, '`window.parent` for multiple nested browsing contexts');
</script>

View file

@ -0,0 +1,66 @@
<!doctype html>
<meta charset="utf-8">
<title>window.top: `null`</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function (t) {
var iframe = document.createElement('iframe');
iframe.onload = t.step_func_done(() => {
var iWindow = iframe.contentWindow;
/**
* `top` should return the top-level browsing context but will return
* `null` if none exists, such as when any of the BC's ancestor browsing
* context container's document elements are disconnected/removed.
*/
assert_equals(iWindow.top, window);
document.body.removeChild(iframe);
assert_equals(iWindow.top, null);
});
document.body.appendChild(iframe);
}, '`window.top` is null when browsing context container element removed');
async_test(t => {
var iframe = document.createElement('iframe');
var iframe2, removedEl;
var testFunc = t.step_func(() => {
var frameWindow = iframe.contentWindow;
var frame2Window = iframe2.contentWindow;
assert_equals(frameWindow.top, window);
assert_equals(frame2Window.top, window);
iframe.removeEventListener('load', nestFrame);
iframe2.removeEventListener('load', testFunc);
removedEl = document.body.removeChild(iframe);
assert_equals(frameWindow.top, null);
assert_equals(frame2Window.top, null);
removedEl.addEventListener('load', t.step_func_done(() => {
// reattached iframe's browsing context will report window.top
assert_equals(removedEl.contentWindow.top, window);
// removed/re-added iframes will have new browsing context / window
assert_equals(frameWindow.top, null);
assert_equals(frame2Window.top, null);
}));
document.body.appendChild(removedEl);
});
var nestFrame = function () {
iframe2 = iframe.contentDocument.createElement('iframe');
// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1229707
iframe2.src = '/common/blank.html';
iframe2.addEventListener('load', testFunc);
iframe.contentDocument.body.appendChild(iframe2);
};
iframe.addEventListener('load', nestFrame);
document.body.appendChild(iframe);
}, '`window.top`null when any ancestor browsing context container removed');
</script>

View file

@ -43,6 +43,8 @@ t2.step(function() {
var doc = iframe.contentDocument;
iframe2 = document.createElement("iframe");
//iframe2.src = "data:text/html,"
// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1229707
iframe2.src = '/common/blank.html';
iframe2.onload = t2.step_func(
function() {

View file

@ -1,3 +1,3 @@
<meta charset=utf-8>
<p>Follow this link to open a new browsing context and then confirm it can be closed:
<a rel=noreferrer target=reallydoesnotmatter href="//天気の良い日.{{location[host]}}/html/browsers/windows/support-close.html">link</a>.
<a rel=noreferrer target=reallydoesnotmatter href="//天気の良い日.{{location[host]}}/html/browsers/windows/resources/window-close-button.html">link</a>.

View file

@ -1,3 +1,3 @@
<meta charset=utf-8>
<p>Follow this link to open a new browsing context and then confirm it says "idonteven":
<a rel=noreferrer target=idonteven href="//天気の良い日.{{location[host]}}/html/browsers/windows/support-window-name-echo.html">link</a>.
<a rel=noreferrer target=idonteven href="//天気の良い日.{{location[host]}}/html/browsers/windows/resources/echo-window-name.html">link</a>.

View file

@ -10,7 +10,7 @@
var hyperlink = document.body.appendChild(document.createElement("a"))
hyperlink.rel = "noreferrer"
hyperlink.target = "_blank"
hyperlink.href = "support-opener-null.html"
hyperlink.href = "resources/window-opener.html"
hyperlink.click()
document.body.removeChild(hyperlink)

View file

@ -11,7 +11,7 @@
var hyperlink = document.body.appendChild(document.createElement("a"))
hyperlink.rel = "noreferrer"
hyperlink.target = "sufficientlyrandomwindownameamiright"
hyperlink.href = "support-named-null-opener.html#" + n
hyperlink.href = "resources/noreferrer-window-name.html#" + n
return hyperlink
}

View file

@ -0,0 +1,10 @@
<ol>
<li><p>Clicking this link must navigate this page to a resource that contains "THE END":
<a href=//{{domains[www1]}}:{{location[port]}}/html/browsers/windows/resources/opener-cross-origin.html target=_blank>test</a>
<li><p>Clicking this link must open a new browsing context that is empty:
<a rel=noreferrer href=//{{domains[www1]}}:{{location[port]}}/html/browsers/windows/resources/opener-cross-origin.html target=_blank>test</a>
<li><p>Clicking this link must navigate this page to a resource that contains "THE END":
<a href=//{{domains[www1]}}:{{location[port]}}/html/browsers/windows/resources/opener-cross-origin-embed.sub.html target=_blank>test</a>
</ol>

View file

@ -0,0 +1,7 @@
<script>
if (window.parent) {
window.parent.postMessage({
"thisWindowEquivalency": (window === this)
}, "*");
}
</script>

View file

@ -0,0 +1,2 @@
<meta charset=utf-8>
<iframe src=//{{domains[élève]}}:{{location[port]}}/html/browsers/windows/resources/opener-cross-origin.html></iframe>

View file

@ -0,0 +1,4 @@
<script>
parent.opener.location.href = "./opener-cross-origin-end.txt"
parent.window.close()
</script>

View file

@ -1,3 +1,3 @@
<meta charset=utf-8>
<p>Follow this link to open a new browsing context in a separate origin.
<a target=second href="{{location[scheme]}}://{{domains[www2]}}:{{location[port]}}/html/browsers/windows/support-open-cross-origin.sub.html">link</a>.
<a target=second href="{{location[scheme]}}://{{domains[www2]}}:{{location[port]}}/html/browsers/windows/resources/target-cross-origin.sub.html">link</a>.

View file

@ -15,7 +15,7 @@
if (e.data.name == "openee") {
var a = document.body.appendChild(document.createElement('a'));
a.target = "nested1";
a.href = "support-post-to-opener.html";
a.href = "resources/post-to-opener.html";
a.click();
windowsToClose.push(e.source);
} else {
@ -31,7 +31,7 @@
var a = document.body.appendChild(document.createElement('a'));
a.target = "openee";
a.href = get_host_info().HTTP_REMOTE_ORIGIN + "/html/browsers/windows/support-nested-browsing-contexts.html";
a.href = get_host_info().HTTP_REMOTE_ORIGIN + "/html/browsers/windows/resources/nested-post-to-opener.html";
a.click();
});
</script>

View file

@ -1,9 +1,9 @@
<meta charset=utf-8>
<p>Follow this link to open a new browsing context in a separate origin. Follow the instructions
in that new window, and then come back to this window.
<a target=first href="{{location[scheme]}}://{{domains[天気の良い日]}}:{{location[port]}}/html/browsers/windows/support-open-cross-origin.sub.html">link</a>.
<a target=first href="{{location[scheme]}}://{{domains[天気の良い日]}}:{{location[port]}}/html/browsers/windows/resources/target-cross-origin.sub.html">link</a>.
<p>Once you come back to this page, follow this link.
<a target=second href="support-window-name-echo.html">link</a>.
<a target=second href="resources/echo-window-name.html">link</a>.
<p>After clicking that link, you should have three additional windows open.