Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 94ca2b0f38366468f9b71005ed9aa7781ea2cce7
https://github.com/WebKit/WebKit/commit/94ca2b0f38366468f9b71005ed9aa7781ea2cce7
Author: Elika Etemad <[email protected]>
Date: 2025-02-27 (Thu, 27 Feb 2025)
Changed paths:
M Source/WebCore/rendering/RenderBox.cpp
M Source/WebCore/rendering/RenderBox.h
Log Message:
-----------
Restructure Positioned Layout
https://bugs.webkit.org/show_bug.cgi?id=288648
rdar://145690034
Reviewed by Antti Koivisto.
1. Factors out style extraction into a helper method called from the
PositionedLayoutConstraints() constructor. See captureInsets().
2. Cleans up calls to the RTL adjustment function by removing
unnecessary parameters, making the code easier to follow or adjust.
(Also renamed function to match.) See ~RTLInlineBoxContainingBlock().
3. Factors out margin+position resolution from size resolution,
consolidating constraint resolution into a single shared method and
simplifying logic in the core layout methods. Also cleans up the code
flow so we're not making so many redundant or useless layout function
calls. See resolvePosition() and resulting simplifications to
computePositionedLogical~().
4. Simplifies writing mode arithmetic for heights by performing more
conversions up front. See captureInsets() and convertLogicalTopValue().
This makes positioned layout easier to understand, easier to build
on top of, and less wasteful.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::PositionedLayoutConstraints::containingCoordsAreFlipped
const):
(WebCore::RenderBox::PositionedLayoutConstraints::availableContentSpace const):
(WebCore::RenderBox::PositionedLayoutConstraints::PositionedLayoutConstraints):
(WebCore::RenderBox::PositionedLayoutConstraints::captureInsets):
(WebCore::RenderBox::PositionedLayoutConstraints::adjustForPositionArea):
(WebCore::RenderBox::PositionedLayoutConstraints::resolvePosition const):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
(WebCore::RenderBox::PositionedLayoutConstraints::computeInlineStaticDistance):
(WebCore::RenderBox::computePositionedLogicalWidth const):
(WebCore::adjustmentForRTLInlineBoxContainingBlock):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):
(WebCore::RenderBox::PositionedLayoutConstraints::computeBlockStaticDistance):
(WebCore::RenderBox::computePositionedLogicalHeight const):
(WebCore::RenderBox::PositionedLayoutConstraints::convertLogicalTopValue const):
(WebCore::RenderBox::computePositionedLogicalHeightUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
(WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
(WebCore::positionWithRTLInlineBoxContainingBlock): Deleted.
* Source/WebCore/rendering/RenderBox.h:
Canonical link: https://commits.webkit.org/291298@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes