Diff
Modified: trunk/LayoutTests/ChangeLog (276151 => 276152)
--- trunk/LayoutTests/ChangeLog 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/ChangeLog 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,3 +1,16 @@
+2021-04-16 Tyler Wilcock <[email protected]>
+
+ [css-counter-styles] Parse and add feature flag for @counter-style
+ https://bugs.webkit.org/show_bug.cgi?id=223150
+
+ Reviewed by Darin Adler.
+
+ Add tests ensuring @counter-style is not exposed when feature flag is
+ disabled.
+
+ * webexposed/counter-style-is-not-exposed-expected.txt: Added.
+ * webexposed/counter-style-is-not-exposed.html: Added.
+
2021-04-16 Zalan Bujtas <[email protected]>
[IFC] Incorrect box height when scrollbar takes padding box space
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,3 +1,28 @@
+2021-04-16 Tyler Wilcock <[email protected]>
+
+ [css-counter-styles] Parse and add feature flag for @counter-style
+ https://bugs.webkit.org/show_bug.cgi?id=223150
+
+ Reviewed by Darin Adler.
+
+ @counter-style and its descriptors are now exposed behind a feature
+ flag, so pass some tests and fail others for a different reason
+ because this patch doesn't actually implement descriptor parsing and
+ setting yet.
+
+ * web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt:
+ * web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt:
+ * web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt:
+ * web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt:
+ * web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt:
+ * web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt:
+ * web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt:
+ * web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt:
+ * web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt:
+ * web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt:
+ * web-platform-tests/css/css-counter-styles/idlharness-expected.txt:
+ * web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt:
+
2021-04-16 Antoine Quint <[email protected]>
Blend using calc() when necessary
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,7 +1,7 @@
-FAIL @counter-style 'additive-symbols: 1 "X"' is valid assert_equals: expected (undefined) undefined but got (string) "1 \"X\""
-FAIL @counter-style 'additive-symbols: "X" 1' is valid assert_equals: expected (undefined) undefined but got (string) "1 \"X\""
-FAIL @counter-style 'additive-symbols: 5 "V", 1 "I"' is valid assert_equals: expected (undefined) undefined but got (string) "5 \"V\", 1 \"I\""
+FAIL @counter-style 'additive-symbols: 1 "X"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'additive-symbols: "X" 1' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'additive-symbols: 5 "V", 1 "I"' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'additive-symbols: ' is invalid
PASS @counter-style 'additive-symbols: -1 "X"' is invalid
PASS @counter-style 'additive-symbols: 1 "I", 5 "V"' is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,5 +1,5 @@
-FAIL @counter-style 'fallback: bar' is valid assert_equals: expected (undefined) undefined but got (string) "bar"
+FAIL @counter-style 'fallback: bar' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'fallback: "bar"' is invalid
PASS @counter-style 'fallback: none' is invalid
PASS @counter-style 'fallback: initial' is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,5 +1,5 @@
-FAIL @counter-style name foo is valid assert_not_equals: got disallowed value undefined
+PASS @counter-style name foo is valid
PASS @counter-style name is invalid
PASS @counter-style name none is invalid
PASS @counter-style name initial is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,5 +1,5 @@
-FAIL @counter-style 'negative: "X"' is valid assert_equals: expected (undefined) undefined but got (string) "\"X\""
-FAIL @counter-style 'negative: "X" "X"' is valid assert_equals: expected (undefined) undefined but got (string) "\"X\" \"X\""
+FAIL @counter-style 'negative: "X"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'negative: "X" "X"' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'negative: "X" "X" "X"' is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,8 +1,8 @@
PASS @counter-style 'pad: 10' is invalid
PASS @counter-style 'pad: "X"' is invalid
-FAIL @counter-style 'pad: 10 "X"' is valid assert_equals: expected (undefined) undefined but got (string) "10 \"X\""
-FAIL @counter-style 'pad: "X" 10' is valid assert_equals: expected (undefined) undefined but got (string) "10 \"X\""
+FAIL @counter-style 'pad: 10 "X"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'pad: "X" 10' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'pad: -1 "X"' is invalid
PASS @counter-style 'pad: "X" -1' is invalid
PASS @counter-style 'pad: 10 "X" "Y"' is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,14 +1,14 @@
-FAIL @counter-style 'prefix: "string"' is valid assert_equals: expected (undefined) undefined but got (string) "\"string\""
-FAIL @counter-style 'suffix: "string"' is valid assert_equals: expected (undefined) undefined but got (string) "\"string\""
-FAIL @counter-style 'prefix: "initial"' is valid assert_equals: expected (undefined) undefined but got (string) "\"initial\""
-FAIL @counter-style 'suffix: "initial"' is valid assert_equals: expected (undefined) undefined but got (string) "\"initial\""
-FAIL @counter-style 'prefix: "inherit"' is valid assert_equals: expected (undefined) undefined but got (string) "\"inherit\""
-FAIL @counter-style 'suffix: "inherit"' is valid assert_equals: expected (undefined) undefined but got (string) "\"inherit\""
-FAIL @counter-style 'prefix: "unset"' is valid assert_equals: expected (undefined) undefined but got (string) "\"unset\""
-FAIL @counter-style 'suffix: "unset"' is valid assert_equals: expected (undefined) undefined but got (string) "\"unset\""
-FAIL @counter-style 'prefix: custom-ident' is valid assert_equals: expected (undefined) undefined but got (string) "custom-ident"
-FAIL @counter-style 'suffix: custom-ident' is valid assert_equals: expected (undefined) undefined but got (string) "custom-ident"
+FAIL @counter-style 'prefix: "string"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'suffix: "string"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'prefix: "initial"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'suffix: "initial"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'prefix: "inherit"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'suffix: "inherit"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'prefix: "unset"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'suffix: "unset"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'prefix: custom-ident' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'suffix: custom-ident' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'prefix: initial' is invalid
PASS @counter-style 'suffix: initial' is invalid
PASS @counter-style 'prefix: inherit' is invalid
@@ -15,12 +15,12 @@
PASS @counter-style 'suffix: inherit' is invalid
PASS @counter-style 'prefix: unset' is invalid
PASS @counter-style 'suffix: unset' is invalid
-FAIL @counter-style 'prefix: url("https://example.com/foo.png")' is valid assert_equals: expected (undefined) undefined but got (string) "url(\"https://example.com/foo.png\")"
-FAIL @counter-style 'suffix: url("https://example.com/foo.png")' is valid assert_equals: expected (undefined) undefined but got (string) "url(\"https://example.com/foo.png\")"
-FAIL @counter-style 'prefix: url(https://example.com/foo.png)' is valid assert_equals: expected (undefined) undefined but got (string) "url(\"https://example.com/foo.png\")"
-FAIL @counter-style 'suffix: url(https://example.com/foo.png)' is valid assert_equals: expected (undefined) undefined but got (string) "url(\"https://example.com/foo.png\")"
-FAIL @counter-style 'prefix: linear-gradient(yellow, blue)' is valid assert_equals: expected (undefined) undefined but got (string) "linear-gradient(yellow, blue)"
-FAIL @counter-style 'suffix: linear-gradient(yellow, blue)' is valid assert_equals: expected (undefined) undefined but got (string) "linear-gradient(yellow, blue)"
+FAIL @counter-style 'prefix: url("https://example.com/foo.png")' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'suffix: url("https://example.com/foo.png")' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'prefix: url(https://example.com/foo.png)' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'suffix: url(https://example.com/foo.png)' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'prefix: linear-gradient(yellow, blue)' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'suffix: linear-gradient(yellow, blue)' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'prefix: ' is invalid
PASS @counter-style 'suffix: ' is invalid
PASS @counter-style 'prefix: foo bar' is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,10 +1,10 @@
-FAIL @counter-style 'range: auto' is valid assert_equals: expected (undefined) undefined but got (string) "auto"
-FAIL @counter-style 'range: infinite infinite' is valid assert_equals: expected (undefined) undefined but got (string) "infinite infinite"
-FAIL @counter-style 'range: infinite 0' is valid assert_equals: expected (undefined) undefined but got (string) "infinite 0"
-FAIL @counter-style 'range: 0 infinite' is valid assert_equals: expected (undefined) undefined but got (string) "0 infinite"
-FAIL @counter-style 'range: infinite 0, 5 10, 100 infinite' is valid assert_equals: expected (undefined) undefined but got (string) "infinite 0, 5 10, 100 infinite"
-FAIL @counter-style 'range: infinite 10, 5 20, 15 infinite' is valid assert_equals: expected (undefined) undefined but got (string) "infinite 10, 5 20, 15 infinite"
+FAIL @counter-style 'range: auto' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'range: infinite infinite' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'range: infinite 0' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'range: 0 infinite' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'range: infinite 0, 5 10, 100 infinite' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'range: infinite 10, 5 20, 15 infinite' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'range: ' is invalid
PASS @counter-style 'range: 0 -1' is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,11 +1,11 @@
-FAIL @counter-style 'speak-as: auto' is valid assert_equals: expected (undefined) undefined but got (string) "auto"
-FAIL @counter-style 'speak-as: bullets' is valid assert_equals: expected (undefined) undefined but got (string) "bullets"
-FAIL @counter-style 'speak-as: numbers' is valid assert_equals: expected (undefined) undefined but got (string) "numbers"
-FAIL @counter-style 'speak-as: words' is valid assert_equals: expected (undefined) undefined but got (string) "words"
-FAIL @counter-style 'speak-as: spell-out' is valid assert_equals: expected (undefined) undefined but got (string) "spell-out"
-FAIL @counter-style 'speak-as: bar' is valid assert_equals: expected (undefined) undefined but got (string) "bar"
-FAIL @counter-style 'speak-as: spellout' is valid assert_equals: expected (undefined) undefined but got (string) "spellout"
+FAIL @counter-style 'speak-as: auto' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'speak-as: bullets' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'speak-as: numbers' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'speak-as: words' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'speak-as: spell-out' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'speak-as: bar' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'speak-as: spellout' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'speak-as: bullets numbers' is invalid
PASS @counter-style 'speak-as: none' is invalid
PASS @counter-style 'speak-as: initial' is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,8 +1,8 @@
-FAIL @counter-style 'symbols: "X"' is valid assert_equals: expected (undefined) undefined but got (string) "\"X\""
-FAIL @counter-style 'symbols: "X" "X"' is valid assert_equals: expected (undefined) undefined but got (string) "\"X\" \"X\""
-FAIL @counter-style 'symbols: ident "X"' is valid assert_equals: expected (undefined) undefined but got (string) "ident \"X\""
-FAIL @counter-style 'symbols: ident "X" url("foo.jpg")' is valid assert_equals: expected (undefined) undefined but got (string) "ident \"X\" url(\"foo.jpg\")"
+FAIL @counter-style 'symbols: "X"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'symbols: "X" "X"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'symbols: ident "X"' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'symbols: ident "X" url("foo.jpg")' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'symbols: ' is invalid
PASS @counter-style 'symbols: initial "X" "X"' is invalid
PASS @counter-style 'symbols: inherit "X" "X"' is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,13 +1,13 @@
-FAIL @counter-style 'system: cyclic' is valid assert_equals: expected (undefined) undefined but got (string) "cyclic"
-FAIL @counter-style 'system: fixed' is valid assert_equals: expected (undefined) undefined but got (string) "fixed"
-FAIL @counter-style 'system: fixed 100' is valid assert_equals: expected (undefined) undefined but got (string) "fixed 100"
-FAIL @counter-style 'system: fixed -1' is valid assert_equals: expected (undefined) undefined but got (string) "fixed -1"
-FAIL @counter-style 'system: symbolic' is valid assert_equals: expected (undefined) undefined but got (string) "symbolic"
-FAIL @counter-style 'system: alphabetic' is valid assert_equals: expected (undefined) undefined but got (string) "alphabetic"
-FAIL @counter-style 'system: numeric' is valid assert_equals: expected (undefined) undefined but got (string) "numeric"
-FAIL @counter-style 'system: additive' is valid assert_equals: expected (undefined) undefined but got (string) "additive"
-FAIL @counter-style 'system: extends bar' is valid assert_equals: expected (undefined) undefined but got (string) "extends bar"
+FAIL @counter-style 'system: cyclic' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'system: fixed' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'system: fixed 100' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'system: fixed -1' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'system: symbolic' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'system: alphabetic' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'system: numeric' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'system: additive' is valid assert_not_equals: got disallowed value -1
+FAIL @counter-style 'system: extends bar' is valid assert_not_equals: got disallowed value -1
PASS @counter-style 'system: float' is invalid
PASS @counter-style 'system: cyclic cyclic' is invalid
PASS @counter-style 'system: extends none' is invalid
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/idlharness-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/idlharness-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/idlharness-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -3,37 +3,37 @@
PASS idl_test validation
PASS Partial interface CSSRule: original interface defined
PASS Partial interface CSSRule: member names are unique
-FAIL CSSCounterStyleRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface object length assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface object name assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute name assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute system assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute symbols assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute additiveSymbols assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute negative assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute prefix assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute suffix assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute range assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute pad assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute speakAs assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule interface: attribute fallback assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing
-FAIL CSSCounterStyleRule must be primary interface of counter assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL Stringification of counter assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "name" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "system" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "symbols" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "additiveSymbols" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "negative" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "prefix" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "suffix" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "range" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "pad" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "speakAs" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSCounterStyleRule interface: counter must inherit property "fallback" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSRule interface: counter must inherit property "COUNTER_STYLE_RULE" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
-FAIL CSSRule interface: constant COUNTER_STYLE_RULE on interface object assert_own_property: expected property "COUNTER_STYLE_RULE" missing
-FAIL CSSRule interface: constant COUNTER_STYLE_RULE on interface prototype object assert_own_property: expected property "COUNTER_STYLE_RULE" missing
+PASS CSSCounterStyleRule interface: existence and properties of interface object
+PASS CSSCounterStyleRule interface object length
+PASS CSSCounterStyleRule interface object name
+PASS CSSCounterStyleRule interface: existence and properties of interface prototype object
+PASS CSSCounterStyleRule interface: existence and properties of interface prototype object's "constructor" property
+PASS CSSCounterStyleRule interface: existence and properties of interface prototype object's @@unscopables property
+PASS CSSCounterStyleRule interface: attribute name
+PASS CSSCounterStyleRule interface: attribute system
+PASS CSSCounterStyleRule interface: attribute symbols
+PASS CSSCounterStyleRule interface: attribute additiveSymbols
+PASS CSSCounterStyleRule interface: attribute negative
+PASS CSSCounterStyleRule interface: attribute prefix
+PASS CSSCounterStyleRule interface: attribute suffix
+PASS CSSCounterStyleRule interface: attribute range
+PASS CSSCounterStyleRule interface: attribute pad
+PASS CSSCounterStyleRule interface: attribute speakAs
+PASS CSSCounterStyleRule interface: attribute fallback
+PASS CSSCounterStyleRule must be primary interface of counter
+PASS Stringification of counter
+PASS CSSCounterStyleRule interface: counter must inherit property "name" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "system" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "symbols" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "additiveSymbols" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "negative" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "prefix" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "suffix" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "range" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "pad" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "speakAs" with the proper type
+PASS CSSCounterStyleRule interface: counter must inherit property "fallback" with the proper type
+PASS CSSRule interface: counter must inherit property "COUNTER_STYLE_RULE" with the proper type
+PASS CSSRule interface: constant COUNTER_STYLE_RULE on interface object
+PASS CSSRule interface: constant COUNTER_STYLE_RULE on interface prototype object
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt (276151 => 276152)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,3 +1,3 @@
-FAIL CSSCounterStyleRule.cssText doesn't serialize with newlines undefined is not an object (evaluating 'rule.cssText')
+PASS CSSCounterStyleRule.cssText doesn't serialize with newlines
Added: trunk/LayoutTests/webexposed/counter-style-is-not-exposed-expected.txt (0 => 276152)
--- trunk/LayoutTests/webexposed/counter-style-is-not-exposed-expected.txt (rev 0)
+++ trunk/LayoutTests/webexposed/counter-style-is-not-exposed-expected.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -0,0 +1,3 @@
+
+PASS @counter-style is not exposed
+
Added: trunk/LayoutTests/webexposed/counter-style-is-not-exposed.html (0 => 276152)
--- trunk/LayoutTests/webexposed/counter-style-is-not-exposed.html (rev 0)
+++ trunk/LayoutTests/webexposed/counter-style-is-not-exposed.html 2021-04-16 19:19:04 UTC (rev 276152)
@@ -0,0 +1,18 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ CSSCounterStyleAtRulesEnabled=false ] -->
+<script src=""
+<script src=""
+<style>
+ @counter-style foo {
+ system: cyclic;
+ prefix: "(";
+ suffix: ")";
+ symbols: A B C D E;
+ }
+</style>
+<script>
+ test(function() {
+ const cssRules = document.styleSheets[0].cssRules
+ assert_equals(cssRules.length, 0, '@counter-style should not be exposed with the runtime feature flag disabled.')
+ assert_equals(window.CSSRule.COUNTER_STYLE_RULE, undefined, 'COUNTER_STYLE_RULE constant should not be exposed with the runtime feature flag disabled.');
+ }, '@counter-style is not exposed')
+</script>
\ No newline at end of file
Modified: trunk/Source/WTF/ChangeLog (276151 => 276152)
--- trunk/Source/WTF/ChangeLog 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WTF/ChangeLog 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,3 +1,13 @@
+2021-04-16 Tyler Wilcock <[email protected]>
+
+ [css-counter-styles] Parse and add feature flag for @counter-style
+ https://bugs.webkit.org/show_bug.cgi?id=223150
+
+ Reviewed by Darin Adler.
+
+ * Scripts/Preferences/WebPreferencesExperimental.yaml:
+ Add CSSCounterStyleAtRulesEnabled and CSSCounterStyleAtRuleImageSymbolsEnabled flags.
+
2021-04-15 Alex Christensen <[email protected]>
Use WTF::Function instead of std::function in SVGPropertyAnimatorFactory::attributeAnimatorCreator
Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (276151 => 276152)
--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml 2021-04-16 19:19:04 UTC (rev 276152)
@@ -160,6 +160,30 @@
WebCore:
default: false
+CSSCounterStyleAtRuleImageSymbolsEnabled:
+ type: bool
+ humanReadableName: "CSS @counter-style <image> symbols"
+ humanReadableDescription: "Enable support for <image> symbols in CSS @counter-style rules"
+ defaultValue:
+ WebKitLegacy:
+ default: false
+ WebKit:
+ default: false
+ WebCore:
+ default: false
+
+CSSCounterStyleAtRulesEnabled:
+ type: bool
+ humanReadableName: "CSS @counter-style"
+ humanReadableDescription: "Enable support for CSS @counter-style rules"
+ defaultValue:
+ WebKitLegacy:
+ default: false
+ WebKit:
+ default: false
+ WebCore:
+ default: false
+
CSSCustomPropertiesAndValuesEnabled:
type: bool
humanReadableName: "CSS Custom Properties and Values API"
Modified: trunk/Source/WebCore/CMakeLists.txt (276151 => 276152)
--- trunk/Source/WebCore/CMakeLists.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/CMakeLists.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -736,6 +736,7 @@
crypto/parameters/RsaPssParams.idl
css/CSSConditionRule.idl
+ css/CSSCounterStyleRule.idl
css/CSSFontFaceRule.idl
css/CSSGroupingRule.idl
css/CSSImportRule.idl
Modified: trunk/Source/WebCore/ChangeLog (276151 => 276152)
--- trunk/Source/WebCore/ChangeLog 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/ChangeLog 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,3 +1,137 @@
+2021-04-16 Tyler Wilcock <[email protected]>
+
+ [css-counter-styles] Parse and add feature flag for @counter-style
+ https://bugs.webkit.org/show_bug.cgi?id=223150
+
+ Reviewed by Darin Adler.
+
+ Parse @counter-style (without implementing descriptor parsing) behind
+ a new feature flag, CSSCounterStyleAtRulesEnabled. A separate feature
+ flag for @counter-style <image> symbol values has also been added, as
+ image symbols have extra complexities that we won't want to hold the
+ entire feature back on.
+ https://www.w3.org/TR/css-counter-styles-3
+
+ The CSSCounterStyleRule IDL interface is also added and implemented,
+ and similarly feature flagged.
+ https://www.w3.org/TR/css-counter-styles-3/#apis
+
+ Test: webexposed/counter-style-is-not-exposed.html and existing WPTs.
+
+ * CMakeLists.txt:
+ Add CSSCounterStyleRule.idl.
+
+ * DerivedSources-input.xcfilelist:
+ Add CSSCounterStyleRule.idl.
+
+ * DerivedSources-output.xcfilelist:
+ Add JSCSSCounterStyleRule.h and JSCSSCounterStyleRule.cpp.
+
+ * DerivedSources.make:
+ Add CSSCounterStyleRule.idl.
+
+ * Sources.txt:
+ Add CSSCounterStyleRule.cpp and JSCSSCounterStyleRule.cpp.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Add CounterStyle.h, CounterStyle.cpp, and CounterStyle.idl.
+
+ * bindings/js/JSCSSRuleCustom.cpp:
+ (WebCore::toJSNewlyCreated):
+ Support CSSCounterStyleRule.
+
+ * bindings/js/WebCoreBuiltinNames.h:
+ Add macro(CSSCounterStyleRule) to generate counter-style built-in
+ names.
+
+ * css/CSSCounterStyleRule.cpp: Added.
+ (WebCore::StyleRuleCounterStyle::StyleRuleCounterStyle):
+ (WebCore::StyleRuleCounterStyle::create):
+ (WebCore::StyleRuleCounterStyle::mutableProperties):
+ (WebCore::CSSCounterStyleRule::CSSCounterStyleRule):
+ (WebCore::CSSCounterStyleRule::reattach):
+ (WebCore::CSSCounterStyleRule::cssText const):
+
+ * css/CSSCounterStyleRule.h: Added.
+ (isType): Add specialized rule.isCounterStyleRule() implementation.
+
+ * css/CSSCounterStyleRule.idl: Added.
+ * css/CSSRule.cpp: Add new StyleRuleType::CounterStyle COMPILE_ASSERT.
+ * css/CSSRule.h:
+ Add COUNTER_STYLE_RULE constant. Also add comment `// WebIDL enum` to
+ disable enum_casing lint, since these values are named to match IDL
+ attributes.
+ * css/CSSRule.idl: Add COUNTER_STYLE_RULE constant behind flag.
+
+ * css/StyleRule.cpp:
+ (WebCore::StyleRuleBase::destroy):
+ (WebCore::StyleRuleBase::copy const):
+ (WebCore::StyleRuleBase::createCSSOMWrapper const):
+ Handle newly added StyleRuleType::CounterStyle.
+
+ * css/StyleRule.h:
+ (WebCore::StyleRuleBase::isCounterStyleRule const): Added.
+
+ * css/StyleRuleType.h: Add StyleRuleType::CounterStyle
+
+ * css/StyleSheetContents.cpp:
+ (WebCore::traverseRulesInVector):
+ (WebCore::StyleSheetContents::traverseSubresources const):
+ If @counter-style image symbols flag is enabled, do traverse
+ subresources.
+
+ * css/parser/CSSAtRuleID.cpp:
+ If the @counter-style feature flag is enabled, return newly added
+ CSSAtRuleCounterStyle ID.
+
+ (WebCore::cssAtRuleID):
+ * css/parser/CSSAtRuleID.h:
+ Add CSSAtRuleCounterStyle ID.
+
+ * css/parser/CSSParserContext.cpp:
+ (WebCore::operator==):
+ * css/parser/CSSParserContext.h:
+ (WebCore::CSSParserContextHash::hash):
+ Add cssCounterStyleAtRulesEnabled and
+ cssCounterStyleAtRuleImageSymbolsEnabled flags.
+
+ * css/parser/CSSParserFastPaths.cpp:
+ (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+ Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle
+ method.
+
+ * css/parser/CSSParserImpl.cpp:
+ (WebCore::computeNewAllowedRules):
+ (WebCore::CSSParserImpl::consumeAtRule):
+ (WebCore::CSSParserImpl::consumeCounterStyleRule): Added.
+ (WebCore::CSSParserImpl::consumeDeclarationList):
+ (WebCore::CSSParserImpl::consumeDeclaration):
+ * css/parser/CSSParserImpl.h:
+ Handle new @counter-style rule.
+
+ * css/parser/CSSPropertyParser.cpp:
+ (WebCore::CSSPropertyParser::parseValue): Handle
+ StyleRuleType::CounterStyle.
+ (WebCore::consumeCounterContent):
+ Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle
+ method.
+ (WebCore::CSSPropertyParser::parseCounterStyleDescriptor):
+ Add placeholder for future @counter-style descriptor parsing work.
+
+ * css/parser/CSSPropertyParser.h:
+ Add parseCounterStyleDescriptor method
+
+ * css/parser/CSSPropertyParserHelpers.h:
+ * css/parser/CSSPropertyParserHelpers.cpp:
+ (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
+ Add new flag that allows consumed custom ident values to be lowercased
+ on-parse. This is necessary for some <counter-style-name> values.
+ (WebCore::CSSPropertyParserHelpers::isPredefinedCounterStyle): Added.
+ (WebCore::CSSPropertyParserHelpers::consumeCounterStyleName):
+ (WebCore::CSSPropertyParserHelpers::consumeCounterStyleNameInPrelude):
+ Parse @counter-style names, both in-prelude names and non-prelude
+ names (e.g. as part of the `extends` descriptor).
+
2021-04-16 Chris Dumez <[email protected]>
Unreviewed GTK / WinCairo build fix after Antoine's r276141.
Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (276151 => 276152)
--- trunk/Source/WebCore/DerivedSources-input.xcfilelist 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist 2021-04-16 19:19:04 UTC (rev 276152)
@@ -720,6 +720,7 @@
$(PROJECT_DIR)/crypto/parameters/RsaOaepParams.idl
$(PROJECT_DIR)/crypto/parameters/RsaPssParams.idl
$(PROJECT_DIR)/css/CSSConditionRule.idl
+$(PROJECT_DIR)/css/CSSCounterStyleRule.idl
$(PROJECT_DIR)/css/CSSFontFaceRule.idl
$(PROJECT_DIR)/css/CSSGroupingRule.idl
$(PROJECT_DIR)/css/CSSImportRule.idl
Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (276151 => 276152)
--- trunk/Source/WebCore/DerivedSources-output.xcfilelist 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist 2021-04-16 19:19:04 UTC (rev 276152)
@@ -283,6 +283,8 @@
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSAnimation.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSConditionRule.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSConditionRule.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSCounterStyleRule.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSCounterStyleRule.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSFontFaceRule.cpp
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSFontFaceRule.h
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSGroupingRule.cpp
Modified: trunk/Source/WebCore/DerivedSources.make (276151 => 276152)
--- trunk/Source/WebCore/DerivedSources.make 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/DerivedSources.make 2021-04-16 19:19:04 UTC (rev 276152)
@@ -617,6 +617,7 @@
$(WebCore)/crypto/parameters/RsaOaepParams.idl \
$(WebCore)/crypto/parameters/RsaPssParams.idl \
$(WebCore)/css/CSSConditionRule.idl \
+ $(WebCore)/css/CSSCounterStyleRule.idl \
$(WebCore)/css/CSSFontFaceRule.idl \
$(WebCore)/css/CSSGroupingRule.idl \
$(WebCore)/css/CSSImportRule.idl \
Modified: trunk/Source/WebCore/Sources.txt (276151 => 276152)
--- trunk/Source/WebCore/Sources.txt 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/Sources.txt 2021-04-16 19:19:04 UTC (rev 276152)
@@ -723,6 +723,7 @@
css/CSSComputedStyleDeclaration.cpp
css/CSSConditionRule.cpp
css/CSSContentDistributionValue.cpp
+css/CSSCounterStyleRule.cpp
css/CSSCrossfadeValue.cpp
css/CSSCursorImageValue.cpp
css/CSSCustomIdentValue.cpp
@@ -2835,6 +2836,7 @@
JSCDATASection.cpp
JSCSSAnimation.cpp
JSCSSConditionRule.cpp
+JSCSSCounterStyleRule.cpp
JSCSSFontFaceRule.cpp
JSCSSGroupingRule.cpp
JSCSSImportRule.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (276151 => 276152)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2021-04-16 19:19:04 UTC (rev 276152)
@@ -3090,6 +3090,7 @@
98CBC8052618F68C001593C8 /* SelectionRestorationMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 98CBC8032618F68B001593C8 /* SelectionRestorationMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
98CE432A129E00E5005821DC /* LinkLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 98CE4329129E00E5005821DC /* LinkLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
98EB1F951313FE0500D0E1EA /* NotImplemented.h in Headers */ = {isa = PBXBuildFile; fileRef = 98EB1F941313FE0500D0E1EA /* NotImplemented.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 98F9D66925FDE02200BD842D /* CSSCounterStyleRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 98F9D66825FDDFE800BD842D /* CSSCounterStyleRule.h */; settings = {ATTRIBUTES = (Private, ); }; };
9920398318B95BC600B39AF9 /* UserInputBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 9920398118B95BC600B39AF9 /* UserInputBridge.h */; settings = {ATTRIBUTES = (Private, ); }; };
994C603A253A277300BDF060 /* InspectorFrontendAPIDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 994C6037253A277200BDF060 /* InspectorFrontendAPIDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; };
996E59DF1DF0128D006612B9 /* NavigatorWebDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 996E59DC1DF00D90006612B9 /* NavigatorWebDriver.h */; };
@@ -12123,6 +12124,9 @@
98CE4325129E00BD005821DC /* LinkLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkLoader.cpp; sourceTree = "<group>"; };
98CE4329129E00E5005821DC /* LinkLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkLoader.h; sourceTree = "<group>"; };
98EB1F941313FE0500D0E1EA /* NotImplemented.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotImplemented.h; sourceTree = "<group>"; };
+ 98F9D66525FDDFE700BD842D /* CSSCounterStyleRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCounterStyleRule.cpp; sourceTree = "<group>"; };
+ 98F9D66725FDDFE800BD842D /* CSSCounterStyleRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSCounterStyleRule.idl; sourceTree = "<group>"; };
+ 98F9D66825FDDFE800BD842D /* CSSCounterStyleRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSCounterStyleRule.h; sourceTree = "<group>"; };
9908B0ED1BCACF9100ED0F65 /* ByteLengthQueuingStrategy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = ByteLengthQueuingStrategy.js; sourceTree = "<group>"; };
9908B0EE1BCACF9100ED0F65 /* CountQueuingStrategy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = CountQueuingStrategy.js; sourceTree = "<group>"; };
9908B0EF1BCACF9100ED0F65 /* ReadableStream.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = ReadableStream.js; sourceTree = "<group>"; };
@@ -29600,6 +29604,9 @@
930AAC99250EB8180013DA9F /* CSSConditionRule.idl */,
9DAC7C521AF2CAA100437C44 /* CSSContentDistributionValue.cpp */,
9DAC7C531AF2CAA100437C44 /* CSSContentDistributionValue.h */,
+ 98F9D66525FDDFE700BD842D /* CSSCounterStyleRule.cpp */,
+ 98F9D66825FDDFE800BD842D /* CSSCounterStyleRule.h */,
+ 98F9D66725FDDFE800BD842D /* CSSCounterStyleRule.idl */,
2D8FEBDA143E3EF70072502B /* CSSCrossfadeValue.cpp */,
2D8FEBDB143E3EF70072502B /* CSSCrossfadeValue.h */,
AA0978ED0ABAA6E100874480 /* CSSCursorImageValue.cpp */,
@@ -31958,6 +31965,7 @@
BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */,
930AAC9A250EB8490013DA9F /* CSSConditionRule.h in Headers */,
9DAC7C551AF2CAA200437C44 /* CSSContentDistributionValue.h in Headers */,
+ 98F9D66925FDE02200BD842D /* CSSCounterStyleRule.h in Headers */,
2D8FEBDD143E3EF70072502B /* CSSCrossfadeValue.h in Headers */,
AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */,
9444CBE41D8861990073A074 /* CSSCustomIdentValue.h in Headers */,
@@ -32115,6 +32123,7 @@
4162A451101145AE00DFF3ED /* DedicatedWorkerGlobalScope.h in Headers */,
41A3D58F101C152D00316D07 /* DedicatedWorkerThread.h in Headers */,
FD06DFA6134A4DEF006F5D7D /* DefaultAudioDestinationNode.h in Headers */,
+ E4F38D1B2626F13B007B1064 /* DefaultResourceLoadPriority.h in Headers */,
CD83D36221122A210076E11C /* DeferrableTask.h in Headers */,
FD31602C12B0267600C1A359 /* DelayDSPKernel.h in Headers */,
FD31602E12B0267600C1A359 /* DelayNode.h in Headers */,
@@ -34614,7 +34623,6 @@
B595FF471824CEE300FF51CD /* RenderIterator.h in Headers */,
BCEA487A097D93020094C9E4 /* RenderLayer.h in Headers */,
0F580CFF0F12DE9B0051D689 /* RenderLayerBacking.h in Headers */,
- E4F38D1B2626F13B007B1064 /* DefaultResourceLoadPriority.h in Headers */,
0F580CFD0F12DE9B0051D689 /* RenderLayerCompositor.h in Headers */,
3C244FEAA375AC633F88BE6F /* RenderLayerModelObject.h in Headers */,
0F53FB84213B7A6400C40D34 /* RenderLayerScrollableArea.h in Headers */,
Modified: trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp (276151 => 276152)
--- trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -26,6 +26,7 @@
#include "config.h"
#include "JSCSSRule.h"
+#include "CSSCounterStyleRule.h"
#include "CSSFontFaceRule.h"
#include "CSSImportRule.h"
#include "CSSKeyframeRule.h"
@@ -35,6 +36,7 @@
#include "CSSPageRule.h"
#include "CSSStyleRule.h"
#include "CSSSupportsRule.h"
+#include "JSCSSCounterStyleRule.h"
#include "JSCSSFontFaceRule.h"
#include "JSCSSImportRule.h"
#include "JSCSSKeyframeRule.h"
@@ -80,6 +82,8 @@
return createWrapper<CSSKeyframesRule>(globalObject, WTFMove(rule));
case CSSRule::SUPPORTS_RULE:
return createWrapper<CSSSupportsRule>(globalObject, WTFMove(rule));
+ case CSSRule::COUNTER_STYLE_RULE:
+ return createWrapper<CSSCounterStyleRule>(globalObject, WTFMove(rule));
default:
return createWrapper<CSSRule>(globalObject, WTFMove(rule));
}
Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (276151 => 276152)
--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -75,6 +75,7 @@
macro(Credential) \
macro(CredentialsContainer) \
macro(CSSAnimation) \
+ macro(CSSCounterStyleRule) \
macro(CSSImageValue) \
macro(CSSNumericValue) \
macro(CSSPaintSize) \
Added: trunk/Source/WebCore/css/CSSCounterStyleRule.cpp (0 => 276152)
--- trunk/Source/WebCore/css/CSSCounterStyleRule.cpp (rev 0)
+++ trunk/Source/WebCore/css/CSSCounterStyleRule.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2021 Tyler Wilcock <[email protected]>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CSSCounterStyleRule.h"
+
+namespace WebCore {
+
+StyleRuleCounterStyle::StyleRuleCounterStyle(const AtomString& name, Ref<StyleProperties>&& properties)
+ : StyleRuleBase(StyleRuleType::CounterStyle)
+ , m_name(name)
+ , m_properties(WTFMove(properties))
+{
+}
+
+Ref<StyleRuleCounterStyle> StyleRuleCounterStyle::create(const AtomString& name, Ref<StyleProperties>&& properties)
+{
+ return adoptRef(*new StyleRuleCounterStyle(name, WTFMove(properties)));
+}
+
+StyleRuleCounterStyle::~StyleRuleCounterStyle() = default;
+
+MutableStyleProperties& StyleRuleCounterStyle::mutableProperties()
+{
+ if (!is<MutableStyleProperties>(m_properties.get()))
+ m_properties = m_properties->mutableCopy();
+ return downcast<MutableStyleProperties>(m_properties.get());
+}
+
+Ref<CSSCounterStyleRule> CSSCounterStyleRule::create(StyleRuleCounterStyle& rule, CSSStyleSheet* sheet)
+{
+ return adoptRef(*new CSSCounterStyleRule(rule, sheet));
+}
+
+CSSCounterStyleRule::CSSCounterStyleRule(StyleRuleCounterStyle& counterStyleRule, CSSStyleSheet* parent)
+ : CSSRule(parent)
+ , m_counterStyleRule(counterStyleRule)
+{
+}
+
+CSSCounterStyleRule::~CSSCounterStyleRule() = default;
+
+String CSSCounterStyleRule::cssText() const
+{
+ // FIXME: Implement this function when we parse @counter-style descriptors.
+ return emptyString();
+}
+
+void CSSCounterStyleRule::reattach(StyleRuleBase& rule)
+{
+ m_counterStyleRule = static_cast<StyleRuleCounterStyle&>(rule);
+}
+
+} // namespace WebCore
Added: trunk/Source/WebCore/css/CSSCounterStyleRule.h (0 => 276152)
--- trunk/Source/WebCore/css/CSSCounterStyleRule.h (rev 0)
+++ trunk/Source/WebCore/css/CSSCounterStyleRule.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2021 Tyler Wilcock <[email protected]>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CSSRule.h"
+#include "StyleProperties.h"
+#include "StyleRule.h"
+#include <wtf/text/AtomString.h>
+
+namespace WebCore {
+
+class StyleRuleCounterStyle final : public StyleRuleBase {
+public:
+ static Ref<StyleRuleCounterStyle> create(const AtomString& name, Ref<StyleProperties>&&);
+ ~StyleRuleCounterStyle();
+
+ const StyleProperties& properties() const { return m_properties; }
+ MutableStyleProperties& mutableProperties();
+
+ const AtomString& name() const { return m_name; }
+
+private:
+ explicit StyleRuleCounterStyle(const AtomString&, Ref<StyleProperties>&&);
+
+ AtomString m_name;
+ Ref<StyleProperties> m_properties;
+};
+
+class CSSCounterStyleRule final : public CSSRule {
+public:
+ static Ref<CSSCounterStyleRule> create(StyleRuleCounterStyle&, CSSStyleSheet*);
+ virtual ~CSSCounterStyleRule();
+
+ String cssText() const final;
+ void reattach(StyleRuleBase&) final;
+ CSSRule::Type type() const final { return COUNTER_STYLE_RULE; }
+
+ String name() const { return m_counterStyleRule->name(); }
+ // FIXME: Implement after we parse @counter-style descriptors.
+ String system() const { return emptyString(); }
+ String negative() const { return emptyString(); }
+ String prefix() const { return emptyString(); }
+ String suffix() const { return emptyString(); }
+ String range() const { return emptyString(); }
+ String pad() const { return emptyString(); }
+ String fallback() const { return emptyString(); }
+ String symbols() const { return emptyString(); }
+ String additiveSymbols() const { return emptyString(); }
+ String speakAs() const { return emptyString(); }
+
+ // FIXME: Implement after we parse @counter-style descriptors.
+ void setName(const String&) { }
+ void setSystem(const String&) { }
+ void setNegative(const String&) { }
+ void setPrefix(const String&) { }
+ void setSuffix(const String&) { }
+ void setRange(const String&) { }
+ void setPad(const String&) { }
+ void setFallback(const String&) { }
+ void setSymbols(const String&) { }
+ void setAdditiveSymbols(const String&) { }
+ void setSpeakAs(const String&) { }
+
+private:
+ CSSCounterStyleRule(StyleRuleCounterStyle&, CSSStyleSheet* parent);
+
+ Ref<StyleRuleCounterStyle> m_counterStyleRule;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSCounterStyleRule, CSSRule::COUNTER_STYLE_RULE)
+
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleCounterStyle)
+static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isCounterStyleRule(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
Copied: trunk/Source/WebCore/css/CSSCounterStyleRule.idl (from rev 276149, trunk/Source/WebCore/css/StyleRuleType.h) (0 => 276152)
--- trunk/Source/WebCore/css/CSSCounterStyleRule.idl (rev 0)
+++ trunk/Source/WebCore/css/CSSCounterStyleRule.idl 2021-04-16 19:19:04 UTC (rev 276152)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2021 Tyler Wilcock <[email protected]>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// https://www.w3.org/TR/css-counter-styles-3/#the-csscounterstylerule-interface
+[
+ EnabledBySetting=CSSCounterStyleAtRules,
+ Exposed=Window
+] interface CSSCounterStyleRule : CSSRule {
+ attribute DOMString name;
+ attribute DOMString system;
+ attribute DOMString symbols;
+ attribute DOMString additiveSymbols;
+ attribute DOMString negative;
+ attribute DOMString prefix;
+ attribute DOMString suffix;
+ attribute DOMString range;
+ attribute DOMString pad;
+ attribute DOMString speakAs;
+ attribute DOMString fallback;
+};
Modified: trunk/Source/WebCore/css/CSSRule.cpp (276151 => 276152)
--- trunk/Source/WebCore/css/CSSRule.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/CSSRule.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -46,6 +46,7 @@
COMPILE_ASSERT(StyleRuleType::Keyframes == static_cast<StyleRuleType>(CSSRule::Type::KEYFRAMES_RULE), enums_should_match);
COMPILE_ASSERT(StyleRuleType::Keyframe == static_cast<StyleRuleType>(CSSRule::Type::KEYFRAME_RULE), enums_should_match);
COMPILE_ASSERT(StyleRuleType::Namespace == static_cast<StyleRuleType>(CSSRule::Type::NAMESPACE_RULE), enums_should_match);
+COMPILE_ASSERT(StyleRuleType::CounterStyle == static_cast<StyleRuleType>(CSSRule::Type::COUNTER_STYLE_RULE), enums_should_match);
COMPILE_ASSERT(StyleRuleType::Supports == static_cast<StyleRuleType>(CSSRule::Type::SUPPORTS_RULE), enums_should_match);
ExceptionOr<void> CSSRule::setCssText(const String&)
Modified: trunk/Source/WebCore/css/CSSRule.h (276151 => 276152)
--- trunk/Source/WebCore/css/CSSRule.h 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/CSSRule.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -36,6 +36,7 @@
public:
virtual ~CSSRule() = default;
+ // WebIDL enum
enum Type {
UNKNOWN_RULE,
STYLE_RULE,
@@ -48,7 +49,8 @@
KEYFRAME_RULE,
MARGIN_RULE,
NAMESPACE_RULE,
- SUPPORTS_RULE = 12,
+ COUNTER_STYLE_RULE,
+ SUPPORTS_RULE
};
enum DeprecatedType {
Modified: trunk/Source/WebCore/css/CSSRule.idl (276151 => 276152)
--- trunk/Source/WebCore/css/CSSRule.idl 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/CSSRule.idl 2021-04-16 19:19:04 UTC (rev 276152)
@@ -42,6 +42,7 @@
const unsigned short KEYFRAME_RULE = 8;
const unsigned short MARGIN_RULE = 9;
const unsigned short NAMESPACE_RULE = 10;
+ [EnabledBySetting=CSSCounterStyleAtRules] const unsigned short COUNTER_STYLE_RULE = 11;
const unsigned short SUPPORTS_RULE = 12;
// Legacy synonyms for the above, kept to avoid breaking existing content.
Modified: trunk/Source/WebCore/css/StyleRule.cpp (276151 => 276152)
--- trunk/Source/WebCore/css/StyleRule.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/StyleRule.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -22,6 +22,7 @@
#include "config.h"
#include "StyleRule.h"
+#include "CSSCounterStyleRule.h"
#include "CSSDeferredParser.h"
#include "CSSFontFaceRule.h"
#include "CSSImportRule.h"
@@ -90,6 +91,9 @@
case StyleRuleType::Charset:
delete downcast<StyleRuleCharset>(this);
return;
+ case StyleRuleType::CounterStyle:
+ delete downcast<StyleRuleCounterStyle>(this);
+ return;
case StyleRuleType::Unknown:
ASSERT_NOT_REACHED();
return;
@@ -112,6 +116,8 @@
return downcast<StyleRuleSupports>(*this).copy();
case StyleRuleType::Keyframes:
return downcast<StyleRuleKeyframes>(*this).copy();
+ case StyleRuleType::CounterStyle:
+ return downcast<StyleRuleCounterStyle>(*this).copy();
case StyleRuleType::Import:
case StyleRuleType::Namespace:
// FIXME: Copy import and namespace rules.
@@ -153,6 +159,9 @@
case StyleRuleType::Namespace:
rule = CSSNamespaceRule::create(downcast<StyleRuleNamespace>(self), parentSheet);
break;
+ case StyleRuleType::CounterStyle:
+ rule = CSSCounterStyleRule::create(downcast<StyleRuleCounterStyle>(self), parentSheet);
+ break;
case StyleRuleType::Unknown:
case StyleRuleType::Charset:
case StyleRuleType::Keyframe:
Modified: trunk/Source/WebCore/css/StyleRule.h (276151 => 276152)
--- trunk/Source/WebCore/css/StyleRule.h 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/StyleRule.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -47,6 +47,7 @@
StyleRuleType type() const { return static_cast<StyleRuleType>(m_type); }
bool isCharsetRule() const { return type() == StyleRuleType::Charset; }
+ bool isCounterStyleRule() const { return type() == StyleRuleType::CounterStyle; }
bool isFontFaceRule() const { return type() == StyleRuleType::FontFace; }
bool isKeyframesRule() const { return type() == StyleRuleType::Keyframes; }
bool isKeyframeRule() const { return type() == StyleRuleType::Keyframe; }
Modified: trunk/Source/WebCore/css/StyleRuleType.h (276151 => 276152)
--- trunk/Source/WebCore/css/StyleRuleType.h 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/StyleRuleType.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -38,6 +38,7 @@
Keyframes,
Keyframe, // Not used. These are internally non-rule StyleRuleKeyframe objects.
Namespace = 10,
+ CounterStyle = 11,
Supports = 12,
};
Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (276151 => 276152)
--- trunk/Source/WebCore/css/StyleSheetContents.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -444,6 +444,7 @@
case StyleRuleType::Namespace:
case StyleRuleType::Unknown:
case StyleRuleType::Charset:
+ case StyleRuleType::CounterStyle:
case StyleRuleType::Keyframe:
case StyleRuleType::Supports:
break;
@@ -478,6 +479,8 @@
if (auto* cachedResource = downcast<StyleRuleImport>(rule).cachedCSSStyleSheet())
return handler(*cachedResource);
return false;
+ case StyleRuleType::CounterStyle:
+ return m_parserContext.counterStyleAtRuleImageSymbolsEnabled;
case StyleRuleType::Media:
case StyleRuleType::Page:
case StyleRuleType::Keyframes:
Modified: trunk/Source/WebCore/css/parser/CSSAtRuleID.cpp (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSAtRuleID.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSAtRuleID.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -56,6 +56,8 @@
return CSSAtRuleWebkitKeyframes;
if (equalIgnoringASCIICase(name, "apply"))
return CSSAtRuleApply;
+ if (equalIgnoringASCIICase(name, "counter-style"))
+ return CSSAtRuleCounterStyle;
return CSSAtRuleInvalid;
}
Modified: trunk/Source/WebCore/css/parser/CSSAtRuleID.h (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSAtRuleID.h 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSAtRuleID.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -47,6 +47,7 @@
CSSAtRuleWebkitKeyframes = 10,
CSSAtRuleApply = 11,
+ CSSAtRuleCounterStyle = 12,
};
CSSAtRuleID cssAtRuleID(StringView name);
Modified: trunk/Source/WebCore/css/parser/CSSParserContext.cpp (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSParserContext.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -73,6 +73,8 @@
, colorMixEnabled { document.settings().cssColorMixEnabled() }
, constantPropertiesEnabled { document.settings().constantPropertiesEnabled() }
, containmentEnabled { document.settings().cssContainmentEnabled() }
+ , counterStyleAtRulesEnabled { document.settings().cssCounterStyleAtRulesEnabled() }
+ , counterStyleAtRuleImageSymbolsEnabled { document.settings().cssCounterStyleAtRuleImageSymbolsEnabled() }
, cssColor4 { document.settings().cssColor4() }
, deferredCSSParserEnabled { document.settings().deferredCSSParserEnabled() }
, individualTransformPropertiesEnabled { document.settings().cssIndividualTransformPropertiesEnabled() }
@@ -113,6 +115,8 @@
&& a.colorMixEnabled == b.colorMixEnabled
&& a.constantPropertiesEnabled == b.constantPropertiesEnabled
&& a.containmentEnabled == b.containmentEnabled
+ && a.counterStyleAtRulesEnabled == b.counterStyleAtRulesEnabled
+ && a.counterStyleAtRuleImageSymbolsEnabled == b.counterStyleAtRuleImageSymbolsEnabled
&& a.cssColor4 == b.cssColor4
&& a.deferredCSSParserEnabled == b.deferredCSSParserEnabled
&& a.individualTransformPropertiesEnabled == b.individualTransformPropertiesEnabled
Modified: trunk/Source/WebCore/css/parser/CSSParserContext.h (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSParserContext.h 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -60,6 +60,8 @@
bool colorMixEnabled { false };
bool constantPropertiesEnabled { false };
bool containmentEnabled { false };
+ bool counterStyleAtRulesEnabled { false };
+ bool counterStyleAtRuleImageSymbolsEnabled { false };
bool cssColor4 { false };
bool deferredCSSParserEnabled { false };
bool individualTransformPropertiesEnabled { false };
Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -35,6 +35,7 @@
#include "CSSParserIdioms.h"
#include "CSSPrimitiveValue.h"
#include "CSSPropertyParser.h"
+#include "CSSPropertyParserHelpers.h"
#include "CSSValueList.h"
#include "CSSValuePool.h"
#include "HTMLParserIdioms.h"
@@ -661,7 +662,7 @@
case CSSPropertyListStyleType:
// See section CSS_PROP_LIST_STYLE_TYPE of file CSSValueKeywords.in
// for the list of supported list-style-types.
- return (valueID >= CSSValueDisc && valueID <= CSSValueKatakanaIroha) || valueID == CSSValueNone;
+ return CSSPropertyParserHelpers::isPredefinedCounterStyle(valueID) || valueID == CSSValueNone;
case CSSPropertyMaskType:
return valueID == CSSValueLuminance || valueID == CSSValueAlpha;
case CSSPropertyMathStyle:
Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.cpp (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSParserImpl.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -31,6 +31,7 @@
#include "CSSParserImpl.h"
#include "CSSAtRuleID.h"
+#include "CSSCounterStyleRule.h"
#include "CSSCustomPropertyValue.h"
#include "CSSDeferredParser.h"
#include "CSSKeyframeRule.h"
@@ -337,7 +338,7 @@
static CSSParserImpl::AllowedRulesType computeNewAllowedRules(CSSParserImpl::AllowedRulesType allowedRules, StyleRuleBase* rule)
{
- if (!rule || allowedRules == CSSParserImpl::KeyframeRules || allowedRules == CSSParserImpl::NoRules)
+ if (!rule || allowedRules == CSSParserImpl::KeyframeRules || allowedRules == CSSParserImpl::CounterStyleRules || allowedRules == CSSParserImpl::NoRules)
return allowedRules;
ASSERT(allowedRules <= CSSParserImpl::RegularRules);
if (rule->isCharsetRule() || rule->isImportRule())
@@ -448,6 +449,8 @@
return consumeKeyframesRule(false, prelude, block);
case CSSAtRulePage:
return consumePageRule(prelude, block);
+ case CSSAtRuleCounterStyle:
+ return consumeCounterStyleRule(prelude, block);
default:
return nullptr; // Parse error, unrecognised at-rule with block
}
@@ -652,6 +655,27 @@
return StyleRulePage::create(createStyleProperties(m_parsedProperties, m_context.mode), WTFMove(selectorList));
}
+RefPtr<StyleRuleCounterStyle> CSSParserImpl::consumeCounterStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block)
+{
+ if (!m_context.counterStyleAtRulesEnabled)
+ return nullptr;
+
+ auto rangeCopy = prelude; // For inspector callbacks
+ auto name = CSSPropertyParserHelpers::consumeCounterStyleNameInPrelude(rangeCopy);
+ if (name.isNull())
+ return nullptr;
+
+ if (m_observerWrapper) {
+ m_observerWrapper->observer().startRuleHeader(StyleRuleType::CounterStyle, m_observerWrapper->startOffset(rangeCopy));
+ m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude));
+ m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(block));
+ m_observerWrapper->observer().endRuleBody(m_observerWrapper->endOffset(block));
+ }
+
+ consumeDeclarationList(block, StyleRuleType::CounterStyle);
+ return StyleRuleCounterStyle::create(name, createStyleProperties(m_parsedProperties, m_context.mode));
+}
+
// FIXME-NEWPARSER: Support "apply"
/*void CSSParserImpl::consumeApplyRule(CSSParserTokenRange prelude)
{
@@ -728,7 +752,7 @@
{
ASSERT(m_parsedProperties.isEmpty());
- bool useObserver = m_observerWrapper && (ruleType == StyleRuleType::Style || ruleType == StyleRuleType::Keyframe);
+ bool useObserver = m_observerWrapper && (ruleType == StyleRuleType::Style || ruleType == StyleRuleType::Keyframe || ruleType == StyleRuleType::CounterStyle);
if (useObserver) {
m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(range));
m_observerWrapper->skipCommentsBefore(range, true);
@@ -810,7 +834,7 @@
consumeCustomPropertyValue(range.makeSubRange(&range.peek(), declarationValueEnd), variableName, important);
}
- if (important && (ruleType == StyleRuleType::FontFace || ruleType == StyleRuleType::Keyframe))
+ if (important && (ruleType == StyleRuleType::FontFace || ruleType == StyleRuleType::Keyframe || ruleType == StyleRuleType::CounterStyle))
return;
if (propertyID != CSSPropertyInvalid)
Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.h (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSParserImpl.h 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -45,6 +45,7 @@
class CSSParserObserverWrapper;
class CSSSelectorList;
class CSSTokenizer;
+class StyleRuleCounterStyle;
class StyleRuleKeyframe;
class StyleRule;
class StyleRuleBase;
@@ -79,6 +80,7 @@
RegularRules,
KeyframeRules,
ApplyRules, // For @apply inside style rules
+ CounterStyleRules,
NoRules, // For parsing at-rules inside declaration lists
};
@@ -132,6 +134,7 @@
RefPtr<StyleRuleFontFace> consumeFontFaceRule(CSSParserTokenRange prelude, CSSParserTokenRange block);
RefPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitPrefixed, CSSParserTokenRange prelude, CSSParserTokenRange block);
RefPtr<StyleRulePage> consumePageRule(CSSParserTokenRange prelude, CSSParserTokenRange block);
+ RefPtr<StyleRuleCounterStyle> consumeCounterStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block);
// FIXME-NEWPARSER: Support "apply"
// void consumeApplyRule(CSSParserTokenRange prelude);
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -234,6 +234,8 @@
if (ruleType == StyleRuleType::FontFace)
parseSuccess = parser.parseFontFaceDescriptor(propertyID);
+ else if (ruleType == StyleRuleType::CounterStyle)
+ parseSuccess = parser.parseCounterStyleDescriptor(propertyID, context);
else
parseSuccess = parser.parseValueStart(propertyID, important);
@@ -2242,7 +2244,7 @@
RefPtr<CSSPrimitiveValue> listStyle;
if (consumeCommaIncludingWhitespace(args)) {
CSSValueID id = args.peek().id();
- if ((id != CSSValueNone && (id < CSSValueDisc || id > CSSValueKatakanaIroha)))
+ if ((id != CSSValueNone && !isPredefinedCounterStyle(id)))
return nullptr;
listStyle = consumeIdent(args);
} else
@@ -4434,6 +4436,27 @@
return nullptr;
}
+RefPtr<CSSValue> CSSPropertyParser::parseCounterStyleDescriptor(CSSPropertyID propId, CSSParserTokenRange& range, const CSSParserContext& context)
+{
+ if (!context.counterStyleAtRulesEnabled)
+ return nullptr;
+ // FIXME: Implement this function when we can parse @counter-style descriptors.
+ UNUSED_PARAM(propId);
+ UNUSED_PARAM(range);
+ UNUSED_PARAM(context);
+ return nullptr;
+}
+
+bool CSSPropertyParser::parseCounterStyleDescriptor(CSSPropertyID propId, const CSSParserContext& context)
+{
+ auto parsedValue = parseCounterStyleDescriptor(propId, m_range, context);
+ if (!parsedValue || !m_range.atEnd())
+ return false;
+
+ addProperty(propId, CSSPropertyInvalid, *parsedValue, false);
+ return true;
+}
+
bool CSSPropertyParser::parseFontFaceDescriptor(CSSPropertyID propId)
{
RefPtr<CSSValue> parsedValue;
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.h (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSPropertyParser.h 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -56,6 +56,8 @@
static RefPtr<CSSCustomPropertyValue> parseTypedCustomPropertyValue(const String& name, const String& syntax, const CSSParserTokenRange&, const Style::BuilderState&, const CSSParserContext&);
static void collectParsedCustomPropertyValueDependencies(const String& syntax, bool isRoot, HashSet<CSSPropertyID>& dependencies, const CSSParserTokenRange&, const CSSParserContext&);
+ static RefPtr<CSSValue> parseCounterStyleDescriptor(CSSPropertyID, CSSParserTokenRange&, const CSSParserContext&);
+
private:
CSSPropertyParser(const CSSParserTokenRange&, const CSSParserContext&, Vector<CSSProperty, 256>*, bool consumeWhitespace = true);
@@ -71,6 +73,7 @@
bool parseViewportDescriptor(CSSPropertyID propId, bool important);
bool parseFontFaceDescriptor(CSSPropertyID);
+ bool parseCounterStyleDescriptor(CSSPropertyID, const CSSParserContext&);
void addProperty(CSSPropertyID, CSSPropertyID, Ref<CSSValue>&&, bool important, bool implicit = false);
void addExpandedPropertyForValue(CSSPropertyID propId, Ref<CSSValue>&&, bool);
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -670,11 +670,12 @@
// FIXME-NEWPARSER: Eventually we'd like this to use CSSCustomIdentValue, but we need
// to do other plumbing work first (like changing Pair to CSSValuePair and make it not
// use only primitive values).
-RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange& range)
+RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange& range, bool shouldLowercase)
{
if (range.peek().type() != IdentToken || isCSSWideKeyword(range.peek().id()))
return nullptr;
- return CSSValuePool::singleton().createValue(range.consumeIncludingWhitespace().value().toString(), CSSUnitType::CSS_STRING);
+ auto identifier = range.consumeIncludingWhitespace().value();
+ return CSSValuePool::singleton().createValue(shouldLowercase ? identifier.convertToASCIILowercase() : identifier.toString(), CSSUnitType::CSS_STRING);
}
RefPtr<CSSPrimitiveValue> consumeString(CSSParserTokenRange& range)
@@ -2930,6 +2931,43 @@
return nullptr;
}
+// https://www.w3.org/TR/css-counter-styles-3/#predefined-counters
+bool isPredefinedCounterStyle(CSSValueID valueID)
+{
+ return valueID >= CSSValueDisc && valueID <= CSSValueKatakanaIroha;
+}
+
+// https://www.w3.org/TR/css-counter-styles-3/#typedef-counter-style-name
+RefPtr<CSSPrimitiveValue> consumeCounterStyleName(CSSParserTokenRange& range)
+{
+ // <counter-style-name> is a <custom-ident> that is not an ASCII case-insensitive match for "none".
+ auto valueID = range.peek().id();
+ if (valueID == CSSValueNone)
+ return nullptr;
+ // If the value is an ASCII case-insensitive match for any of the predefined counter styles, lowercase it.
+ if (auto name = consumeCustomIdent(range, isPredefinedCounterStyle(valueID)))
+ return name;
+ return nullptr;
+}
+
+// https://www.w3.org/TR/css-counter-styles-3/#typedef-counter-style-name
+AtomString consumeCounterStyleNameInPrelude(CSSParserTokenRange& prelude)
+{
+ auto nameToken = prelude.consumeIncludingWhitespace();
+ if (!prelude.atEnd())
+ return AtomString();
+ // Ensure this token is a valid <custom-ident>.
+ if (nameToken.type() != IdentToken || isCSSWideKeyword(nameToken.id()))
+ return AtomString();
+ // In the context of the prelude of an @counter-style rule, a <counter-style-name> must not be an ASCII
+ // case-insensitive match for "decimal" or "disc". No <counter-style-name>, prelude or not, may be an ASCII
+ // case-insensitive match for "none".
+ if (identMatches<CSSValueDecimal, CSSValueDisc, CSSValueNone>(nameToken.id()))
+ return AtomString();
+ auto name = nameToken.value();
+ return isPredefinedCounterStyle(nameToken.id()) ? name.convertToASCIILowercase() : name.toString();
+}
+
Optional<CSSValueID> consumeFontVariantCSS21Raw(CSSParserTokenRange& range)
{
return consumeIdentRaw<CSSValueNormal, CSSValueSmallCaps>(range);
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h (276151 => 276152)
--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h 2021-04-16 19:19:04 UTC (rev 276152)
@@ -106,7 +106,7 @@
template<CSSValueID... allowedIdents> RefPtr<CSSPrimitiveValue> consumeIdent(CSSParserTokenRange&);
template<CSSValueID... allowedIdents> RefPtr<CSSPrimitiveValue> consumeIdentWorkerSafe(CSSParserTokenRange&, CSSValuePool&);
-RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange&);
+RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange&, bool shouldLowercase = false);
RefPtr<CSSPrimitiveValue> consumeString(CSSParserTokenRange&);
StringView consumeUrlAsStringView(CSSParserTokenRange&);
RefPtr<CSSPrimitiveValue> consumeUrl(CSSParserTokenRange&);
@@ -165,6 +165,10 @@
Vector<FontFamilyRaw> family;
};
+bool isPredefinedCounterStyle(CSSValueID);
+RefPtr<CSSPrimitiveValue> consumeCounterStyleName(CSSParserTokenRange&);
+AtomString consumeCounterStyleNameInPrelude(CSSParserTokenRange&);
+
Optional<CSSValueID> consumeFontVariantCSS21Raw(CSSParserTokenRange&);
Optional<CSSValueID> consumeFontWeightKeywordValueRaw(CSSParserTokenRange&);
Optional<FontWeightRaw> consumeFontWeightRaw(CSSParserTokenRange&);
Modified: trunk/Tools/ChangeLog (276151 => 276152)
--- trunk/Tools/ChangeLog 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Tools/ChangeLog 2021-04-16 19:19:04 UTC (rev 276152)
@@ -1,3 +1,15 @@
+2021-04-16 Tyler Wilcock <[email protected]>
+
+ [css-counter-styles] Parse and add feature flag for @counter-style
+ https://bugs.webkit.org/show_bug.cgi?id=223150
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/TestOptions.cpp:
+ (WTR::TestOptions::defaults):
+ Add `false` defaults for CSSCounterStyleAtRulesEnabled and
+ CSSCounterStyleAtRuleImageSymbolsEnabled flags.
+
2021-04-16 Chris Dumez <[email protected]>
Exit the GPUProcess when under memory pressure if it is not being used
Modified: trunk/Tools/DumpRenderTree/TestOptions.cpp (276151 => 276152)
--- trunk/Tools/DumpRenderTree/TestOptions.cpp 2021-04-16 19:04:10 UTC (rev 276151)
+++ trunk/Tools/DumpRenderTree/TestOptions.cpp 2021-04-16 19:19:04 UTC (rev 276152)
@@ -133,6 +133,8 @@
{ "AsyncClipboardAPIEnabled", false },
{ "AttachmentElementEnabled", false },
{ "CSSContainmentEnabled", false },
+ { "CSSCounterStyleAtRuleEnabled", false },
+ { "CSSCounterStyleAtRuleImageSymbolsEnabled", false },
{ "CSSLogicalEnabled", false },
{ "CSSOMViewSmoothScrollingEnabled", false },
{ "ColorFilterEnabled", false },