-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-counter-styles] RenderListMarker, RenderCounter should use CSSCo…
…unterStyle::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
- Loading branch information
1 parent
5dceca8
commit 8105a85
Showing
14 changed files
with
43 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters