import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1 @@
window-top-001.html

View file

@ -0,0 +1,6 @@
[
{
"id": "navigating-nested-browsing-contexts-in-the-dom",
"original_id": "navigating-nested-browsing-contexts-in-the-dom"
}
]

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>