-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle setting innerHTML to the empty string
- Loading branch information
Showing
3 changed files
with
25 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
20 changes: 20 additions & 0 deletions
20
test/web-platform-tests/to-upstream/domparsing/innerhtml-08.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,20 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>innerHTML to empty string</title> | ||
<link rel="help" href="https://w3c.github.io/DOM-Parsing/#dom-element-innerhtml"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<script> | ||
"use strict"; | ||
|
||
test(() => { | ||
const doc = document.createElement("html"); | ||
doc.innerHTML = "<head><title>foo</title></head><body></body>"; | ||
|
||
doc.innerHTML = ""; | ||
|
||
assert_true(doc.getElementsByTagName("body")[0] instanceof HTMLBodyElement); | ||
|
||
}, "Setting innerHTML to empty string"); | ||
</script> |