mirror of
https://github.com/servo/servo.git
synced 2025-10-13 23:10:20 +01:00
Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'
This commit is contained in:
parent
35e95f55a1
commit
58e8ee674b
9438 changed files with 266112 additions and 106976 deletions
|
@ -0,0 +1,24 @@
|
|||
// This tests whether the insertion point gets reset before or after the readystatechange event.
|
||||
// See https://github.com/whatwg/html/pull/6613#discussion_r620171070.
|
||||
// Recall that resetting the insertion point means that document.write() performs the document open
|
||||
// steps and blows away previous content in the document.
|
||||
|
||||
async_test(t => {
|
||||
const frame = document.body.appendChild(document.createElement("iframe"));
|
||||
t.add_cleanup(() => { frame.remove(); });
|
||||
frame.src = "../opening-the-input-stream/resources/dummy.html";
|
||||
frame.onload = t.step_func_done(() => {
|
||||
const states = [];
|
||||
frame.contentDocument.onreadystatechange = t.step_func(() => {
|
||||
if (frame.contentDocument.readyState === "interactive") {
|
||||
assert_not_equals(frame.contentDocument.textContent, "", "Precondition check: dummy document is not empty");
|
||||
|
||||
frame.contentDocument.write("Some text");
|
||||
|
||||
// If the insertion point is reset before the readystatechange handler, then the
|
||||
// document.write() call above will blow away the text originally in dummy.html, leaving only what we wrote.
|
||||
assert_equals(frame.contentDocument.textContent, "Some text");
|
||||
}
|
||||
});
|
||||
});
|
||||
}, "document.write() during readystatechange to interactive");
|
Loading…
Add table
Add a link
Reference in a new issue