-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=266876 Reviewed by Tim Nguyen. Up to and including web-platform-tests/wpt#43788. * LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSConditionRule-conditionText-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSConditionRule-conditionText.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-concat-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-concat-ref.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-concat.html: * LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-replace-cssRules-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-replace-cssRules.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-all-shorthand-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-all-shorthand.html: * LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo.html: * LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log: Canonical link: https://commits.webkit.org/272497@main
- Loading branch information
Showing
12 changed files
with
213 additions
and
20 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...sts/imported/w3c/web-platform-tests/css/cssom/CSSConditionRule-conditionText-expected.txt
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,3 @@ | ||
|
||
PASS CSSConditionRule.conditionText | ||
|
23 changes: 23 additions & 0 deletions
23
LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSConditionRule-conditionText.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,23 @@ | ||
<!doctype html> | ||
<title>CSSConditionRule.conditionText</title> | ||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> | ||
<link rel="help" href="https://drafts.csswg.org/css-conditional-3/#cssconditionrule"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<style> | ||
@media not all { | ||
:root { color: lime } | ||
} | ||
</style> | ||
<script> | ||
test(function(t) { | ||
let rule = document.styleSheets[0].cssRules[0]; | ||
assert_true(rule instanceof CSSConditionRule); | ||
assert_equals(rule.conditionText, "not all"); | ||
rule.conditionText = 1; | ||
assert_equals(rule.conditionText, "not all"); | ||
rule.conditionText = "all"; | ||
assert_equals(rule.conditionText, "not all"); | ||
assert_not_equals(getComputedStyle(document.documentElement).color, "rgb(0, 255, 0)"); | ||
}); | ||
</script> |
19 changes: 19 additions & 0 deletions
19
...mported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-concat-expected.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,19 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Adoptedstylesheets.concat should work when starting empty</title> | ||
<link rel="author" href="mailto:masonf@chromium.org"> | ||
|
||
<span>This should be green</span><br> | ||
<span>This should be green</span> | ||
<pre>Tests: | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
</pre> | ||
|
||
<style> | ||
span { | ||
background-color:green; | ||
} | ||
</style> |
19 changes: 19 additions & 0 deletions
19
...sts/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-concat-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,19 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Adoptedstylesheets.concat should work when starting empty</title> | ||
<link rel="author" href="mailto:masonf@chromium.org"> | ||
|
||
<span>This should be green</span><br> | ||
<span>This should be green</span> | ||
<pre>Tests: | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
</pre> | ||
|
||
<style> | ||
span { | ||
background-color:green; | ||
} | ||
</style> |
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
...3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-replace-cssRules-expected.txt
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 @@ | ||
|
||
PASS cssRules tests (sync: true) | ||
PASS cssRules tests (sync: false) | ||
|
41 changes: 41 additions & 0 deletions
41
...ported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-replace-cssRules.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,41 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSSStyleSheet.replace reflects the right cssRules.</title> | ||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> | ||
<link rel="author" title="Mozilla" href="https://mozilla.org"> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1864815"> | ||
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-cssstylesheet-replace"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<p></p> | ||
<script> | ||
async function runTest(sync) { | ||
let sheet = new CSSStyleSheet(); | ||
let rules = sheet.cssRules; | ||
function replace(text) { | ||
return sync ? sheet.replaceSync(text) : sheet.replace(text); | ||
} | ||
function assert_color(color) { | ||
assert_equals(sheet.cssRules, rules, "StyleSheet.cssRules is [SameObject]"); | ||
assert_equals(rules.length, 1, "Should have one rule"); | ||
assert_equals(rules[0].style.color, color, "Should be the right css rule"); | ||
} | ||
async function replace_and_test(color) { | ||
await replace(`p { color: ${color} }`); | ||
assert_equals(sheet.cssRules, rules, "StyleSheet.cssRules is [SameObject]"); | ||
assert_equals(rules.length, 1, "Should have one rule"); | ||
assert_equals(rules[0].style.color, color, "Should be the right css rule"); | ||
} | ||
|
||
await replace_and_test("red"); | ||
await replace_and_test("green"); | ||
document.adoptedStyleSheets.push(sheet); | ||
assert_equals(getComputedStyle(document.querySelector("p")).color, "rgb(0, 128, 0)", "Sheet should apply"); | ||
document.adoptedStyleSheets.pop(sheet); | ||
assert_not_equals(getComputedStyle(document.querySelector("p")).color, "rgb(0, 128, 0)", "Sheet should stop applying"); | ||
} | ||
|
||
for (let sync of [true, false]) { | ||
promise_test(() => runTest(sync), `cssRules tests (sync: ${sync})`); | ||
} | ||
</script> |
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
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