Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a test for changing an iframe's parentage.
- Loading branch information
Alan Jeffrey
committed
Jun 9, 2016
1 parent
77e0089
commit 999e057
Showing
10 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...t/web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_child.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<body> | ||
Child. | ||
<iframe id="grandchild" src="change_grandchild.html"></iframe> | ||
</body> | ||
<script> | ||
var timer = window.setInterval(poll, 100); | ||
function poll() { | ||
if (document.body.getAttribute("data-contains-grandchild")) { | ||
var grandchild = document.getElementById("grandchild"); | ||
window.frameElement.parentNode.appendChild(grandchild); | ||
window.clearTimeout(timer); | ||
} | ||
} | ||
</script> |
4 changes: 4 additions & 0 deletions
4
...-platform-tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<body>Grandchild.</body> | ||
<script> | ||
window.frameElement.parentNode.setAttribute("data-contains-grandchild", true); | ||
</script> |
22 changes: 22 additions & 0 deletions
22
...b-platform-tests/html/semantics/embedded-content/the-iframe-element/change_parentage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>Change the frame heriarchy</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<body> | ||
<iframe src="change_child.html"></iframe> | ||
</body> | ||
<script> | ||
async_test(function(t) { | ||
var timer = window.setInterval(t.step_func(poll), 100); | ||
function poll() { | ||
// We wait for the grandchild's script to set the custom attribtue. | ||
// Note that if this test passes, the grandchild's script must have been run twice, | ||
// once to trigger the move from the child to here, and once to pass this test. | ||
if (document.body.getAttribute("data-contains-grandchild")) { | ||
window.clearTimeout(timer); | ||
t.done(); | ||
} | ||
} | ||
}); | ||
</script> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.