Skip to content

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=321399 - #64181

Open
annevk wants to merge 1 commit into
web-platform-tests:masterfrom
annevk:wpt-export-for-webkit-321399
Open

annevk wants to merge 1 commit into
web-platform-tests:masterfrom
annevk:wpt-export-for-webkit-321399

Conversation

@annevk

@annevk annevk commented Oct 25, 2026

Copy link
Copy Markdown
Member

WebKit export from bug: [list-marker] direction on ::marker moves the marker box to the wrong side of the list item

[list-marker] direction on ::marker moves the marker box to the wrong side of the list item

  <style>
  ::marker { direction: rtl }
  </style>
  <ol><li>text

The marker should stay outside the list item's content, to its left. Instead it moved on
top of the content.

An outside marker is pulled out of the line by a negative inline-start margin, which
updateInlineMargins() wrote with the logical setter. That resolves start against the
marker's own direction, so a right-to-left marker got the negative margin on its right
edge. Both readers ask the other way around, BoxGeometryUpdater against the parent's
writing mode and RenderBlock::marginStartForChild against the containing block's, so
they found nothing on the left and the marker stayed on the content.

Write the physical edges of the list item's inline axis instead: left and right in a
horizontal writing mode, top and bottom in a vertical one, which is the axis those readers
take them from. That is what css-lists-3 asks for as well: with marker-side: match-self,
its initial value, the marker box is positioned using the directionality of the ::marker's
originating element rather than the marker's own.

WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=321399
WebKit-Canonical-Link: https://commits.webkit.org/318888@main

… side of the list item

  <style>
  ::marker { direction: rtl }
  </style>
  <ol><li>text

The marker should stay outside the list item's content, to its left. Instead it moved on
top of the content.

An outside marker is pulled out of the line by a negative inline-start margin, which
updateInlineMargins() wrote with the logical setter. That resolves start against the
marker's own direction, so a right-to-left marker got the negative margin on its right
edge. Both readers ask the other way around, BoxGeometryUpdater against the parent's
writing mode and RenderBlock::marginStartForChild against the containing block's, so
they found nothing on the left and the marker stayed on the content.

Write the physical edges of the list item's inline axis instead: left and right in a
horizontal writing mode, top and bottom in a vertical one, which is the axis those readers
take them from. That is what css-lists-3 asks for as well: with marker-side: match-self,
its initial value, the marker box is positioned using the directionality of the ::marker's
originating element rather than the marker's own.

WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=321399
WebKit-Canonical-Link: https://commits.webkit.org/318888@main

@wpt-pr-bot wpt-pr-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the WebKit project.

@annevk
annevk enabled auto-merge (rebase) October 25, 2026 08:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants