Title: [290888] trunk
Revision
290888
Author
[email protected]
Date
2022-03-07 06:26:58 -0800 (Mon, 07 Mar 2022)

Log Message

[web-animations] text-emphasis-style should support discrete animations
https://bugs.webkit.org/show_bug.cgi?id=237514

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:
* web-platform-tests/css/css-text-decor/inheritance-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:

Source/WebCore:

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

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (290887 => 290888)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-07 14:26:58 UTC (rev 290888)
@@ -1,5 +1,19 @@
 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
+
+        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:
+        * web-platform-tests/css/css-text-decor/inheritance-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:
+
+2022-03-07  Antoine Quint  <[email protected]>
+
         [web-animations] text-emphasis-color should support non-discrete animations
         https://bugs.webkit.org/show_bug.cgi?id=237518
 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt	2022-03-07 14:26:58 UTC (rev 290888)
@@ -52,7 +52,7 @@
 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-color value 'rgb(0, 255, 0)' in ::marker
 PASS Property text-emphasis-position value 'under left' in ::marker
-FAIL Property text-emphasis-style value 'dot' in ::marker assert_equals: expected "dot" but got "filled dot"
+PASS Property text-emphasis-style value 'dot' in ::marker
 PASS Property text-shadow value 'rgb(0, 255, 0) 1px 2px 3px' in ::marker
 PASS Property display value 'none' in ::marker
 PASS Property position value 'absolute' in ::marker

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-07 14:26:58 UTC (rev 290888)
@@ -37,7 +37,7 @@
 FAIL Animation of text-emphasis in ::marker assert_equals: expected "triangle rgb(50, 100, 100)" but got ""
 PASS Animation of text-emphasis-color in ::marker
 PASS Animation of text-emphasis-position in ::marker
-FAIL Animation of text-emphasis-style in ::marker assert_equals: expected "triangle" but got "none"
+PASS Animation of text-emphasis-style in ::marker
 PASS Animation of text-shadow in ::marker
 PASS Animation of display in ::marker
 PASS Animation of position in ::marker
@@ -84,7 +84,7 @@
 FAIL Transition of text-emphasis in ::marker assert_equals: expected "triangle rgb(50, 100, 100)" but got ""
 PASS Transition of text-emphasis-color in ::marker
 PASS Transition of text-emphasis-position in ::marker
-FAIL Transition of text-emphasis-style in ::marker assert_equals: expected "triangle" but got "filled triangle"
+PASS Transition of text-emphasis-style in ::marker
 PASS Transition of text-shadow in ::marker
 PASS Transition of display in ::marker
 PASS Transition of position in ::marker

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/inheritance-expected.txt (290887 => 290888)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/inheritance-expected.txt	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/inheritance-expected.txt	2022-03-07 14:26:58 UTC (rev 290888)
@@ -10,7 +10,7 @@
 PASS Property text-emphasis-position has initial value over right
 PASS Property text-emphasis-position inherits
 PASS Property text-emphasis-style has initial value none
-FAIL Property text-emphasis-style inherits assert_equals: expected "triangle" but got "filled triangle"
+PASS Property text-emphasis-style inherits
 PASS Property text-shadow has initial value none
 PASS Property text-shadow inherits
 PASS Property text-underline-position has initial value auto

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt (290887 => 290888)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt	2022-03-07 14:26:58 UTC (rev 290888)
@@ -162,6 +162,9 @@
 PASS text-emphasis-position (type: discrete) has testAccumulation function
 PASS text-emphasis-position: "under left" onto "over"
 PASS text-emphasis-position: "over" onto "under left"
+PASS text-emphasis-style (type: discrete) has testAccumulation function
+PASS text-emphasis-style: "open dot" onto "circle"
+PASS text-emphasis-style: "circle" onto "open dot"
 PASS text-overflow (type: discrete) has testAccumulation function
 PASS text-overflow: "ellipsis" onto "clip"
 PASS text-overflow: "clip" onto "ellipsis"

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt (290887 => 290888)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt	2022-03-07 14:26:58 UTC (rev 290888)
@@ -162,6 +162,9 @@
 PASS text-emphasis-position (type: discrete) has testAddition function
 PASS text-emphasis-position: "under left" onto "over"
 PASS text-emphasis-position: "over" onto "under left"
+PASS text-emphasis-style (type: discrete) has testAddition function
+PASS text-emphasis-style: "open dot" onto "circle"
+PASS text-emphasis-style: "circle" onto "open dot"
 PASS text-overflow (type: discrete) has testAddition function
 PASS text-overflow: "ellipsis" onto "clip"
 PASS text-overflow: "clip" onto "ellipsis"

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt (290887 => 290888)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt	2022-03-07 14:26:58 UTC (rev 290888)
@@ -189,6 +189,10 @@
 PASS text-emphasis-position uses discrete animation when animating between "over" and "under left" with linear easing
 PASS text-emphasis-position uses discrete animation when animating between "over" and "under left" with effect easing
 PASS text-emphasis-position uses discrete animation when animating between "over" and "under left" with keyframe easing
+PASS text-emphasis-style (type: discrete) has testInterpolation function
+PASS text-emphasis-style uses discrete animation when animating between "circle" and "open dot" with linear easing
+PASS text-emphasis-style uses discrete animation when animating between "circle" and "open dot" with effect easing
+PASS text-emphasis-style uses discrete animation when animating between "circle" and "open dot" with keyframe easing
 PASS text-overflow (type: discrete) has testInterpolation function
 PASS text-overflow uses discrete animation when animating between "clip" and "ellipsis" with linear easing
 PASS text-overflow uses discrete animation when animating between "clip" and "ellipsis" with effect easing

Modified: trunk/Source/WebCore/ChangeLog (290887 => 290888)


--- trunk/Source/WebCore/ChangeLog	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/Source/WebCore/ChangeLog	2022-03-07 14:26:58 UTC (rev 290888)
@@ -1,5 +1,17 @@
 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
+
+        Reviewed by Antti Koivisto.
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
+
+2022-03-07  Antoine Quint  <[email protected]>
+
         [web-animations] text-emphasis-color should support non-discrete animations
         https://bugs.webkit.org/show_bug.cgi?id=237518
 

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (290887 => 290888)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-07 14:26:58 UTC (rev 290888)
@@ -728,7 +728,7 @@
 };
 
 template <typename T>
-class DiscretePropertyWrapper final : public PropertyWrapperGetter<T> {
+class DiscretePropertyWrapper : public PropertyWrapperGetter<T> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     DiscretePropertyWrapper(CSSPropertyID property, T (RenderStyle::*getter)() const, void (RenderStyle::*setter)(T))
@@ -737,7 +737,7 @@
     {
     }
 
-    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const final
+    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const override
     {
         ASSERT(!context.progress || context.progress == 1.0);
         (destination.*this->m_setter)(this->value(context.progress ? to : from));
@@ -2465,6 +2465,22 @@
     }
 };
 
+class TextEmphasisStyleWrapper final : public DiscretePropertyWrapper<TextEmphasisMark> {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    TextEmphasisStyleWrapper()
+        : DiscretePropertyWrapper<TextEmphasisMark>(CSSPropertyTextEmphasisStyle, &RenderStyle::textEmphasisMark, &RenderStyle::setTextEmphasisMark)
+    {
+    }
+
+private:
+    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const final
+    {
+        destination.setTextEmphasisFill((context.progress > 0.5 ? to : from).textEmphasisFill());
+        DiscretePropertyWrapper::blend(destination, from, to, context);
+    }
+};
+
 class CSSPropertyAnimationWrapperMap final {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -2763,6 +2779,7 @@
         new DiscretePropertyWrapper<TextDecorationStyle>(CSSPropertyTextDecorationStyle, &RenderStyle::textDecorationStyle, &RenderStyle::setTextDecorationStyle),
         new PropertyWrapperVisitedAffectedColor(CSSPropertyTextEmphasisColor, MaybeInvalidColor, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::visitedLinkTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor),
         new DiscretePropertyWrapper<OptionSet<TextEmphasisPosition>>(CSSPropertyTextEmphasisPosition, &RenderStyle::textEmphasisPosition, &RenderStyle::setTextEmphasisPosition),
+        new TextEmphasisStyleWrapper,
         new DiscretePropertyWrapper<TextOverflow>(CSSPropertyTextOverflow, &RenderStyle::textOverflow, &RenderStyle::setTextOverflow),
         new DiscretePropertyWrapper<OptionSet<TouchAction>>(CSSPropertyTouchAction, &RenderStyle::touchActions, &RenderStyle::setTouchActions),
         new DiscretePropertyWrapper<TextTransform>(CSSPropertyTextTransform, &RenderStyle::textTransform, &RenderStyle::setTextTransform),

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (290887 => 290888)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-03-07 14:24:46 UTC (rev 290887)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-03-07 14:26:58 UTC (rev 290888)
@@ -3570,7 +3570,8 @@
             case TextEmphasisMark::Triangle:
             case TextEmphasisMark::Sesame:
                 auto list = CSSValueList::createSpaceSeparated();
-                list->append(cssValuePool.createValue(style.textEmphasisFill()));
+                if (style.textEmphasisFill() != TextEmphasisFill::Filled)
+                    list->append(cssValuePool.createValue(style.textEmphasisFill()));
                 list->append(cssValuePool.createValue(style.textEmphasisMark()));
                 return list;
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to