Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 924a6596c2f80d8e923ba220dadf364430d9789b
https://github.com/WebKit/WebKit/commit/924a6596c2f80d8e923ba220dadf364430d9789b
Author: Alan Baradlay <[email protected]>
Date: 2026-08-17 (Mon, 17 Aug 2026)
Changed paths:
M LayoutTests/TestExpectations
M
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/hebrew/css3-counter-styles-016.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-fallback-rtl-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-fallback-rtl-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-fallback-rtl.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-mutation-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-mutation-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-mutation.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-rtl-string-width-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-rtl-string-width-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-rtl-string-width.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-unicode-bidi-default.html
M LayoutTests/platform/glib/fast/html/details-writing-mode-expected.txt
M
LayoutTests/platform/glib/fast/html/details-writing-mode-mixed-expected.txt
M LayoutTests/platform/ios/fast/html/details-writing-mode-expected.txt
M LayoutTests/platform/ios/fast/html/details-writing-mode-mixed-expected.txt
M LayoutTests/platform/ios/fast/lists/008-expected.txt
M LayoutTests/platform/ios/fast/lists/008-vertical-expected.txt
M LayoutTests/platform/ios/fast/lists/marker-image-error-expected.txt
M LayoutTests/platform/mac/fast/html/details-writing-mode-expected.txt
M LayoutTests/platform/mac/fast/html/details-writing-mode-mixed-expected.txt
M LayoutTests/platform/mac/fast/lists/008-expected.txt
M LayoutTests/platform/mac/fast/lists/008-vertical-expected.txt
M Source/WebCore/css/CSSRegisteredCounterStyle.h
M Source/WebCore/rendering/RenderListMarker.cpp
M Source/WebCore/rendering/RenderListMarker.h
M Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp
Log Message:
-----------
[list-marker] List marker overlaps the list item content when the marker text
is right-to-left
https://bugs.webkit.org/show_bug.cgi?id=321396
<rdar://problem/185048387>
Reviewed by Antti Koivisto.
<style>
li { list-style-type: "\627 \644 " }
</style>
<ol><li>a
The marker should reserve the 12px its two glyphs occupy. Instead it reserved
9px, so the list item's content painted on top of the marker.
The marker had no renderers for its text, so nothing ever ran the bidi
algorithm over it and
textRunForContent reversed the characters itself. Painting needs that reversal:
drawText forces the
embedding level, so it draws in memory order and pre-reversed text lands in the
right visual order.
Measuring does not, because FontCascade::width lets CoreText resolve the run
instead. Reversing
right-to-left text also changes its Arabic joining forms, here forming a
lam-alef ligature, so the box
was sized for 8.41px of ligature while 12.28px of two separate glyphs was
painted. Reordering by hand
got text of mixed direction wrong outright.
Give the marker's text renderers of its own when it needs bidi resolution,
reusing the anonymous
inline-block child that `content` markers already have, so inline layout
measures and paints the same
resolved runs. A counter style draws its fallback's text whenever it cannot
represent a value, so that
decision walks the whole fallback chain and sends anything it cannot prove is
left-to-right through
inline layout. A disclosure triangle is no longer excluded from it either: its
glyph and suffix are
both direction-neutral, so a right-to-left box reorders them and the suffix
space used to end up on
the wrong side of the triangle.
* Source/WebCore/rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::isImage const):
(WebCore::RenderListMarker::hasContentProperty const):
(WebCore::symbolsContainStrongDirectionalityText):
(WebCore::counterStyleChainHasStrongDirectionalitySymbols):
(WebCore::RenderListMarker::textNeedsBidiResolution const):
(WebCore::RenderListMarker::usesInlineLayout const):
(WebCore::textRunForContent):
(WebCore::RenderListMarker::paint):
(WebCore::RenderListMarker::updateContent):
(WebCore::RenderListMarker::updateTextRendererForInlineLayout):
(WebCore::RenderListMarker::layoutContentContainer):
(WebCore::RenderListMarker::computeIntrinsicLogicalWidthContributions):
(WebCore::RenderListMarker::updateInlineMargins):
(WebCore::RenderListMarker::relativeMarkerRect):
(WebCore::RenderListMarker::drawsBulletShape const):
(WebCore::RenderListMarker::hasContent const): Deleted.
(WebCore::reversed): Deleted.
(WebCore::RenderListMarker::widthUsesMetricsOfPrimaryFont const): Deleted.
(WebCore::RenderListMarker::imageChanged):
(WebCore::RenderListMarker::needsContentContainer const):
(WebCore::RenderListMarker::updateContentContainerText):
* Source/WebCore/rendering/RenderListMarker.h:
* Source/WebCore/css/CSSRegisteredCounterStyle.h:
(WebCore::CSSRegisteredCounterStyle::fallbackStyle const):
* Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
(WebCore::RenderTreeBuilder::List::buildMarkerContentRenderers):
(WebCore::RenderTreeBuilder::List::wrapInsideMarkerInAnonymousInline):
* LayoutTests/TestExpectations: list-style-type-string-005a, -006 and
disclosure-styles pass now.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-rtl-string-width.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-rtl-string-width-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-rtl-string-width-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-unicode-bidi-default.html:
* LayoutTests/platform/ios/fast/lists/008-expected.txt:
* LayoutTests/platform/ios/fast/lists/008-vertical-expected.txt:
* LayoutTests/platform/mac/fast/lists/008-expected.txt:
* LayoutTests/platform/mac/fast/lists/008-vertical-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-counter-styles/hebrew/css3-counter-styles-016.html:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-mutation-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-mutation-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-mutation.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-fallback-rtl.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-fallback-rtl-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-lists/list-marker-counter-style-fallback-rtl-expected.html:
Added.
* LayoutTests/platform/ios/fast/lists/marker-image-error-expected.txt:
* LayoutTests/platform/glib/fast/html/details-writing-mode-expected.txt:
* LayoutTests/platform/glib/fast/html/details-writing-mode-mixed-expected.txt:
* LayoutTests/platform/ios/fast/html/details-writing-mode-expected.txt:
* LayoutTests/platform/ios/fast/html/details-writing-mode-mixed-expected.txt:
* LayoutTests/platform/mac/fast/html/details-writing-mode-expected.txt:
* LayoutTests/platform/mac/fast/html/details-writing-mode-mixed-expected.txt:
Canonical link: https://commits.webkit.org/319314@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications