Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing CounterStyle representation from StyleRuleCounterStyle #7114

Commits on Jan 4, 2023

  1. Implementing CounterStyle representation from StyleRuleCounterStyle

    https://bugs.webkit.org/show_bug.cgi?id=248666
    rdar://102910060
    
    Reviewed by Antti Koivisto.
    Reviewed by Antti Koivisto.
    
    * Source/WebCore/Headers.cmake:
    * Source/WebCore/Sources.txt:
    * Source/WebCore/WebCore.xcodeproj/project.pbxproj:
    Adding CSSCounterStyle and CSSCounterStyleDescriptors .h and .cpp files.
    
    * Source/WebCore/css/CSSCounterStyle.cpp: Added.
    (WebCore::CounterStyle::isInRange const):
    Returns true if counter is in range, as defined by
    https://www.w3.org/TR/css-counter-styles-3/#descdef-counter-style-range.
    
    (WebCore::CounterStyle::CounterStyle):
    (WebCore::CounterStyle::create):
    
    (WebCore::CounterStyle::createCounterStyleDecimal):
    Create a CounterStyle object representing a Decimal counter.
    
    (WebCore::CounterStyle::setFallbackReference):
    
    (WebCore::CounterStyle::extendAndResolve):
    Extend another CounterStyle as defined by
    https://www.w3.org/TR/css-counter-styles-3/#extends-system and resolve
    its Extend reference. The counter's system value is then promoted
    from 'extend' to the valye of the CounterStyle we are extending.
    
    (WebCore::CounterStyle::text):
    Dummy text representation for the counter. The real representation wil
    be implemented by rdar://103648354.
    
    * Source/WebCore/css/CSSCounterStyle.h: Added.
    (WebCore::CounterStyle::operator== const):
    (WebCore::CounterStyle::fallbackName const):
    (WebCore::CounterStyle::extendsName const):
    (WebCore::CounterStyle::isFallbackUnresolved):
    (WebCore::CounterStyle::isExtendsUnresolved):
    (WebCore::CounterStyle::isExtendsSystem const):
    (WebCore::CounterStyle::system const):
    (WebCore::CounterStyle::isPredefinedCounterStyle const):
    Returns true if CounterStyle is predefined by the user agent stylesheet.
    A counter style parsed from author-defined rule will return false.
    
    (WebCore::CounterStyle::isAutoRange const):
    Returns true if the range descriptor is set to 'auto'. A 'auto' value
    is represented by a empty vector of ranges.
    
    * Source/WebCore/css/CSSCounterStyleRule.cpp:
    (WebCore::toCounterStyleSystemEnum):
    * Source/WebCore/css/CSSCounterStyleRule.h:
    Moving enum to CSSCounterStyle.h.
    Adding getters for the properties's CSS values.
    
    * Source/WebCore/css/CSSStyleSheet.cpp:
    * Source/WebCore/css/CSSValueKeywords.in:
    * Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
    (WebCore::CSSPropertyParserHelpers::consumeCounterStyleSystem):
    * Source/WebCore/dom/Element.h:
    * Source/WebCore/style/MatchedDeclarationsCache.cpp:
    (WebCore::Style::MatchedDeclarationsCache::isCacheable):
    Adding FIXME with matching radars.
    
    CSSCounterStyleDescriptors defines the descriptors for the counter-style
    rule in a specialized manner. It serves as a payload for CSSCounterStyle.
    
    * Source/WebCore/css/CSSCounterStyleDescriptors.cpp: Added.
    (WebCore::translateRangeFromStyleProperties):
    (WebCore::symbolToString):
    (WebCore::translatePadFromStyleProperties):
    (WebCore::translateNegativeSymbolsFromStyleProperties):
    (WebCore::translateSymbolsFromStyleProperties):
    (WebCore::translateFallbackNameFromStyleProperties):
    (WebCore::translatePrefixFromStyleProperties):
    (WebCore::translateSuffixFromStyleProperties):
    (WebCore::extractDataFromSystemDescriptor):
    (WebCore::CSSCounterStyleDescriptors::setExplicitlySetDescriptors):
    Translation from CSSValues of rule's properties to adequated
    specialized types.
    (WebCore::CSSCounterStyleDescriptors::create):
    Creates an instance of CSSCounterStyleDescriptor based on
    StyleProperties. A create function was preferred instead of a
    constructor in order to maintain the class as a aggregate, enabling
    desginated initializers.
    * Source/WebCore/css/CSSCounterStyleDescriptors.h: Added.
    
    Canonical link: https://commits.webkit.org/258434@main
    vitorroriz committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    ac2f8a4 View commit details
    Browse the repository at this point in the history