Skip to content

Commit

Permalink
Never put an "outside" list-item marker in an anonymous block.
Browse files Browse the repository at this point in the history
If a list item has an anonymous block inside (for whatever reason), an
"outside" list item marker is yet to be put on the outside. Normally,
the list item marker is created and attached when the list item is
attached, before any regular children are added, so there'll never be an
anonymous child block. However, if list-style-type is 'none' initially,
there'll be no marker. If list-style-type then is changed later on, we
need to create the marker at that point, and then there may be an
anonymous block to worry about.

BlockLayoutAlgorithm::PositionOrPropagateListMarker() will always add
the marker fragment as a direct child of the list item fragment, and if
this doesn't match the actual layout structure (there's an anonymous
block there), pre-paint will fail when performing a fragment-accompanied
LayoutObject tree walk, which is the case for block fragmentation.
PrePaintTreeWalk::WalkLayoutObjectChildren() won't find the marker,
because it's searching for it inside the anonymous block fragment. But
it's a child of the list item fragment.

Bug: 1510614
Change-Id: I5b63303ce225bc5c89f3ccc52eae41a600a64d8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5115680
Reviewed-by: Koji Ishii <[email protected]>
Commit-Queue: Morten Stenshorne <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1236576}
  • Loading branch information
mstensho authored and chromium-wpt-export-bot committed Dec 12, 2023
1 parent f3342fe commit 2b77720
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions css/css-multicol/crashtests/add-list-item-marker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:[email protected]">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1510614">
<div style="columns:2;">
<div id="outer" style="display:list-item; list-style-type:none;">
text
<div></div>
</div>
</div>
<script>
document.body.offsetTop;
outer.style.listStyleType = "disc";
</script>

0 comments on commit 2b77720

Please sign in to comment.