Title: [290895] trunk
Revision
290895
Author
[email protected]
Date
2022-03-07 09:53:06 -0800 (Mon, 07 Mar 2022)

Log Message

[web-animations] text-emphasis shorthand should be animatable
https://bugs.webkit.org/show_bug.cgi?id=237529

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
* web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:

Source/WebCore:

* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForTextEmphasisStyle):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (290894 => 290895)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-07 17:52:09 UTC (rev 290894)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-07 17:53:06 UTC (rev 290895)
@@ -1,5 +1,15 @@
 2022-03-07  Antoine Quint  <[email protected]>
 
+        [web-animations] text-emphasis shorthand should be animatable
+        https://bugs.webkit.org/show_bug.cgi?id=237529
+
+        Reviewed by Antti Koivisto.
+
+        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
+        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
+
+2022-03-07  Antoine Quint  <[email protected]>
+
         [web-animations] text-emphasis-style should support discrete animations
         https://bugs.webkit.org/show_bug.cgi?id=237514
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt (290894 => 290895)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt	2022-03-07 17:52:09 UTC (rev 290894)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt	2022-03-07 17:53:06 UTC (rev 290895)
@@ -49,7 +49,7 @@
 PASS Property word-break value 'break-word' in ::marker
 PASS Property word-spacing value '10px' in ::marker
 PASS Property text-decoration-skip-ink value 'none' in ::marker
-FAIL Property text-emphasis value 'dot rgb(0, 255, 0)' in ::marker assert_equals: expected "dot rgb(0, 255, 0)" but got ""
+PASS Property text-emphasis value 'dot rgb(0, 255, 0)' in ::marker
 PASS Property text-emphasis-color value 'rgb(0, 255, 0)' in ::marker
 PASS Property text-emphasis-position value 'under left' in ::marker
 PASS Property text-emphasis-style value 'dot' in ::marker

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt (290894 => 290895)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-07 17:52:09 UTC (rev 290894)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-07 17:53:06 UTC (rev 290895)
@@ -34,7 +34,7 @@
 PASS Animation of word-break in ::marker
 PASS Animation of word-spacing in ::marker
 PASS Animation of text-decoration-skip-ink in ::marker
-FAIL Animation of text-emphasis in ::marker assert_equals: expected "triangle rgb(50, 100, 100)" but got ""
+PASS Animation of text-emphasis in ::marker
 PASS Animation of text-emphasis-color in ::marker
 PASS Animation of text-emphasis-position in ::marker
 PASS Animation of text-emphasis-style in ::marker
@@ -81,7 +81,7 @@
 PASS Transition of word-break in ::marker
 PASS Transition of word-spacing in ::marker
 PASS Transition of text-decoration-skip-ink in ::marker
-FAIL Transition of text-emphasis in ::marker assert_equals: expected "triangle rgb(50, 100, 100)" but got ""
+PASS Transition of text-emphasis in ::marker
 PASS Transition of text-emphasis-color in ::marker
 PASS Transition of text-emphasis-position in ::marker
 PASS Transition of text-emphasis-style in ::marker

Modified: trunk/Source/WebCore/ChangeLog (290894 => 290895)


--- trunk/Source/WebCore/ChangeLog	2022-03-07 17:52:09 UTC (rev 290894)
+++ trunk/Source/WebCore/ChangeLog	2022-03-07 17:53:06 UTC (rev 290895)
@@ -1,3 +1,16 @@
+2022-03-07  Antoine Quint  <[email protected]>
+
+        [web-animations] text-emphasis shorthand should be animatable
+        https://bugs.webkit.org/show_bug.cgi?id=237529
+
+        Reviewed by Antti Koivisto.
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::valueForTextEmphasisStyle):
+        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
+
 2022-03-07  Peng Liu  <[email protected]>
 
         Small cleanups of media code

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (290894 => 290895)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-07 17:52:09 UTC (rev 290894)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-07 17:53:06 UTC (rev 290895)
@@ -2836,7 +2836,8 @@
         CSSPropertyWebkitBorderRadius,
         CSSPropertyTransformOrigin,
         CSSPropertyPerspectiveOrigin,
-        CSSPropertyOffset
+        CSSPropertyOffset,
+        CSSPropertyTextEmphasis
     };
     const unsigned animatableShorthandPropertiesCount = WTF_ARRAY_LENGTH(animatableShorthandProperties);
 

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (290894 => 290895)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-03-07 17:52:09 UTC (rev 290894)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-03-07 17:53:06 UTC (rev 290895)
@@ -1922,6 +1922,33 @@
     return list;
 }
 
+static Ref<CSSValue> valueForTextEmphasisStyle(const RenderStyle& style)
+{
+    auto& cssValuePool = CSSValuePool::singleton();
+    switch (style.textEmphasisMark()) {
+    case TextEmphasisMark::None:
+        return cssValuePool.createIdentifierValue(CSSValueNone);
+    case TextEmphasisMark::Custom:
+        return cssValuePool.createValue(style.textEmphasisCustomMark(), CSSUnitType::CSS_STRING);
+    case TextEmphasisMark::Auto:
+        ASSERT_NOT_REACHED();
+#if !ASSERT_ENABLED
+        FALLTHROUGH;
+#endif
+    case TextEmphasisMark::Dot:
+    case TextEmphasisMark::Circle:
+    case TextEmphasisMark::DoubleCircle:
+    case TextEmphasisMark::Triangle:
+    case TextEmphasisMark::Sesame:
+        auto list = CSSValueList::createSpaceSeparated();
+        if (style.textEmphasisFill() != TextEmphasisFill::Filled)
+            list->append(cssValuePool.createValue(style.textEmphasisFill()));
+        list->append(cssValuePool.createValue(style.textEmphasisMark()));
+        return list;
+    }
+    RELEASE_ASSERT_NOT_REACHED();
+}
+
 static Ref<CSSValue> speakAsToCSSValue(OptionSet<SpeakAs> speakAs)
 {
     auto& cssValuePool = CSSValuePool::singleton();
@@ -3554,28 +3581,13 @@
         case CSSPropertyTextEmphasisPosition:
             return renderEmphasisPositionFlagsToCSSValue(style.textEmphasisPosition());
         case CSSPropertyTextEmphasisStyle:
-            switch (style.textEmphasisMark()) {
-            case TextEmphasisMark::None:
-                return cssValuePool.createIdentifierValue(CSSValueNone);
-            case TextEmphasisMark::Custom:
-                return cssValuePool.createValue(style.textEmphasisCustomMark(), CSSUnitType::CSS_STRING);
-            case TextEmphasisMark::Auto:
-                ASSERT_NOT_REACHED();
-#if !ASSERT_ENABLED
-                FALLTHROUGH;
-#endif
-            case TextEmphasisMark::Dot:
-            case TextEmphasisMark::Circle:
-            case TextEmphasisMark::DoubleCircle:
-            case TextEmphasisMark::Triangle:
-            case TextEmphasisMark::Sesame:
-                auto list = CSSValueList::createSpaceSeparated();
-                if (style.textEmphasisFill() != TextEmphasisFill::Filled)
-                    list->append(cssValuePool.createValue(style.textEmphasisFill()));
-                list->append(cssValuePool.createValue(style.textEmphasisMark()));
-                return list;
-            }
-            RELEASE_ASSERT_NOT_REACHED();
+            return valueForTextEmphasisStyle(style);
+        case CSSPropertyTextEmphasis: {
+            auto list = CSSValueList::createSpaceSeparated();
+            list->append(valueForTextEmphasisStyle(style));
+            list->append(currentColorOrValidColor(&style, style.textEmphasisColor()));
+            return list;
+        }
         case CSSPropertyTextIndent: {
             auto textIndent = zoomAdjustedPixelValueForLength(style.textIndent(), style);
             if (style.textIndentLine() == TextIndentLine::EachLine || style.textIndentType() == TextIndentType::Hanging) {
@@ -4179,7 +4191,6 @@
 
         /* Unimplemented CSS 3 properties (including CSS3 shorthand properties) */
         case CSSPropertyAll:
-        case CSSPropertyTextEmphasis:
             break;
 
         /* Directional properties are resolved by resolveDirectionAwareProperty() before the switch. */
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to