Auto merge of #14840 - servo:entry-global, r=nox

Implement the entry global.

Partial fix for #10963.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14840)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-06 05:15:11 -08:00 committed by GitHub
commit 85d3bbd999
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>