Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for using replaceData to change CSS
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 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
7 changes: 7 additions & 0 deletions
7
tests/wpt/web-platform-tests/css/cssom/stylesheet-replacedata-dynamic-ref.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,7 @@ | ||
<!doctype html> | ||
<title>(Ref #1) CSS Test Reference</title> | ||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@mozilla.com"> | ||
<link rel="author" title="Cheng You Bai" href="mailto:cyb.ai.815@gmail.com"> | ||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-characterdata-replacedata"> | ||
<style>.pass { color: green }</style> | ||
<div class="pass">Should be green</div> |
12 changes: 12 additions & 0 deletions
12
tests/wpt/web-platform-tests/css/cssom/stylesheet-replacedata-dynamic.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,12 @@ | ||
<!doctype html> | ||
<title>(Test #1) CSS Test: Dynamic changes to the stylesheet contents using replaceData are reflected</title> | ||
<link rel="match" href="stylesheet-replacedata-dynamic-ref.html"> | ||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@mozilla.com"> | ||
<link rel="author" title="Cheng You Bai" href="mailto:cyb.ai.815@gmail.com"> | ||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-characterdata-replacedata"> | ||
<style>.fail { color: green }</style> | ||
<div class="pass">Should be green</div> | ||
<script> | ||
document.body.offsetTop; | ||
document.querySelector('style').firstChild.replaceData(1, 4, "pass"); | ||
</script> |