Title: [291114] trunk
Revision
291114
Author
[email protected]
Date
2022-03-10 08:43:08 -0800 (Thu, 10 Mar 2022)

Log Message

[web-animations] font-variant-ligatures should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237667

Reviewed by Myles C. Maxfield.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:

Source/WebCore:

* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291113 => 291114)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-10 16:34:19 UTC (rev 291113)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-10 16:43:08 UTC (rev 291114)
@@ -1,5 +1,17 @@
 2022-03-10  Antoine Quint  <[email protected]>
 
+        [web-animations] font-variant-ligatures should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237667
+
+        Reviewed by Myles C. Maxfield.
+
+        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:
+
+2022-03-10  Antoine Quint  <[email protected]>
+
         [web-animations] font-variant-east-asian should support discrete animation
         https://bugs.webkit.org/show_bug.cgi?id=237665
 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-10 16:34:19 UTC (rev 291113)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt	2022-03-10 16:43:08 UTC (rev 291114)
@@ -14,7 +14,7 @@
 FAIL Animation of font-variant in ::marker assert_equals: expected "small-caps" but got "tabular-nums"
 FAIL Animation of font-variant-caps in ::marker assert_equals: expected "small-caps" but got "normal"
 PASS Animation of font-variant-east-asian in ::marker
-FAIL Animation of font-variant-ligatures in ::marker assert_equals: expected "historical-ligatures" but got "normal"
+PASS Animation of font-variant-ligatures in ::marker
 FAIL Animation of font-variant-numeric in ::marker assert_equals: expected "slashed-zero" but got "tabular-nums"
 FAIL Animation of font-variant-position in ::marker assert_equals: expected "sub" but got "normal"
 PASS Animation of font-weight in ::marker

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-10 16:34:19 UTC (rev 291113)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-10 16:43:08 UTC (rev 291114)
@@ -260,6 +260,9 @@
 PASS font-variant-east-asian (type: discrete) has testAccumulation function
 PASS font-variant-east-asian: "proportional-width" onto "full-width"
 PASS font-variant-east-asian: "full-width" onto "proportional-width"
+PASS font-variant-ligatures (type: discrete) has testAccumulation function
+PASS font-variant-ligatures: "no-common-ligatures" onto "common-ligatures"
+PASS font-variant-ligatures: "common-ligatures" onto "no-common-ligatures"
 PASS font-variation-settings (type: fontVariationSettings) has testAccumulation function
 FAIL font-variation-settings with composite type accumulate assert_equals: The value should be "wght" 2.2 at 250ms expected "\"wght\" 2.2" but got "\"wght\" 1.2"
 PASS font-variation-settings (type: discrete) has testAccumulation function

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-10 16:34:19 UTC (rev 291113)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-10 16:43:08 UTC (rev 291114)
@@ -260,6 +260,9 @@
 PASS font-variant-east-asian (type: discrete) has testAddition function
 PASS font-variant-east-asian: "proportional-width" onto "full-width"
 PASS font-variant-east-asian: "full-width" onto "proportional-width"
+PASS font-variant-ligatures (type: discrete) has testAddition function
+PASS font-variant-ligatures: "no-common-ligatures" onto "common-ligatures"
+PASS font-variant-ligatures: "common-ligatures" onto "no-common-ligatures"
 PASS font-variation-settings (type: fontVariationSettings) has testAddition function
 FAIL font-variation-settings with composite type add assert_equals: The value should be "wght" 2.2 at 250ms expected "\"wght\" 2.2" but got "\"wght\" 1.2"
 PASS font-variation-settings (type: discrete) has testAddition function

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-10 16:34:19 UTC (rev 291113)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-10 16:43:08 UTC (rev 291114)
@@ -317,6 +317,10 @@
 PASS font-variant-east-asian uses discrete animation when animating between "full-width" and "proportional-width" with linear easing
 PASS font-variant-east-asian uses discrete animation when animating between "full-width" and "proportional-width" with effect easing
 PASS font-variant-east-asian uses discrete animation when animating between "full-width" and "proportional-width" with keyframe easing
+PASS font-variant-ligatures (type: discrete) has testInterpolation function
+PASS font-variant-ligatures uses discrete animation when animating between "common-ligatures" and "no-common-ligatures" with linear easing
+PASS font-variant-ligatures uses discrete animation when animating between "common-ligatures" and "no-common-ligatures" with effect easing
+PASS font-variant-ligatures uses discrete animation when animating between "common-ligatures" and "no-common-ligatures" with keyframe easing
 PASS font-variation-settings (type: fontVariationSettings) has testInterpolation function
 PASS font-variation-settings supports animation as float
 PASS font-variation-settings supports animation as float with multiple tags

Modified: trunk/Source/WebCore/ChangeLog (291113 => 291114)


--- trunk/Source/WebCore/ChangeLog	2022-03-10 16:34:19 UTC (rev 291113)
+++ trunk/Source/WebCore/ChangeLog	2022-03-10 16:43:08 UTC (rev 291114)
@@ -1,3 +1,13 @@
+2022-03-10  Antoine Quint  <[email protected]>
+
+        [web-animations] font-variant-ligatures should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237667
+
+        Reviewed by Myles C. Maxfield.
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+
 2022-03-10  Lauro Moura  <[email protected]>
 
         Unreviewed, non-unified build fix after 248260@main

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (291113 => 291114)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-10 16:34:19 UTC (rev 291113)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-10 16:43:08 UTC (rev 291114)
@@ -2633,6 +2633,49 @@
 #endif
 };
 
+class FontVariantLigaturesWrapper final : public AnimationPropertyWrapperBase {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    FontVariantLigaturesWrapper()
+        : AnimationPropertyWrapperBase(CSSPropertyFontVariantLigatures)
+    {
+    }
+
+private:
+    bool canInterpolate(const RenderStyle&, const RenderStyle&, CompositeOperation) const override { return false; }
+
+    bool equals(const RenderStyle& a, const RenderStyle& b) const override
+    {
+        auto& aFontDescription = a.fontDescription();
+        auto& bFontDescription = b.fontDescription();
+        return aFontDescription.variantCommonLigatures() == bFontDescription.variantCommonLigatures()
+            && aFontDescription.variantDiscretionaryLigatures() == bFontDescription.variantDiscretionaryLigatures()
+            && aFontDescription.variantHistoricalLigatures() == bFontDescription.variantHistoricalLigatures()
+            && aFontDescription.variantContextualAlternates() == bFontDescription.variantContextualAlternates();
+    }
+
+    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const override
+    {
+        ASSERT(!context.progress || context.progress == 1.0);
+        auto& sourceFontDescription = (context.progress ? to : from).fontDescription();
+
+        FontSelector* currentFontSelector = destination.fontCascade().fontSelector();
+        auto description = destination.fontDescription();
+        description.setVariantCommonLigatures(sourceFontDescription.variantCommonLigatures());
+        description.setVariantDiscretionaryLigatures(sourceFontDescription.variantDiscretionaryLigatures());
+        description.setVariantHistoricalLigatures(sourceFontDescription.variantHistoricalLigatures());
+        description.setVariantContextualAlternates(sourceFontDescription.variantContextualAlternates());
+        destination.setFontDescription(WTFMove(description));
+        destination.fontCascade().update(currentFontSelector);
+    }
+
+#if !LOG_DISABLED
+    void logBlend(const RenderStyle&, const RenderStyle&, const RenderStyle&, double) const override
+    {
+    }
+#endif
+};
+
 class CSSPropertyAnimationWrapperMap final {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -2970,7 +3013,8 @@
         new DiscretePropertyWrapper<WindRule>(CSSPropertyFillRule, &RenderStyle::fillRule, &RenderStyle::setFillRule),
         new DiscretePropertyWrapper<FontSynthesis>(CSSPropertyFontSynthesis, &RenderStyle::fontSynthesis, &RenderStyle::setFontSynthesis),
         new DiscretePropertyWrapper<FontVariantAlternates>(CSSPropertyFontVariantAlternates, &RenderStyle::fontVariantAlternates, &RenderStyle::setFontVariantAlternates),
-        new FontVariantEastAsianWrapper
+        new FontVariantEastAsianWrapper,
+        new FontVariantLigaturesWrapper
     };
     const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to