diff --git a/LayoutTests/imported/w3c/resources/import-expectations.json b/LayoutTests/imported/w3c/resources/import-expectations.json index be0e01f56d0d..b5384018c29d 100644 --- a/LayoutTests/imported/w3c/resources/import-expectations.json +++ b/LayoutTests/imported/w3c/resources/import-expectations.json @@ -110,6 +110,7 @@ "web-platform-tests/css/css-color": "import", "web-platform-tests/css/css-conditional": "import", "web-platform-tests/css/css-contain": "import", + "web-platform-tests/css/css-contain/container-queries": "import", "web-platform-tests/css/css-content": "import", "web-platform-tests/css/css-counter-styles": "import", "web-platform-tests/css/css-display": "import", diff --git a/LayoutTests/imported/w3c/resources/resource-files.json b/LayoutTests/imported/w3c/resources/resource-files.json index 6f67353bdb32..00975384f322 100644 --- a/LayoutTests/imported/w3c/resources/resource-files.json +++ b/LayoutTests/imported/w3c/resources/resource-files.json @@ -696,6 +696,8 @@ "web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-001-crash.html", "web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-002-crash.html", "web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-003-crash.html", + "web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-004-crash.html", + "web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-005-crash.html", "web-platform-tests/css/css-contain/container-queries/display-in-container-ref.html", "web-platform-tests/css/css-contain/container-queries/fieldset-legend-change-ref.html", "web-platform-tests/css/css-contain/container-queries/flex-in-columns-000-crash.html", diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing-expected.txt index f5325fb13ec7..29dae852411c 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing-expected.txt @@ -40,6 +40,13 @@ PASS (100px <= width < 200px) PASS (100px > width > 200px) PASS (100px > width >= 200px) PASS (100px >= width > 200px) +PASS (width: calc(10px)) +PASS (width: calc(10em)) +PASS (width: calc(10px + 10em)) +PASS (width < calc(10px + 10em)) +PASS (width < max(10px, 10em)) +PASS (calc(10px + 10em) < width) +PASS (calc(10px + 10em) < width < max(30px, 30em)) PASS foo(width) PASS size(width) PASS (asdf) @@ -83,4 +90,24 @@ PASS Container selector: "foo" PASS Container selector: "inherit" PASS Container selector: none PASS Container selector: None +PASS Container selector: normal +PASS Container selector: Normal +PASS Container selector: auto +PASS Container selector: Auto +PASS Container selector: and +PASS Container selector: or +PASS Container selector: not +PASS Container selector: And +PASS Container selector: oR +PASS Container selector: nOt +FAIL style(--my-prop: foo) assert_equals: expected "true" but got "" +FAIL style(--my-prop: foo - bar ()) assert_equals: expected "true" but got "" +FAIL style(not ((--foo: calc(10px + 2em)) and ((--foo: url(x))))) assert_equals: expected "true" but got "" +FAIL style((--foo: bar) or (--bar: 10px)) assert_equals: expected "true" but got "" +FAIL style(--foo: bar !important) assert_equals: expected "true" but got "" +FAIL style(--my-prop:) assert_equals: expected "true" but got "" +FAIL style(--my-prop: ) assert_equals: expected "true" but got "" +PASS style(--foo: bar;) +PASS style(--foo) +PASS style(style(--foo: bar)) diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing.html index c308fb46a5ef..6278f88216f3 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing.html @@ -112,6 +112,14 @@ test_query_known('(100px > width >= 200px)'); test_query_known('(100px >= width > 200px)'); + test_query_known('(width: calc(10px))'); + test_query_known('(width: calc(10em))'); + test_query_known('(width: calc(10px + 10em))'); + test_query_known('(width < calc(10px + 10em))'); + test_query_known('(width < max(10px, 10em))'); + test_query_known('(calc(10px + 10em) < width)'); + test_query_known('(calc(10px + 10em) < width < max(30px, 30em))'); + test_query_unknown('foo(width)'); test_query_unknown('size(width)'); test_query_unknown('(asdf)'); @@ -158,4 +166,26 @@ test_container_selector_invalid('"inherit"'); test_container_selector_invalid('none'); test_container_selector_invalid('None'); + test_container_selector_invalid('normal'); + test_container_selector_invalid('Normal'); + test_container_selector_invalid('auto'); + test_container_selector_invalid('Auto'); + test_container_selector_invalid('and'); + test_container_selector_invalid('or'); + test_container_selector_invalid('not'); + test_container_selector_invalid('And'); + test_container_selector_invalid('oR'); + test_container_selector_invalid('nOt'); + + test_query_known('style(--my-prop: foo)'); + test_query_known('style(--my-prop: foo - bar ())'); + test_query_known('style(not ((--foo: calc(10px + 2em)) and ((--foo: url(x)))))'); + test_query_known('style((--foo: bar) or (--bar: 10px))'); + test_query_known('style(--foo: bar !important)'); + test_query_known('style(--my-prop:)'); + test_query_known('style(--my-prop: )'); + + test_query_unknown('style(--foo: bar;)'); + test_query_unknown('style(--foo)'); + test_query_unknown('style(style(--foo: bar))'); diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-serialization-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-serialization-expected.txt index a29e585cef17..0c78279b3d9a 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-serialization-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-serialization-expected.txt @@ -5,4 +5,5 @@ PASS Serialization of nested @container rule PASS Serialization of boolean condition syntax PASS Serialization of colon condition syntax PASS Serialization of range condition syntax +PASS Serialization of calc() diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-serialization.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-serialization.html index ef31473c8122..e1c4710b3697 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-serialization.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-serialization.html @@ -24,6 +24,7 @@ @container (10px <= width <= 100px) { } @container (100px>WIDTH>10px) { } @container ( 100px >= width >= 10px ) { } + @container (calc(1em + 1px) >= width >= max(10em, 10px)) { } diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-serialization-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-serialization-expected.txt new file mode 100644 index 000000000000..7bf0cdd92595 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-serialization-expected.txt @@ -0,0 +1,8 @@ + +FAIL Normalize spaces assert_equals: expected "style(--foo: bar)" but got "style( --foo:bar)" +FAIL Empty declaration value - spaces assert_equals: expected "style(--foo: )" but got "STyle(--foo: )" +FAIL Empty declaration value assert_equals: expected "style(--foo: )" but got "STyle(--foo:)" +PASS Missing declaration value +FAIL Unknown CSS property after 'or' assert_equals: expected "style((--FOO: BAR) or ( prop: val ))" but got "style( ( --FOO: BAR) OR ( prop: val ) )" +FAIL Not a style function with space before '(' assert_equals: expected "(--foo: bar)" but got "(--foo: )" + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-serialization.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-serialization.html new file mode 100644 index 000000000000..a498c4a7e6c2 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-serialization.html @@ -0,0 +1,34 @@ + +CSS Container Queries: style() conditionText serialization + + + + + + + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/calc-evaluation-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/calc-evaluation-expected.txt new file mode 100644 index 000000000000..59046787bc55 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/calc-evaluation-expected.txt @@ -0,0 +1,3 @@ + +PASS em relative inline-size + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/calc-evaluation.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/calc-evaluation.html new file mode 100644 index 000000000000..71a5e23764ed --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/calc-evaluation.html @@ -0,0 +1,32 @@ + +CSS Container Queries Test: calc() + + + + + + +
+
+
+ diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-001.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-001.html index 2f0c5f4827ca..f904d1fe249b 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-001.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-001.html @@ -21,5 +21,9 @@
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-002.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-002.html index 0638d1e64865..689feeb5fffd 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-002.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-002.html @@ -22,5 +22,9 @@
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-003.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-003.html index 7c2651ff4691..74199cc72b7e 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-003.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-003.html @@ -24,5 +24,9 @@
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-004.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-004.html index d9b661c0f95e..b23846382b74 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-004.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-004.html @@ -25,5 +25,9 @@
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/column-spanner-in-container-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/column-spanner-in-container-expected.txt new file mode 100644 index 000000000000..e1db70cad88b --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/column-spanner-in-container-expected.txt @@ -0,0 +1,5 @@ + +PASS #spanner matching container with column-width 300px, getting column-span:all +PASS Reducing #multicol width means #spanner no longer gets column-span:all +PASS Back to matching 300px and column-span:all + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/column-spanner-in-container.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/column-spanner-in-container.html new file mode 100644 index 000000000000..d494e28504fb --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/column-spanner-in-container.html @@ -0,0 +1,41 @@ + +CSS Container Queries Test: Column-spanner depending on container in column + + + + + +
+
+
+ diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed-expected.txt index 334a368e83cc..7b2648d51857 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed-expected.txt @@ -14,4 +14,5 @@ PASS Property container value 'foo/ inline-size' PASS Property container value 'foo/inline-size' PASS Property container value 'FoO / size' PASS Property container value 'foo bar / size' +PASS Property container value 'foo / normal' diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed.html index b38b0d83dbe3..d83f36164005 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed.html @@ -26,4 +26,5 @@ test_computed_value('container', 'foo/inline-size', 'foo / inline-size'); test_computed_value('container', 'FoO / size'); test_computed_value('container', 'foo bar / size', 'foo bar / size'); +test_computed_value('container', 'foo / normal', 'foo'); diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-inheritance-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-inheritance-expected.txt index 3ce326787341..ea8e9782c30a 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-inheritance-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-inheritance-expected.txt @@ -1,6 +1,6 @@ PASS Property container-name has initial value none PASS Property container-name does not inherit -PASS Property container-type has initial value none +PASS Property container-type has initial value normal PASS Property container-type does not inherit diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-inheritance.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-inheritance.html index efc09983c0dd..b333b691fd78 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-inheritance.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-inheritance.html @@ -14,5 +14,5 @@ setup(() => assert_implements_container_queries()); assert_not_inherited('container-name', 'none', 'foo'); -assert_not_inherited('container-type', 'none', 'inline-size'); +assert_not_inherited('container-type', 'normal', 'inline-size'); diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing-expected.txt index a2952dc64a00..abb76b6d0ccc 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing-expected.txt @@ -9,7 +9,8 @@ PASS e.style['container-name'] = "BAR" should set the property value PASS e.style['container-name'] = "foo bar" should set the property value PASS e.style['container-name'] = "foo foo" should set the property value PASS e.style['container-name'] = "\\!escaped" should set the property value -PASS e.style['container-name'] = "not" should set the property value +PASS e.style['container-name'] = "auto" should not set the property value +PASS e.style['container-name'] = "normal" should not set the property value PASS e.style['container-name'] = "none none" should not set the property value PASS e.style['container-name'] = "foo, bar" should not set the property value PASS e.style['container-name'] = "#fff" should not set the property value @@ -21,4 +22,10 @@ PASS e.style['container-name'] = "\"unset\"" should not set the property value PASS e.style['container-name'] = "\"revert\"" should not set the property value PASS e.style['container-name'] = "\"none\"" should not set the property value PASS e.style['container-name'] = "\"foo\"" should not set the property value +PASS e.style['container-name'] = "not" should not set the property value +PASS e.style['container-name'] = "and" should not set the property value +PASS e.style['container-name'] = "or" should not set the property value +PASS e.style['container-name'] = "Not" should not set the property value +PASS e.style['container-name'] = "aNd" should not set the property value +PASS e.style['container-name'] = "oR" should not set the property value diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing.html index c8ae73ad778c..217a73fb68cb 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-name-parsing.html @@ -20,8 +20,9 @@ test_valid_value('container-name', 'foo bar'); test_valid_value('container-name', 'foo foo'); test_valid_value('container-name', '\\!escaped'); -test_valid_value('container-name', 'not'); +test_invalid_value('container-name', 'auto'); +test_invalid_value('container-name', 'normal'); test_invalid_value('container-name', 'none none'); test_invalid_value('container-name', 'foo, bar'); test_invalid_value('container-name', '#fff'); @@ -34,4 +35,11 @@ test_invalid_value('container-name', '"revert"'); test_invalid_value('container-name', '"none"'); test_invalid_value('container-name', '"foo"'); + +test_invalid_value('container-name', 'not'); +test_invalid_value('container-name', 'and'); +test_invalid_value('container-name', 'or'); +test_invalid_value('container-name', 'Not'); +test_invalid_value('container-name', 'aNd'); +test_invalid_value('container-name', 'oR'); diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing-expected.txt index e64d963a6db6..e1185ecfce3e 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing-expected.txt @@ -4,7 +4,7 @@ PASS e.style['container'] = "inherit" should set the property value PASS e.style['container'] = "unset" should set the property value PASS e.style['container'] = "revert" should set the property value PASS e.style['container'] = "none" should set the property value -PASS e.style['container'] = "none / none" should set the property value +PASS e.style['container'] = "none / normal" should set the property value PASS e.style['container'] = "inline-size" should set the property value PASS e.style['container'] = "none / inline-size" should set the property value PASS e.style['container'] = "size" should set the property value @@ -13,20 +13,26 @@ PASS e.style['container'] = "inline-size / inline-size" should set the property PASS e.style['container'] = "size / size" should set the property value FAIL e.style['container'] = "none / size style" should set the property value assert_not_equals: property should be set got disallowed value "" PASS e.style['container'] = "foo" should set the property value -PASS e.style['container'] = "foo / none" should set the property value +PASS e.style['container'] = "foo / normal" should set the property value PASS e.style['container'] = "foo bar / size" should set the property value -PASS e.style['container'] = "foo bar / none" should set the property value +PASS e.style['container'] = "foo bar / normal" should set the property value PASS e.style['container'] = "FOO / size" should set the property value PASS e.style['container'] = "FOO/size" should set the property value PASS e.style['container'] = " FOO /size" should set the property value PASS e.style['container'] = "none none" should not set the property value PASS e.style['container'] = "none inline-size" should not set the property value PASS e.style['container'] = "none / inline-size none" should not set the property value +PASS e.style['container'] = "none / inline-size normal" should not set the property value PASS e.style['container'] = "none / inline-size inline-size" should not set the property value PASS e.style['container'] = "none / inline-size block-size unknown" should not set the property value PASS e.style['container'] = "none / inline-size block-size" should not set the property value PASS e.style['container'] = "none / size block-size" should not set the property value PASS e.style['container'] = "none, none" should not set the property value +PASS e.style['container'] = "none, normal" should not set the property value +PASS e.style['container'] = "none / none" should not set the property value +PASS e.style['container'] = "none / auto" should not set the property value +PASS e.style['container'] = "normal / size" should not set the property value +PASS e.style['container'] = "auto / size" should not set the property value PASS e.style['container'] = "none / foo" should not set the property value PASS e.style['container'] = "none / foo, bar" should not set the property value PASS e.style['container'] = "#fff" should not set the property value diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing.html index b8ac69296715..9f1293f51cc7 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-parsing.html @@ -16,7 +16,7 @@ test_valid_value('container', 'unset'); test_valid_value('container', 'revert'); test_valid_value('container', 'none'); -test_valid_value('container', 'none / none', 'none'); +test_valid_value('container', 'none / normal', 'none'); test_valid_value('container', 'inline-size'); test_valid_value('container', 'none / inline-size', 'none / inline-size'); test_valid_value('container', 'size'); @@ -25,9 +25,9 @@ test_valid_value('container', 'size / size'); test_valid_value('container', 'none / size style', 'none / style size'); test_valid_value('container', 'foo'); -test_valid_value('container', 'foo / none', 'foo'); +test_valid_value('container', 'foo / normal', 'foo'); test_valid_value('container', 'foo bar / size'); -test_valid_value('container', 'foo bar / none', 'foo bar'); +test_valid_value('container', 'foo bar / normal', 'foo bar'); test_valid_value('container', 'FOO / size'); test_valid_value('container', 'FOO/size', 'FOO / size'); test_valid_value('container', ' FOO /size', 'FOO / size'); @@ -35,11 +35,17 @@ test_invalid_value('container', 'none none'); test_invalid_value('container', 'none inline-size'); test_invalid_value('container', 'none / inline-size none'); +test_invalid_value('container', 'none / inline-size normal'); test_invalid_value('container', 'none / inline-size inline-size'); test_invalid_value('container', 'none / inline-size block-size unknown'); test_invalid_value('container', 'none / inline-size block-size'); test_invalid_value('container', 'none / size block-size'); test_invalid_value('container', 'none, none'); +test_invalid_value('container', 'none, normal'); +test_invalid_value('container', 'none / none'); +test_invalid_value('container', 'none / auto'); +test_invalid_value('container', 'normal / size'); +test_invalid_value('container', 'auto / size'); test_invalid_value('container', 'none / foo'); test_invalid_value('container', 'none / foo, bar'); test_invalid_value('container', '#fff'); diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-nested-invalidation-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-nested-invalidation-expected.txt new file mode 100644 index 000000000000..e46faab4a330 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-nested-invalidation-expected.txt @@ -0,0 +1,3 @@ + +PASS Queries that skip a container are invalidated correctly + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-nested-invalidation.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-nested-invalidation.html new file mode 100644 index 000000000000..a549f6d84820 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-nested-invalidation.html @@ -0,0 +1,62 @@ + +Nested @container-dependent elements respond to outer container size changes + + + + + +
+
+
+
+
+
+ diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-computed-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-computed-expected.txt index db6b6125eb68..6fb4fbead177 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-computed-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-computed-expected.txt @@ -3,4 +3,5 @@ PASS Property container-type value 'initial' PASS Property container-type value 'unset' PASS Property container-type value 'inline-size' PASS Property container-type value 'size' +PASS Property container-type value 'normal' diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-computed.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-computed.html index cd5f1cbb789e..0b5e033a0f30 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-computed.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-computed.html @@ -10,8 +10,9 @@ diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-parsing-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-parsing-expected.txt index 78907986effa..800d0985f5a3 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-parsing-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-parsing-expected.txt @@ -3,23 +3,25 @@ PASS e.style['container-type'] = "initial" should set the property value PASS e.style['container-type'] = "inherit" should set the property value PASS e.style['container-type'] = "unset" should set the property value PASS e.style['container-type'] = "revert" should set the property value -PASS e.style['container-type'] = "none" should set the property value +PASS e.style['container-type'] = "normal" should set the property value FAIL e.style['container-type'] = "style" should set the property value assert_not_equals: property should be set got disallowed value "" PASS e.style['container-type'] = "size" should set the property value PASS e.style['container-type'] = "inline-size" should set the property value FAIL e.style['container-type'] = "inline-size style" should set the property value assert_not_equals: property should be set got disallowed value "" FAIL e.style['container-type'] = "style inline-size" should set the property value assert_not_equals: property should be set got disallowed value "" FAIL e.style['container-type'] = "style size" should set the property value assert_not_equals: property should be set got disallowed value "" +PASS e.style['container-type'] = "none" should not set the property value +PASS e.style['container-type'] = "auto" should not set the property value PASS e.style['container-type'] = "block-size" should not set the property value -PASS e.style['container-type'] = "none none" should not set the property value -PASS e.style['container-type'] = "none inline-size" should not set the property value -PASS e.style['container-type'] = "inline-size none" should not set the property value +PASS e.style['container-type'] = "normal normal" should not set the property value +PASS e.style['container-type'] = "normal inline-size" should not set the property value +PASS e.style['container-type'] = "inline-size normal" should not set the property value PASS e.style['container-type'] = "inline-size inline-size" should not set the property value PASS e.style['container-type'] = "inline-size block-size" should not set the property value PASS e.style['container-type'] = "block-size inline-size" should not set the property value PASS e.style['container-type'] = "size inline-size" should not set the property value PASS e.style['container-type'] = "inline-size size" should not set the property value -PASS e.style['container-type'] = "none, none" should not set the property value +PASS e.style['container-type'] = "normal, normal" should not set the property value PASS e.style['container-type'] = "foo" should not set the property value PASS e.style['container-type'] = "\"foo\"" should not set the property value PASS e.style['container-type'] = "foo, bar" should not set the property value diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-parsing.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-parsing.html index cce8aa3b9063..34023cbc4f2a 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-parsing.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-parsing.html @@ -14,7 +14,7 @@ test_valid_value('container-type', 'inherit'); test_valid_value('container-type', 'unset'); test_valid_value('container-type', 'revert'); -test_valid_value('container-type', 'none'); +test_valid_value('container-type', 'normal'); test_valid_value('container-type', 'style'); test_valid_value('container-type', 'size'); test_valid_value('container-type', 'inline-size'); @@ -23,16 +23,18 @@ test_valid_value('container-type', 'style inline-size'); test_valid_value('container-type', 'style size'); +test_invalid_value('container-type', 'none'); +test_invalid_value('container-type', 'auto'); test_invalid_value('container-type', 'block-size'); -test_invalid_value('container-type', 'none none'); -test_invalid_value('container-type', 'none inline-size'); -test_invalid_value('container-type', 'inline-size none'); +test_invalid_value('container-type', 'normal normal'); +test_invalid_value('container-type', 'normal inline-size'); +test_invalid_value('container-type', 'inline-size normal'); test_invalid_value('container-type', 'inline-size inline-size'); test_invalid_value('container-type', 'inline-size block-size'); test_invalid_value('container-type', 'block-size inline-size'); test_invalid_value('container-type', 'size inline-size'); test_invalid_value('container-type', 'inline-size size'); -test_invalid_value('container-type', 'none, none'); +test_invalid_value('container-type', 'normal, normal'); test_invalid_value('container-type', 'foo'); test_invalid_value('container-type', '"foo"'); test_invalid_value('container-type', 'foo, bar'); diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-dynamic-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-dynamic-expected.txt new file mode 100644 index 000000000000..7b9ae9f76ed1 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-dynamic-expected.txt @@ -0,0 +1,4 @@ +Test + +FAIL Query with container-relative units are responsive to changes assert_equals: expected "true" but got "" + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-dynamic.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-dynamic.html new file mode 100644 index 000000000000..c1f929241ca7 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-dynamic.html @@ -0,0 +1,37 @@ + +Container Relative Units: in @container prelude (dynamic) + + + + + + +
+
+
Test
+
+
+ + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-expected.txt new file mode 100644 index 000000000000..292d4f7f4293 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-expected.txt @@ -0,0 +1,22 @@ +Test1 +Test1 + +FAIL cqw unit resolves against appropriate container assert_equals: expected "true" but got "" +FAIL cqh unit resolves against appropriate container assert_equals: expected "true" but got "" +FAIL cqi unit resolves against appropriate container assert_equals: expected "true" but got "" +FAIL cqb unit resolves against appropriate container assert_equals: expected "true" but got "" +FAIL cqmin unit resolves against appropriate container assert_equals: expected "true" but got "" +FAIL cqmax unit resolves against appropriate container assert_equals: expected "true" but got "" +FAIL cqw unit resolves against appropriate container (vertical writing-mode on subject) assert_equals: expected "true" but got "" +FAIL cqh unit resolves against appropriate container (vertical writing-mode on subject) assert_equals: expected "true" but got "" +FAIL cqi unit resolves against appropriate container (vertical writing-mode on subject) assert_equals: expected "true" but got "" +FAIL cqb unit resolves against appropriate container (vertical writing-mode on subject) assert_equals: expected "true" but got "" +FAIL cqmin unit resolves against appropriate container (vertical writing-mode on subject) assert_equals: expected "true" but got "" +FAIL cqmax unit resolves against appropriate container (vertical writing-mode on subject) assert_equals: expected "true" but got "" +FAIL cqw unit resolves against appropriate container (vertical writing-mode on container) assert_equals: expected "true" but got "" +FAIL cqh unit resolves against appropriate container (vertical writing-mode on container) assert_equals: expected "true" but got "" +FAIL cqi unit resolves against appropriate container (vertical writing-mode on container) assert_equals: expected "true" but got "" +FAIL cqb unit resolves against appropriate container (vertical writing-mode on container) assert_equals: expected "true" but got "" +FAIL cqmin unit resolves against appropriate container (vertical writing-mode on container) assert_equals: expected "true" but got "" +FAIL cqmax unit resolves against appropriate container (vertical writing-mode on container) assert_equals: expected "true" but got "" + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-fallback-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-fallback-expected.txt new file mode 100644 index 000000000000..84f9e8ea646d --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-fallback-expected.txt @@ -0,0 +1,4 @@ + + +FAIL Use small viewport size as fallback assert_equals: expected "rgb(0, 0, 255)" but got "rgb(0, 128, 0)" + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-fallback.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-fallback.html new file mode 100644 index 000000000000..3784499c387c --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-fallback.html @@ -0,0 +1,68 @@ + +Container Relative Units: container relative units fall back to small viewport + + + + + + + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container.html new file mode 100644 index 000000000000..9ddca55ec152 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container.html @@ -0,0 +1,111 @@ + +Container Relative Units: in @container prelude + + + + + + +
+
+
+
Test1
+
+
+
+ +
+
+
+
Test1
+
+
+
+ + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-invalidation-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-invalidation-expected.txt index 392aa23ec34d..f5704f3f503b 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-invalidation-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-invalidation-expected.txt @@ -1,7 +1,7 @@ Test -PASS cqi respond when selected container changes type (inline-size -> none) -PASS cqb respond when selected container changes type (size -> none) +PASS cqi respond when selected container changes type (inline-size -> normal) +PASS cqb respond when selected container changes type (size -> normal) PASS cqb respond when intermediate container changes type (inline-size -> size) PASS cqi respond when selected container changes inline-size PASS cqb respond when selected container changes block-size diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-invalidation.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-invalidation.html index 0cb5b15f4a8e..1bc708dc88b0 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-invalidation.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-invalidation.html @@ -39,27 +39,27 @@ assert_cqi_equals(child, '30px'); try { - inline.style.containerType = 'none'; + inline.style.containerType = 'normal'; assert_cqi_equals(child, '50px'); } finally { inline.style = ''; } assert_cqi_equals(child, '30px'); - }, `cqi respond when selected container changes type (inline-size -> none)`); + }, `cqi respond when selected container changes type (inline-size -> normal)`); test(function() { assert_cqb_equals(child, '40px'); try { - size.style.containerType = 'none'; + size.style.containerType = 'normal'; assert_cqb_equals(child, '60px'); } finally { size.style = ''; } assert_cqb_equals(child, '40px'); - }, `cqb respond when selected container changes type (size -> none)`); + }, `cqb respond when selected container changes type (size -> normal)`); test(function() { assert_cqb_equals(child, '40px'); diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/columns-in-table-002-crash.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/columns-in-table-002-crash.html index 8062c91d5c80..24b9f1aab20b 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/columns-in-table-002-crash.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/columns-in-table-002-crash.html @@ -3,7 +3,13 @@

Pass if test does not crash.

-
+
+ diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-004-crash.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-004-crash.html new file mode 100644 index 000000000000..daed42f00945 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-004-crash.html @@ -0,0 +1,16 @@ + +CSS Container Queries Crash Test + +

Pass if no crash

+
+ + + +
+ +
+
+
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-005-crash.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-005-crash.html new file mode 100644 index 000000000000..60d6f9d3a1f7 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-005-crash.html @@ -0,0 +1,8 @@ + +CSS Container Queries Crash Test + +
  • + +
    +
    +
  • diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/w3c-import.log index 896645234a5a..d31ff46bd9a5 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/w3c-import.log +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/w3c-import.log @@ -47,3 +47,5 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-001-crash.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-002-crash.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-003-crash.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-004-crash.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/crashtests/table-in-columns-005-crash.html diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-calc-dynamic-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-calc-dynamic-expected.txt new file mode 100644 index 000000000000..8762d4686689 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-calc-dynamic-expected.txt @@ -0,0 +1,3 @@ + +FAIL font-relative calc() is responsive to container font-size changes assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)" + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-calc-dynamic.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-calc-dynamic.html new file mode 100644 index 000000000000..54f01d45a396 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-calc-dynamic.html @@ -0,0 +1,35 @@ + +CSS Container Queries Test: font-relative calc - dynamic + + + + + +
    +
    +
    +
    +
    + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic-expected.txt index e5f224ee6f1e..6fcfe76b83db 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic-expected.txt @@ -1,10 +1,6 @@ -PASS em relative before change -PASS rem relative before change -PASS ex relative before change -PASS ch relative before change -PASS em relative after change -PASS rem relative after change -PASS ex relative after change -PASS ch relative after change +FAIL em units respond to changes assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)" +PASS rem units respond to changes +FAIL ex units respond to changes assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)" +FAIL ch units respond to changes assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)" diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic.html index 63e17c9a5401..e9f2e1157f3d 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic.html +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic.html @@ -4,50 +4,130 @@ + + -
    -
    -
    -
    -
    -
    - - document.documentElement.className = "larger"; - document.body.className = "larger"; + + - test(() => assert_equals(getComputedStyle(em_test).color, green), "em relative after change"); - test(() => assert_equals(getComputedStyle(rem_test).color, green), "rem relative after change"); - test(() => assert_equals(getComputedStyle(ex_test).color, green), "ex relative after change"); - test(() => assert_equals(getComputedStyle(ch_test).color, green), "ch relative after change"); + + + + + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-container-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-container-expected.txt new file mode 100644 index 000000000000..dc1ade0b0f05 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-container-expected.txt @@ -0,0 +1,3 @@ + +PASS Check that grid items can query grid container + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-container.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-container.html new file mode 100644 index 000000000000..60278e09c69f --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-container.html @@ -0,0 +1,29 @@ + +CSS Container Queries Test: Grid container + + + + + +
    +
    +
    +
    + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-item-container-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-item-container-expected.txt new file mode 100644 index 000000000000..191c684a3b74 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-item-container-expected.txt @@ -0,0 +1,3 @@ + +PASS Check that children can query grid item containers + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-item-container.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-item-container.html new file mode 100644 index 000000000000..f1c66efc26d9 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-item-container.html @@ -0,0 +1,38 @@ + +CSS Container Queries Test: Grid item container + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/w3c-import.log index 2111ae714281..0ffdb74a1f67 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/w3c-import.log +++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/w3c-import.log @@ -21,8 +21,10 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/aspect-ratio-feature-evaluation.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-parsing.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-serialization.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/at-container-style-serialization.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/auto-scrollbars.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/backdrop-invalidation.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/calc-evaluation.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-001-expected.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-001.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/canvas-as-container-002-expected.html @@ -38,6 +40,7 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/change-display-in-container.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/chrome-legacy-skip-recalc-expected.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/chrome-legacy-skip-recalc.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/column-spanner-in-container.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/conditional-container-status.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-computed.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-for-cue-expected.html @@ -55,6 +58,7 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-selection.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-invalidation-after-load.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-invalidation.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-size-nested-invalidation.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-computed.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-containment.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-type-invalidation.html @@ -68,6 +72,9 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient-invalidation.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient-ref.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-gradient.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-dynamic.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container-fallback.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-in-at-container.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-invalidation.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-media-queries.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-units-selection.html @@ -92,10 +99,13 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/fieldset-legend-change-expected.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/fieldset-legend-change-ref.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/fieldset-legend-change.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-calc-dynamic.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-dynamic.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/fragmented-container-001.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/get-animations.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-container.html +/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/grid-item-container.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/idlharness.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/iframe-in-container-invalidation.html /LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/iframe-invalidation.html diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp index cf64c23f3b40..9473102c078c 100644 --- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -2581,7 +2581,7 @@ static inline bool hasValidStyleForProperty(Element& element, CSSPropertyID prop auto isQueryContainer = [&](Element& element) { auto* style = element.renderStyle(); - return style && style->containerType() != ContainerType::None; + return style && style->containerType() != ContainerType::Normal; }; bool isInherited = CSSProperty::isInheritedProperty(propertyID) || isImplicitlyInheritedGridOrFlexProperty(propertyID); @@ -3794,7 +3794,7 @@ RefPtr ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty list->append(cssValuePool.createIdentifierValue(CSSValueNone)); else list->append(propertyValue(CSSPropertyContainerName, DoNotUpdateLayout).releaseNonNull()); - if (style.containerType() != ContainerType::None) + if (style.containerType() != ContainerType::Normal) list->append(propertyValue(CSSPropertyContainerType, DoNotUpdateLayout).releaseNonNull()); return list; } diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h index 6e5da6078a47..4815d2c0cbab 100644 --- a/Source/WebCore/css/CSSPrimitiveValueMappings.h +++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h @@ -5576,8 +5576,8 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ContainerType containerTy { setPrimitiveUnitType(CSSUnitType::CSS_VALUE_ID); switch (containerType) { - case ContainerType::None: - m_value.valueID = CSSValueNone; + case ContainerType::Normal: + m_value.valueID = CSSValueNormal; break; case ContainerType::Size: m_value.valueID = CSSValueSize; @@ -5592,8 +5592,8 @@ template<> inline CSSPrimitiveValue::operator ContainerType() const { ASSERT(isValueID()); switch (m_value.valueID) { - case CSSValueNone: - return ContainerType::None; + case CSSValueNormal: + return ContainerType::Normal; case CSSValueSize: return ContainerType::Size; case CSSValueInlineSize: @@ -5602,7 +5602,7 @@ template<> inline CSSPrimitiveValue::operator ContainerType() const break; } ASSERT_NOT_REACHED(); - return ContainerType::None; + return ContainerType::Normal; } } diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in index 742e53012745..581d130a7124 100644 --- a/Source/WebCore/css/CSSValueKeywords.in +++ b/Source/WebCore/css/CSSValueKeywords.in @@ -1583,7 +1583,7 @@ paint #endif // container-type -// none +// normal // size inline-size diff --git a/Source/WebCore/css/StyleProperties.cpp b/Source/WebCore/css/StyleProperties.cpp index 7952c6efb677..c44dab680e32 100644 --- a/Source/WebCore/css/StyleProperties.cpp +++ b/Source/WebCore/css/StyleProperties.cpp @@ -64,7 +64,7 @@ static size_t sizeForImmutableStylePropertiesWithPropertyCount(unsigned count) static bool isCSSWideValueKeyword(StringView value) { - return value == "initial"_s || value == "inherit"_s || value == "unset"_s || value == "revert"_s; + return value == "initial"_s || value == "inherit"_s || value == "unset"_s || value == "revert"_s || value == "revert-layer"_s; } static bool isNoneValue(const RefPtr& value) @@ -72,6 +72,11 @@ static bool isNoneValue(const RefPtr& value) return value && value->isPrimitiveValue() && downcast(value.get())->isValueID() && downcast(value.get())->valueID() == CSSValueNone; } +static bool isNormalValue(const RefPtr& value) +{ + return value && value->isPrimitiveValue() && downcast(value.get())->isValueID() && downcast(value.get())->valueID() == CSSValueNormal; +} + static bool isValueID(const Ref& value, CSSValueID id) { return value->isPrimitiveValue() && downcast(value.get()).isValueID() && downcast(value.get()).valueID() == id; @@ -265,7 +270,7 @@ String StyleProperties::getPropertyValue(CSSPropertyID propertyID, Document* doc return getShorthandValue(columnsShorthand()); case CSSPropertyContainer: if (auto type = getPropertyCSSValue(CSSPropertyContainerType)) { - if (isNoneValue(type)) { + if (isNormalValue(type)) { if (auto name = getPropertyCSSValue(CSSPropertyContainerName)) return name->cssText(); return { }; diff --git a/Source/WebCore/css/parser/CSSParserFastPaths.cpp b/Source/WebCore/css/parser/CSSParserFastPaths.cpp index 3eed38885bf2..a609cbf2307b 100644 --- a/Source/WebCore/css/parser/CSSParserFastPaths.cpp +++ b/Source/WebCore/css/parser/CSSParserFastPaths.cpp @@ -901,7 +901,7 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueAll; case CSSPropertyContainerType: // FIXME: Support 'style'. It will require parsing the value as a list. - return valueID == CSSValueNone || valueID == CSSValueSize || valueID == CSSValueInlineSize; + return valueID == CSSValueNormal || valueID == CSSValueSize || valueID == CSSValueInlineSize; default: ASSERT_NOT_REACHED(); return false; diff --git a/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp b/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp index 98b5832bbc90..a424545093c5 100644 --- a/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp +++ b/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp @@ -4291,11 +4291,19 @@ AtomString consumeCounterStyleNameInPrelude(CSSParserTokenRange& prelude) RefPtr consumeSingleContainerName(CSSParserTokenRange& range) { - if (range.peek().id() == CSSValueNone) + switch (range.peek().id()) { + case CSSValueNormal: + case CSSValueNone: + case CSSValueAuto: + case CSSValueAnd: + case CSSValueOr: + case CSSValueNot: return nullptr; - if (auto ident = consumeCustomIdent(range)) - return ident; - return nullptr; + default: + if (auto ident = consumeCustomIdent(range)) + return ident; + return nullptr; + } } std::optional consumeFontVariantCSS21Raw(CSSParserTokenRange& range) diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp index 841a241dd230..05577fe6fb65 100644 --- a/Source/WebCore/dom/Document.cpp +++ b/Source/WebCore/dom/Document.cpp @@ -2372,7 +2372,7 @@ bool Document::updateLayoutIfDimensionsOutOfDate(Element& element, DimensionsChe previousBox = currentBox; currentBox = downcast(currRenderer); - if (currentBox->style().containerType() != ContainerType::None) { + if (currentBox->style().containerType() != ContainerType::Normal) { requireFullLayout = true; break; } diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp index 68a8621401df..14877f50bd9b 100644 --- a/Source/WebCore/rendering/RenderBox.cpp +++ b/Source/WebCore/rendering/RenderBox.cpp @@ -176,7 +176,7 @@ void RenderBox::willBeDestroyed() if (hasInitializedStyle()) { if (style().hasSnapPosition()) view().unregisterBoxWithScrollSnapPositions(*this); - if (style().containerType() != ContainerType::None) + if (style().containerType() != ContainerType::Normal) view().unregisterContainerQueryBox(*this); } @@ -297,9 +297,9 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl view().unregisterBoxWithScrollSnapPositions(*this); } - if (newStyle.containerType() != ContainerType::None) + if (newStyle.containerType() != ContainerType::Normal) view().registerContainerQueryBox(*this); - else if (oldStyle && oldStyle->containerType() != ContainerType::None) + else if (oldStyle && oldStyle->containerType() != ContainerType::Normal) view().unregisterContainerQueryBox(*this); RenderBoxModelObject::styleWillChange(diff, newStyle); diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h index 06b17e536625..7c2e50e01603 100644 --- a/Source/WebCore/rendering/style/RenderStyle.h +++ b/Source/WebCore/rendering/style/RenderStyle.h @@ -1718,7 +1718,7 @@ class RenderStyle { static OptionSet initialContainment() { return OptionSet { }; } static OptionSet strictContainment() { return OptionSet { Containment::Size, Containment::Layout, Containment::Paint, Containment::Style }; } static OptionSet contentContainment() { return OptionSet { Containment::Layout, Containment::Paint, Containment::Style }; } - static ContainerType initialContainerType() { return ContainerType::None; } + static ContainerType initialContainerType() { return ContainerType::Normal; } static Vector initialContainerNames() { return { }; } static double initialAspectRatioWidth() { return 1.0; } static double initialAspectRatioHeight() { return 1.0; } diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h index 111c5de3af6f..a23668fc2d50 100644 --- a/Source/WebCore/rendering/style/RenderStyleConstants.h +++ b/Source/WebCore/rendering/style/RenderStyleConstants.h @@ -1205,7 +1205,7 @@ enum class Containment : uint8_t { }; enum class ContainerType : uint8_t { - None, + Normal, Size, InlineSize, }; diff --git a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp index 5f655ead62e6..955315d4f85d 100644 --- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp +++ b/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp @@ -370,7 +370,7 @@ OptionSet StyleRareNonInheritedData::effectiveContainment() const auto containment = contain; switch (static_cast(containerType)) { - case ContainerType::None: + case ContainerType::Normal: break; case ContainerType::Size: containment.add({ Containment::Layout, Containment::Style, Containment::Size }); diff --git a/Source/WebCore/style/ContainerQueryEvaluator.cpp b/Source/WebCore/style/ContainerQueryEvaluator.cpp index 9c6de6887564..8be6d2fdf394 100644 --- a/Source/WebCore/style/ContainerQueryEvaluator.cpp +++ b/Source/WebCore/style/ContainerQueryEvaluator.cpp @@ -107,7 +107,7 @@ const Element* ContainerQueryEvaluator::selectContainer(OptionSet axes if (axes.contains(CQ::Axis::Block)) return false; return !axes.contains(principalBox->isHorizontalWritingMode() ? CQ::Axis::Height : CQ::Axis::Width); - case ContainerType::None: + case ContainerType::Normal: return false; } RELEASE_ASSERT_NOT_REACHED(); @@ -245,7 +245,7 @@ auto ContainerQueryEvaluator::evaluateSizeFeature(const CQ::SizeFeature& sizeFea return renderer.shouldApplyInlineSizeContainment(); case ContainerType::Size: return renderer.shouldApplySizeContainment(); - case ContainerType::None: + case ContainerType::Normal: return true; } RELEASE_ASSERT_NOT_REACHED(); diff --git a/Source/WebCore/style/StyleScope.cpp b/Source/WebCore/style/StyleScope.cpp index 645b3b85a3cd..1fac3ef376dc 100644 --- a/Source/WebCore/style/StyleScope.cpp +++ b/Source/WebCore/style/StyleScope.cpp @@ -816,7 +816,7 @@ bool Scope::updateQueryContainerState(QueryContainerUpdateContext& context) return size.width() != oldSize.width(); case ContainerType::Size: return size != oldSize; - case ContainerType::None: + case ContainerType::Normal: RELEASE_ASSERT_NOT_REACHED(); } RELEASE_ASSERT_NOT_REACHED(); diff --git a/Source/WebCore/style/StyleSharingResolver.cpp b/Source/WebCore/style/StyleSharingResolver.cpp index 33c282657f35..6efd511a4ad6 100644 --- a/Source/WebCore/style/StyleSharingResolver.cpp +++ b/Source/WebCore/style/StyleSharingResolver.cpp @@ -261,7 +261,7 @@ bool SharingResolver::canShareStyleWithElement(const Context& context, const Sty if (candidateElement.isLink() && context.elementLinkState != style->insideLink()) return false; - if (style->containerType() != ContainerType::None) + if (style->containerType() != ContainerType::Normal) return false; if (candidateElement.elementData() != element.elementData()) { diff --git a/Source/WebCore/style/StyleTreeResolver.cpp b/Source/WebCore/style/StyleTreeResolver.cpp index 614ebfcd796b..c839313952f6 100644 --- a/Source/WebCore/style/StyleTreeResolver.cpp +++ b/Source/WebCore/style/StyleTreeResolver.cpp @@ -629,7 +629,7 @@ ElementUpdate TreeResolver::createAnimatedElementUpdate(std::unique_ptrcontainerType() : ContainerType::None; + auto previousContainerType = style ? style->containerType() : ContainerType::Normal; auto resolutionType = determineResolutionType(element, parent.descendantsToResolve, parent.change); if (resolutionType) { @@ -889,7 +889,7 @@ auto TreeResolver::determineQueryContainerAction(const Element& element, const R // FIXME: Render tree needs to be updated before proceeding to children also if we have a former query container // because container unit resolution for descendants relies on it being up-to-date. - if (style->containerType() == ContainerType::None && previousContainerType == ContainerType::None) + if (style->containerType() == ContainerType::Normal && previousContainerType == ContainerType::Normal) return QueryContainerAction::None; if (m_resolvedQueryContainers.contains(element))