Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 376d3ef4163021f3bcebe93dbcb60dc92caa7100
      
https://github.com/WebKit/WebKit/commit/376d3ef4163021f3bcebe93dbcb60dc92caa7100
  Author: Yulun Wu <[email protected]>
  Date:   2026-03-14 (Sat, 14 Mar 2026)

  Changed paths:
    A 
LayoutTests/fast/lists/list-marker-outside-flex-collapse-anonymous-block-expected.html
    A 
LayoutTests/fast/lists/list-marker-outside-flex-collapse-anonymous-block.html
    M Source/WebCore/layout/formattingContexts/inline/InlineQuirks.cpp
    M Source/WebCore/layout/integration/LayoutIntegrationBoxTreeUpdater.cpp
    M Source/WebCore/layout/layouttree/LayoutElementBox.h
    M Source/WebCore/rendering/RenderListMarker.h
    M Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp

  Log Message:
  -----------
  [List Marker] Collapse anonymous blocks for outside marker when 
blockification prevents line-box parenting
https://bugs.webkit.org/show_bug.cgi?id=309925
<rdar://165933903>

Reviewed by Alan Baradlay.

findParentOfEmptyOrFirstLineBox sometimes fails to find a suitable line-box
parent when a list item contains a flex or grid container because flex/grid
containers blockify inline content like <svg> and <img>. In this case, we
fall back to creating an anonymous block to parent the list marker. However,
this causes layout issues because the anonymous block's inherited line height
pushes the visible content down (and no longer next to the list marker).

This fixes the issue by detecting parenting failure due to blockification
and flagging the marker to collapse its parent block.

* 
LayoutTests/fast/lists/list-marker-outside-flex-collapse-anonymous-block-expected.html:
 Added.
* 
LayoutTests/fast/lists/list-marker-outside-flex-collapse-anonymous-block.html: 
Added.
* Source/WebCore/layout/formattingContexts/inline/InlineQuirks.cpp:
(WebCore::Layout::InlineQuirks::shouldCollapseLineBoxHeight const):
* Source/WebCore/layout/integration/LayoutIntegrationBoxTreeUpdater.cpp:
(WebCore::LayoutIntegration::updateListMarkerAttributes):
(WebCore::LayoutIntegration::BoxTreeUpdater::createLayoutBox):
* Source/WebCore/layout/layouttree/LayoutElementBox.h:
(WebCore::Layout::ElementBox::shouldCollapseAnonymousBlockParentForListMarker 
const):
* Source/WebCore/rendering/RenderListMarker.h:
* Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::findParentOfEmptyOrFirstLineBox):
(WebCore::parentCandidateForMarker):
(WebCore::RenderTreeBuilder::List::updateItemMarker):

Canonical link: https://commits.webkit.org/309272@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to