Changeset 291109 in webkit


Ignore:
Timestamp:
Mar 10, 2022 7:57:15 AM (4 months ago)
Author:
graouts@webkit.org
Message:

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

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):

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r291106 r291109  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-variant-east-asian should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237665
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
     9        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
     10        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
     11        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:
     12
    1132022-03-10  Lauro Moura  <lmoura@igalia.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt

    r291103 r291109  
    1414FAIL Animation of font-variant in ::marker assert_equals: expected "small-caps" but got "tabular-nums"
    1515FAIL Animation of font-variant-caps in ::marker assert_equals: expected "small-caps" but got "normal"
    16 FAIL Animation of font-variant-east-asian in ::marker assert_equals: expected "full-width" but got "normal"
     16PASS Animation of font-variant-east-asian in ::marker
    1717FAIL Animation of font-variant-ligatures in ::marker assert_equals: expected "historical-ligatures" but got "normal"
    1818FAIL Animation of font-variant-numeric in ::marker assert_equals: expected "slashed-zero" but got "tabular-nums"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt

    r291104 r291109  
    258258FAIL font-variant-alternates: "stylistic(unknown)" onto "swash(unknown)" assert_equals: The value should be stylistic(unknown) at 0ms expected "stylistic(unknown)" but got "normal"
    259259FAIL font-variant-alternates: "swash(unknown)" onto "stylistic(unknown)" assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
     260PASS font-variant-east-asian (type: discrete) has testAccumulation function
     261PASS font-variant-east-asian: "proportional-width" onto "full-width"
     262PASS font-variant-east-asian: "full-width" onto "proportional-width"
    260263PASS font-variation-settings (type: fontVariationSettings) has testAccumulation function
    261264FAIL 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"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt

    r291104 r291109  
    258258FAIL font-variant-alternates: "stylistic(unknown)" onto "swash(unknown)" assert_equals: The value should be stylistic(unknown) at 0ms expected "stylistic(unknown)" but got "normal"
    259259FAIL font-variant-alternates: "swash(unknown)" onto "stylistic(unknown)" assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
     260PASS font-variant-east-asian (type: discrete) has testAddition function
     261PASS font-variant-east-asian: "proportional-width" onto "full-width"
     262PASS font-variant-east-asian: "full-width" onto "proportional-width"
    260263PASS font-variation-settings (type: fontVariationSettings) has testAddition function
    261264FAIL 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"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt

    r291104 r291109  
    314314FAIL font-variant-alternates uses discrete animation when animating between "swash(unknown)" and "stylistic(unknown)" with effect easing assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
    315315FAIL font-variant-alternates uses discrete animation when animating between "swash(unknown)" and "stylistic(unknown)" with keyframe easing assert_equals: The value should be swash(unknown) at 0ms expected "swash(unknown)" but got "normal"
     316PASS font-variant-east-asian (type: discrete) has testInterpolation function
     317PASS font-variant-east-asian uses discrete animation when animating between "full-width" and "proportional-width" with linear easing
     318PASS font-variant-east-asian uses discrete animation when animating between "full-width" and "proportional-width" with effect easing
     319PASS font-variant-east-asian uses discrete animation when animating between "full-width" and "proportional-width" with keyframe easing
    316320PASS font-variation-settings (type: fontVariationSettings) has testInterpolation function
    317321PASS font-variation-settings supports animation as float
  • trunk/Source/WebCore/ChangeLog

    r291108 r291109  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-variant-east-asian should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237665
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        * animation/CSSPropertyAnimation.cpp:
     9        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     10
    1112022-03-10  Rob Buis  <rbuis@igalia.com>
    212
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r291104 r291109  
    25912591        }
    25922592    }
     2593};
     2594
     2595class FontVariantEastAsianWrapper final : public AnimationPropertyWrapperBase {
     2596    WTF_MAKE_FAST_ALLOCATED;
     2597public:
     2598    FontVariantEastAsianWrapper()
     2599        : AnimationPropertyWrapperBase(CSSPropertyFontVariantEastAsian)
     2600    {
     2601    }
     2602
     2603private:
     2604    bool canInterpolate(const RenderStyle&, const RenderStyle&, CompositeOperation) const override { return false; }
     2605
     2606    bool equals(const RenderStyle& a, const RenderStyle& b) const override
     2607    {
     2608        auto& aFontDescription = a.fontDescription();
     2609        auto& bFontDescription = b.fontDescription();
     2610        return aFontDescription.variantEastAsianVariant() == bFontDescription.variantEastAsianVariant()
     2611            && aFontDescription.variantEastAsianWidth() == bFontDescription.variantEastAsianWidth()
     2612            && aFontDescription.variantEastAsianRuby() == bFontDescription.variantEastAsianRuby();
     2613    }
     2614
     2615    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const override
     2616    {
     2617        ASSERT(!context.progress || context.progress == 1.0);
     2618        auto& sourceFontDescription = (context.progress ? to : from).fontDescription();
     2619
     2620        FontSelector* currentFontSelector = destination.fontCascade().fontSelector();
     2621        auto description = destination.fontDescription();
     2622        description.setVariantEastAsianVariant(sourceFontDescription.variantEastAsianVariant());
     2623        description.setVariantEastAsianWidth(sourceFontDescription.variantEastAsianWidth());
     2624        description.setVariantEastAsianRuby(sourceFontDescription.variantEastAsianRuby());
     2625        destination.setFontDescription(WTFMove(description));
     2626        destination.fontCascade().update(currentFontSelector);
     2627    }
     2628
     2629#if !LOG_DISABLED
     2630    void logBlend(const RenderStyle&, const RenderStyle&, const RenderStyle&, double) const override
     2631    {
     2632    }
     2633#endif
    25932634};
    25942635
     
    29292970        new DiscretePropertyWrapper<WindRule>(CSSPropertyFillRule, &RenderStyle::fillRule, &RenderStyle::setFillRule),
    29302971        new DiscretePropertyWrapper<FontSynthesis>(CSSPropertyFontSynthesis, &RenderStyle::fontSynthesis, &RenderStyle::setFontSynthesis),
    2931         new DiscretePropertyWrapper<FontVariantAlternates>(CSSPropertyFontVariantAlternates, &RenderStyle::fontVariantAlternates, &RenderStyle::setFontVariantAlternates)
     2972        new DiscretePropertyWrapper<FontVariantAlternates>(CSSPropertyFontVariantAlternates, &RenderStyle::fontVariantAlternates, &RenderStyle::setFontVariantAlternates),
     2973        new FontVariantEastAsianWrapper
    29322974    };
    29332975    const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
Note: See TracChangeset for help on using the changeset viewer.