Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@container] Evaluate style() queries for custom properties
The currently failing tests are due to issue 1220144. Bug: 1302630 Change-Id: I0278b50fa3cd168b77f2bfa70deb08a0237693dc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3805335 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1033407}
- Loading branch information
Rune Lillesveen
authored and
Chromium LUCI CQ
committed
Aug 10, 2022
1 parent
1b0b506
commit 1e417ce
Showing
13 changed files
with
252 additions
and
17 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
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
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
96 changes: 96 additions & 0 deletions
96
...b_tests/external/wpt/css/css-contain/container-queries/custom-property-style-queries.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,96 @@ | ||
<!doctype html> | ||
<title>CSS Container Queries Test: custom property style queries</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-contain-3/#style-container"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="support/cq-testcommon.js"></script> | ||
<style> | ||
#outer { | ||
container-name: outer; | ||
--inner: false; | ||
--outer: true; | ||
--inner-no-space:false; | ||
--outer-no-space:true; | ||
--inner-space-after:false ; | ||
--outer-space-after:true ; | ||
} | ||
#inner { | ||
--inner: true; | ||
--outer: false; | ||
--inner-no-space:true; | ||
--outer-no-space:false; | ||
--inner-space-after:true ; | ||
--outer-space-after:false ; | ||
} | ||
</style> | ||
<div id="outer"> | ||
<div id="inner"> | ||
<div id="target"></div> | ||
</div> | ||
</div> | ||
<script> | ||
function test_evaluation(query, expected) { | ||
test((t) => { | ||
let style_node = document.createElement('style'); | ||
t.add_cleanup(() => { | ||
style_node.remove(); | ||
}); | ||
style_node.innerText = `@container ${query} { #target { --applied:true; } }`; | ||
|
||
assert_equals(getComputedStyle(target).getPropertyValue('--applied'), ''); | ||
document.head.append(style_node); | ||
assert_equals(getComputedStyle(target).getPropertyValue('--applied'), expected ? 'true' : ''); | ||
}, `${query}`); | ||
} | ||
|
||
setup(() => assert_implements_container_queries()); | ||
|
||
test_evaluation('style(--inner: true)', true); | ||
test_evaluation('style(--inner:true)', true); | ||
test_evaluation('style(--inner:true )', true); | ||
test_evaluation('style(--inner: true )', true); | ||
test_evaluation('style(--inner-no-space: true)', true); | ||
test_evaluation('style(--inner-no-space:true)', true); | ||
test_evaluation('style(--inner-no-space:true )', true); | ||
test_evaluation('style(--inner-no-space: true )', true); | ||
test_evaluation('style(--inner-space-after: true)', true); | ||
test_evaluation('style(--inner-space-after:true)', true); | ||
test_evaluation('style(--inner-space-after:true )', true); | ||
test_evaluation('style(--inner-space-after: true )', true); | ||
test_evaluation('style(--outer: true)', false); | ||
test_evaluation('style(--outer:true)', false); | ||
test_evaluation('style(--outer:true )', false); | ||
test_evaluation('style(--outer: true )', false); | ||
test_evaluation('style(--outer-no-space: true)', false); | ||
test_evaluation('style(--outer-no-space:true)', false); | ||
test_evaluation('style(--outer-no-space:true )', false); | ||
test_evaluation('style(--outer-no-space: true )', false); | ||
test_evaluation('style(--outer-space-after: true)', false); | ||
test_evaluation('style(--outer-space-after:true)', false); | ||
test_evaluation('style(--outer-space-after:true )', false); | ||
test_evaluation('style(--outer-space-after: true )', false); | ||
test_evaluation('outer style(--inner: true)', false); | ||
test_evaluation('outer style(--inner:true)', false); | ||
test_evaluation('outer style(--inner:true )', false); | ||
test_evaluation('outer style(--inner: true )', false); | ||
test_evaluation('outer style(--inner-no-space: true)', false); | ||
test_evaluation('outer style(--inner-no-space:true)', false); | ||
test_evaluation('outer style(--inner-no-space:true )', false); | ||
test_evaluation('outer style(--inner-no-space: true )', false); | ||
test_evaluation('outer style(--inner-space-after: true)', false); | ||
test_evaluation('outer style(--inner-space-after:true)', false); | ||
test_evaluation('outer style(--inner-space-after:true )', false); | ||
test_evaluation('outer style(--inner-space-after: true )', false); | ||
test_evaluation('outer style(--outer: true)', true); | ||
test_evaluation('outer style(--outer:true)', true); | ||
test_evaluation('outer style(--outer:true )', true); | ||
test_evaluation('outer style(--outer: true )', true); | ||
test_evaluation('outer style(--outer-no-space: true)', true); | ||
test_evaluation('outer style(--outer-no-space:true)', true); | ||
test_evaluation('outer style(--outer-no-space:true )', true); | ||
test_evaluation('outer style(--outer-no-space: true )', true); | ||
test_evaluation('outer style(--outer-space-after: true)', true); | ||
test_evaluation('outer style(--outer-space-after:true)', true); | ||
test_evaluation('outer style(--outer-space-after:true )', true); | ||
test_evaluation('outer style(--outer-space-after: true )', true); | ||
</script> |
51 changes: 51 additions & 0 deletions
51
...external/wpt/css/css-contain/container-queries/custom-property-style-queries-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,51 @@ | ||
This is a testharness.js-based test. | ||
FAIL style(--inner: true) assert_equals: expected "true" but got "" | ||
FAIL style(--inner:true) assert_equals: expected "true" but got "" | ||
FAIL style(--inner:true ) assert_equals: expected "true" but got "" | ||
FAIL style(--inner: true ) assert_equals: expected "true" but got "" | ||
PASS style(--inner-no-space: true) | ||
PASS style(--inner-no-space:true) | ||
FAIL style(--inner-no-space:true ) assert_equals: expected "true" but got "" | ||
FAIL style(--inner-no-space: true ) assert_equals: expected "true" but got "" | ||
FAIL style(--inner-space-after: true) assert_equals: expected "true" but got "" | ||
FAIL style(--inner-space-after:true) assert_equals: expected "true" but got "" | ||
PASS style(--inner-space-after:true ) | ||
PASS style(--inner-space-after: true ) | ||
PASS style(--outer: true) | ||
PASS style(--outer:true) | ||
PASS style(--outer:true ) | ||
PASS style(--outer: true ) | ||
PASS style(--outer-no-space: true) | ||
PASS style(--outer-no-space:true) | ||
PASS style(--outer-no-space:true ) | ||
PASS style(--outer-no-space: true ) | ||
PASS style(--outer-space-after: true) | ||
PASS style(--outer-space-after:true) | ||
PASS style(--outer-space-after:true ) | ||
PASS style(--outer-space-after: true ) | ||
PASS outer style(--inner: true) | ||
PASS outer style(--inner:true) | ||
PASS outer style(--inner:true ) | ||
PASS outer style(--inner: true ) | ||
PASS outer style(--inner-no-space: true) | ||
PASS outer style(--inner-no-space:true) | ||
PASS outer style(--inner-no-space:true ) | ||
PASS outer style(--inner-no-space: true ) | ||
PASS outer style(--inner-space-after: true) | ||
PASS outer style(--inner-space-after:true) | ||
PASS outer style(--inner-space-after:true ) | ||
PASS outer style(--inner-space-after: true ) | ||
FAIL outer style(--outer: true) assert_equals: expected "true" but got "" | ||
FAIL outer style(--outer:true) assert_equals: expected "true" but got "" | ||
FAIL outer style(--outer:true ) assert_equals: expected "true" but got "" | ||
FAIL outer style(--outer: true ) assert_equals: expected "true" but got "" | ||
PASS outer style(--outer-no-space: true) | ||
PASS outer style(--outer-no-space:true) | ||
FAIL outer style(--outer-no-space:true ) assert_equals: expected "true" but got "" | ||
FAIL outer style(--outer-no-space: true ) assert_equals: expected "true" but got "" | ||
FAIL outer style(--outer-space-after: true) assert_equals: expected "true" but got "" | ||
FAIL outer style(--outer-space-after:true) assert_equals: expected "true" but got "" | ||
PASS outer style(--outer-space-after:true ) | ||
PASS outer style(--outer-space-after: true ) | ||
Harness: the test ran to completion. | ||
|