From 397d748f9d2c8f8b132dd7a922307ae92c2cc557 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 14 Dec 2015 18:59:03 -0500 Subject: [PATCH] Ensure that grandchild same-origin iframes are added to the children of the child iframe of the root. Resolves #8973. --- components/script/script_task.rs | 3 ++- tests/wpt/mozilla/meta/MANIFEST.json | 6 ++++++ .../mozilla/tests/mozilla/iframe_child1.html | 1 + .../tests/mozilla/iframe_hierarchy.html | 18 ++++++++++++++++++ .../mozilla/tests/mozilla/iframe_parent1.html | 1 + 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/wpt/mozilla/tests/mozilla/iframe_child1.html create mode 100644 tests/wpt/mozilla/tests/mozilla/iframe_hierarchy.html create mode 100644 tests/wpt/mozilla/tests/mozilla/iframe_parent1.html 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 @@ + + + + + + + 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 @@ +