Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@container] CSSOM serialization tests and escape fix
Bug: 1217931 Change-Id: I2d837f75689425517a5b13d5429a282a861d32aa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3547676 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#984758}
- Loading branch information
Rune Lillesveen
authored and
Chromium LUCI CQ
committed
Mar 24, 2022
1 parent
c4ff1e2
commit 7be5769
Showing
4 changed files
with
41 additions
and
1 deletion.
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
37 changes: 37 additions & 0 deletions
37
.../web_tests/external/wpt/css/css-contain/container-queries/at-container-serialization.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,37 @@ | ||
<!doctype html> | ||
<title>CSS Container Queries: @container serialization</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-contain-3/#container-queries"> | ||
<link rel="help" href="https://drafts.csswg.org/cssom/#serialize-a-css-rule"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="support/cq-testcommon.js"></script> | ||
<style id="testSheet"> | ||
@container (width=100px) { | ||
@container \!-name (inline-size > 200px ) { | ||
#id { color: lime } | ||
} | ||
#id { color: green } | ||
} | ||
</style> | ||
<script> | ||
setup(() => assert_implements_container_queries()); | ||
|
||
let rules = testSheet.sheet.cssRules; | ||
|
||
test(() => { | ||
assert_equals(rules.length, 1); | ||
assert_equals(rules[0].cssRules.length, 2); | ||
|
||
assert_equals(rules[0].conditionText, "(width = 100px)"); | ||
assert_equals(rules[0].cssRules[0].conditionText, "(inline-size > 200px)"); | ||
}, "Serialization of conditionText"); | ||
|
||
test(() => { | ||
assert_equals(rules[0].cssRules[0].cssText, "@container \\!-name (inline-size > 200px) {\n #id { color: lime; }\n}"); | ||
}, "Serialization of inner @container rule"); | ||
|
||
test(() => { | ||
assert_equals(rules[0].cssText, "@container (width = 100px) {\n @container \\!-name (inline-size > 200px) {\n #id { color: lime; }\n}\n #id { color: green; }\n}"); | ||
}, "Serialization of nested @container rule"); | ||
|
||
</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