[webkit-changes] [WebKit/WebKit] 6ee658: [css-counter-styles] Remove code for old predefine...

Tim Nguyen noreply at github.com
Mon May 8 16:22:49 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6ee6584631d2851d9d76841231b74b54306fa4d3
      https://github.com/WebKit/WebKit/commit/6ee6584631d2851d9d76841231b74b54306fa4d3
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-05-08 (Mon, 08 May 2023)

  Changed paths:
    M Source/WebCore/css/CSSPrimitiveValueMappings.h
    M Source/WebCore/editing/cocoa/FontAttributesCocoa.mm
    M Source/WebCore/rendering/RenderCounter.cpp
    M Source/WebCore/rendering/RenderListMarker.cpp
    M Source/WebCore/rendering/RenderListMarker.h
    M Source/WebCore/rendering/style/ListStyleType.cpp
    M Source/WebCore/rendering/style/ListStyleType.h
    M Source/WebCore/rendering/style/RenderStyleInlines.h
    M Source/WebCore/style/StyleBuilderConverter.h
    M Source/WebCore/style/UserAgentStyle.cpp

  Log Message:
  -----------
  [css-counter-styles] Remove code for old predefined counter styles implementation
https://bugs.webkit.org/show_bug.cgi?id=256156
rdar://108704012

Reviewed by Darin Adler.

Before this change, CSSCounterStyleAtRulesEnabled would toggle the codepath for rendering predefined (UA-level) counter styles.
This change makes rendering predefined styles go through the new codepath with CSSCounterStyleAtRulesEnabled off.
The only remaining role of setting is now to allow authors to turn on/off author-level @counter-style definitions.

Here's a summary of changes:
- Remove all the code in RenderListMarker that renders built-in counter styles when CSSCounterStyleAtRulesEnabled is off
- Always use the modern ListStyleType representation ({ ListStyleType::Type::CounterStyle, <counter-style-name> })
- Unconditionally parse counterStyles.css and use it to render built-in counter styles

Doing this allows easier bug fixing around pre-defined counter styles (since bugs don't need to be fixed twice), but
also removes a large amount of code.

Tested that built-in counter styles still work properly with the pref off by running:
run-webkit-tests fast/lists imported/w3c/web-platform-tests/css/css-counter-styles --experimental-feature CSSCounterStyleAtRulesEnabled=false

* Source/WebCore/css/CSSPrimitiveValueMappings.h:
(WebCore::toCSSValueID):
(WebCore::fromCSSValueID):
* Source/WebCore/editing/cocoa/FontAttributesCocoa.mm:
(WebCore::cocoaTextListMarkerName):
* Source/WebCore/rendering/RenderCounter.cpp:
(WebCore::RenderCounter::originalText const):
* Source/WebCore/rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
(WebCore::RenderListMarker::updateContent):
(WebCore::toAlphabeticOrNumeric): Deleted.
(WebCore::toSymbolic): Deleted.
(WebCore::toAlphabetic): Deleted.
(WebCore::toNumeric): Deleted.
(WebCore::toPredefinedAdditiveSystem): Deleted.
(WebCore::effectiveListMarkerType): Deleted.
(WebCore::listMarkerSuffix): Deleted.
(WebCore::listMarkerText): Deleted.
* Source/WebCore/rendering/RenderListMarker.h:
* Source/WebCore/rendering/style/ListStyleType.cpp:
(WebCore::ListStyleType::isCircle const):
(WebCore::ListStyleType::isSquare const):
(WebCore::ListStyleType::isDisc const):
(WebCore::ListStyleType::isDisclosureClosed const):
* Source/WebCore/rendering/style/ListStyleType.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::initialListStyleType):
* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertListStyleType):
* Source/WebCore/style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):

Canonical link: https://commits.webkit.org/263835@main




More information about the webkit-changes mailing list