Ensure that grandchild same-origin iframes are added to the children of the child iframe of the root. Resolves #8973.

This commit is contained in:
Josh Matthews 2015-12-14 18:59:03 -05:00
parent d11f96e270
commit 397d748f9d
5 changed files with 28 additions and 1 deletions

View file

@ -1594,7 +1594,8 @@ impl ScriptTask {
let parent_page = self.root_page(); let parent_page = self.root_page();
// TODO(gw): This find will fail when we are sharing script tasks // TODO(gw): This find will fail when we are sharing script tasks
// between cross origin iframes in the same TLD. // 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()); parent_page.children.borrow_mut().push(page.clone());
} }

View file

@ -5637,6 +5637,12 @@
"url": "/_mozilla/mozilla/iframe_contentDocument.html" "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": [ "mozilla/img_width_height.html": [
{ {
"path": "mozilla/img_width_height.html", "path": "mozilla/img_width_height.html",

View file

@ -0,0 +1 @@
foo

View file

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

View file

@ -0,0 +1 @@
<iframe src="iframe_child1.html" onload="parent.do_test()"></iframe>