Changeset 275610 in webkit


Ignore:
Timestamp:
Apr 7, 2021 10:06:09 AM (3 years ago)
Author:
Simon Fraser
Message:

Wasted vector capacity in StyleRuleKeyframes
https://bugs.webkit.org/show_bug.cgi?id=224264

Reviewed by Antti Koivisto.

Shrink StyleRuleKeyframes::m_keyframes. Saves 23KB on youtube.com.

  • css/CSSKeyframesRule.cpp:

(WebCore::StyleRuleKeyframes::shrinkToFit):

  • css/CSSKeyframesRule.h:
  • css/parser/CSSParserImpl.cpp:

(WebCore::CSSParserImpl::consumeKeyframesRule):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::CSSPropertyParser::consumeAnimationShorthand):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r275609 r275610  
     12021-04-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Wasted vector capacity in StyleRuleKeyframes
     4        https://bugs.webkit.org/show_bug.cgi?id=224264
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Shrink StyleRuleKeyframes::m_keyframes. Saves 23KB on youtube.com.
     9
     10        * css/CSSKeyframesRule.cpp:
     11        (WebCore::StyleRuleKeyframes::shrinkToFit):
     12        * css/CSSKeyframesRule.h:
     13        * css/parser/CSSParserImpl.cpp:
     14        (WebCore::CSSParserImpl::consumeKeyframesRule):
     15        * css/parser/CSSPropertyParser.cpp:
     16        (WebCore::CSSPropertyParser::consumeAnimationShorthand):
     17
    1182021-04-07  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Source/WebCore/css/CSSKeyframesRule.cpp

    r257696 r275610  
    119119}
    120120
     121void StyleRuleKeyframes::shrinkToFit()
     122{
     123    m_keyframes.shrinkToFit();
     124}
     125
    121126CSSKeyframesRule::CSSKeyframesRule(StyleRuleKeyframes& keyframesRule, CSSStyleSheet* parent)
    122127    : CSSRule(parent)
  • trunk/Source/WebCore/css/CSSKeyframesRule.h

    r257696 r275610  
    6161    Ref<StyleRuleKeyframes> copy() const { return adoptRef(*new StyleRuleKeyframes(*this)); }
    6262
     63    void shrinkToFit();
     64
    6365private:
    6466    explicit StyleRuleKeyframes(const AtomString&);
  • trunk/Source/WebCore/css/parser/CSSParserImpl.cpp

    r275609 r275610  
    631631    // FIXME-NEWPARSER: Find out why this is done. Behavior difference when prefixed?
    632632    // keyframeRule->setVendorPrefixed(webkitPrefixed);
     633   
     634    keyframeRule->shrinkToFit();
    633635    return keyframeRule;
    634636}
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r275281 r275610  
    16691669                    continue;
    16701670
    1671                 if (RefPtr<CSSValue> value = consumeAnimationValue(shorthand.properties()[i], m_range, m_context)) {
     1671                if (auto value = consumeAnimationValue(shorthand.properties()[i], m_range, m_context)) {
    16721672                    parsedLonghand[i] = true;
    16731673                    foundProperty = true;
Note: See TracChangeset for help on using the changeset viewer.