mirror of
https://github.com/servo/servo.git
synced 2025-07-30 10:40:27 +01:00
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:
parent
d11f96e270
commit
397d748f9d
5 changed files with 28 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
1
tests/wpt/mozilla/tests/mozilla/iframe_child1.html
Normal file
1
tests/wpt/mozilla/tests/mozilla/iframe_child1.html
Normal file
|
@ -0,0 +1 @@
|
|||
foo
|
18
tests/wpt/mozilla/tests/mozilla/iframe_hierarchy.html
Normal file
18
tests/wpt/mozilla/tests/mozilla/iframe_hierarchy.html
Normal 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>
|
1
tests/wpt/mozilla/tests/mozilla/iframe_parent1.html
Normal file
1
tests/wpt/mozilla/tests/mozilla/iframe_parent1.html
Normal file
|
@ -0,0 +1 @@
|
|||
<iframe src="iframe_child1.html" onload="parent.do_test()"></iframe>
|
Loading…
Add table
Add a link
Reference in a new issue