Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 992e7fe2b7fb32ade4727d19f8511a90e60da8ff
https://github.com/WebKit/WebKit/commit/992e7fe2b7fb32ade4727d19f8511a90e60da8ff
Author: Alan Baradlay <[email protected]>
Date: 2023-01-01 (Sun, 01 Jan 2023)
Changed paths:
A LayoutTests/fast/lists/overlapping-nested-list-markers-expected.html
A LayoutTests/fast/lists/overlapping-nested-list-markers.html
M LayoutTests/platform/ios/css1/box_properties/padding_right-expected.txt
M LayoutTests/platform/ios/fast/lists/002-expected.txt
M LayoutTests/platform/ios/fast/lists/002-vertical-expected.txt
M LayoutTests/platform/mac/css1/box_properties/margin_right-expected.txt
M LayoutTests/platform/mac/css1/box_properties/padding_right-expected.txt
M LayoutTests/platform/mac/fast/lists/002-expected.txt
M LayoutTests/platform/mac/fast/lists/002-vertical-expected.txt
M Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h
M
Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
M
Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp
M Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.h
M Source/WebCore/layout/formattingContexts/inline/InlineFormattingState.h
M Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h
M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp
M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.h
M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
Log Message:
-----------
[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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes