Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix document.write check for activity.
- Loading branch information
Alan Jeffrey
committed
Jan 27, 2017
1 parent
a43c842
commit ca9cee0
Showing
6 changed files
with
48 additions
and
2 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
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
4 changes: 4 additions & 0 deletions
4
.../metadata/html/dom/dynamic-markup-insertion/document-write/write-active-document.html.ini
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 @@ | ||
[write-active-document.html] | ||
type: testharness | ||
[document.write only writes to active documents] | ||
expected: FAIL |
1 change: 1 addition & 0 deletions
1
tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/empty.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 @@ | ||
<html><body></body></html> |
35 changes: 35 additions & 0 deletions
35
...latform-tests/html/dom/dynamic-markup-insertion/document-write/write-active-document.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,35 @@ | ||
<!doctype html> | ||
<title>document.write only writes to active documents</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<body><div id="log"></div></body> | ||
<script> | ||
async_test(function(t) { | ||
var child = document.createElement("iframe"); | ||
child.src = "empty.html?1"; | ||
child.onload = t.step_func(function() { | ||
var child1 = child.contentDocument; | ||
var link = child1.createElement("a"); | ||
link.href = "data:text/html,Clicked."; | ||
link.innerText = "Link."; | ||
child1.body.appendChild(link); | ||
var grandchild = child1.createElement("iframe"); | ||
grandchild.src = "empty.html?2"; | ||
grandchild.onload = t.step_func(function() { | ||
var grandchild1 = grandchild.contentDocument; | ||
child.onload = t.step_func(function() { | ||
// This is a write to an inactive document | ||
child1.write('WRITE HAPPENED'); | ||
assert_equals(child1.body.lastChild.tagName, "IFRAME"); | ||
// This is a write to an active but not fully active document | ||
grandchild1.write('WRITE HAPPENED'); | ||
assert_equals(grandchild1.body.innerHTML, "WRITE HAPPENED"); | ||
t.done(); | ||
}); | ||
link.click(); | ||
}); | ||
child1.body.appendChild(grandchild); | ||
}); | ||
document.body.appendChild(child); | ||
}); | ||
</script> |