diff options
-rw-r--r-- | components/script/script_task.rs | 3 | ||||
-rw-r--r-- | tests/wpt/mozilla/meta/MANIFEST.json | 6 | ||||
-rw-r--r-- | tests/wpt/mozilla/tests/mozilla/iframe_child1.html | 1 | ||||
-rw-r--r-- | tests/wpt/mozilla/tests/mozilla/iframe_hierarchy.html | 18 | ||||
-rw-r--r-- | tests/wpt/mozilla/tests/mozilla/iframe_parent1.html | 1 |
5 files changed, 28 insertions, 1 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 3c54259fc3e..84c9629ff86 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -1594,7 +1594,8 @@ impl ScriptTask { let parent_page = self.root_page(); // TODO(gw): This find will fail when we are sharing script tasks // between cross origin iframes in the same TLD. - parent_page.find(parent).expect("received load for subpage with missing parent"); + let parent_page = parent_page.find(parent) + .expect("received load for subpage with missing parent"); parent_page.children.borrow_mut().push(page.clone()); } diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index cfa25fec76d..103ccf657ae 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -5637,6 +5637,12 @@ "url": "/_mozilla/mozilla/iframe_contentDocument.html" } ], + "mozilla/iframe_hierarchy.html": [ + { + "path": "mozilla/iframe_hierarchy.html", + "url": "/_mozilla/mozilla/iframe_hierarchy.html" + } + ], "mozilla/img_width_height.html": [ { "path": "mozilla/img_width_height.html", diff --git a/tests/wpt/mozilla/tests/mozilla/iframe_child1.html b/tests/wpt/mozilla/tests/mozilla/iframe_child1.html new file mode 100644 index 00000000000..257cc5642cb --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/iframe_child1.html @@ -0,0 +1 @@ +foo diff --git a/tests/wpt/mozilla/tests/mozilla/iframe_hierarchy.html b/tests/wpt/mozilla/tests/mozilla/iframe_hierarchy.html new file mode 100644 index 00000000000..88ec28c229e --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/iframe_hierarchy.html @@ -0,0 +1,18 @@ +<!doctype html> +<meta charset="utf-8"> +<title></title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<iframe src="iframe_parent1.html"></iframe> +<script> +var t = async_test("iframe content hierarchy is correct"); +function do_test() { +console.log("whee"); + t.step(function() { + var doc = document.getElementsByTagName("iframe")[0].contentDocument; + doc = doc.getElementsByTagName("iframe")[0].contentDocument; + assert_equals(doc.body.firstChild.textContent, "foo"); + t.done(); + }); +} +</script> diff --git a/tests/wpt/mozilla/tests/mozilla/iframe_parent1.html b/tests/wpt/mozilla/tests/mozilla/iframe_parent1.html new file mode 100644 index 00000000000..146f5b7d529 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/iframe_parent1.html @@ -0,0 +1 @@ +<iframe src="iframe_child1.html" onload="parent.do_test()"></iframe> |