-
-
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.
Update nwsapi and add a test for getComputedStyle
pin nwsapi to bugfix commit
- Loading branch information
Showing
3 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
50 changes: 50 additions & 0 deletions
50
test/web-platform-tests/to-upstream/cssom/getComputedStyle-pseudoclass.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,50 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8" /> | ||
<title>Computed color is inherited correctly</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<!-- Test for https://github.com/jsdom/jsdom/issues/3607 --> | ||
|
||
<style> | ||
.test-1, .test-2 { | ||
color: rgb(255, 0, 0); | ||
} | ||
|
||
.test-1:hover, | ||
.test-2:hover { | ||
color: rgb(0, 0, 255); | ||
} | ||
|
||
.test-2:has(span) { | ||
color: rgb(0, 255, 0); | ||
} | ||
</style> | ||
|
||
<body> | ||
<div class="test-1"> | ||
<p id="p1">test</p> | ||
</div> | ||
<div class="test-2"> | ||
<p id="p2">test</p> | ||
</div> | ||
</body> | ||
|
||
<script> | ||
"use strict"; | ||
|
||
test(() => { | ||
const element = document.getElementById("p1"); | ||
|
||
assert_equals(getComputedStyle(element).color, "rgb(255, 0, 0)"); | ||
}, "Initial text color should be red"); | ||
|
||
test(() => { | ||
const element = document.getElementById("p2"); | ||
assert_equals(getComputedStyle(element).color, "rgb(255, 0, 0)"); | ||
|
||
element.appendChild(document.createElement("span")); | ||
|
||
assert_equals(getComputedStyle(element).color, "rgb(0, 255, 0)"); | ||
}, "Adding a span should change the text color to green"); | ||
</script> |