Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[IFC][list marker] Adjust nested list markers when intrusive float is…
… present https://bugs.webkit.org/show_bug.cgi?id=249975 Reviewed by Antti Koivisto. The following html markup <!DOCTYPE html> <ul><li><ul><li>overlapping nested list markers</li></ul></li></ul> produces 2 list markers. These markers are placed on the same line. * * overlapping nested list markers. However in quirks mode: <ul><li><ul><li>non-overlapping nested list markers</li></ul></li></ul> each list maker is on a dedicated line. * * non-overlapping nested list markers This is controlled by negative margin start on the list marker box. These list marker positions are affected by any overlapping floats, even when the float is not intrusive to the line itself. This patch makes sure the we take floats into account when computing the final position of such list items. LineLayout::updateListMarkerDimensions: Cache the list marker's offset from the associated list item. In case of nested list markers (when multiple markers share the same line), the containing block is not necessarily the associated <li>. This offset is later may be adjusted by taking overlapping floats into account. LineBoxBuilder::adjustOutsideListMarkersPosition: In this function we compute the final position of the list markers and also make that nested list markers do avoid float boxes. * LayoutTests/fast/lists/overlapping-nested-list-markers-expected.html: Added. * LayoutTests/fast/lists/overlapping-nested-list-markers.html: Added. * Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h: (WebCore::Layout::BlockLayoutState::floatingState const): * Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::createDisplayContentForLine): * Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp: (WebCore::Layout::InlineFormattingGeometry::adjustMarginStartForListMarker const): * Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.h: * Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::addNestedListMarkerOffset): (WebCore::Layout::InlineFormattingState::nestedListMarkerOffset const): (WebCore::Layout::InlineFormattingState::resetNestedListMarkerOffsets): * Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h: (WebCore::Layout::InlineLevelBox::setLogicalLeft): * Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp: (WebCore::Layout::LineBoxBuilder::LineBoxBuilder): (WebCore::Layout::LineBoxBuilder::build): (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): (WebCore::Layout::LineBoxBuilder::computeLineBoxGeometry const): (WebCore::Layout::LineBoxBuilder::adjustOutsideListMarkersPosition): * Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h: (WebCore::Layout::LineBoxBuilder::blockLayoutState const): * Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): * Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::updateListMarkerDimensions): (WebCore::LayoutIntegration::LineLayout::constructContent): Canonical link: https://commits.webkit.org/258372@main
- Loading branch information
1 parent
0611819
commit 992e7fe
Showing
18 changed files
with
159 additions
and
51 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
LayoutTests/fast/lists/overlapping-nested-list-markers-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,14 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
ul { | ||
list-style-type: circle; | ||
} | ||
.container { | ||
padding-left: 160px; | ||
} | ||
</style> | ||
<div class=container> | ||
<ul><li>overlapping nested list markers</li></ul> | ||
<ul><li>overlapping nested list markers</li></ul> | ||
<ul><li>overlapping nested list markers</li></ul> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
LayoutTests/fast/lists/overlapping-nested-list-markers.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,16 @@ | ||
<!DOCTYPE html> | ||
<meta name="fuzzy" content="maxDifference=120-121; totalPixels=54-117" /> | ||
<style> | ||
ul { | ||
list-style-type: circle; | ||
} | ||
.float { | ||
float: left; | ||
width: 200px; | ||
height: 500px; | ||
} | ||
</style> | ||
<div class=float></div> | ||
<ul><li><ul><li>overlapping nested list markers</li></ul></li></ul> | ||
<ul><li><ul><li><ul><li>overlapping nested list markers</li></ul></li></ul></li></ul> | ||
<ul><li><ul><li><ul><li><ul><li>overlapping nested list markers</li></ul></li></ul></li></ul></li></ul> |
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
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
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
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
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
Oops, something went wrong.