Bug 279172

Summary: List marker incorrectly positioned when list child has inline margin
Product: WebKit Reporter: Robin Whittleton <robin>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, karlcow, koivisto, pbryan, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 17   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Reduced testcase
none
Marker position testcase result in Edge
none
Marker position testcase result in Firefox
none
Marker position testcase result in Safari
none
rendering in safari, firefox, chrome
none
Patch
none
Patch
none
Patch
none
[fast-cq]Patch none

Robin Whittleton
Reported 2024-09-05 00:16:24 PDT
Created attachment 472459 [details] Reduced testcase When a list item has an child with an inline margin in the direction of the list marker (typically margin-left), the marker will position itself in relation to the child as if the margin wasn’t there, and out of order with the other markers. This is possibly a stylistic choice, but I couldn’t find anything in the specs to back this up and it doesn’t match Gecko or Chromium. I’ve attached a testcase and will attach screenshots from current Safari, Edge and Firefox.
Attachments
Reduced testcase (302 bytes, text/html)
2024-09-05 00:16 PDT, Robin Whittleton
no flags
Marker position testcase result in Edge (116.77 KB, image/png)
2024-09-05 00:17 PDT, Robin Whittleton
no flags
Marker position testcase result in Firefox (124.64 KB, image/png)
2024-09-05 00:17 PDT, Robin Whittleton
no flags
Marker position testcase result in Safari (68.98 KB, image/png)
2024-09-05 00:17 PDT, Robin Whittleton
no flags
rendering in safari, firefox, chrome (632.61 KB, image/png)
2024-09-05 02:20 PDT, Karl Dubost
no flags
Patch (4.52 KB, patch)
2024-09-06 09:27 PDT, zalan
no flags
Patch (3.92 KB, patch)
2024-09-06 10:06 PDT, zalan
no flags
Patch (3.91 KB, patch)
2024-09-06 11:48 PDT, zalan
no flags
[fast-cq]Patch (4.65 KB, patch)
2024-09-06 18:14 PDT, zalan
no flags
Robin Whittleton
Comment 1 2024-09-05 00:17:22 PDT
Created attachment 472460 [details] Marker position testcase result in Edge
Robin Whittleton
Comment 2 2024-09-05 00:17:43 PDT
Created attachment 472461 [details] Marker position testcase result in Firefox
Robin Whittleton
Comment 3 2024-09-05 00:17:57 PDT
Created attachment 472462 [details] Marker position testcase result in Safari
Karl Dubost
Comment 4 2024-09-05 02:20:35 PDT
Created attachment 472463 [details] rendering in safari, firefox, chrome Tested with: Safari Technology Preview 202 20620.1.4.8 Firefox Nightly 132.0a1 13224.9.4 Google Chrome Canary 130.0.6699.0 6699.0 Adding outlines to visualize the boxes. What a strange bug. :)
Radar WebKit Bug Importer
Comment 5 2024-09-05 02:21:26 PDT
Karl Dubost
Comment 6 2024-09-05 02:30:19 PDT
fwiw the number also slides out of view with a negative margin, while the number is overlapping with the text for other browsers. Also this is not happening with a child element which has display: inline or inline-* or table but happening for all kind of block elements display: block, flex, grid, etc.
zalan
Comment 7 2024-09-05 07:45:04 PDT
I think it's just an unfortunate side effect of us trying to find a place for the (inline) list marker renderer when <li> has a block child. <ol><li><div>text OL RenderBlock LI RenderListItem DIV RenderBlock RenderListMarker (::marker) #text RenderText vs. <ol><li>text OL RenderBlock LI RenderListItem RenderListMarker (::marker) #text RenderText
zalan
Comment 8 2024-09-06 09:27:51 PDT
Antti Koivisto
Comment 9 2024-09-06 09:52:55 PDT
Comment on attachment 472478 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=472478&action=review > Source/WebCore/layout/integration/inline/LayoutIntegrationBoxGeometryUpdater.cpp:85 > + auto hasAccountedForMargin = false; This is never set to any other value than false?
zalan
Comment 10 2024-09-06 09:56:22 PDT
(In reply to Antti Koivisto from comment #9) > Comment on attachment 472478 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=472478&action=review > > > Source/WebCore/layout/integration/inline/LayoutIntegrationBoxGeometryUpdater.cpp:85 > > + auto hasAccountedForMargin = false; > > This is never set to any other value than false? git amend fail
zalan
Comment 11 2024-09-06 10:06:15 PDT
zalan
Comment 12 2024-09-06 11:48:35 PDT
zalan
Comment 13 2024-09-06 18:14:53 PDT
Created attachment 472485 [details] [fast-cq]Patch
EWS
Comment 14 2024-09-06 19:40:59 PDT
Committed 283289@main (1ef26a308328): <https://commits.webkit.org/283289@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 472485 [details].
Note You need to log in before you can comment on or make changes to this bug.