Changeset 291115 in webkit


Ignore:
Timestamp:
Mar 10, 2022 8:47:04 AM (4 months ago)
Author:
graouts@webkit.org
Message:

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

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

  • platform/text/TextFlags.cpp:

(WebCore::operator<<):

  • platform/text/TextFlags.h:
  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::setFontVariantAlternates):
(WebCore::RenderStyle::setFontVariantPosition):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::fontVariantPosition const):

Location:
trunk
Files:
11 edited

Legend:

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

    r291114 r291115  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-variant-position should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237671
     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  Antoine Quint  <graouts@webkit.org>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt

    r291114 r291115  
    1717PASS Animation of font-variant-ligatures in ::marker
    1818FAIL Animation of font-variant-numeric in ::marker assert_equals: expected "slashed-zero" but got "tabular-nums"
    19 FAIL Animation of font-variant-position in ::marker assert_equals: expected "sub" but got "normal"
     19PASS Animation of font-variant-position in ::marker
    2020PASS Animation of font-weight in ::marker
    2121PASS Animation of line-height in ::marker
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt

    r291114 r291115  
    264264PASS font-variant-ligatures: "no-common-ligatures" onto "common-ligatures"
    265265PASS font-variant-ligatures: "common-ligatures" onto "no-common-ligatures"
     266PASS font-variant-position (type: discrete) has testAccumulation function
     267PASS font-variant-position: "super" onto "sub"
     268PASS font-variant-position: "sub" onto "super"
    266269PASS font-variation-settings (type: fontVariationSettings) has testAccumulation function
    267270FAIL 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

    r291114 r291115  
    264264PASS font-variant-ligatures: "no-common-ligatures" onto "common-ligatures"
    265265PASS font-variant-ligatures: "common-ligatures" onto "no-common-ligatures"
     266PASS font-variant-position (type: discrete) has testAddition function
     267PASS font-variant-position: "super" onto "sub"
     268PASS font-variant-position: "sub" onto "super"
    266269PASS font-variation-settings (type: fontVariationSettings) has testAddition function
    267270FAIL 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

    r291114 r291115  
    322322PASS font-variant-ligatures uses discrete animation when animating between "common-ligatures" and "no-common-ligatures" with effect easing
    323323PASS font-variant-ligatures uses discrete animation when animating between "common-ligatures" and "no-common-ligatures" with keyframe easing
     324PASS font-variant-position (type: discrete) has testInterpolation function
     325PASS font-variant-position uses discrete animation when animating between "sub" and "super" with linear easing
     326PASS font-variant-position uses discrete animation when animating between "sub" and "super" with effect easing
     327PASS font-variant-position uses discrete animation when animating between "sub" and "super" with keyframe easing
    324328PASS font-variation-settings (type: fontVariationSettings) has testInterpolation function
    325329PASS font-variation-settings supports animation as float
  • trunk/Source/WebCore/ChangeLog

    r291114 r291115  
     12022-03-10  Antoine Quint  <graouts@webkit.org>
     2
     3        [web-animations] font-variant-position should support discrete animation
     4        https://bugs.webkit.org/show_bug.cgi?id=237671
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        * animation/CSSPropertyAnimation.cpp:
     9        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
     10        * platform/text/TextFlags.cpp:
     11        (WebCore::operator<<):
     12        * platform/text/TextFlags.h:
     13        * rendering/style/RenderStyle.cpp:
     14        (WebCore::RenderStyle::setFontVariantAlternates):
     15        (WebCore::RenderStyle::setFontVariantPosition):
     16        * rendering/style/RenderStyle.h:
     17        (WebCore::RenderStyle::fontVariantPosition const):
     18
    1192022-03-10  Antoine Quint  <graouts@webkit.org>
    220
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r291114 r291115  
    30153015        new DiscretePropertyWrapper<FontVariantAlternates>(CSSPropertyFontVariantAlternates, &RenderStyle::fontVariantAlternates, &RenderStyle::setFontVariantAlternates),
    30163016        new FontVariantEastAsianWrapper,
    3017         new FontVariantLigaturesWrapper
     3017        new FontVariantLigaturesWrapper,
     3018        new DiscretePropertyWrapper<FontVariantPosition>(CSSPropertyFontVariantPosition, &RenderStyle::fontVariantPosition, &RenderStyle::setFontVariantPosition)
    30183019    };
    30193020    const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
  • trunk/Source/WebCore/platform/text/TextFlags.cpp

    r291104 r291115  
    5050}
    5151
     52WTF::TextStream& operator<<(TextStream& ts, FontVariantPosition position)
     53{
     54    switch (position) {
     55    case FontVariantPosition::Normal: ts << "normal"; break;
     56    case FontVariantPosition::Subscript: ts << "subscript"; break;
     57    case FontVariantPosition::Superscript: ts << "superscript"; break;
     58    }
     59    return ts;
     60}
     61
    5262} // namespace WebCore
  • trunk/Source/WebCore/platform/text/TextFlags.h

    r291104 r291115  
    8686enum class FontVariantLigatures : uint8_t { Normal, Yes, No };
    8787enum class FontVariantPosition : uint8_t { Normal, Subscript, Superscript };
     88
     89WTF::TextStream& operator<<(WTF::TextStream&, FontVariantPosition);
    8890
    8991enum class FontVariantCaps : uint8_t {
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r291104 r291115  
    20702070    auto description = fontDescription();
    20712071    description.setVariantAlternates(value);
     2072
     2073    setFontDescription(WTFMove(description));
     2074    fontCascade().update(currentFontSelector);
     2075}
     2076
     2077void RenderStyle::setFontVariantPosition(FontVariantPosition value)
     2078{
     2079    FontSelector* currentFontSelector = fontCascade().fontSelector();
     2080    auto description = fontDescription();
     2081    description.setVariantPosition(value);
    20722082
    20732083    setFontDescription(WTFMove(description));
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r291104 r291115  
    376376    FontSynthesis fontSynthesis() const { return fontDescription().fontSynthesis(); }
    377377    FontVariantAlternates fontVariantAlternates() const { return fontDescription().variantAlternates(); }
     378    FontVariantPosition fontVariantPosition() const { return fontDescription().variantPosition(); }
    378379
    379380    const Length& textIndent() const { return m_rareInheritedData->indent; }
     
    10021003    void setFontSynthesis(FontSynthesis);
    10031004    void setFontVariantAlternates(FontVariantAlternates);
     1005    void setFontVariantPosition(FontVariantPosition);
    10041006
    10051007    void setColor(const Color&);
Note: See TracChangeset for help on using the changeset viewer.