-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement margin-trim for floats in block containers that contain only block boxes. #8910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
de74673
to
26913a3
Compare
EWS run on previous version of this PR (hash 26913a3)
|
26913a3
to
18be5d8
Compare
EWS run on previous version of this PR (hash 18be5d8)
|
18be5d8
to
f5f1db7
Compare
EWS run on previous version of this PR (hash f5f1db7)
|
f5f1db7
to
e46bf26
Compare
EWS run on previous version of this PR (hash e46bf26)
|
e46bf26
to
4a89c14
Compare
EWS run on previous version of this PR (hash 4a89c14)
|
66cf0dc
to
f3e2720
Compare
EWS run on previous version of this PR (hash f3e2720) |
f3e2720
to
5992334
Compare
EWS run on previous version of this PR (hash 5992334) |
5992334
to
58a94a0
Compare
EWS run on previous version of this PR (hash 58a94a0)
|
58a94a0
to
586d366
Compare
EWS run on previous version of this PR (hash 586d366)
|
586d366
to
e5b6b0d
Compare
EWS run on previous version of this PR (hash e5b6b0d)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be good to go (after that &style() adjustment).
07eed4a
to
fdb75fc
Compare
EWS run on current version of this PR (hash fdb75fc)
|
EWS run on previous version of this PR (hash 07eed4a) |
…y block boxes. https://bugs.webkit.org/show_bug.cgi?id=249207 rdar://103285803 Reviewed by Alan Baradlay. Another patch will be added to provide support for block containers that contain only inline level boxes. There are 3 different pieces that we need to implement: 1.) Trimming the block start, inline start, and inline end margins 2.) Trimming the block-end margin, which is slightly different from the others 3.) Making sure the trimmed margins do not contribute to the inrinsic sizing of the container When a candidate position for a float is determined in the float positioning code, we can determine whether it is possible to trim its margins. For each candidate position, we can determine whether any edges of the margin box would touch the container and then trim that edge if it is specified in margin-trim. This can be done for the inline-start, inline-end, and block-start edges of the container. Trimming the block-end margin is slightly different because it is not in the context of the containing block like the other margins but of the block formatting context. This means that we can only trim these margins after its block formatting context is done with layout. In RnderBlockFlow we can check to see if it establishes a block formatting context and then proceed to trim the block-end margins of its floats where needed. As we iterate over each float, we check to see if its block end location is lower than the lowest piece of content in the BFC. If so, we trim it up to the necesssary amount where it will not extend the height of the BFC. Finally, to make sure that the trimmed inline margins do not contribute to the intrinsic sizing of its containing block, all we need to do is check to see if the item is a float and if any of the inline margins are specified to be trimmed. If so, we do not include those in its contribution. * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-end-deeply-nested-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-end-deeply-nested.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-end-up-to-content-block-layout-different-containers-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-end-up-to-content-block-layout-different-containers-vert-lr-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-end-up-to-content-block-layout-different-containers-vert-lr.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-end-up-to-content-block-layout-different-containers.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-end-up-to-content-block-layout-same-container-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-end-up-to-content-block-layout-same-container.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-start-block-layout-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-start-block-layout.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-start-relative-positioned-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-start-relative-positioned.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-start-with-transforms-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-block-start-with-transforms.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-fit-content-block-layout-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-fit-content-block-layout.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-inline-end-block-layout-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-inline-end-block-layout.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-inline-start-block-layout-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-inline-start-block-layout.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-left-trimmed-margin-allows-float-to-fit-block-layout-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-left-trimmed-margin-allows-float-to-fit-block-layout-vert-lr-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-left-trimmed-margin-allows-float-to-fit-block-layout-vert-lr.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-left-trimmed-margin-allows-float-to-fit-block-layout.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-min-content-with-block-content-block-layout-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-min-content-with-block-content-block-layout.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-right-trimmed-margin-allows-float-to-fit-block-layout-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-float-right-trimmed-margin-allows-float-to-fit-block-layout.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-overflowing-float-margins-tirmmed-at-final-position-block-layout-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/block-container-overflowing-float-margins-tirmmed-at-final-position-block-layout.html: Added. * Source/WebCore/rendering/FloatingObjects.cpp: (WebCore::FloatingObject::isLowestPlacedFloatBottomInBlockFormattingContext const): * Source/WebCore/rendering/FloatingObjects.h: (WebCore::FloatingObject::setHeight): * Source/WebCore/rendering/RenderBlock.cpp: (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const): * Source/WebCore/rendering/RenderBlock.h: (WebCore::RenderBlock::logicalMarginBoxHeightForChild const): (WebCore::RenderBlock::logicalMarginBoxTopForChild const): * Source/WebCore/rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlock): (WebCore::RenderBlockFlow::trimFloatBlockEndMargins): (WebCore::RenderBlockFlow::shouldChildInlineMarginContributeToContainerIntrinsicSize const): (WebCore::RenderBlockFlow::insertFloatingObject): (WebCore::RenderBlockFlow::trimMarginForFloat): (WebCore::RenderBlockFlow::computeLogicalLocationForFloat): (WebCore::RenderBlockFlow::blockFormattingContextInFlowBlockLevelContentHeight const): * Source/WebCore/rendering/RenderBlockFlow.h: * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::establishesBlockFormattingContext const): (WebCore::RenderBox::blockFormattingContextRoot const): * Source/WebCore/rendering/RenderBox.h: Canonical link: https://commits.webkit.org/260318@main
fdb75fc
to
f679766
Compare
Committed 260318@main (f679766): https://commits.webkit.org/260318@main Reviewed commits have been landed. Closing PR #8910 and removing active labels. |
f679766
fdb75fc
🧪 api-gtk