Title: [267940] trunk
Revision
267940
Author
[email protected]
Date
2020-10-03 18:58:51 -0700 (Sat, 03 Oct 2020)

Log Message

[css-lists] Implement list-style-type: <string>
https://bugs.webkit.org/show_bug.cgi?id=167729

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update test expectations, and await document.fonts.ready in a test with Ahem.

* web-platform-tests/css/css-lists/parsing/list-style-type-computed-expected.txt:
* web-platform-tests/css/css-lists/parsing/list-style-type-valid-expected.txt:
* web-platform-tests/css/css-pseudo/marker-hit-testing-expected.txt:
* web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt:
* web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001.html:

Source/WebCore:

This patch extends the syntax of the list-style-type property to accept
arbitrary string values in order to customize the marker contents.
When a string is specified for list-style-type, the patch sets it to a
special ListStyleType::String, and the string value is stored in an
extra field.

It's a reland of r252076, which got reverted because in some platform
the number of bitfields in GreaterThanOrSameSizeAsStyleRareInheritedData
was actually smaller than in StyleRareInheritedData, due to padding
differences. Hopefully this will no longer be an issue.

Tests: imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001a.html
       imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001b.html
       imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html
       imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html
       imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-007.html
       imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed.html
       imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid.html
       imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing.html
       imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001.html

Some tests fail because mixed-bidi is not supported in markers
(https://bugs.webkit.org/show_bug.cgi?id=202849).

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSProperties.json:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isPartialKeywordPropertyID):
* css/parser/CSSParserFastPaths.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/RenderListMarker.cpp:
(WebCore::effectiveListMarkerType):
(WebCore::listMarkerSuffix):
(WebCore::listMarkerText):
(WebCore::RenderListMarker::styleDidChange):
(WebCore::RenderListMarker::paint):
(WebCore::RenderListMarker::updateContent):
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::updateMargins):
(WebCore::RenderListMarker::suffix const):
(WebCore::RenderListMarker::getRelativeMarkerRect):
* rendering/style/CounterContent.h:
(WebCore::CounterContent::CounterContent):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::listStyleStringValue const):
(WebCore::RenderStyle::setListStyleStringValue):
(WebCore::RenderStyle::initialListStyleStringValue):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyInheritListStyleType):
(WebCore::Style::BuilderCustom::applyInitialListStyleType):
(WebCore::Style::BuilderCustom::applyValueListStyleType):

LayoutTests:

Most tests for 'list-style-type: <string>' pass now, but some still fail
because mixed-bidi is not supported in markers
(https://bugs.webkit.org/show_bug.cgi?id=202849).

Various tests for the 'content' property in ::marker fail now. This is
expected because they were only passing by chance, since ::marker does
not support 'content' (https://bugs.webkit.org/show_bug.cgi?id=204163).

iOS and Mac have some extra failures due to subpixel differences for the
marker position.

* TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt: Removed.
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/mac/imported/w3c/web-platform-tests/css/css-pseudo/text-selection-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (267939 => 267940)


--- trunk/LayoutTests/ChangeLog	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/ChangeLog	2020-10-04 01:58:51 UTC (rev 267940)
@@ -1,3 +1,28 @@
+2020-10-03  Oriol Brufau  <[email protected]>
+
+        [css-lists] Implement list-style-type: <string>
+        https://bugs.webkit.org/show_bug.cgi?id=167729
+
+        Reviewed by Darin Adler.
+
+        Most tests for 'list-style-type: <string>' pass now, but some still fail
+        because mixed-bidi is not supported in markers
+        (https://bugs.webkit.org/show_bug.cgi?id=202849).
+
+        Various tests for the 'content' property in ::marker fail now. This is
+        expected because they were only passing by chance, since ::marker does
+        not support 'content' (https://bugs.webkit.org/show_bug.cgi?id=204163).
+
+        iOS and Mac have some extra failures due to subpixel differences for the
+        marker position.
+
+        * TestExpectations:
+        * platform/gtk/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt: Removed.
+        * platform/ios/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/mac/imported/w3c/web-platform-tests/css/css-pseudo/text-selection-expected.txt: Added.
+        * platform/wpe/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt: Removed.
+
 2020-10-03  Tetsuharu Ohzeki  <[email protected]>
 
         Add onslotchange on ShadowRoot and GlobalEventHandlers

Modified: trunk/LayoutTests/TestExpectations (267939 => 267940)


--- trunk/LayoutTests/TestExpectations	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/TestExpectations	2020-10-04 01:58:51 UTC (rev 267940)
@@ -3007,14 +3007,9 @@
 imported/w3c/web-platform-tests/css/css-lists/content-property/marker-text-matches-lower-latin.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-lists/content-property/marker-text-matches-square.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-lists/list-marker-with-lineheight-and-overflow-hidden-001.html [ ImageOnlyFailure ]
-webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001a.html [ ImageOnlyFailure ]
-webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001b.html [ ImageOnlyFailure ]
-webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html [ ImageOnlyFailure ]
-webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html [ ImageOnlyFailure ]
-webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005a.html [ ImageOnlyFailure ]
-webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005b.html [ ImageOnlyFailure ]
-webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-006.html [ ImageOnlyFailure ]
-webkit.org/b/167729 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-007.html [ ImageOnlyFailure ]
+webkit.org/b/202849 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005a.html [ ImageOnlyFailure ]
+webkit.org/b/202849 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-005b.html [ ImageOnlyFailure ]
+webkit.org/b/202849 imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-006.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-lists/list-with-image-display-changed-001.html [ ImageOnlyFailure ]
 
 webkit.org/b/196274 imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm [ Pass Failure ]
@@ -4337,18 +4332,26 @@
 webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/first-line-with-before-after.html [ ImageOnlyFailure ]
 webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/first-line-with-out-of-flow.html [ ImageOnlyFailure ]
 webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/grammar-error-001.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-006.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-007.tentative.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-008.tentative.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-009.tentative.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-010.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-011.tentative.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-012.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-014.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-017.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-019.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-021.html [ ImageOnlyFailure ]
-webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-022.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-002.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-003.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-003b.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-004.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-005.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-006.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-007.tentative.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-008.tentative.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-009.tentative.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-010.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-011.tentative.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-012.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-014.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-015.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-016.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-017.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-018.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-019.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-021.html [ ImageOnlyFailure ]
+webkit.org/b/204163 imported/w3c/web-platform-tests/css/css-pseudo/marker-content-022.html [ ImageOnlyFailure ]
 webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-font-variant-numeric-normal.html [ ImageOnlyFailure ]
 webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-list-style-position.html [ ImageOnlyFailure ]
 webkit.org/b/214461 imported/w3c/web-platform-tests/css/css-pseudo/marker-text-combine-upright.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (267939 => 267940)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-10-04 01:58:51 UTC (rev 267940)
@@ -1,3 +1,18 @@
+2020-10-03  Oriol Brufau  <[email protected]>
+
+        [css-lists] Implement list-style-type: <string>
+        https://bugs.webkit.org/show_bug.cgi?id=167729
+
+        Reviewed by Darin Adler.
+
+        Update test expectations, and await document.fonts.ready in a test with Ahem.
+
+        * web-platform-tests/css/css-lists/parsing/list-style-type-computed-expected.txt:
+        * web-platform-tests/css/css-lists/parsing/list-style-type-valid-expected.txt:
+        * web-platform-tests/css/css-pseudo/marker-hit-testing-expected.txt:
+        * web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt:
+        * web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001.html:
+
 2020-10-03  Tetsuharu Ohzeki  <[email protected]>
 
         Add onslotchange on ShadowRoot and GlobalEventHandlers

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed-expected.txt (267939 => 267940)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed-expected.txt	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed-expected.txt	2020-10-04 01:58:51 UTC (rev 267940)
@@ -14,8 +14,8 @@
 PASS Property list-style-type value 'georgian'
 PASS Property list-style-type value 'lower-alpha'
 PASS Property list-style-type value 'upper-alpha'
-FAIL Property list-style-type value '"marker string"' assert_true: '"marker string"' is a supported value for list-style-type. expected true got false
-FAIL Property list-style-type value '"Note: "' assert_true: '"Note: "' is a supported value for list-style-type. expected true got false
+PASS Property list-style-type value '"marker string"'
+PASS Property list-style-type value '"Note: "'
 FAIL Property list-style-type value 'counter-Style-Name' assert_true: 'counter-Style-Name' is a supported value for list-style-type. expected true got false
 FAIL Property list-style-type value 'CounterStyleName' assert_true: 'CounterStyleName' is a supported value for list-style-type. expected true got false
 FAIL Property list-style-type value 'symbols(cyclic "string")' assert_true: 'symbols(cyclic "string")' is a supported value for list-style-type. expected true got false

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid-expected.txt (267939 => 267940)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid-expected.txt	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid-expected.txt	2020-10-04 01:58:51 UTC (rev 267940)
@@ -14,8 +14,8 @@
 PASS e.style['list-style-type'] = "georgian" should set the property value
 PASS e.style['list-style-type'] = "lower-alpha" should set the property value
 PASS e.style['list-style-type'] = "upper-alpha" should set the property value
-FAIL e.style['list-style-type'] = "\"marker string\"" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['list-style-type'] = "\"Note: \"" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['list-style-type'] = "\"marker string\"" should set the property value
+PASS e.style['list-style-type'] = "\"Note: \"" should set the property value
 FAIL e.style['list-style-type'] = "counter-Style-Name" should set the property value assert_not_equals: property should be set got disallowed value ""
 FAIL e.style['list-style-type'] = "CounterStyleName" should set the property value assert_not_equals: property should be set got disallowed value ""
 FAIL e.style['list-style-type'] = "symbols(cyclic \"string\")" should set the property value assert_not_equals: property should be set got disallowed value ""

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing-expected.txt (267939 => 267940)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing-expected.txt	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing-expected.txt	2020-10-04 01:58:51 UTC (rev 267940)
@@ -9,7 +9,8 @@
 FAIL outside string ::marker assert_equals: event.target expected Element node <li class="string"></li> but got Element node <li class="image"></li>
 FAIL outside marker ::marker's content assert_equals: event.target expected Element node <li class="marker"></li> but got Element node <ol class="outside" data-x="-65">
   <li class="image"></l...
-FAIL outside marker ::marker assert_equals: event.target expected Element node <li class="marker"></li> but got Element node <li class="string"></li>
+FAIL outside marker ::marker assert_equals: event.target expected Element node <li class="marker"></li> but got Element node <ol class="outside" data-x="-65">
+  <li class="image"></l...
 FAIL outside nested image ::marker's content assert_equals: event.target expected Element node <li class="nested image"></li> but got Element node <ol class="outside" data-x="-65">
   <li class="image"></l...
 FAIL outside nested image ::marker assert_equals: event.target expected Element node <li class="nested image"></li> but got Element node <li class="marker"></li>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt (267939 => 267940)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt	2020-10-04 01:58:51 UTC (rev 267940)
@@ -5,6 +5,6 @@
 PASS Intrinsic contribution of outside content marker
 PASS Intrinsic contribution of inside symbol marker
 PASS Intrinsic contribution of inside decimal marker
-FAIL Intrinsic contribution of inside string marker assert_equals: clientWidth expected 60 but got 30
+PASS Intrinsic contribution of inside string marker
 FAIL Intrinsic contribution of inside content marker assert_equals: clientWidth expected 70 but got 30
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001.html (267939 => 267940)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001.html	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001.html	2020-10-04 01:58:51 UTC (rev 267940)
@@ -56,11 +56,15 @@
   }, msg);
 }
 
-for (let item of document.querySelectorAll(".outside > li")) {
-  check(item, `Intrinsic contribution of outside ${item.className} marker`);
-}
+setup({ explicit_done: true });
 
-for (let item of document.querySelectorAll(".inside > li")) {
-  check(item, `Intrinsic contribution of inside ${item.className} marker`);
-}
+document.fonts.ready.then(() => {
+  for (let item of document.querySelectorAll(".outside > li")) {
+    check(item, `Intrinsic contribution of outside ${item.className} marker`);
+  }
+  for (let item of document.querySelectorAll(".inside > li")) {
+    check(item, `Intrinsic contribution of inside ${item.className} marker`);
+  }
+  done();
+});
 </script>

Deleted: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt (267939 => 267940)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt	2020-10-04 01:58:51 UTC (rev 267940)
@@ -1,10 +0,0 @@
-
-PASS Intrinsic contribution of outside symbol marker
-PASS Intrinsic contribution of outside decimal marker
-PASS Intrinsic contribution of outside string marker
-PASS Intrinsic contribution of outside content marker
-PASS Intrinsic contribution of inside symbol marker
-FAIL Intrinsic contribution of inside decimal marker assert_equals: clientWidth expected 30 but got 11
-FAIL Intrinsic contribution of inside string marker assert_equals: clientWidth expected 60 but got 11
-FAIL Intrinsic contribution of inside content marker assert_equals: clientWidth expected 70 but got 11
-

Modified: trunk/LayoutTests/platform/ios/TestExpectations (267939 => 267940)


--- trunk/LayoutTests/platform/ios/TestExpectations	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2020-10-04 01:58:51 UTC (rev 267940)
@@ -3497,3 +3497,6 @@
 
 #<rdar://68952824> [ macOS iOS wk2 ] media/media-continues-playing-after-replace-source.html is a flaky failure
 media/media-continues-playing-after-replace-source.html [ Pass Failure ]
+
+# This test fails in iOS due to subpixel differences for the marker position
+imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html [ ImageOnlyFailure ]

Modified: trunk/LayoutTests/platform/mac/TestExpectations (267939 => 267940)


--- trunk/LayoutTests/platform/mac/TestExpectations	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2020-10-04 01:58:51 UTC (rev 267940)
@@ -2228,3 +2228,7 @@
 [ arm64 ] webaudio/convolution-mono-mono.html [ Failure ]
 
 webkit.org/b/217118 [ Release ] imported/w3c/web-platform-tests/user-timing/measure-l3.any.worker.html [ Pass Failure ]
+
+# These tests fail in Mac due to subpixel differences for the marker position
+imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html [ ImageOnlyFailure ]
+imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-004.html [ ImageOnlyFailure ]

Added: trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/css/css-pseudo/text-selection-expected.txt (0 => 267940)


--- trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/css/css-pseudo/text-selection-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/css/css-pseudo/text-selection-expected.txt	2020-10-04 01:58:51 UTC (rev 267940)
@@ -0,0 +1,11 @@
+helloworld
+helloworld
+helloworld
+
+FAIL Selection ending in ::before assert_equals: toString expected "hello" but got ""
+PASS Selection contained in ::before
+FAIL Selection ending in ::marker assert_equals: toString expected "hello" but got ""
+PASS Selection contained in ::marker
+FAIL Selection ending in ::before-marker assert_equals: toString expected "hello" but got ""
+FAIL Selection contained in ::before-marker assert_equals: toString expected "" but got "h"
+

Deleted: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt (267939 => 267940)


--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001-expected.txt	2020-10-04 01:58:51 UTC (rev 267940)
@@ -1,10 +0,0 @@
-
-PASS Intrinsic contribution of outside symbol marker
-PASS Intrinsic contribution of outside decimal marker
-PASS Intrinsic contribution of outside string marker
-PASS Intrinsic contribution of outside content marker
-PASS Intrinsic contribution of inside symbol marker
-FAIL Intrinsic contribution of inside decimal marker assert_equals: clientWidth expected 30 but got 11
-FAIL Intrinsic contribution of inside string marker assert_equals: clientWidth expected 60 but got 11
-FAIL Intrinsic contribution of inside content marker assert_equals: clientWidth expected 70 but got 11
-

Modified: trunk/Source/WebCore/ChangeLog (267939 => 267940)


--- trunk/Source/WebCore/ChangeLog	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/ChangeLog	2020-10-04 01:58:51 UTC (rev 267940)
@@ -1,3 +1,73 @@
+2020-10-03  Oriol Brufau  <[email protected]>
+
+        [css-lists] Implement list-style-type: <string>
+        https://bugs.webkit.org/show_bug.cgi?id=167729
+
+        Reviewed by Darin Adler.
+
+        This patch extends the syntax of the list-style-type property to accept
+        arbitrary string values in order to customize the marker contents.
+        When a string is specified for list-style-type, the patch sets it to a
+        special ListStyleType::String, and the string value is stored in an
+        extra field.
+
+        It's a reland of r252076, which got reverted because in some platform
+        the number of bitfields in GreaterThanOrSameSizeAsStyleRareInheritedData
+        was actually smaller than in StyleRareInheritedData, due to padding
+        differences. Hopefully this will no longer be an issue.
+
+        Tests: imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001a.html
+               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001b.html
+               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html
+               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html
+               imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-007.html
+               imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed.html
+               imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid.html
+               imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing.html
+               imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001.html
+
+        Some tests fail because mixed-bidi is not supported in markers
+        (https://bugs.webkit.org/show_bug.cgi?id=202849).
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        * css/CSSProperties.json:
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::CSSParserFastPaths::isPartialKeywordPropertyID):
+        * css/parser/CSSParserFastPaths.h:
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::CSSPropertyParser::parseSingleValue):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::effectiveListMarkerType):
+        (WebCore::listMarkerSuffix):
+        (WebCore::listMarkerText):
+        (WebCore::RenderListMarker::styleDidChange):
+        (WebCore::RenderListMarker::paint):
+        (WebCore::RenderListMarker::updateContent):
+        (WebCore::RenderListMarker::computePreferredLogicalWidths):
+        (WebCore::RenderListMarker::updateMargins):
+        (WebCore::RenderListMarker::suffix const):
+        (WebCore::RenderListMarker::getRelativeMarkerRect):
+        * rendering/style/CounterContent.h:
+        (WebCore::CounterContent::CounterContent):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::listStyleStringValue const):
+        (WebCore::RenderStyle::setListStyleStringValue):
+        (WebCore::RenderStyle::initialListStyleStringValue):
+        * rendering/style/RenderStyleConstants.cpp:
+        (WebCore::operator<<):
+        * rendering/style/RenderStyleConstants.h:
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+        (WebCore::StyleRareInheritedData::operator== const):
+        * rendering/style/StyleRareInheritedData.h:
+        * style/StyleBuilderCustom.h:
+        (WebCore::Style::BuilderCustom::applyInheritListStyleType):
+        (WebCore::Style::BuilderCustom::applyInitialListStyleType):
+        (WebCore::Style::BuilderCustom::applyValueListStyleType):
+
 2020-10-03  Tetsuharu Ohzeki  <[email protected]>
 
         Add onslotchange on ShadowRoot and GlobalEventHandlers

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (267939 => 267940)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2020-10-04 01:58:51 UTC (rev 267940)
@@ -3002,6 +3002,8 @@
         case CSSPropertyListStylePosition:
             return cssValuePool.createValue(style.listStylePosition());
         case CSSPropertyListStyleType:
+            if (style.listStyleType() == ListStyleType::String)
+                return cssValuePool.createValue(style.listStyleStringValue(), CSSUnitType::CSS_STRING);
             return cssValuePool.createValue(style.listStyleType());
         case CSSPropertyWebkitLocale:
             if (style.specifiedLocale().isNull())

Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (267939 => 267940)


--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h	2020-10-04 01:58:51 UTC (rev 267940)
@@ -1924,6 +1924,10 @@
     case ListStyleType::Square:
         m_value.valueID = CSSValueSquare;
         break;
+    case ListStyleType::String:
+        ASSERT_NOT_REACHED();
+        m_value.valueID = CSSValueInvalid;
+        break;
     case ListStyleType::Telugu:
         m_value.valueID = CSSValueTelugu;
         break;

Modified: trunk/Source/WebCore/css/CSSProperties.json (267939 => 267940)


--- trunk/Source/WebCore/css/CSSProperties.json	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/css/CSSProperties.json	2020-10-04 01:58:51 UTC (rev 267940)
@@ -2831,6 +2831,9 @@
                 "katakana-iroha",
                 "none"
             ],
+            "codegen-properties": {
+                "custom": "All"
+            },
             "specification": {
                 "category": "css-lists",
                 "url": "https://www.w3.org/TR/css-lists-3/#propdef-list-style-type"

Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (267939 => 267940)


--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2020-10-04 01:58:51 UTC (rev 267940)
@@ -1060,6 +1060,16 @@
     }
 }
 
+bool CSSParserFastPaths::isPartialKeywordPropertyID(CSSPropertyID propertyId)
+{
+    switch (propertyId) {
+    case CSSPropertyListStyleType:
+        return true;
+    default:
+        return false;
+    }
+}
+
 static bool isUniversalKeyword(StringView string)
 {
     // These keywords can be used for all properties.

Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.h (267939 => 267940)


--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.h	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.h	2020-10-04 01:58:51 UTC (rev 267940)
@@ -48,6 +48,11 @@
 
     // Properties handled here shouldn't be explicitly handled in CSSPropertyParser.
     static bool isKeywordPropertyID(CSSPropertyID);
+
+    // Returns whether a property may be handled by the fast path but has other
+    // non-keyword values which should be handled by the CSSPropertyParser.
+    static bool isPartialKeywordPropertyID(CSSPropertyID);
+
     static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, const CSSParserContext&);
 
     // Parses numeric and named colors.

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (267939 => 267940)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2020-10-04 01:58:51 UTC (rev 267940)
@@ -3878,10 +3878,12 @@
 RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSSPropertyID currentShorthand)
 {
     if (CSSParserFastPaths::isKeywordPropertyID(property)) {
-        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context))
+        if (CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context))
+            return consumeIdent(m_range);
+
+        // Some properties need to fall back onto the regular parser.
+        if (!CSSParserFastPaths::isPartialKeywordPropertyID(property))
             return nullptr;
-
-        return consumeIdent(m_range);
     }
     switch (property) {
     case CSSPropertyWillChange:
@@ -4337,6 +4339,9 @@
     case CSSPropertyColorScheme:
         return consumeColorScheme(m_range);
 #endif
+    case CSSPropertyListStyleType:
+        // All the keyword values for the list-style-type property are handled by the CSSParserFastPaths.
+        return consumeString(m_range);
     default:
         return nullptr;
     }

Modified: trunk/Source/WebCore/rendering/RenderListMarker.cpp (267939 => 267940)


--- trunk/Source/WebCore/rendering/RenderListMarker.cpp	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/rendering/RenderListMarker.cpp	2020-10-04 01:58:51 UTC (rev 267940)
@@ -498,6 +498,9 @@
     case ListStyleType::UpperLatin:
     case ListStyleType::UpperNorwegian:
         return (value < 1) ? ListStyleType::Decimal : type;
+    case ListStyleType::String:
+        ASSERT_NOT_REACHED();
+        break;
     }
 
     ASSERT_NOT_REACHED();
@@ -597,6 +600,9 @@
     case ListStyleType::UpperRoman:
     case ListStyleType::Urdu:
         return '.';
+    case ListStyleType::String:
+        ASSERT_NOT_REACHED();
+        break;
     }
 
     ASSERT_NOT_REACHED();
@@ -1050,6 +1056,9 @@
         return toGeorgian(value);
     case ListStyleType::Hebrew:
         return toHebrew(value);
+    case ListStyleType::String:
+        ASSERT_NOT_REACHED();
+        break;
     }
 
     ASSERT_NOT_REACHED();
@@ -1080,9 +1089,8 @@
 void RenderListMarker::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBox::styleDidChange(diff, oldStyle);
-
     if (oldStyle) {
-        if (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType())
+        if (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType() || (style().listStyleType() == ListStyleType::String && style().listStyleStringValue() != oldStyle->listStyleStringValue()))
             setNeedsLayoutAndPrefWidthsRecalc();
         if (oldStyle->isDisplayInlineType() && !style().isDisplayInlineType()) {
             delete m_inlineBoxWrapper;
@@ -1260,6 +1268,7 @@
     case ListStyleType::Urdu:
     case ListStyleType::Asterisks:
     case ListStyleType::Footnotes:
+    case ListStyleType::String:
         break;
     }
     if (m_text.isEmpty())
@@ -1282,7 +1291,7 @@
     FloatPoint textOrigin = FloatPoint(markerRect.x(), markerRect.y() + style().fontMetrics().ascent());
     textOrigin = roundPointToDevicePixels(LayoutPoint(textOrigin), document().deviceScaleFactor(), style().isLeftToRightDirection());
 
-    if (type == ListStyleType::Asterisks || type == ListStyleType::Footnotes)
+    if (type == ListStyleType::Asterisks || type == ListStyleType::Footnotes || type == ListStyleType::String)
         context.drawText(font, textRun, textOrigin);
     else {
         const UChar suffix = listMarkerSuffix(type, m_listItem->value());
@@ -1505,6 +1514,9 @@
     switch (type) {
     case ListStyleType::None:
         break;
+    case ListStyleType::String:
+        m_text = style().listStyleStringValue();
+        break;
     case ListStyleType::Circle:
     case ListStyleType::Disc:
     case ListStyleType::Square:
@@ -1613,11 +1625,13 @@
     case ListStyleType::None:
         break;
     case ListStyleType::Asterisks:
-    case ListStyleType::Footnotes: {
-        TextRun run = RenderBlock::constructTextRun(m_text, style());
-        logicalWidth = font.width(run); // no suffix for these types
+    case ListStyleType::Footnotes:
+    case ListStyleType::String:
+        if (!m_text.isEmpty()) {
+            TextRun run = RenderBlock::constructTextRun(m_text, style());
+            logicalWidth = font.width(run); // no suffix for these types
+        }
         break;
-    }
     case ListStyleType::Circle:
     case ListStyleType::Disc:
     case ListStyleType::Square:
@@ -1738,45 +1752,30 @@
             default:
                 break;
         }
+    } else if (isImage()) {
+        marginStart = -minPreferredLogicalWidth() - cMarkerPadding;
+        marginEnd = cMarkerPadding;
     } else {
-        if (style().isLeftToRightDirection()) {
-            if (isImage())
-                marginStart = -minPreferredLogicalWidth() - cMarkerPadding;
-            else {
-                int offset = fontMetrics.ascent() * 2 / 3;
-                switch (style().listStyleType()) {
-                case ListStyleType::Disc:
-                case ListStyleType::Circle:
-                case ListStyleType::Square:
-                    marginStart = -offset - cMarkerPadding - 1;
-                    break;
-                case ListStyleType::None:
-                    break;
-                default:
-                    marginStart = m_text.isEmpty() ? 0_lu : -minPreferredLogicalWidth() - offset / 2;
-                }
+        int offset = fontMetrics.ascent() * 2 / 3;
+        switch (style().listStyleType()) {
+        case ListStyleType::Disc:
+        case ListStyleType::Circle:
+        case ListStyleType::Square:
+            marginStart = -offset - cMarkerPadding - 1;
+            marginEnd = offset + cMarkerPadding + 1 - minPreferredLogicalWidth();
+            break;
+        case ListStyleType::None:
+            break;
+        case ListStyleType::String:
+            if (!m_text.isEmpty())
+                marginStart = -minPreferredLogicalWidth();
+            break;
+        default:
+            if (!m_text.isEmpty()) {
+                marginStart = -minPreferredLogicalWidth() - offset / 2;
+                marginEnd = offset / 2;
             }
-            marginEnd = -marginStart - minPreferredLogicalWidth();
-        } else {
-            if (isImage())
-                marginEnd = cMarkerPadding;
-            else {
-                int offset = fontMetrics.ascent() * 2 / 3;
-                switch (style().listStyleType()) {
-                case ListStyleType::Disc:
-                case ListStyleType::Circle:
-                case ListStyleType::Square:
-                    marginEnd = offset + cMarkerPadding + 1 - minPreferredLogicalWidth();
-                    break;
-                case ListStyleType::None:
-                    break;
-                default:
-                    marginEnd = m_text.isEmpty() ? 0 : offset / 2;
-                }
-            }
-            marginStart = -marginEnd - minPreferredLogicalWidth();
         }
-        
     }
 
     mutableStyle().setMarginStart(Length(marginStart, Fixed));
@@ -1800,6 +1799,9 @@
 String RenderListMarker::suffix() const
 {
     ListStyleType type = style().listStyleType();
+    if (type == ListStyleType::String)
+        return emptyString();
+
     const UChar suffix = listMarkerSuffix(type, m_listItem->value());
 
     if (suffix == ' ')
@@ -1832,7 +1834,10 @@
     ListStyleType type = style().listStyleType();
     switch (type) {
     case ListStyleType::Asterisks:
-    case ListStyleType::Footnotes: {
+    case ListStyleType::Footnotes:
+    case ListStyleType::String: {
+        if (m_text.isEmpty())
+            return FloatRect();
         const FontCascade& font = style().fontCascade();
         TextRun run = RenderBlock::constructTextRun(m_text, style());
         relativeRect = FloatRect(0, 0, font.width(run), font.fontMetrics().height());

Modified: trunk/Source/WebCore/rendering/style/CounterContent.h (267939 => 267940)


--- trunk/Source/WebCore/rendering/style/CounterContent.h	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/rendering/style/CounterContent.h	2020-10-04 01:58:51 UTC (rev 267940)
@@ -37,6 +37,7 @@
         , m_listStyle(style)
         , m_separator(separator)
     {
+        ASSERT(style != ListStyleType::String);
     }
 
     const AtomString& identifier() const { return m_identifier; }

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (267939 => 267940)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2020-10-04 01:58:51 UTC (rev 267940)
@@ -439,6 +439,7 @@
     EmptyCell emptyCells() const { return static_cast<EmptyCell>(m_inheritedFlags.emptyCells); }
     CaptionSide captionSide() const { return static_cast<CaptionSide>(m_inheritedFlags.captionSide); }
 
+    const AtomString& listStyleStringValue() const { return m_rareInheritedData->listStyleStringValue; }
     ListStyleType listStyleType() const { return static_cast<ListStyleType>(m_inheritedFlags.listStyleType); }
     StyleImage* listStyleImage() const;
     ListStylePosition listStylePosition() const { return static_cast<ListStylePosition>(m_inheritedFlags.listStylePosition); }
@@ -998,6 +999,7 @@
     void setAspectRatioDenominator(float v) { SET_VAR(m_rareNonInheritedData, aspectRatioDenominator, v); }
     void setAspectRatioNumerator(float v) { SET_VAR(m_rareNonInheritedData, aspectRatioNumerator, v); }
 
+    void setListStyleStringValue(const AtomString& value) { SET_VAR(m_rareInheritedData, listStyleStringValue, value); }
     void setListStyleType(ListStyleType v) { m_inheritedFlags.listStyleType = static_cast<unsigned>(v); }
     void setListStyleImage(RefPtr<StyleImage>&&);
     void setListStylePosition(ListStylePosition v) { m_inheritedFlags.listStylePosition = static_cast<unsigned>(v); }
@@ -1506,6 +1508,7 @@
     static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0f, Percent), Length(50.0f, Percent)); }
     static EmptyCell initialEmptyCells() { return EmptyCell::Show; }
     static ListStylePosition initialListStylePosition() { return ListStylePosition::Outside; }
+    static const AtomString& initialListStyleStringValue() { return nullAtom(); }
     static ListStyleType initialListStyleType() { return ListStyleType::Disc; }
     static TextTransform initialTextTransform() { return TextTransform::None; }
     static Visibility initialVisibility() { return Visibility::Visible; }

Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp (267939 => 267940)


--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp	2020-10-04 01:58:51 UTC (rev 267940)
@@ -773,6 +773,7 @@
     case ListStyleType::HiraganaIroha: ts << "hiragana-iroha"; break;
     case ListStyleType::KatakanaIroha: ts << "katakana-iroha"; break;
     case ListStyleType::None: ts << "none"; break;
+    case ListStyleType::String: ts << "string"; break;
     }
     return ts;
 }

Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (267939 => 267940)


--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h	2020-10-04 01:58:51 UTC (rev 267940)
@@ -638,6 +638,7 @@
     Katakana,
     HiraganaIroha,
     KatakanaIroha,
+    String,
     None
 };
 

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (267939 => 267940)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2020-10-04 01:58:51 UTC (rev 267940)
@@ -42,7 +42,7 @@
     float firstFloat;
     Color colors[9];
     void* ownPtrs[1];
-    AtomString atomStrings[5];
+    AtomString atomStrings[6];
     void* refPtrs[3];
     Length lengths[2];
     float secondFloat;
@@ -77,6 +77,7 @@
 
 StyleRareInheritedData::StyleRareInheritedData()
     : listStyleImage(RenderStyle::initialListStyleImage())
+    , listStyleStringValue(RenderStyle::initialListStyleStringValue())
     , textStrokeWidth(RenderStyle::initialTextStrokeWidth())
     , indent(RenderStyle::initialTextIndent())
     , effectiveZoom(RenderStyle::initialZoom())
@@ -162,6 +163,7 @@
 inline StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
     : RefCounted<StyleRareInheritedData>()
     , listStyleImage(o.listStyleImage)
+    , listStyleStringValue(o.listStyleStringValue)
     , textStrokeColor(o.textStrokeColor)
     , textStrokeWidth(o.textStrokeWidth)
     , textFillColor(o.textFillColor)
@@ -359,7 +361,8 @@
         && visitedLinkStrokeColor == o.visitedLinkStrokeColor
         && miterLimit == o.miterLimit
         && customProperties == o.customProperties
-        && arePointingToEqualData(listStyleImage, o.listStyleImage);
+        && arePointingToEqualData(listStyleImage, o.listStyleImage)
+        && listStyleStringValue == o.listStyleStringValue;
 }
 
 bool StyleRareInheritedData::hasColorFilters() const

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (267939 => 267940)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2020-10-04 01:58:51 UTC (rev 267940)
@@ -73,6 +73,7 @@
     bool hasColorFilters() const;
 
     RefPtr<StyleImage> listStyleImage;
+    AtomString listStyleStringValue;
 
     Color textStrokeColor;
     float textStrokeWidth;

Modified: trunk/Source/WebCore/style/StyleBuilderCustom.h (267939 => 267940)


--- trunk/Source/WebCore/style/StyleBuilderCustom.h	2020-10-04 00:34:54 UTC (rev 267939)
+++ trunk/Source/WebCore/style/StyleBuilderCustom.h	2020-10-04 01:58:51 UTC (rev 267940)
@@ -92,6 +92,7 @@
 #if ENABLE(TEXT_AUTOSIZING)
     DECLARE_PROPERTY_CUSTOM_HANDLERS(LineHeight);
 #endif
+    DECLARE_PROPERTY_CUSTOM_HANDLERS(ListStyleType);
     DECLARE_PROPERTY_CUSTOM_HANDLERS(OutlineStyle);
     DECLARE_PROPERTY_CUSTOM_HANDLERS(Size);
     DECLARE_PROPERTY_CUSTOM_HANDLERS(Stroke);
@@ -746,6 +747,30 @@
 
 #endif
 
+inline void BuilderCustom::applyInheritListStyleType(BuilderState& builderState)
+{
+    builderState.style().setListStyleType(builderState.parentStyle().listStyleType());
+    builderState.style().setListStyleStringValue(builderState.parentStyle().listStyleStringValue());
+}
+
+inline void BuilderCustom::applyInitialListStyleType(BuilderState& builderState)
+{
+    builderState.style().setListStyleType(RenderStyle::initialListStyleType());
+    builderState.style().setListStyleStringValue(RenderStyle::initialListStyleStringValue());
+}
+
+inline void BuilderCustom::applyValueListStyleType(BuilderState& builderState, CSSValue& value)
+{
+    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
+    if (primitiveValue.isValueID()) {
+        builderState.style().setListStyleType(primitiveValue);
+        builderState.style().setListStyleStringValue(RenderStyle::initialListStyleStringValue());
+        return;
+    }
+    builderState.style().setListStyleType(ListStyleType::String);
+    builderState.style().setListStyleStringValue(primitiveValue.stringValue());
+}
+
 inline void BuilderCustom::applyInheritOutlineStyle(BuilderState& builderState)
 {
     builderState.style().setOutlineStyleIsAuto(builderState.parentStyle().outlineStyleIsAuto());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to