mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
{
|
||||
"id": "navigating-auxiliary-browsing-contexts-in-the-dom",
|
||||
"original_id": "navigating-auxiliary-browsing-contexts-in-the-dom"
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>HTML Test: Browsing context is first created</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/" />
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
var doc, iframe;
|
||||
|
||||
setup(function () {
|
||||
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.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");
|
||||
|
||||
test(function () {
|
||||
assert_equals(doc.childNodes.length, 1, "The document must have only one child.");
|
||||
assert_equals(doc.documentElement.tagName, "HTML");
|
||||
assert_equals(doc.documentElement.childNodes.length, 2, "The HTML element should have 2 children.");
|
||||
assert_equals(doc.documentElement.childNodes[0].tagName, "HEAD", "The first child of HTML element should be a HEAD element.");
|
||||
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");
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<!doctype html>
|
||||
001-1
|
||||
<script>
|
||||
if (window.opener !== null) {
|
||||
window.opener.postMessage("FAIL", "*");
|
||||
}
|
||||
window.close();
|
||||
</script>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!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>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<!doctype html>
|
||||
002-1
|
||||
<script>
|
||||
if (window.opener !== null) {
|
||||
window.opener.postMessage("PASS", "*");
|
||||
}
|
||||
window.close();
|
||||
</script>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<!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>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
001.html
|
||||
support 001-1.html
|
||||
002.html
|
||||
support 002-1.html
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<!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>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!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>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!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>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!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>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<!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>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<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");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<!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>
|
||||
|
||||
top.postMessage({name: window.name}, "*");
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<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>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>HTML Test: browsing context name - parent</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<script>
|
||||
|
||||
window.open("message.html", "_parent");
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!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>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!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 = "selfWin2";
|
||||
var win = window.open("message.html", "");
|
||||
win.close();
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1 @@
|
|||
window-top-001.html
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
{
|
||||
"id": "navigating-nested-browsing-contexts-in-the-dom",
|
||||
"original_id": "navigating-nested-browsing-contexts-in-the-dom"
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8"/>
|
||||
<title>HTML Test: window.frameElement</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>
|
||||
<script>
|
||||
|
||||
var t1 = async_test("The window's frameElement attribute must return its container element if it is a nested browsing context");
|
||||
var t2 = async_test("The SecurityError must be thrown if the window accesses to frameElement attribute of a Window which does not have the same effective script origin");
|
||||
var t3 = async_test("The window's frameElement attribute must return null if the container's document does not have the same effective script origin");
|
||||
|
||||
function on_load() {
|
||||
t1.step(function () {
|
||||
assert_equals(frames[0].frameElement, document.getElementById("fr1"),
|
||||
"The frameElement attribute should be the first iframe element.");
|
||||
assert_equals(window["win2"].frameElement, document.getElementById("obj"),
|
||||
"The frameElement attribute should be the object element.");
|
||||
assert_equals(window["win3"].frameElement, document.getElementById("emb"),
|
||||
"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'.");
|
||||
});
|
||||
t1.done();
|
||||
|
||||
t2.step(function () {
|
||||
assert_throws("SecurityError", function () { frames[1].frameElement; },
|
||||
"The SecurityError exception should be thrown.");
|
||||
});
|
||||
t2.done();
|
||||
|
||||
t3.step(function () {
|
||||
document.getElementById("fr5").contentWindow.postMessage(null, "*");
|
||||
});
|
||||
window.addEventListener("message", function (event) {
|
||||
var data = JSON.parse(event.data);
|
||||
if (data.name == "testcase3") {
|
||||
t3.step(function () {
|
||||
assert_equals(data.result, "window.frameElement = null",
|
||||
"The frameElement attribute should be null.");
|
||||
});
|
||||
t3.done();
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
</script>
|
||||
<body onload="on_load()">
|
||||
<div id="log"></div>
|
||||
<iframe id="fr1"></iframe>
|
||||
<iframe id="fr2" src="test.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 -->
|
||||
<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";
|
||||
});
|
||||
|
||||
test(function () {
|
||||
assert_equals(window.frameElement, null,
|
||||
"The frameElement attribute should be null.");
|
||||
}, "The window's frameElement attribute must return null if it is not a nested browsing context");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8"/>
|
||||
<title>HTML Test: child browsing context created by the frame element</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/" />
|
||||
<frameset>
|
||||
<frame id="f1" name="frame">
|
||||
</frameset>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Testcase 3: frameElement attribute must return null if the container\'s document does not have the same effective script origin</title>
|
||||
<script>
|
||||
window.addEventListener("message", function (event) {
|
||||
try {
|
||||
var result = "window.frameElement = " + window.frameElement;
|
||||
} catch (e) {
|
||||
result = e.message;
|
||||
}
|
||||
event.source.postMessage(JSON.stringify({name: "testcase3", result: result}),
|
||||
"*");
|
||||
}, false);
|
||||
</script>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>window.top</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(window, top)
|
||||
}, "Top level browsing context");
|
||||
|
||||
function step_func(test) {
|
||||
return function (top_pointer) {
|
||||
test.step(function() {assert_equals(top_pointer, window);})
|
||||
test.done();
|
||||
}
|
||||
}
|
||||
|
||||
var t1 = async_test("One nested iframe");
|
||||
t1.step(function() {
|
||||
var iframe = document.createElement("iframe");
|
||||
//iframe.src = "data:text/html,"
|
||||
|
||||
iframe.onload = t1.step_func(
|
||||
function() {
|
||||
var doc = iframe.contentDocument;
|
||||
iframe.contentWindow.test_func = step_func(t1);
|
||||
|
||||
var script = doc.createElement("script")
|
||||
script.textContent = "test_func(top);"
|
||||
doc.body.appendChild(script);
|
||||
});
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
|
||||
var t2 = async_test("Two nested iframes");
|
||||
t2.step(function() {
|
||||
var iframe = document.createElement("iframe");
|
||||
//iframe.src = "data:text/html,"
|
||||
|
||||
iframe.onload = t2.step_func(
|
||||
function() {
|
||||
var doc = iframe.contentDocument;
|
||||
iframe2 = document.createElement("iframe");
|
||||
//iframe2.src = "data:text/html,"
|
||||
|
||||
iframe2.onload = t2.step_func(
|
||||
function() {
|
||||
var doc2 = iframe2.contentDocument;
|
||||
|
||||
iframe2.contentWindow.test_func = step_func(t2);
|
||||
|
||||
var script = doc2.createElement("script")
|
||||
script.textContent = "test_func(top);"
|
||||
doc2.body.appendChild(script);
|
||||
});
|
||||
doc.body.appendChild(iframe2);
|
||||
});
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +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>.
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<ol>
|
||||
<li><p>After clicking these two links in order a single browsing context should be open showing
|
||||
<code>example.org</code>:
|
||||
<a target=doesnotmatter href="http://example.com/">one</a>,
|
||||
<a target=doesnotmatter href="http://example.org/">two</a>.
|
||||
|
||||
<li><p>After clicking these two links two browsing contexts should have been opened:
|
||||
<a rel=noreferrer target=reallydoesnotmatter href="http://example.com/">one</a>,
|
||||
<a rel=noreferrer target=reallydoesnotmatter href="http://example.com/">two</a>.
|
||||
</ol>
|
||||
|
|
@ -0,0 +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>.
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<!doctype html>
|
||||
<title>rel=noreferrer and reuse of names</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
localStorage.clear()
|
||||
|
||||
function makeHyperlink(n) {
|
||||
var hyperlink = document.body.appendChild(document.createElement("a"))
|
||||
hyperlink.rel = "noreferrer"
|
||||
hyperlink.target = "sufficientlyrandomwindownameamiright"
|
||||
hyperlink.href = "support-named-null-opener.html#" + n
|
||||
return hyperlink
|
||||
}
|
||||
|
||||
var hyperlink1 = makeHyperlink(1),
|
||||
hyperlink2 = makeHyperlink(2)
|
||||
|
||||
t.add_cleanup(function() {
|
||||
localStorage.setItem("x", "close")
|
||||
localStorage.clear()
|
||||
document.body.removeChild(hyperlink1)
|
||||
document.body.removeChild(hyperlink2)
|
||||
})
|
||||
|
||||
addEventListener("storage", function(e) {
|
||||
t.step(function() {
|
||||
if(localStorage.getItem("window1") && localStorage.getItem("window2")) {
|
||||
localStorage.setItem("x", "close")
|
||||
t.done()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
hyperlink1.click()
|
||||
hyperlink2.click()
|
||||
}, "Following a noreferrer link with a named target should not cause creation of a window that can be targeted by another noreferrer link with the same named target");
|
||||
|
||||
async_test(function(t) {
|
||||
var ifr = document.createElement("iframe");
|
||||
ifr.name = "sufficientlyrandomwindownameamiright2";
|
||||
ifr.onload = t.step_func(function() {
|
||||
var hyperlink = document.body.appendChild(document.createElement("a"));
|
||||
t.add_cleanup(function() {
|
||||
hyperlink.remove();
|
||||
});
|
||||
hyperlink.rel = "noreferrer";
|
||||
hyperlink.href = URL.createObjectURL(new Blob(["hello subframe"],
|
||||
{ type: "text/html"}));
|
||||
hyperlink.target = "sufficientlyrandomwindownameamiright2";
|
||||
ifr.onload = t.step_func_done(function() {
|
||||
assert_equals(ifr.contentDocument.documentElement.textContent,
|
||||
"hello subframe");
|
||||
});
|
||||
hyperlink.click();
|
||||
});
|
||||
document.body.appendChild(ifr);
|
||||
t.add_cleanup(function() {
|
||||
ifr.remove();
|
||||
});
|
||||
}, "Targeting a rel=noreferrer link at an existing named subframe should work");
|
||||
|
||||
async_test(function(t) {
|
||||
var win = window.open("", "sufficientlyrandomwindownameamiright3");
|
||||
t.add_cleanup(function() {
|
||||
win.close();
|
||||
});
|
||||
|
||||
var hyperlink = document.body.appendChild(document.createElement("a"));
|
||||
t.add_cleanup(function() {
|
||||
hyperlink.remove();
|
||||
});
|
||||
hyperlink.rel = "noreferrer";
|
||||
hyperlink.href = URL.createObjectURL(new Blob(["hello window"],
|
||||
{ type: "text/html"}));
|
||||
hyperlink.target = "sufficientlyrandomwindownameamiright3";
|
||||
win.onload = t.step_func_done(function() {
|
||||
assert_equals(win.document.documentElement.textContent,
|
||||
"hello window");
|
||||
});
|
||||
hyperlink.click();
|
||||
}, "Targeting a rel=noreferrer link at an existing named window should work");
|
||||
</script>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<!doctype html>
|
||||
<title>rel=noreferrer nullifies window.opener</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
localStorage.clear()
|
||||
|
||||
var hyperlink = document.body.appendChild(document.createElement("a"))
|
||||
hyperlink.rel = "noreferrer"
|
||||
hyperlink.target = "_blank"
|
||||
hyperlink.href = "support-opener-null.html"
|
||||
hyperlink.click()
|
||||
document.body.removeChild(hyperlink)
|
||||
|
||||
addEventListener("storage", function(e) {
|
||||
t.step(function() {
|
||||
assert_equals(e.newValue, "null")
|
||||
localStorage.clear()
|
||||
t.done()
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<p>Clicking this button should close this browsing context: <button onclick=window.close()>button</button>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<script>
|
||||
addEventListener("storage", function(e) {
|
||||
if(e.newValue === "close") {
|
||||
close()
|
||||
}
|
||||
})
|
||||
localStorage.setItem("window" + location.hash.slice(1), "tralala")
|
||||
</script>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<body>
|
||||
<script>
|
||||
var i = document.createElement("iframe");
|
||||
i.name = "nested1";
|
||||
document.body.appendChild(i);
|
||||
|
||||
window.opener.postMessage({
|
||||
"name": window.name,
|
||||
"isTop": window.top === window
|
||||
}, "*");
|
||||
</script>
|
||||
</body>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<script>
|
||||
localStorage.setItem("opener", window.opener)
|
||||
window.close()
|
||||
</script>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<script>
|
||||
if (window.opener) {
|
||||
window.opener.postMessage({
|
||||
"name": window.name,
|
||||
"isTop": window.top === window
|
||||
}, "*");
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<script>document.write(name)</script>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Targeting nested browsing contexts</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script>
|
||||
async_test(function (t) {
|
||||
var windowsToClose = [];
|
||||
window.onmessage = t.step_func(function (e) {
|
||||
if (e.data.name == "openee") {
|
||||
var a = document.body.appendChild(document.createElement('a'));
|
||||
a.target = "nested1";
|
||||
a.href = "support-post-to-opener.html";
|
||||
a.click();
|
||||
windowsToClose.push(e.source);
|
||||
} else {
|
||||
assert_equals(e.data.name, "nested1");
|
||||
assert_equals(e.data.isTop, true);
|
||||
windowsToClose.push(e.source);
|
||||
windowsToClose.forEach(function (w) {
|
||||
w.close();
|
||||
});
|
||||
t.done();
|
||||
}
|
||||
});
|
||||
|
||||
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.click();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue