-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION(264248@main): A floating element can cause a list item's b…
…ullet to be orphaned on overconstrained lines https://bugs.webkit.org/show_bug.cgi?id=266801 <rdar://problem/120022893> Reviewed by Antti Koivisto. Do not disconnect list marker and the associated list item when they are embedded in a list element (e.g. <div><ul><li> vs. <div><li>) -and they are not positioned inside. This quirky behavior matches both Chrome and legacy line layout. * LayoutTests/fast/inline/list-item-inside-list-and-wrap-expected.html: Added. * LayoutTests/fast/inline/list-item-inside-list-and-wrap.html: Added. * Source/WebCore/layout/formattingContexts/inline/InlineFormattingUtils.cpp: (WebCore::Layout::isAtSoftWrapOpportunity): Check whether we are inside a list element to decide whether we can break after the list marker. * Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp: (WebCore::LayoutIntegration::BoxTree::createLayoutBox): * Source/WebCore/layout/layouttree/LayoutElementBox.h: (WebCore::Layout::ElementBox::isListMarkerInsideList const): Canonical link: https://commits.webkit.org/272451@main
- Loading branch information
1 parent
270a645
commit ba97ecf
Showing
5 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
LayoutTests/fast/inline/list-item-inside-list-and-wrap-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<style> | ||
.container { | ||
width: 400px; | ||
font-family: Monospace; | ||
} | ||
.float_box { | ||
float: left; | ||
width: 400px; | ||
height: 20px; | ||
} | ||
</style> | ||
<div class=container> | ||
<ul style="margin-top: 28px;"> | ||
<li>Pass if bullet appears in front of item</li> | ||
</ul> | ||
<div class=container> | ||
<div class=float_box style="width: 380px"></div> | ||
<li><br>Pass if item wraps</li> | ||
</div> | ||
</div> |
22 changes: 22 additions & 0 deletions
22
LayoutTests/fast/inline/list-item-inside-list-and-wrap.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<style> | ||
.container { | ||
width: 400px; | ||
font-family: Monospace; | ||
} | ||
|
||
.float_box { | ||
float: left; | ||
width: 400px; | ||
height: 20px; | ||
} | ||
</style> | ||
<div class=container> | ||
<div class=float_box></div> | ||
<ul> | ||
<li>Pass if bullet appears in front of item</li> | ||
</ul> | ||
</div> | ||
<div class=container> | ||
<div class=float_box style="width: 380px"></div> | ||
<li>Pass if item wraps</li> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters