Implement the entry global.

Partial fix for #10963.
This commit is contained in:
Ms2ger 2016-12-29 13:39:12 +01:00
parent 839b7fe8ef
commit cb47a7e403
15 changed files with 156 additions and 0 deletions

View file

@ -8408,6 +8408,18 @@
"url": "/_mozilla/mozilla/global.html"
}
],
"mozilla/globals/entry.html": [
{
"path": "mozilla/globals/entry.html",
"url": "/_mozilla/mozilla/globals/entry.html"
}
],
"mozilla/globals/entry.worker.js": [
{
"path": "mozilla/globals/entry.worker.js",
"url": "/_mozilla/mozilla/globals/entry.worker.html"
}
],
"mozilla/hit_test_nested_sc.html": [
{
"path": "mozilla/hit_test_nested_sc.html",

View file

@ -0,0 +1,3 @@
[entry.html]
type: testharness
prefs: [dom.testbinding.enabled:true]

View file

@ -0,0 +1,3 @@
[entry.worker.html]
type: testharness
prefs: [dom.testbinding.enabled:true]

View file

@ -0,0 +1,2 @@
<!DOCTYPE html>
<title>Empty page</title>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Entry page</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
var entry_test = async_test("Entry global");
var loaded = function() {
entry_test.step(function() {
var entry = document.querySelector("#incumbent").contentWindow.get_entry();
assert_equals(entry, window);
});
entry_test.done();
}
</script>
<iframe id="incumbent" src="incumbent.html" onload="loaded()"></iframe>

View file

@ -0,0 +1,9 @@
importScripts("/resources/testharness.js");
test(function() {
var entry = (new TestBinding()).entryGlobal();
assert_equals(entry, self);
});
done();

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>Incumbent page</title>
<iframe src="empty.html" id="current"></iframe>
<iframe src="empty.html" id="relevant"></iframe>
<script>
function get_entry() {
var current = document.querySelector("#current").contentWindow;
var relevant = document.querySelector("#relevant").contentWindow;
return current.TestBinding.prototype.entryGlobal.call(new relevant.TestBinding());
}
</script>