Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8105a859925ce565fd8953e8234578b8c49ac354
      
https://github.com/WebKit/WebKit/commit/8105a859925ce565fd8953e8234578b8c49ac354
  Author: Vitor Roriz <[email protected]>
  Date:   2024-05-28 (Tue, 28 May 2024)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WTF/wtf/unicode/CharacterNames.h
    M Source/WebCore/css/CSSCounterStyle.cpp
    M Source/WebCore/css/CSSCounterStyle.h
    M Source/WebCore/css/CSSCounterStyleDescriptors.cpp
    M Source/WebCore/css/CSSCounterStyleDescriptors.h
    M Source/WebCore/css/CSSCounterStyleRule.cpp
    M Source/WebCore/css/CSSValueKeywords.in
    M Source/WebCore/css/counterStyles.css
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/rendering/RenderCounter.cpp
    M Source/WebCore/rendering/RenderListMarker.cpp
    M Source/WebCore/rendering/style/ListStyleType.cpp
    M Source/WebCore/rendering/style/ListStyleType.h

  Log Message:
  -----------
  [css-counter-styles] RenderListMarker, RenderCounter should use 
CSSCounterStyle::text() to handle TextDirection
https://bugs.webkit.org/show_bug.cgi?id=256153
rdar://109014745

Reviewed by Matthieu Dubet and Tim Nguyen.

Before we can address the bug, we need a small refactoring on how we handle
disclosure-closed counter style:
With this patch, we will handle disclosure-closed as one of the special complex 
systems,
such that we can consider RTL context when calculating its text value.

We fail css/css-counter-styles/counter-style-at-rule/disclosure-styles.html for 
2 different
reasons. Therefore, we need to fix it in 2 different points:

1. RenderListMarker: This class is used for rendering list markers for the 
general case.
It has custom code for hadling TextDirection for counter styles due to 
disclosure-closed
style. We can now delegate this to CSSCounterStyle::text by passing 
TextDirection information.

The custom code currently checks if the counter-style has a "disclosure-closed" 
identifier but
that won't work for "extends" systems. When an author extends a counter-style, 
it can give any
identifier name to it, but it should still act as the counter-style it is 
extending.  Since this
is now handled by CSSCounterStyle itself, we no longer need the custom code.

2. RenderCounter: The class is used when rendering counters with the counter() 
function. These
counters can also be a list-style-type that is mapped to an existent 
counter-style. Currently we
don't handle TextDirection here, which breaks disclosure-closed style for the 
RTL case. Also here
we can delegate TextDirection processing by passing the element's direction to 
CSSCounterStyle::text().

* LayoutTests/TestExpectations:
* Source/WTF/wtf/unicode/CharacterNames.h:
* Source/WebCore/css/CSSCounterStyle.cpp:
(WebCore::CSSCounterStyle::counterForSystemDisclosureClosed):
(WebCore::CSSCounterStyle::initialRepresentation const):
(WebCore::CSSCounterStyle::fallbackText):
(WebCore::CSSCounterStyle::text):
(WebCore::CSSCounterStyle::isInRange const):
* Source/WebCore/css/CSSCounterStyle.h:
* Source/WebCore/css/CSSCounterStyleDescriptors.cpp:
(WebCore::CSSCounterStyleDescriptors::areSymbolsValidForSystem):
(WebCore::CSSCounterStyleDescriptors::systemCSSText const):
* Source/WebCore/css/CSSCounterStyleDescriptors.h:
* Source/WebCore/css/CSSCounterStyleRule.cpp:
(WebCore::toCounterStyleSystemEnum):
* Source/WebCore/css/CSSValueKeywords.in:
* Source/WebCore/css/counterStyles.css:
(@counter-style disclosure-closed):
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCounterStyleSystem):
* Source/WebCore/rendering/RenderCounter.cpp:
(WebCore::RenderCounter::originalText const):
* Source/WebCore/rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::textRun const):
(WebCore::RenderListMarker::updateContent):
* Source/WebCore/rendering/style/ListStyleType.cpp:
(WebCore::ListStyleType::isDisclosureClosed const): Deleted.
* Source/WebCore/rendering/style/ListStyleType.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to