mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +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,14 @@
|
|||
<body>
|
||||
Child.
|
||||
<iframe id="grandchild" src="change_grandchild.html"></iframe>
|
||||
</body>
|
||||
<script>
|
||||
var timer = window.setInterval(poll, 100);
|
||||
function poll() {
|
||||
if (document.body.getAttribute("data-contains-grandchild")) {
|
||||
var grandchild = document.getElementById("grandchild");
|
||||
window.frameElement.parentNode.appendChild(grandchild);
|
||||
window.clearTimeout(timer);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<body>Grandchild.</body>
|
||||
<script>
|
||||
window.frameElement.parentNode.setAttribute("data-contains-grandchild", true);
|
||||
</script>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Change the frame heriarchy</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body>
|
||||
<iframe src="change_child.html"></iframe>
|
||||
</body>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
var timer = window.setInterval(t.step_func(poll), 100);
|
||||
function poll() {
|
||||
// We wait for the grandchild's script to set the custom attribtue.
|
||||
// Note that if this test passes, the grandchild's script must have been run twice,
|
||||
// once to trigger the move from the child to here, and once to pass this test.
|
||||
if (document.body.getAttribute("data-contains-grandchild")) {
|
||||
window.clearTimeout(timer);
|
||||
t.done();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<script src="iframe_harness.js"></script>
|
||||
<body>
|
||||
<iframe src="cross_origin_grandchild.html"></iframe>
|
||||
</body>
|
||||
<script>
|
||||
send_test_results({
|
||||
"id": '79a52de8-4222-427e-92db-caec28e75f8e',
|
||||
"parent": window.parent !== window,
|
||||
"grandparent": window.parent.parent === window.parent,
|
||||
"top": window.top === window.parent,
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<script src="iframe_harness.js"></script>
|
||||
<body>
|
||||
</body>
|
||||
<script>
|
||||
send_test_results({
|
||||
"id": '6c8da65d-2c5e-44ef-bb0b-b8b9849aab19',
|
||||
"parent": window.parent !== window,
|
||||
"grandparent": window.parent.parent !== window.parent,
|
||||
"top": window.top === window.parent.parent,
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Check the frame heriarchy</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="iframe_harness.js"></script>
|
||||
<body>
|
||||
<iframe src="http://www1.web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html"></iframe>
|
||||
</body>
|
||||
<script>
|
||||
get_test_results('bffa23ee-b45a-4e9a-9405-87ab437d5cfa');
|
||||
get_test_results('79a52de8-4222-427e-92db-caec28e75f8e');
|
||||
get_test_results('6c8da65d-2c5e-44ef-bb0b-b8b9849aab19');
|
||||
send_test_results({
|
||||
"id": 'bffa23ee-b45a-4e9a-9405-87ab437d5cfa',
|
||||
"parent": window.parent === window,
|
||||
"top": window.top === window,
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<!doctype html>
|
||||
<title>Historical iframe element features should not be supported</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
function t(property) {
|
||||
test(function() {
|
||||
assert_false(property in document.createElement('iframe'));
|
||||
}, 'iframe.' + property + ' should not be supported');
|
||||
}
|
||||
|
||||
// added in https://github.com/whatwg/html/commit/f6490f17f577fa3478791b29ad8c2b586418001f
|
||||
// removed in https://github.com/whatwg/html/commit/1490eba4dba5ab476f0981443a86c01acae01311
|
||||
t('seamless');
|
||||
</script>
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Check how allowfullscreen affects fullscreen enabled flag</title>
|
||||
<link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
|
||||
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/browsers.html#initialise-the-document-object">
|
||||
<link rel="help" href="https://fullscreen.spec.whatwg.org/#fullscreen-enabled-flag">
|
||||
<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.src = "support/blank.htm";
|
||||
var eventWatcher = new EventWatcher(t, iframe, "load");
|
||||
document.body.appendChild(iframe);
|
||||
t.add_cleanup(function() {
|
||||
document.body.removeChild(iframe);
|
||||
});
|
||||
|
||||
assert_true(document.fullscreenEnabled, "Top level document has fullscreen enabled flag set");
|
||||
eventWatcher.wait_for("load").then(t.step_func_done(function() {
|
||||
assert_false(iframe.contentDocument.fullscreenEnabled, "Document inside iframe without allowfullscreen attribute should not have fullscreen enabled flag set");
|
||||
iframe.setAttribute("allowfullscreen", true);
|
||||
assert_true(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be allowed when allowfullscreen attribute is set");
|
||||
iframe.removeAttribute("allowfullscreen");
|
||||
assert_false(iframe.contentDocument.fullscreenEnabled, "Fullscreen should be denied when allowfullscreen attribute is removed");
|
||||
}));
|
||||
}, "iframe-allowfullscreen");
|
||||
|
||||
/* Fullscreen enabled flag with about:blank */
|
||||
|
||||
function test_allowfullscreen_noload(setup_iframe, check) {
|
||||
var iframe = document.createElement("iframe");
|
||||
setup_iframe(iframe);
|
||||
document.body.appendChild(iframe);
|
||||
check(iframe.contentDocument);
|
||||
document.body.removeChild(iframe);
|
||||
}
|
||||
|
||||
test(function() {
|
||||
test_allowfullscreen_noload(function() {}, function(doc) {
|
||||
assert_false(doc.fullscreenEnabled, "Fullscreen should not be enabled without allowfullscreen attribute");
|
||||
});
|
||||
}, "iframe-noload-noallowfullscreen");
|
||||
|
||||
test(function() {
|
||||
test_allowfullscreen_noload(function(iframe) {
|
||||
iframe.setAttribute("allowfullscreen", true);
|
||||
}, function(doc) {
|
||||
assert_true(doc.fullscreenEnabled, "Fullscreen should be enabled with allowfullscreen attribute");
|
||||
});
|
||||
}, "iframe-noload-allowfullscreen");
|
||||
</script>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Append iframe element to its own child document</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<iframe id=x></iframe>
|
||||
<script>
|
||||
test(function() {
|
||||
var iframe = document.getElementById('x');
|
||||
var childWindow = iframe.contentWindow;
|
||||
assert_equals(childWindow.parent, window);
|
||||
childWindow.document.body.appendChild(iframe);
|
||||
assert_equals(childWindow.parent, null);
|
||||
assert_equals(iframe.contentWindow, null);
|
||||
assert_equals(childWindow.document.body.firstChild, iframe);
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test some sanity behavior around iframe load/error events</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<body>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
var obj = document.createElement("iframe");
|
||||
obj.onload = t.step_func_done(function(e){
|
||||
assert_true(obj.contentWindow instanceof Window, "The iframe element should represent a nested browsing context.")
|
||||
assert_equals(Object.getPrototypeOf(e).constructor, Event, "The load event should use the Event interface.");
|
||||
assert_true(e.isTrusted, "The load event should be a trusted event.");
|
||||
assert_false(e.cancelable, "The load event should not be a cancelable event.");
|
||||
assert_false(e.bubbles, "The load event should not be a bubble event.");
|
||||
assert_equals(e.target, obj, "The load event target should be the corresponding object element.");
|
||||
});
|
||||
|
||||
obj.onerror = t.step_func_done(function(e){
|
||||
assert_unreached("The error event should not be fired.");
|
||||
});
|
||||
|
||||
var url = URL.createObjectURL(new Blob([""], { type: "text/html" }));
|
||||
|
||||
obj.src = url;
|
||||
document.body.appendChild(obj);
|
||||
}, "load event of blob URL");
|
||||
|
||||
async_test(function(t) {
|
||||
var obj = document.createElement("iframe");
|
||||
obj.onload = t.step_func_done(function(e){
|
||||
assert_true(obj.contentWindow instanceof Window, "The object element should represent a nested browsing context.")
|
||||
assert_equals(Object.getPrototypeOf(e).constructor, Event, "The load event should use the Event interface.");
|
||||
assert_true(e.isTrusted, "The load event should be a trusted event.");
|
||||
assert_false(e.cancelable, "The load event should not be a cancelable event.");
|
||||
assert_false(e.bubbles, "The load event should not be a bubble event.");
|
||||
assert_equals(e.target, obj, "The load event target should be the corresponding object element.");
|
||||
});
|
||||
|
||||
obj.onerror = t.step_func_done(function(e){
|
||||
assert_unreached("The error event should not be fired.");
|
||||
});
|
||||
|
||||
document.body.appendChild(obj);
|
||||
}, "load event of initial about:blank");
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>iframe Without Base Tag</title>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="support/blank.htm">
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>iframe With Base Tag</title>
|
||||
<link rel="match" href="iframe-with-base-ref.html">
|
||||
<base href="support/">
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="blank.htm">
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
function get_test_results(id) {
|
||||
async_test(function(test) {
|
||||
var timer = window.setInterval(test.step_func(loop), 100);
|
||||
function loop() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', 'stash.py?id=' + id);
|
||||
xhr.onreadystatechange = test.step_func(function() {
|
||||
assert_equals(xhr.status, 200);
|
||||
if (xhr.responseText) {
|
||||
assert_equals(xhr.responseText, "OK");
|
||||
test.done();
|
||||
window.clearTimeout(timer);
|
||||
}
|
||||
});
|
||||
xhr.send();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function send_test_results(results) {
|
||||
var ok = true;
|
||||
for (result in results) { ok = ok && results[result]; }
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', 'stash.py?id=' + results.id);
|
||||
xhr.send(ok ? "OK" : "FAIL: " + JSON.stringify(results));
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html><html><head><title>javascript: URL creating a document in an about:blank iframe</title>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-iframe-element">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#process-the-iframe-attributes">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log">FAILED (test did not run)</div>
|
||||
|
||||
<iframe src="about:blank" name="ifr1"></iframe>
|
||||
<iframe src="" name="ifr2"></iframe>
|
||||
<iframe src="./" name="ifr3"></iframe>
|
||||
|
||||
<script>
|
||||
var test = async_test();
|
||||
var results = {};
|
||||
var expected = {
|
||||
ifr1:{url:"about:blank", sameDom: true},
|
||||
ifr2:{url:"about:blank", sameDom: true},
|
||||
ifr3:{url: location.href.replace(/\/[^\/]*$/, '/'), sameDom: true },
|
||||
ifr4:{url:"about:blank", sameDom: true}
|
||||
}
|
||||
|
||||
var js_url = 'javascript:"<html><script>var sameDom = false; try{var cn = top.document.body.className;sameDom = true;}catch(e){}; parent.postMessage( {url: document.URL, name: name, sameDom: sameDom}, \'*\')<\/script><body><p>JS-generated document</p></body></<html>";'
|
||||
window.addEventListener('message', function(e){
|
||||
var ifr = e.data.name;
|
||||
results[ifr] = e.data;
|
||||
test.step(function(){
|
||||
assert_equals(results[ifr].url, expected[ifr].url);
|
||||
assert_equals(results[ifr].sameDom, expected[ifr].sameDom);
|
||||
}, 'Testing URL and details of IFRAME ' + ifr);
|
||||
if(Object.keys(results).length === Object.keys(expected).length){
|
||||
test.done();
|
||||
}
|
||||
}, false);
|
||||
|
||||
var ifr = document.createElement('iframe');
|
||||
ifr.name = 'ifr4';
|
||||
document.body.appendChild(ifr);
|
||||
|
||||
window.onload = function () {
|
||||
for (var i = 0, frame, frames = document.getElementsByTagName('iframe'); frame = frames[i]; i++) {
|
||||
try{
|
||||
frame.src = js_url;
|
||||
}catch(e){
|
||||
results[frame.name] = 'Exception on setting!';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="uft-8">
|
||||
<title>HTML Test: iframe_sandbox_allow_scripts</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-iframe-sandbox">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-iframe-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
// Set up all our script stuff before the iframe starts loading, so we don't
|
||||
// miss any messages from it.
|
||||
var step1 = false;
|
||||
var t = async_test("iframe_sandbox_allow_scripts");
|
||||
|
||||
setup({timeout:1000});
|
||||
window.addEventListener("message", callback1, false);
|
||||
|
||||
function run() {
|
||||
window.removeEventListener("message", callback1, false);
|
||||
document.getElementById("testIframe").sandbox = "allow-scripts";
|
||||
document.getElementById("testIframe").contentWindow.location.reload();
|
||||
window.addEventListener("message", callback2, false);
|
||||
}
|
||||
|
||||
function callback1(e) {
|
||||
step1= !step1;
|
||||
}
|
||||
|
||||
function callback2(e) {
|
||||
t.step(function () {
|
||||
assert_false(step1, "[allow-scripts] is not set.");
|
||||
assert_equals(e.data, "Script executed", "[allow-scripts] is set.");
|
||||
});
|
||||
t.done();
|
||||
}
|
||||
|
||||
// Make sure the iframe loads before we mess with it.
|
||||
window.addEventListener("load", function() {
|
||||
// The load event might fire before a message from the child comes in...
|
||||
// Wait a bit to see if that message does come in.
|
||||
setTimeout(run, 500);
|
||||
});
|
||||
</script>
|
||||
<iframe id="testIframe" src="support/sandbox_allow_script.html" sandbox="allow-same-origin" style="display:none"></iframe>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<!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-1.html";
|
||||
});
|
||||
postMessage("hello", "*");
|
||||
</script>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<!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");
|
||||
});
|
||||
|
||||
var iframe = document.querySelector("iframe");
|
||||
iframe.onload = function() {
|
||||
frames[0].postMessage("start", "*");
|
||||
}
|
||||
iframe.src = "iframe_sandbox_popups_helper-2.html";
|
||||
});
|
||||
addEventListener("load", function() {
|
||||
postMessage("hello", "*");
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<!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-3.html";
|
||||
});
|
||||
postMessage("hello", "*");
|
||||
</script>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<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 }, "*");
|
||||
};
|
||||
popupWin = window.open(location.href);
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<!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 from our parent and open
|
||||
// ourselves as the popup when we get the "start" message.
|
||||
onmessage = function (e) {
|
||||
if (e.data == "start") {
|
||||
// Now listen for messages from the thing we plan to open.
|
||||
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>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<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 popupWin = window.open();
|
||||
popupWin.location.href = location.href;
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<!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-1.html"></iframe>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<!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");
|
||||
});
|
||||
addEventListener("load", function() {
|
||||
frames[0].postMessage("start", "*");
|
||||
});
|
||||
</script>
|
||||
<iframe sandbox="allow-scripts allow-popups"
|
||||
src="iframe_sandbox_popups_helper-2.html"></iframe>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<!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-3.html"></iframe>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>moving modified IFRAME in document (original page about:blank, DOM modification)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
|
||||
<iframe src="about:blank"></iframe>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
onload = function() {
|
||||
var ifr = document.getElementsByTagName('iframe')[0];
|
||||
ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document';
|
||||
setTimeout(function() {
|
||||
ifr.onload = function() {
|
||||
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
|
||||
done();
|
||||
};
|
||||
document.getElementById('target').appendChild(ifr);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<title>moving modified IFRAME in document (original page about:blank, document.write modification)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
|
||||
<iframe src="about:blank"></iframe>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
onload = function() {
|
||||
var ifr = document.getElementsByTagName('iframe')[0];
|
||||
ifr.contentDocument.open();
|
||||
ifr.contentDocument.write('Modified document');
|
||||
ifr.contentDocument.close();
|
||||
setTimeout(function() {
|
||||
ifr.onload = function() {
|
||||
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
|
||||
done();
|
||||
};
|
||||
document.getElementById('target').appendChild(ifr);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>moving modified IFRAME in document (original page from server, DOM modification)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
|
||||
<iframe src="support/blank.htm"></iframe>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
onload = function() {
|
||||
var ifr = document.getElementsByTagName('iframe')[0];
|
||||
ifr.contentDocument.body.appendChild(ifr.contentDocument.createElement('p')).textContent = 'Modified document';
|
||||
setTimeout(function() {
|
||||
ifr.onload = function() {
|
||||
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
|
||||
done();
|
||||
};
|
||||
document.getElementById('target').appendChild(ifr);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<title>moving modified IFRAME in document (original page from server, document.write modification)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="help" href="https://html.spec.whatwg.org/#iframe-load-event-steps">
|
||||
<iframe src="support/blank.htm"></iframe>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
onload = function(){
|
||||
var ifr = document.getElementsByTagName('iframe')[0];
|
||||
ifr.contentDocument.open();
|
||||
ifr.contentDocument.write('Modified document');
|
||||
ifr.contentDocument.close();
|
||||
setTimeout(function() {
|
||||
ifr.onload = function () {
|
||||
assert_equals(ifr.contentDocument.body.textContent.indexOf('Modified'), -1);
|
||||
done();
|
||||
};
|
||||
document.getElementById('target').appendChild(ifr);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<script src="iframe_harness.js"></script>
|
||||
<body>
|
||||
<iframe src="same_origin_grandchild.html"></iframe>
|
||||
</body>
|
||||
<script>
|
||||
send_test_results({
|
||||
"id": '08782f28-e313-47ae-8cd7-419f3e194b0a',
|
||||
"parent": window.parent !== window,
|
||||
"grandparent": window.parent.parent === window.parent,
|
||||
"top": window.top === window.parent,
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<script src="iframe_harness.js"></script>
|
||||
<body>
|
||||
</body>
|
||||
<script>
|
||||
send_test_results({
|
||||
"id": '66de8d44-7da7-47c7-9a52-41cba4f22bfe',
|
||||
"parent": window.parent !== window,
|
||||
"grandparent": window.parent.parent !== window.parent,
|
||||
"top": window.top === window.parent.parent,
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>Check the frame heriarchy</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="iframe_harness.js"></script>
|
||||
<body>
|
||||
<iframe src="same_origin_child.html"></iframe>
|
||||
</body>
|
||||
<script>
|
||||
get_test_results('17381dae-9c3e-4661-9f2b-28eb07a5f2fc');
|
||||
get_test_results('08782f28-e313-47ae-8cd7-419f3e194b0a');
|
||||
get_test_results('66de8d44-7da7-47c7-9a52-41cba4f22bfe');
|
||||
send_test_results({
|
||||
"id": '17381dae-9c3e-4661-9f2b-28eb07a5f2fc',
|
||||
"parent": window.parent === window,
|
||||
"top": window.top === window,
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
|
||||
def main(request, response):
|
||||
if request.method == 'POST':
|
||||
request.server.stash.put(request.GET["id"], request.body)
|
||||
return ''
|
||||
return request.server.stash.take(request.GET["id"])
|
||||
|
|
@ -0,0 +1 @@
|
|||
<html></html>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="uft-8">
|
||||
<title>HTML Test: sandbox_allow_scripts</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<div id="test">Before change</div>
|
||||
<script>
|
||||
parent.window.postMessage("Script executed", "*");
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue