Changeset 276152 in webkit
- Timestamp:
- Apr 16, 2021, 12:19:04 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 45 edited
- 1 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/idlharness-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt (modified) (1 diff)
-
LayoutTests/webexposed (added)
-
LayoutTests/webexposed/counter-style-is-not-exposed-expected.txt (added)
-
LayoutTests/webexposed/counter-style-is-not-exposed.html (added)
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (modified) (1 diff)
-
Source/WebCore/CMakeLists.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/DerivedSources-input.xcfilelist (modified) (1 diff)
-
Source/WebCore/DerivedSources-output.xcfilelist (modified) (1 diff)
-
Source/WebCore/DerivedSources.make (modified) (1 diff)
-
Source/WebCore/Sources.txt (modified) (2 diffs)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (6 diffs)
-
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/js/WebCoreBuiltinNames.h (modified) (1 diff)
-
Source/WebCore/css/CSSCounterStyleRule.cpp (added)
-
Source/WebCore/css/CSSCounterStyleRule.h (added)
-
Source/WebCore/css/CSSCounterStyleRule.idl (copied) (copied from trunk/Source/WebCore/css/StyleRuleType.h ) (2 diffs)
-
Source/WebCore/css/CSSRule.cpp (modified) (1 diff)
-
Source/WebCore/css/CSSRule.h (modified) (2 diffs)
-
Source/WebCore/css/CSSRule.idl (modified) (1 diff)
-
Source/WebCore/css/StyleRule.cpp (modified) (4 diffs)
-
Source/WebCore/css/StyleRule.h (modified) (1 diff)
-
Source/WebCore/css/StyleRuleType.h (modified) (1 diff)
-
Source/WebCore/css/StyleSheetContents.cpp (modified) (2 diffs)
-
Source/WebCore/css/parser/CSSAtRuleID.cpp (modified) (1 diff)
-
Source/WebCore/css/parser/CSSAtRuleID.h (modified) (1 diff)
-
Source/WebCore/css/parser/CSSParserContext.cpp (modified) (2 diffs)
-
Source/WebCore/css/parser/CSSParserContext.h (modified) (1 diff)
-
Source/WebCore/css/parser/CSSParserFastPaths.cpp (modified) (2 diffs)
-
Source/WebCore/css/parser/CSSParserImpl.cpp (modified) (6 diffs)
-
Source/WebCore/css/parser/CSSParserImpl.h (modified) (3 diffs)
-
Source/WebCore/css/parser/CSSPropertyParser.cpp (modified) (3 diffs)
-
Source/WebCore/css/parser/CSSPropertyParser.h (modified) (2 diffs)
-
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (modified) (2 diffs)
-
Source/WebCore/css/parser/CSSPropertyParserHelpers.h (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/TestOptions.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276135 r276152 1 2021-04-16 Tyler Wilcock <twilco.o@protonmail.com> 2 3 [css-counter-styles] Parse and add feature flag for @counter-style 4 https://bugs.webkit.org/show_bug.cgi?id=223150 5 6 Reviewed by Darin Adler. 7 8 Add tests ensuring @counter-style is not exposed when feature flag is 9 disabled. 10 11 * webexposed/counter-style-is-not-exposed-expected.txt: Added. 12 * webexposed/counter-style-is-not-exposed.html: Added. 13 1 14 2021-04-16 Zalan Bujtas <zalan@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/ChangeLog
r276138 r276152 1 2021-04-16 Tyler Wilcock <twilco.o@protonmail.com> 2 3 [css-counter-styles] Parse and add feature flag for @counter-style 4 https://bugs.webkit.org/show_bug.cgi?id=223150 5 6 Reviewed by Darin Adler. 7 8 @counter-style and its descriptors are now exposed behind a feature 9 flag, so pass some tests and fail others for a different reason 10 because this patch doesn't actually implement descriptor parsing and 11 setting yet. 12 13 * web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt: 14 * web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt: 15 * web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt: 16 * web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt: 17 * web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt: 18 * web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt: 19 * web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt: 20 * web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt: 21 * web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt: 22 * web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt: 23 * web-platform-tests/css/css-counter-styles/idlharness-expected.txt: 24 * web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt: 25 1 26 2021-04-16 Antoine Quint <graouts@webkit.org> 2 27 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt
r273065 r276152 1 1 2 FAIL @counter-style 'additive-symbols: 1 "X"' is valid assert_ equals: expected (undefined) undefined but got (string) "1 \"X\""3 FAIL @counter-style 'additive-symbols: "X" 1' is valid assert_ equals: expected (undefined) undefined but got (string) "1 \"X\""4 FAIL @counter-style 'additive-symbols: 5 "V", 1 "I"' is valid assert_ equals: expected (undefined) undefined but got (string) "5 \"V\", 1 \"I\""2 FAIL @counter-style 'additive-symbols: 1 "X"' is valid assert_not_equals: got disallowed value -1 3 FAIL @counter-style 'additive-symbols: "X" 1' is valid assert_not_equals: got disallowed value -1 4 FAIL @counter-style 'additive-symbols: 5 "V", 1 "I"' is valid assert_not_equals: got disallowed value -1 5 5 PASS @counter-style 'additive-symbols: ' is invalid 6 6 PASS @counter-style 'additive-symbols: -1 "X"' is invalid -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt
r273065 r276152 1 1 2 FAIL @counter-style 'fallback: bar' is valid assert_ equals: expected (undefined) undefined but got (string) "bar"2 FAIL @counter-style 'fallback: bar' is valid assert_not_equals: got disallowed value -1 3 3 PASS @counter-style 'fallback: "bar"' is invalid 4 4 PASS @counter-style 'fallback: none' is invalid -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt
r273065 r276152 1 1 2 FAIL @counter-style name foo is valid assert_not_equals: got disallowed value undefined2 PASS @counter-style name foo is valid 3 3 PASS @counter-style name is invalid 4 4 PASS @counter-style name none is invalid -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt
r273065 r276152 1 1 2 FAIL @counter-style 'negative: "X"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"X\""3 FAIL @counter-style 'negative: "X" "X"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"X\" \"X\""2 FAIL @counter-style 'negative: "X"' is valid assert_not_equals: got disallowed value -1 3 FAIL @counter-style 'negative: "X" "X"' is valid assert_not_equals: got disallowed value -1 4 4 PASS @counter-style 'negative: "X" "X" "X"' is invalid 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt
r273065 r276152 2 2 PASS @counter-style 'pad: 10' is invalid 3 3 PASS @counter-style 'pad: "X"' is invalid 4 FAIL @counter-style 'pad: 10 "X"' is valid assert_ equals: expected (undefined) undefined but got (string) "10 \"X\""5 FAIL @counter-style 'pad: "X" 10' is valid assert_ equals: expected (undefined) undefined but got (string) "10 \"X\""4 FAIL @counter-style 'pad: 10 "X"' is valid assert_not_equals: got disallowed value -1 5 FAIL @counter-style 'pad: "X" 10' is valid assert_not_equals: got disallowed value -1 6 6 PASS @counter-style 'pad: -1 "X"' is invalid 7 7 PASS @counter-style 'pad: "X" -1' is invalid -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt
r273065 r276152 1 1 2 FAIL @counter-style 'prefix: "string"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"string\""3 FAIL @counter-style 'suffix: "string"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"string\""4 FAIL @counter-style 'prefix: "initial"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"initial\""5 FAIL @counter-style 'suffix: "initial"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"initial\""6 FAIL @counter-style 'prefix: "inherit"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"inherit\""7 FAIL @counter-style 'suffix: "inherit"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"inherit\""8 FAIL @counter-style 'prefix: "unset"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"unset\""9 FAIL @counter-style 'suffix: "unset"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"unset\""10 FAIL @counter-style 'prefix: custom-ident' is valid assert_ equals: expected (undefined) undefined but got (string) "custom-ident"11 FAIL @counter-style 'suffix: custom-ident' is valid assert_ equals: expected (undefined) undefined but got (string) "custom-ident"2 FAIL @counter-style 'prefix: "string"' is valid assert_not_equals: got disallowed value -1 3 FAIL @counter-style 'suffix: "string"' is valid assert_not_equals: got disallowed value -1 4 FAIL @counter-style 'prefix: "initial"' is valid assert_not_equals: got disallowed value -1 5 FAIL @counter-style 'suffix: "initial"' is valid assert_not_equals: got disallowed value -1 6 FAIL @counter-style 'prefix: "inherit"' is valid assert_not_equals: got disallowed value -1 7 FAIL @counter-style 'suffix: "inherit"' is valid assert_not_equals: got disallowed value -1 8 FAIL @counter-style 'prefix: "unset"' is valid assert_not_equals: got disallowed value -1 9 FAIL @counter-style 'suffix: "unset"' is valid assert_not_equals: got disallowed value -1 10 FAIL @counter-style 'prefix: custom-ident' is valid assert_not_equals: got disallowed value -1 11 FAIL @counter-style 'suffix: custom-ident' is valid assert_not_equals: got disallowed value -1 12 12 PASS @counter-style 'prefix: initial' is invalid 13 13 PASS @counter-style 'suffix: initial' is invalid … … 16 16 PASS @counter-style 'prefix: unset' is invalid 17 17 PASS @counter-style 'suffix: unset' is invalid 18 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\")"19 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\")"20 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\")"21 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\")"22 FAIL @counter-style 'prefix: linear-gradient(yellow, blue)' is valid assert_ equals: expected (undefined) undefined but got (string) "linear-gradient(yellow, blue)"23 FAIL @counter-style 'suffix: linear-gradient(yellow, blue)' is valid assert_ equals: expected (undefined) undefined but got (string) "linear-gradient(yellow, blue)"18 FAIL @counter-style 'prefix: url("https://example.com/foo.png")' is valid assert_not_equals: got disallowed value -1 19 FAIL @counter-style 'suffix: url("https://example.com/foo.png")' is valid assert_not_equals: got disallowed value -1 20 FAIL @counter-style 'prefix: url(https://example.com/foo.png)' is valid assert_not_equals: got disallowed value -1 21 FAIL @counter-style 'suffix: url(https://example.com/foo.png)' is valid assert_not_equals: got disallowed value -1 22 FAIL @counter-style 'prefix: linear-gradient(yellow, blue)' is valid assert_not_equals: got disallowed value -1 23 FAIL @counter-style 'suffix: linear-gradient(yellow, blue)' is valid assert_not_equals: got disallowed value -1 24 24 PASS @counter-style 'prefix: ' is invalid 25 25 PASS @counter-style 'suffix: ' is invalid -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt
r273065 r276152 1 1 2 FAIL @counter-style 'range: auto' is valid assert_ equals: expected (undefined) undefined but got (string) "auto"3 FAIL @counter-style 'range: infinite infinite' is valid assert_ equals: expected (undefined) undefined but got (string) "infinite infinite"4 FAIL @counter-style 'range: infinite 0' is valid assert_ equals: expected (undefined) undefined but got (string) "infinite 0"5 FAIL @counter-style 'range: 0 infinite' is valid assert_ equals: expected (undefined) undefined but got (string) "0 infinite"6 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"7 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"2 FAIL @counter-style 'range: auto' is valid assert_not_equals: got disallowed value -1 3 FAIL @counter-style 'range: infinite infinite' is valid assert_not_equals: got disallowed value -1 4 FAIL @counter-style 'range: infinite 0' is valid assert_not_equals: got disallowed value -1 5 FAIL @counter-style 'range: 0 infinite' is valid assert_not_equals: got disallowed value -1 6 FAIL @counter-style 'range: infinite 0, 5 10, 100 infinite' is valid assert_not_equals: got disallowed value -1 7 FAIL @counter-style 'range: infinite 10, 5 20, 15 infinite' is valid assert_not_equals: got disallowed value -1 8 8 PASS @counter-style 'range: ' is invalid 9 9 PASS @counter-style 'range: 0 -1' is invalid -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt
r273065 r276152 1 1 2 FAIL @counter-style 'speak-as: auto' is valid assert_ equals: expected (undefined) undefined but got (string) "auto"3 FAIL @counter-style 'speak-as: bullets' is valid assert_ equals: expected (undefined) undefined but got (string) "bullets"4 FAIL @counter-style 'speak-as: numbers' is valid assert_ equals: expected (undefined) undefined but got (string) "numbers"5 FAIL @counter-style 'speak-as: words' is valid assert_ equals: expected (undefined) undefined but got (string) "words"6 FAIL @counter-style 'speak-as: spell-out' is valid assert_ equals: expected (undefined) undefined but got (string) "spell-out"7 FAIL @counter-style 'speak-as: bar' is valid assert_ equals: expected (undefined) undefined but got (string) "bar"8 FAIL @counter-style 'speak-as: spellout' is valid assert_ equals: expected (undefined) undefined but got (string) "spellout"2 FAIL @counter-style 'speak-as: auto' is valid assert_not_equals: got disallowed value -1 3 FAIL @counter-style 'speak-as: bullets' is valid assert_not_equals: got disallowed value -1 4 FAIL @counter-style 'speak-as: numbers' is valid assert_not_equals: got disallowed value -1 5 FAIL @counter-style 'speak-as: words' is valid assert_not_equals: got disallowed value -1 6 FAIL @counter-style 'speak-as: spell-out' is valid assert_not_equals: got disallowed value -1 7 FAIL @counter-style 'speak-as: bar' is valid assert_not_equals: got disallowed value -1 8 FAIL @counter-style 'speak-as: spellout' is valid assert_not_equals: got disallowed value -1 9 9 PASS @counter-style 'speak-as: bullets numbers' is invalid 10 10 PASS @counter-style 'speak-as: none' is invalid -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt
r273065 r276152 1 1 2 FAIL @counter-style 'symbols: "X"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"X\""3 FAIL @counter-style 'symbols: "X" "X"' is valid assert_ equals: expected (undefined) undefined but got (string) "\"X\" \"X\""4 FAIL @counter-style 'symbols: ident "X"' is valid assert_ equals: expected (undefined) undefined but got (string) "ident \"X\""5 FAIL @counter-style 'symbols: ident "X" url("foo.jpg")' is valid assert_ equals: expected (undefined) undefined but got (string) "ident \"X\" url(\"foo.jpg\")"2 FAIL @counter-style 'symbols: "X"' is valid assert_not_equals: got disallowed value -1 3 FAIL @counter-style 'symbols: "X" "X"' is valid assert_not_equals: got disallowed value -1 4 FAIL @counter-style 'symbols: ident "X"' is valid assert_not_equals: got disallowed value -1 5 FAIL @counter-style 'symbols: ident "X" url("foo.jpg")' is valid assert_not_equals: got disallowed value -1 6 6 PASS @counter-style 'symbols: ' is invalid 7 7 PASS @counter-style 'symbols: initial "X" "X"' is invalid -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt
r273065 r276152 1 1 2 FAIL @counter-style 'system: cyclic' is valid assert_ equals: expected (undefined) undefined but got (string) "cyclic"3 FAIL @counter-style 'system: fixed' is valid assert_ equals: expected (undefined) undefined but got (string) "fixed"4 FAIL @counter-style 'system: fixed 100' is valid assert_ equals: expected (undefined) undefined but got (string) "fixed 100"5 FAIL @counter-style 'system: fixed -1' is valid assert_ equals: expected (undefined) undefined but got (string) "fixed -1"6 FAIL @counter-style 'system: symbolic' is valid assert_ equals: expected (undefined) undefined but got (string) "symbolic"7 FAIL @counter-style 'system: alphabetic' is valid assert_ equals: expected (undefined) undefined but got (string) "alphabetic"8 FAIL @counter-style 'system: numeric' is valid assert_ equals: expected (undefined) undefined but got (string) "numeric"9 FAIL @counter-style 'system: additive' is valid assert_ equals: expected (undefined) undefined but got (string) "additive"10 FAIL @counter-style 'system: extends bar' is valid assert_ equals: expected (undefined) undefined but got (string) "extends bar"2 FAIL @counter-style 'system: cyclic' is valid assert_not_equals: got disallowed value -1 3 FAIL @counter-style 'system: fixed' is valid assert_not_equals: got disallowed value -1 4 FAIL @counter-style 'system: fixed 100' is valid assert_not_equals: got disallowed value -1 5 FAIL @counter-style 'system: fixed -1' is valid assert_not_equals: got disallowed value -1 6 FAIL @counter-style 'system: symbolic' is valid assert_not_equals: got disallowed value -1 7 FAIL @counter-style 'system: alphabetic' is valid assert_not_equals: got disallowed value -1 8 FAIL @counter-style 'system: numeric' is valid assert_not_equals: got disallowed value -1 9 FAIL @counter-style 'system: additive' is valid assert_not_equals: got disallowed value -1 10 FAIL @counter-style 'system: extends bar' is valid assert_not_equals: got disallowed value -1 11 11 PASS @counter-style 'system: float' is invalid 12 12 PASS @counter-style 'system: cyclic cyclic' is invalid -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/idlharness-expected.txt
r273065 r276152 4 4 PASS Partial interface CSSRule: original interface defined 5 5 PASS Partial interface CSSRule: member names are unique 6 FAIL CSSCounterStyleRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 7 FAIL CSSCounterStyleRule interface object length assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 8 FAIL CSSCounterStyleRule interface object name assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 9 FAIL CSSCounterStyleRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 10 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 11 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 12 FAIL CSSCounterStyleRule interface: attribute name assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 13 FAIL CSSCounterStyleRule interface: attribute system assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 14 FAIL CSSCounterStyleRule interface: attribute symbols assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 15 FAIL CSSCounterStyleRule interface: attribute additiveSymbols assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 16 FAIL CSSCounterStyleRule interface: attribute negative assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 17 FAIL CSSCounterStyleRule interface: attribute prefix assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 18 FAIL CSSCounterStyleRule interface: attribute suffix assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 19 FAIL CSSCounterStyleRule interface: attribute range assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 20 FAIL CSSCounterStyleRule interface: attribute pad assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 21 FAIL CSSCounterStyleRule interface: attribute speakAs assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 22 FAIL CSSCounterStyleRule interface: attribute fallback assert_own_property: self does not have own property "CSSCounterStyleRule" expected property "CSSCounterStyleRule" missing 23 FAIL CSSCounterStyleRule must be primary interface of counter assert_equals: wrong typeof object expected "object" but got "undefined" 24 FAIL Stringification of counter assert_equals: wrong typeof object expected "object" but got "undefined" 25 FAIL CSSCounterStyleRule interface: counter must inherit property "name" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 26 FAIL CSSCounterStyleRule interface: counter must inherit property "system" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 27 FAIL CSSCounterStyleRule interface: counter must inherit property "symbols" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 28 FAIL CSSCounterStyleRule interface: counter must inherit property "additiveSymbols" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 29 FAIL CSSCounterStyleRule interface: counter must inherit property "negative" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 30 FAIL CSSCounterStyleRule interface: counter must inherit property "prefix" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 31 FAIL CSSCounterStyleRule interface: counter must inherit property "suffix" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 32 FAIL CSSCounterStyleRule interface: counter must inherit property "range" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 33 FAIL CSSCounterStyleRule interface: counter must inherit property "pad" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 34 FAIL CSSCounterStyleRule interface: counter must inherit property "speakAs" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 35 FAIL CSSCounterStyleRule interface: counter must inherit property "fallback" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 36 FAIL CSSRule interface: counter must inherit property "COUNTER_STYLE_RULE" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" 37 FAIL CSSRule interface: constant COUNTER_STYLE_RULE on interface object assert_own_property: expected property "COUNTER_STYLE_RULE" missing 38 FAIL CSSRule interface: constant COUNTER_STYLE_RULE on interface prototype object assert_own_property: expected property "COUNTER_STYLE_RULE" missing 6 PASS CSSCounterStyleRule interface: existence and properties of interface object 7 PASS CSSCounterStyleRule interface object length 8 PASS CSSCounterStyleRule interface object name 9 PASS CSSCounterStyleRule interface: existence and properties of interface prototype object 10 PASS CSSCounterStyleRule interface: existence and properties of interface prototype object's "constructor" property 11 PASS CSSCounterStyleRule interface: existence and properties of interface prototype object's @@unscopables property 12 PASS CSSCounterStyleRule interface: attribute name 13 PASS CSSCounterStyleRule interface: attribute system 14 PASS CSSCounterStyleRule interface: attribute symbols 15 PASS CSSCounterStyleRule interface: attribute additiveSymbols 16 PASS CSSCounterStyleRule interface: attribute negative 17 PASS CSSCounterStyleRule interface: attribute prefix 18 PASS CSSCounterStyleRule interface: attribute suffix 19 PASS CSSCounterStyleRule interface: attribute range 20 PASS CSSCounterStyleRule interface: attribute pad 21 PASS CSSCounterStyleRule interface: attribute speakAs 22 PASS CSSCounterStyleRule interface: attribute fallback 23 PASS CSSCounterStyleRule must be primary interface of counter 24 PASS Stringification of counter 25 PASS CSSCounterStyleRule interface: counter must inherit property "name" with the proper type 26 PASS CSSCounterStyleRule interface: counter must inherit property "system" with the proper type 27 PASS CSSCounterStyleRule interface: counter must inherit property "symbols" with the proper type 28 PASS CSSCounterStyleRule interface: counter must inherit property "additiveSymbols" with the proper type 29 PASS CSSCounterStyleRule interface: counter must inherit property "negative" with the proper type 30 PASS CSSCounterStyleRule interface: counter must inherit property "prefix" with the proper type 31 PASS CSSCounterStyleRule interface: counter must inherit property "suffix" with the proper type 32 PASS CSSCounterStyleRule interface: counter must inherit property "range" with the proper type 33 PASS CSSCounterStyleRule interface: counter must inherit property "pad" with the proper type 34 PASS CSSCounterStyleRule interface: counter must inherit property "speakAs" with the proper type 35 PASS CSSCounterStyleRule interface: counter must inherit property "fallback" with the proper type 36 PASS CSSRule interface: counter must inherit property "COUNTER_STYLE_RULE" with the proper type 37 PASS CSSRule interface: constant COUNTER_STYLE_RULE on interface object 38 PASS CSSRule interface: constant COUNTER_STYLE_RULE on interface prototype object 39 39 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt
r268961 r276152 1 1 2 FAIL CSSCounterStyleRule.cssText doesn't serialize with newlines undefined is not an object (evaluating 'rule.cssText') 2 PASS CSSCounterStyleRule.cssText doesn't serialize with newlines 3 3 -
trunk/Source/WTF/ChangeLog
r276033 r276152 1 2021-04-16 Tyler Wilcock <twilco.o@protonmail.com> 2 3 [css-counter-styles] Parse and add feature flag for @counter-style 4 https://bugs.webkit.org/show_bug.cgi?id=223150 5 6 Reviewed by Darin Adler. 7 8 * Scripts/Preferences/WebPreferencesExperimental.yaml: 9 Add CSSCounterStyleAtRulesEnabled and CSSCounterStyleAtRuleImageSymbolsEnabled flags. 10 1 11 2021-04-15 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
r275496 r276152 161 161 default: false 162 162 163 CSSCounterStyleAtRuleImageSymbolsEnabled: 164 type: bool 165 humanReadableName: "CSS @counter-style <image> symbols" 166 humanReadableDescription: "Enable support for <image> symbols in CSS @counter-style rules" 167 defaultValue: 168 WebKitLegacy: 169 default: false 170 WebKit: 171 default: false 172 WebCore: 173 default: false 174 175 CSSCounterStyleAtRulesEnabled: 176 type: bool 177 humanReadableName: "CSS @counter-style" 178 humanReadableDescription: "Enable support for CSS @counter-style rules" 179 defaultValue: 180 WebKitLegacy: 181 default: false 182 WebKit: 183 default: false 184 WebCore: 185 default: false 186 163 187 CSSCustomPropertiesAndValuesEnabled: 164 188 type: bool -
trunk/Source/WebCore/CMakeLists.txt
r276111 r276152 737 737 738 738 css/CSSConditionRule.idl 739 css/CSSCounterStyleRule.idl 739 740 css/CSSFontFaceRule.idl 740 741 css/CSSGroupingRule.idl -
trunk/Source/WebCore/ChangeLog
r276147 r276152 1 2021-04-16 Tyler Wilcock <twilco.o@protonmail.com> 2 3 [css-counter-styles] Parse and add feature flag for @counter-style 4 https://bugs.webkit.org/show_bug.cgi?id=223150 5 6 Reviewed by Darin Adler. 7 8 Parse @counter-style (without implementing descriptor parsing) behind 9 a new feature flag, CSSCounterStyleAtRulesEnabled. A separate feature 10 flag for @counter-style <image> symbol values has also been added, as 11 image symbols have extra complexities that we won't want to hold the 12 entire feature back on. 13 https://www.w3.org/TR/css-counter-styles-3 14 15 The CSSCounterStyleRule IDL interface is also added and implemented, 16 and similarly feature flagged. 17 https://www.w3.org/TR/css-counter-styles-3/#apis 18 19 Test: webexposed/counter-style-is-not-exposed.html and existing WPTs. 20 21 * CMakeLists.txt: 22 Add CSSCounterStyleRule.idl. 23 24 * DerivedSources-input.xcfilelist: 25 Add CSSCounterStyleRule.idl. 26 27 * DerivedSources-output.xcfilelist: 28 Add JSCSSCounterStyleRule.h and JSCSSCounterStyleRule.cpp. 29 30 * DerivedSources.make: 31 Add CSSCounterStyleRule.idl. 32 33 * Sources.txt: 34 Add CSSCounterStyleRule.cpp and JSCSSCounterStyleRule.cpp. 35 36 * WebCore.xcodeproj/project.pbxproj: 37 Add CounterStyle.h, CounterStyle.cpp, and CounterStyle.idl. 38 39 * bindings/js/JSCSSRuleCustom.cpp: 40 (WebCore::toJSNewlyCreated): 41 Support CSSCounterStyleRule. 42 43 * bindings/js/WebCoreBuiltinNames.h: 44 Add macro(CSSCounterStyleRule) to generate counter-style built-in 45 names. 46 47 * css/CSSCounterStyleRule.cpp: Added. 48 (WebCore::StyleRuleCounterStyle::StyleRuleCounterStyle): 49 (WebCore::StyleRuleCounterStyle::create): 50 (WebCore::StyleRuleCounterStyle::mutableProperties): 51 (WebCore::CSSCounterStyleRule::CSSCounterStyleRule): 52 (WebCore::CSSCounterStyleRule::reattach): 53 (WebCore::CSSCounterStyleRule::cssText const): 54 55 * css/CSSCounterStyleRule.h: Added. 56 (isType): Add specialized rule.isCounterStyleRule() implementation. 57 58 * css/CSSCounterStyleRule.idl: Added. 59 * css/CSSRule.cpp: Add new StyleRuleType::CounterStyle COMPILE_ASSERT. 60 * css/CSSRule.h: 61 Add COUNTER_STYLE_RULE constant. Also add comment `// WebIDL enum` to 62 disable enum_casing lint, since these values are named to match IDL 63 attributes. 64 * css/CSSRule.idl: Add COUNTER_STYLE_RULE constant behind flag. 65 66 * css/StyleRule.cpp: 67 (WebCore::StyleRuleBase::destroy): 68 (WebCore::StyleRuleBase::copy const): 69 (WebCore::StyleRuleBase::createCSSOMWrapper const): 70 Handle newly added StyleRuleType::CounterStyle. 71 72 * css/StyleRule.h: 73 (WebCore::StyleRuleBase::isCounterStyleRule const): Added. 74 75 * css/StyleRuleType.h: Add StyleRuleType::CounterStyle 76 77 * css/StyleSheetContents.cpp: 78 (WebCore::traverseRulesInVector): 79 (WebCore::StyleSheetContents::traverseSubresources const): 80 If @counter-style image symbols flag is enabled, do traverse 81 subresources. 82 83 * css/parser/CSSAtRuleID.cpp: 84 If the @counter-style feature flag is enabled, return newly added 85 CSSAtRuleCounterStyle ID. 86 87 (WebCore::cssAtRuleID): 88 * css/parser/CSSAtRuleID.h: 89 Add CSSAtRuleCounterStyle ID. 90 91 * css/parser/CSSParserContext.cpp: 92 (WebCore::operator==): 93 * css/parser/CSSParserContext.h: 94 (WebCore::CSSParserContextHash::hash): 95 Add cssCounterStyleAtRulesEnabled and 96 cssCounterStyleAtRuleImageSymbolsEnabled flags. 97 98 * css/parser/CSSParserFastPaths.cpp: 99 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): 100 Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle 101 method. 102 103 * css/parser/CSSParserImpl.cpp: 104 (WebCore::computeNewAllowedRules): 105 (WebCore::CSSParserImpl::consumeAtRule): 106 (WebCore::CSSParserImpl::consumeCounterStyleRule): Added. 107 (WebCore::CSSParserImpl::consumeDeclarationList): 108 (WebCore::CSSParserImpl::consumeDeclaration): 109 * css/parser/CSSParserImpl.h: 110 Handle new @counter-style rule. 111 112 * css/parser/CSSPropertyParser.cpp: 113 (WebCore::CSSPropertyParser::parseValue): Handle 114 StyleRuleType::CounterStyle. 115 (WebCore::consumeCounterContent): 116 Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle 117 method. 118 (WebCore::CSSPropertyParser::parseCounterStyleDescriptor): 119 Add placeholder for future @counter-style descriptor parsing work. 120 121 * css/parser/CSSPropertyParser.h: 122 Add parseCounterStyleDescriptor method 123 124 * css/parser/CSSPropertyParserHelpers.h: 125 * css/parser/CSSPropertyParserHelpers.cpp: 126 (WebCore::CSSPropertyParserHelpers::consumeCustomIdent): 127 Add new flag that allows consumed custom ident values to be lowercased 128 on-parse. This is necessary for some <counter-style-name> values. 129 (WebCore::CSSPropertyParserHelpers::isPredefinedCounterStyle): Added. 130 (WebCore::CSSPropertyParserHelpers::consumeCounterStyleName): 131 (WebCore::CSSPropertyParserHelpers::consumeCounterStyleNameInPrelude): 132 Parse @counter-style names, both in-prelude names and non-prelude 133 names (e.g. as part of the `extends` descriptor). 134 1 135 2021-04-16 Chris Dumez <cdumez@apple.com> 2 136 -
trunk/Source/WebCore/DerivedSources-input.xcfilelist
r275314 r276152 721 721 $(PROJECT_DIR)/crypto/parameters/RsaPssParams.idl 722 722 $(PROJECT_DIR)/css/CSSConditionRule.idl 723 $(PROJECT_DIR)/css/CSSCounterStyleRule.idl 723 724 $(PROJECT_DIR)/css/CSSFontFaceRule.idl 724 725 $(PROJECT_DIR)/css/CSSGroupingRule.idl -
trunk/Source/WebCore/DerivedSources-output.xcfilelist
r275314 r276152 284 284 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSConditionRule.cpp 285 285 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSConditionRule.h 286 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSCounterStyleRule.cpp 287 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSCounterStyleRule.h 286 288 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSFontFaceRule.cpp 287 289 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSFontFaceRule.h -
trunk/Source/WebCore/DerivedSources.make
r275314 r276152 618 618 $(WebCore)/crypto/parameters/RsaPssParams.idl \ 619 619 $(WebCore)/css/CSSConditionRule.idl \ 620 $(WebCore)/css/CSSCounterStyleRule.idl \ 620 621 $(WebCore)/css/CSSFontFaceRule.idl \ 621 622 $(WebCore)/css/CSSGroupingRule.idl \ -
trunk/Source/WebCore/Sources.txt
r276017 r276152 724 724 css/CSSConditionRule.cpp 725 725 css/CSSContentDistributionValue.cpp 726 css/CSSCounterStyleRule.cpp 726 727 css/CSSCrossfadeValue.cpp 727 728 css/CSSCursorImageValue.cpp … … 2836 2837 JSCSSAnimation.cpp 2837 2838 JSCSSConditionRule.cpp 2839 JSCSSCounterStyleRule.cpp 2838 2840 JSCSSFontFaceRule.cpp 2839 2841 JSCSSGroupingRule.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r276120 r276152 3091 3091 98CE432A129E00E5005821DC /* LinkLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 98CE4329129E00E5005821DC /* LinkLoader.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3092 3092 98EB1F951313FE0500D0E1EA /* NotImplemented.h in Headers */ = {isa = PBXBuildFile; fileRef = 98EB1F941313FE0500D0E1EA /* NotImplemented.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3093 98F9D66925FDE02200BD842D /* CSSCounterStyleRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 98F9D66825FDDFE800BD842D /* CSSCounterStyleRule.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3093 3094 9920398318B95BC600B39AF9 /* UserInputBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 9920398118B95BC600B39AF9 /* UserInputBridge.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3094 3095 994C603A253A277300BDF060 /* InspectorFrontendAPIDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 994C6037253A277200BDF060 /* InspectorFrontendAPIDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 12124 12125 98CE4329129E00E5005821DC /* LinkLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkLoader.h; sourceTree = "<group>"; }; 12125 12126 98EB1F941313FE0500D0E1EA /* NotImplemented.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotImplemented.h; sourceTree = "<group>"; }; 12127 98F9D66525FDDFE700BD842D /* CSSCounterStyleRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCounterStyleRule.cpp; sourceTree = "<group>"; }; 12128 98F9D66725FDDFE800BD842D /* CSSCounterStyleRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSCounterStyleRule.idl; sourceTree = "<group>"; }; 12129 98F9D66825FDDFE800BD842D /* CSSCounterStyleRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSCounterStyleRule.h; sourceTree = "<group>"; }; 12126 12130 9908B0ED1BCACF9100ED0F65 /* ByteLengthQueuingStrategy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ByteLengthQueuingStrategy.js; sourceTree = "<group>"; }; 12127 12131 9908B0EE1BCACF9100ED0F65 /* CountQueuingStrategy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = CountQueuingStrategy.js; sourceTree = "<group>"; }; … … 29601 29605 9DAC7C521AF2CAA100437C44 /* CSSContentDistributionValue.cpp */, 29602 29606 9DAC7C531AF2CAA100437C44 /* CSSContentDistributionValue.h */, 29607 98F9D66525FDDFE700BD842D /* CSSCounterStyleRule.cpp */, 29608 98F9D66825FDDFE800BD842D /* CSSCounterStyleRule.h */, 29609 98F9D66725FDDFE800BD842D /* CSSCounterStyleRule.idl */, 29603 29610 2D8FEBDA143E3EF70072502B /* CSSCrossfadeValue.cpp */, 29604 29611 2D8FEBDB143E3EF70072502B /* CSSCrossfadeValue.h */, … … 31959 31966 930AAC9A250EB8490013DA9F /* CSSConditionRule.h in Headers */, 31960 31967 9DAC7C551AF2CAA200437C44 /* CSSContentDistributionValue.h in Headers */, 31968 98F9D66925FDE02200BD842D /* CSSCounterStyleRule.h in Headers */, 31961 31969 2D8FEBDD143E3EF70072502B /* CSSCrossfadeValue.h in Headers */, 31962 31970 AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */, … … 32116 32124 41A3D58F101C152D00316D07 /* DedicatedWorkerThread.h in Headers */, 32117 32125 FD06DFA6134A4DEF006F5D7D /* DefaultAudioDestinationNode.h in Headers */, 32126 E4F38D1B2626F13B007B1064 /* DefaultResourceLoadPriority.h in Headers */, 32118 32127 CD83D36221122A210076E11C /* DeferrableTask.h in Headers */, 32119 32128 FD31602C12B0267600C1A359 /* DelayDSPKernel.h in Headers */, … … 34615 34624 BCEA487A097D93020094C9E4 /* RenderLayer.h in Headers */, 34616 34625 0F580CFF0F12DE9B0051D689 /* RenderLayerBacking.h in Headers */, 34617 E4F38D1B2626F13B007B1064 /* DefaultResourceLoadPriority.h in Headers */,34618 34626 0F580CFD0F12DE9B0051D689 /* RenderLayerCompositor.h in Headers */, 34619 34627 3C244FEAA375AC633F88BE6F /* RenderLayerModelObject.h in Headers */, -
trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
r273138 r276152 27 27 #include "JSCSSRule.h" 28 28 29 #include "CSSCounterStyleRule.h" 29 30 #include "CSSFontFaceRule.h" 30 31 #include "CSSImportRule.h" … … 36 37 #include "CSSStyleRule.h" 37 38 #include "CSSSupportsRule.h" 39 #include "JSCSSCounterStyleRule.h" 38 40 #include "JSCSSFontFaceRule.h" 39 41 #include "JSCSSImportRule.h" … … 81 83 case CSSRule::SUPPORTS_RULE: 82 84 return createWrapper<CSSSupportsRule>(globalObject, WTFMove(rule)); 85 case CSSRule::COUNTER_STYLE_RULE: 86 return createWrapper<CSSCounterStyleRule>(globalObject, WTFMove(rule)); 83 87 default: 84 88 return createWrapper<CSSRule>(globalObject, WTFMove(rule)); -
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
r274983 r276152 76 76 macro(CredentialsContainer) \ 77 77 macro(CSSAnimation) \ 78 macro(CSSCounterStyleRule) \ 78 79 macro(CSSImageValue) \ 79 80 macro(CSSNumericValue) \ -
trunk/Source/WebCore/css/CSSCounterStyleRule.idl
r276149 r276152 1 1 /* 2 * Copyright (C) 20 19 Apple Inc. All rights reserved.2 * Copyright (C) 2021 Tyler Wilcock <twilco.o@protonmail.com>. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #pragma once27 28 namespace WebCore { 29 30 enum class StyleRuleType : uint8_t{31 Unknown, // Not used.32 Style,33 Charset, // Not used. These are internally strings owned by the style sheet.34 Import,35 Media,36 FontFace,37 Page,38 Keyframes,39 Keyframe, // Not used. These are internally non-rule StyleRuleKeyframe objects.40 Namespace = 10,41 Supports = 12,26 // https://www.w3.org/TR/css-counter-styles-3/#the-csscounterstylerule-interface 27 [ 28 EnabledBySetting=CSSCounterStyleAtRules, 29 Exposed=Window 30 ] interface CSSCounterStyleRule : CSSRule { 31 attribute DOMString name; 32 attribute DOMString system; 33 attribute DOMString symbols; 34 attribute DOMString additiveSymbols; 35 attribute DOMString negative; 36 attribute DOMString prefix; 37 attribute DOMString suffix; 38 attribute DOMString range; 39 attribute DOMString pad; 40 attribute DOMString speakAs; 41 attribute DOMString fallback; 42 42 }; 43 44 } // namespace WebCore -
trunk/Source/WebCore/css/CSSRule.cpp
r256477 r276152 47 47 COMPILE_ASSERT(StyleRuleType::Keyframe == static_cast<StyleRuleType>(CSSRule::Type::KEYFRAME_RULE), enums_should_match); 48 48 COMPILE_ASSERT(StyleRuleType::Namespace == static_cast<StyleRuleType>(CSSRule::Type::NAMESPACE_RULE), enums_should_match); 49 COMPILE_ASSERT(StyleRuleType::CounterStyle == static_cast<StyleRuleType>(CSSRule::Type::COUNTER_STYLE_RULE), enums_should_match); 49 50 COMPILE_ASSERT(StyleRuleType::Supports == static_cast<StyleRuleType>(CSSRule::Type::SUPPORTS_RULE), enums_should_match); 50 51 -
trunk/Source/WebCore/css/CSSRule.h
r267576 r276152 37 37 virtual ~CSSRule() = default; 38 38 39 // WebIDL enum 39 40 enum Type { 40 41 UNKNOWN_RULE, … … 49 50 MARGIN_RULE, 50 51 NAMESPACE_RULE, 51 SUPPORTS_RULE = 12, 52 COUNTER_STYLE_RULE, 53 SUPPORTS_RULE 52 54 }; 53 55 -
trunk/Source/WebCore/css/CSSRule.idl
r267576 r276152 43 43 const unsigned short MARGIN_RULE = 9; 44 44 const unsigned short NAMESPACE_RULE = 10; 45 [EnabledBySetting=CSSCounterStyleAtRules] const unsigned short COUNTER_STYLE_RULE = 11; 45 46 const unsigned short SUPPORTS_RULE = 12; 46 47 -
trunk/Source/WebCore/css/StyleRule.cpp
r267576 r276152 23 23 #include "StyleRule.h" 24 24 25 #include "CSSCounterStyleRule.h" 25 26 #include "CSSDeferredParser.h" 26 27 #include "CSSFontFaceRule.h" … … 91 92 delete downcast<StyleRuleCharset>(this); 92 93 return; 94 case StyleRuleType::CounterStyle: 95 delete downcast<StyleRuleCounterStyle>(this); 96 return; 93 97 case StyleRuleType::Unknown: 94 98 ASSERT_NOT_REACHED(); … … 113 117 case StyleRuleType::Keyframes: 114 118 return downcast<StyleRuleKeyframes>(*this).copy(); 119 case StyleRuleType::CounterStyle: 120 return downcast<StyleRuleCounterStyle>(*this).copy(); 115 121 case StyleRuleType::Import: 116 122 case StyleRuleType::Namespace: … … 153 159 case StyleRuleType::Namespace: 154 160 rule = CSSNamespaceRule::create(downcast<StyleRuleNamespace>(self), parentSheet); 161 break; 162 case StyleRuleType::CounterStyle: 163 rule = CSSCounterStyleRule::create(downcast<StyleRuleCounterStyle>(self), parentSheet); 155 164 break; 156 165 case StyleRuleType::Unknown: -
trunk/Source/WebCore/css/StyleRule.h
r267576 r276152 48 48 49 49 bool isCharsetRule() const { return type() == StyleRuleType::Charset; } 50 bool isCounterStyleRule() const { return type() == StyleRuleType::CounterStyle; } 50 51 bool isFontFaceRule() const { return type() == StyleRuleType::FontFace; } 51 52 bool isKeyframesRule() const { return type() == StyleRuleType::Keyframes; } -
trunk/Source/WebCore/css/StyleRuleType.h
r256477 r276152 39 39 Keyframe, // Not used. These are internally non-rule StyleRuleKeyframe objects. 40 40 Namespace = 10, 41 CounterStyle = 11, 41 42 Supports = 12, 42 43 }; -
trunk/Source/WebCore/css/StyleSheetContents.cpp
r273897 r276152 445 445 case StyleRuleType::Unknown: 446 446 case StyleRuleType::Charset: 447 case StyleRuleType::CounterStyle: 447 448 case StyleRuleType::Keyframe: 448 449 case StyleRuleType::Supports: … … 479 480 return handler(*cachedResource); 480 481 return false; 482 case StyleRuleType::CounterStyle: 483 return m_parserContext.counterStyleAtRuleImageSymbolsEnabled; 481 484 case StyleRuleType::Media: 482 485 case StyleRuleType::Page: -
trunk/Source/WebCore/css/parser/CSSAtRuleID.cpp
r222259 r276152 57 57 if (equalIgnoringASCIICase(name, "apply")) 58 58 return CSSAtRuleApply; 59 if (equalIgnoringASCIICase(name, "counter-style")) 60 return CSSAtRuleCounterStyle; 59 61 return CSSAtRuleInvalid; 60 62 } -
trunk/Source/WebCore/css/parser/CSSAtRuleID.h
r222259 r276152 48 48 CSSAtRuleWebkitKeyframes = 10, 49 49 CSSAtRuleApply = 11, 50 CSSAtRuleCounterStyle = 12, 50 51 }; 51 52 -
trunk/Source/WebCore/css/parser/CSSParserContext.cpp
r275650 r276152 74 74 , constantPropertiesEnabled { document.settings().constantPropertiesEnabled() } 75 75 , containmentEnabled { document.settings().cssContainmentEnabled() } 76 , counterStyleAtRulesEnabled { document.settings().cssCounterStyleAtRulesEnabled() } 77 , counterStyleAtRuleImageSymbolsEnabled { document.settings().cssCounterStyleAtRuleImageSymbolsEnabled() } 76 78 , cssColor4 { document.settings().cssColor4() } 77 79 , deferredCSSParserEnabled { document.settings().deferredCSSParserEnabled() } … … 114 116 && a.constantPropertiesEnabled == b.constantPropertiesEnabled 115 117 && a.containmentEnabled == b.containmentEnabled 118 && a.counterStyleAtRulesEnabled == b.counterStyleAtRulesEnabled 119 && a.counterStyleAtRuleImageSymbolsEnabled == b.counterStyleAtRuleImageSymbolsEnabled 116 120 && a.cssColor4 == b.cssColor4 117 121 && a.deferredCSSParserEnabled == b.deferredCSSParserEnabled -
trunk/Source/WebCore/css/parser/CSSParserContext.h
r275650 r276152 61 61 bool constantPropertiesEnabled { false }; 62 62 bool containmentEnabled { false }; 63 bool counterStyleAtRulesEnabled { false }; 64 bool counterStyleAtRuleImageSymbolsEnabled { false }; 63 65 bool cssColor4 { false }; 64 66 bool deferredCSSParserEnabled { false }; -
trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp
r272987 r276152 36 36 #include "CSSPrimitiveValue.h" 37 37 #include "CSSPropertyParser.h" 38 #include "CSSPropertyParserHelpers.h" 38 39 #include "CSSValueList.h" 39 40 #include "CSSValuePool.h" … … 662 663 // See section CSS_PROP_LIST_STYLE_TYPE of file CSSValueKeywords.in 663 664 // for the list of supported list-style-types. 664 return (valueID >= CSSValueDisc && valueID <= CSSValueKatakanaIroha) || valueID == CSSValueNone;665 return CSSPropertyParserHelpers::isPredefinedCounterStyle(valueID) || valueID == CSSValueNone; 665 666 case CSSPropertyMaskType: 666 667 return valueID == CSSValueLuminance || valueID == CSSValueAlpha; -
trunk/Source/WebCore/css/parser/CSSParserImpl.cpp
r275610 r276152 32 32 33 33 #include "CSSAtRuleID.h" 34 #include "CSSCounterStyleRule.h" 34 35 #include "CSSCustomPropertyValue.h" 35 36 #include "CSSDeferredParser.h" … … 338 339 static CSSParserImpl::AllowedRulesType computeNewAllowedRules(CSSParserImpl::AllowedRulesType allowedRules, StyleRuleBase* rule) 339 340 { 340 if (!rule || allowedRules == CSSParserImpl::KeyframeRules || allowedRules == CSSParserImpl:: NoRules)341 if (!rule || allowedRules == CSSParserImpl::KeyframeRules || allowedRules == CSSParserImpl::CounterStyleRules || allowedRules == CSSParserImpl::NoRules) 341 342 return allowedRules; 342 343 ASSERT(allowedRules <= CSSParserImpl::RegularRules); … … 449 450 case CSSAtRulePage: 450 451 return consumePageRule(prelude, block); 452 case CSSAtRuleCounterStyle: 453 return consumeCounterStyleRule(prelude, block); 451 454 default: 452 455 return nullptr; // Parse error, unrecognised at-rule with block … … 651 654 652 655 return StyleRulePage::create(createStyleProperties(m_parsedProperties, m_context.mode), WTFMove(selectorList)); 656 } 657 658 RefPtr<StyleRuleCounterStyle> CSSParserImpl::consumeCounterStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block) 659 { 660 if (!m_context.counterStyleAtRulesEnabled) 661 return nullptr; 662 663 auto rangeCopy = prelude; // For inspector callbacks 664 auto name = CSSPropertyParserHelpers::consumeCounterStyleNameInPrelude(rangeCopy); 665 if (name.isNull()) 666 return nullptr; 667 668 if (m_observerWrapper) { 669 m_observerWrapper->observer().startRuleHeader(StyleRuleType::CounterStyle, m_observerWrapper->startOffset(rangeCopy)); 670 m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude)); 671 m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(block)); 672 m_observerWrapper->observer().endRuleBody(m_observerWrapper->endOffset(block)); 673 } 674 675 consumeDeclarationList(block, StyleRuleType::CounterStyle); 676 return StyleRuleCounterStyle::create(name, createStyleProperties(m_parsedProperties, m_context.mode)); 653 677 } 654 678 … … 729 753 ASSERT(m_parsedProperties.isEmpty()); 730 754 731 bool useObserver = m_observerWrapper && (ruleType == StyleRuleType::Style || ruleType == StyleRuleType::Keyframe );755 bool useObserver = m_observerWrapper && (ruleType == StyleRuleType::Style || ruleType == StyleRuleType::Keyframe || ruleType == StyleRuleType::CounterStyle); 732 756 if (useObserver) { 733 757 m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(range)); … … 811 835 } 812 836 813 if (important && (ruleType == StyleRuleType::FontFace || ruleType == StyleRuleType::Keyframe ))837 if (important && (ruleType == StyleRuleType::FontFace || ruleType == StyleRuleType::Keyframe || ruleType == StyleRuleType::CounterStyle)) 814 838 return; 815 839 -
trunk/Source/WebCore/css/parser/CSSParserImpl.h
r274520 r276152 46 46 class CSSSelectorList; 47 47 class CSSTokenizer; 48 class StyleRuleCounterStyle; 48 49 class StyleRuleKeyframe; 49 50 class StyleRule; … … 80 81 KeyframeRules, 81 82 ApplyRules, // For @apply inside style rules 83 CounterStyleRules, 82 84 NoRules, // For parsing at-rules inside declaration lists 83 85 }; … … 133 135 RefPtr<StyleRuleKeyframes> consumeKeyframesRule(bool webkitPrefixed, CSSParserTokenRange prelude, CSSParserTokenRange block); 134 136 RefPtr<StyleRulePage> consumePageRule(CSSParserTokenRange prelude, CSSParserTokenRange block); 137 RefPtr<StyleRuleCounterStyle> consumeCounterStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block); 135 138 136 139 // FIXME-NEWPARSER: Support "apply" -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r276017 r276152 235 235 if (ruleType == StyleRuleType::FontFace) 236 236 parseSuccess = parser.parseFontFaceDescriptor(propertyID); 237 else if (ruleType == StyleRuleType::CounterStyle) 238 parseSuccess = parser.parseCounterStyleDescriptor(propertyID, context); 237 239 else 238 240 parseSuccess = parser.parseValueStart(propertyID, important); … … 2243 2245 if (consumeCommaIncludingWhitespace(args)) { 2244 2246 CSSValueID id = args.peek().id(); 2245 if ((id != CSSValueNone && (id < CSSValueDisc || id > CSSValueKatakanaIroha)))2247 if ((id != CSSValueNone && !isPredefinedCounterStyle(id))) 2246 2248 return nullptr; 2247 2249 listStyle = consumeIdent(args); … … 4435 4437 } 4436 4438 4439 RefPtr<CSSValue> CSSPropertyParser::parseCounterStyleDescriptor(CSSPropertyID propId, CSSParserTokenRange& range, const CSSParserContext& context) 4440 { 4441 if (!context.counterStyleAtRulesEnabled) 4442 return nullptr; 4443 // FIXME: Implement this function when we can parse @counter-style descriptors. 4444 UNUSED_PARAM(propId); 4445 UNUSED_PARAM(range); 4446 UNUSED_PARAM(context); 4447 return nullptr; 4448 } 4449 4450 bool CSSPropertyParser::parseCounterStyleDescriptor(CSSPropertyID propId, const CSSParserContext& context) 4451 { 4452 auto parsedValue = parseCounterStyleDescriptor(propId, m_range, context); 4453 if (!parsedValue || !m_range.atEnd()) 4454 return false; 4455 4456 addProperty(propId, CSSPropertyInvalid, *parsedValue, false); 4457 return true; 4458 } 4459 4437 4460 bool CSSPropertyParser::parseFontFaceDescriptor(CSSPropertyID propId) 4438 4461 { -
trunk/Source/WebCore/css/parser/CSSPropertyParser.h
r276017 r276152 57 57 static void collectParsedCustomPropertyValueDependencies(const String& syntax, bool isRoot, HashSet<CSSPropertyID>& dependencies, const CSSParserTokenRange&, const CSSParserContext&); 58 58 59 static RefPtr<CSSValue> parseCounterStyleDescriptor(CSSPropertyID, CSSParserTokenRange&, const CSSParserContext&); 60 59 61 private: 60 62 CSSPropertyParser(const CSSParserTokenRange&, const CSSParserContext&, Vector<CSSProperty, 256>*, bool consumeWhitespace = true); … … 72 74 bool parseViewportDescriptor(CSSPropertyID propId, bool important); 73 75 bool parseFontFaceDescriptor(CSSPropertyID); 76 bool parseCounterStyleDescriptor(CSSPropertyID, const CSSParserContext&); 74 77 75 78 void addProperty(CSSPropertyID, CSSPropertyID, Ref<CSSValue>&&, bool important, bool implicit = false); -
trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
r276017 r276152 671 671 // to do other plumbing work first (like changing Pair to CSSValuePair and make it not 672 672 // use only primitive values). 673 RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange& range )673 RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange& range, bool shouldLowercase) 674 674 { 675 675 if (range.peek().type() != IdentToken || isCSSWideKeyword(range.peek().id())) 676 676 return nullptr; 677 return CSSValuePool::singleton().createValue(range.consumeIncludingWhitespace().value().toString(), CSSUnitType::CSS_STRING); 677 auto identifier = range.consumeIncludingWhitespace().value(); 678 return CSSValuePool::singleton().createValue(shouldLowercase ? identifier.convertToASCIILowercase() : identifier.toString(), CSSUnitType::CSS_STRING); 678 679 } 679 680 … … 2931 2932 } 2932 2933 2934 // https://www.w3.org/TR/css-counter-styles-3/#predefined-counters 2935 bool isPredefinedCounterStyle(CSSValueID valueID) 2936 { 2937 return valueID >= CSSValueDisc && valueID <= CSSValueKatakanaIroha; 2938 } 2939 2940 // https://www.w3.org/TR/css-counter-styles-3/#typedef-counter-style-name 2941 RefPtr<CSSPrimitiveValue> consumeCounterStyleName(CSSParserTokenRange& range) 2942 { 2943 // <counter-style-name> is a <custom-ident> that is not an ASCII case-insensitive match for "none". 2944 auto valueID = range.peek().id(); 2945 if (valueID == CSSValueNone) 2946 return nullptr; 2947 // If the value is an ASCII case-insensitive match for any of the predefined counter styles, lowercase it. 2948 if (auto name = consumeCustomIdent(range, isPredefinedCounterStyle(valueID))) 2949 return name; 2950 return nullptr; 2951 } 2952 2953 // https://www.w3.org/TR/css-counter-styles-3/#typedef-counter-style-name 2954 AtomString consumeCounterStyleNameInPrelude(CSSParserTokenRange& prelude) 2955 { 2956 auto nameToken = prelude.consumeIncludingWhitespace(); 2957 if (!prelude.atEnd()) 2958 return AtomString(); 2959 // Ensure this token is a valid <custom-ident>. 2960 if (nameToken.type() != IdentToken || isCSSWideKeyword(nameToken.id())) 2961 return AtomString(); 2962 // In the context of the prelude of an @counter-style rule, a <counter-style-name> must not be an ASCII 2963 // case-insensitive match for "decimal" or "disc". No <counter-style-name>, prelude or not, may be an ASCII 2964 // case-insensitive match for "none". 2965 if (identMatches<CSSValueDecimal, CSSValueDisc, CSSValueNone>(nameToken.id())) 2966 return AtomString(); 2967 auto name = nameToken.value(); 2968 return isPredefinedCounterStyle(nameToken.id()) ? name.convertToASCIILowercase() : name.toString(); 2969 } 2970 2933 2971 Optional<CSSValueID> consumeFontVariantCSS21Raw(CSSParserTokenRange& range) 2934 2972 { -
trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h
r276017 r276152 107 107 template<CSSValueID... allowedIdents> RefPtr<CSSPrimitiveValue> consumeIdentWorkerSafe(CSSParserTokenRange&, CSSValuePool&); 108 108 109 RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange& );109 RefPtr<CSSPrimitiveValue> consumeCustomIdent(CSSParserTokenRange&, bool shouldLowercase = false); 110 110 RefPtr<CSSPrimitiveValue> consumeString(CSSParserTokenRange&); 111 111 StringView consumeUrlAsStringView(CSSParserTokenRange&); … … 165 165 Vector<FontFamilyRaw> family; 166 166 }; 167 168 bool isPredefinedCounterStyle(CSSValueID); 169 RefPtr<CSSPrimitiveValue> consumeCounterStyleName(CSSParserTokenRange&); 170 AtomString consumeCounterStyleNameInPrelude(CSSParserTokenRange&); 167 171 168 172 Optional<CSSValueID> consumeFontVariantCSS21Raw(CSSParserTokenRange&); -
trunk/Tools/ChangeLog
r276148 r276152 1 2021-04-16 Tyler Wilcock <twilco.o@protonmail.com> 2 3 [css-counter-styles] Parse and add feature flag for @counter-style 4 https://bugs.webkit.org/show_bug.cgi?id=223150 5 6 Reviewed by Darin Adler. 7 8 * DumpRenderTree/TestOptions.cpp: 9 (WTR::TestOptions::defaults): 10 Add `false` defaults for CSSCounterStyleAtRulesEnabled and 11 CSSCounterStyleAtRuleImageSymbolsEnabled flags. 12 1 13 2021-04-16 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Tools/DumpRenderTree/TestOptions.cpp
r275912 r276152 134 134 { "AttachmentElementEnabled", false }, 135 135 { "CSSContainmentEnabled", false }, 136 { "CSSCounterStyleAtRuleEnabled", false }, 137 { "CSSCounterStyleAtRuleImageSymbolsEnabled", false }, 136 138 { "CSSLogicalEnabled", false }, 137 139 { "CSSOMViewSmoothScrollingEnabled", false },
Note:
See TracChangeset
for help on using the changeset viewer.