Backed out changeset df7cb65bee39 (bug 1301138) for wpt test failures

--HG--
rename : testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html => testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping.html
rename : testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper-2.html => testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper.html
rename : testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html => testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping.html
This commit is contained in:
Carsten "Tomcat" Book 2016-09-08 08:33:13 +02:00
Родитель 8a8f12a059
Коммит 8fca739250
8 изменённых файлов: 9 добавлений и 85 удалений

Просмотреть файл

@ -1053,19 +1053,16 @@ nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy* aParent,
nsCOMPtr<nsIDocShell> newDocShell(do_QueryInterface(newDocShellItem));
NS_ENSURE_TRUE(newDocShell, NS_ERROR_UNEXPECTED);
// If our parent is sandboxed, set it as the one permitted sandboxed navigator
// on the new window we're opening.
if (activeDocsSandboxFlags && parentWindow) {
newDocShell->SetOnePermittedSandboxedNavigator(
parentWindow->GetDocShell());
}
// Copy sandbox flags to the new window if activeDocsSandboxFlags says to do
// so. Note that it's only nonzero if the window is new, so clobbering
// sandbox flags on the window makes sense in that case.
if (activeDocsSandboxFlags &
SANDBOX_PROPAGATES_TO_AUXILIARY_BROWSING_CONTEXTS) {
newDocShell->SetSandboxFlags(activeDocsSandboxFlags);
if (parentWindow) {
newDocShell->SetOnePermittedSandboxedNavigator(
parentWindow->GetDocShell());
}
}
rv = ReadyOpenedDocShellItem(newDocShellItem, parentWindow, windowIsNew, aResult);

Просмотреть файл

@ -19482,12 +19482,12 @@
"url": "/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_script.html"
},
{
"path": "html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html",
"url": "/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html"
"path": "html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping.html",
"url": "/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping.html"
},
{
"path": "html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html",
"url": "/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html"
"path": "html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping.html",
"url": "/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping.html"
},
{
"path": "html/semantics/embedded-content/the-iframe-element/move_iframe_in_dom_01.html",
@ -37802,18 +37802,6 @@
"url": "/html/browsers/history/the-location-interface/location-prototype-setting.html"
}
],
"html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html": [
{
"path": "html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html",
"url": "/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html"
}
],
"html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html": [
{
"path": "html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html",
"url": "/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html"
}
],
"html/semantics/forms/the-form-element/form-submission-sandbox.html": [
{
"path": "html/semantics/forms/the-form-element/form-submission-sandbox.html",

Просмотреть файл

@ -1,25 +0,0 @@
<!doctype html>
<meta charset=utf-8>
<title>Check that popups from a sandboxed iframe escape the sandbox if
allow-popups-to-escape-sandbox is used</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<iframe sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox">
</iframe>
<script>
var t = async_test();
var ourOrigin;
onmessage = t.step_func(function(e) {
assert_equals(e.data, "hello", "This is our origin getter message");
ourOrigin = e.origin;
onmessage = t.step_func_done(function(e) {
assert_equals(e.origin, "null", "It came from a sandboxed iframe");
assert_equals(e.data.data, undefined, "Should have the right message");
assert_equals(e.data.origin, ourOrigin, "Should have escaped the sandbox");
});
document.querySelector("iframe").src = "iframe_sandbox_popups_helper-2.html";
});
postMessage("hello", "*");
</script>

Просмотреть файл

@ -19,7 +19,7 @@
assert_equals(e.data.origin, ourOrigin, "Should have escaped the sandbox");
});
document.querySelector("iframe").src = "iframe_sandbox_popups_helper-1.html";
document.querySelector("iframe").src = "iframe_sandbox_popups_helper.html";
});
postMessage("hello", "*");
</script>

Просмотреть файл

@ -1,21 +0,0 @@
<!DOCTYPE html>
<body>
<script>
if (opener) {
// We're the popup. Send back our state. What we really want to send is
// our origin, but that will come automatically.
opener.postMessage(undefined, "*");
self.close();
} else {
// We're the child. Start listening for messages and open ourselves as the
// popup.
onmessage = function (e) {
parent.postMessage({ data: e.data, origin: e.origin }, "*");
};
var a = document.createElement("a");
a.href = location.href;
a.target = "_blank";
document.body.appendChild(a);
a.click();
}
</script>

Просмотреть файл

@ -1,15 +0,0 @@
<!doctype html>
<meta charset=utf-8>
<title>Check that popups from a sandboxed iframe do not escape the sandbox</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
var t = async_test();
onmessage = t.step_func_done(function(e) {
assert_equals(e.origin, "null", "It came from a sandboxed iframe");
assert_equals(e.data.data, undefined, "Should have the right message");
assert_equals(e.data.origin, "null", "Should not have escaped the sandbox");
});
</script>
<iframe sandbox="allow-scripts allow-popups"
src="iframe_sandbox_popups_helper-2.html"></iframe>