Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 702340cc2699d48588d883239c7b4cb0141e0954
https://github.com/WebKit/WebKit/commit/702340cc2699d48588d883239c7b4cb0141e0954
Author: Sammy Gill <[email protected]>
Date: 2025-07-21 (Mon, 21 Jul 2025)
Changed paths:
M Source/WebCore/rendering/PositionedLayoutConstraints.cpp
M Source/WebCore/rendering/PositionedLayoutConstraints.h
Log Message:
-----------
[Absolute Positioning] Add skeleton code for alignment within static position
rectangle.
https://bugs.webkit.org/show_bug.cgi?id=295922
rdar://problem/155818136
Reviewed by Alan Baradlay.
css-align defines how the self-alignment properties are supposed to work
in regards to absolutely positioned boxes.
https://drafts.csswg.org/css-align-3/#justify-abspos
https://drafts.csswg.org/css-align-3/#align-abspos
When the inset properties in the respective axis are both set to auto,
then the alignment container for the subject, which is the absolutely
positioned box's margin box, is supposed to be the static position
rectangle.
https://drafts.csswg.org/css-align-3/#static-position-rectangle
It does not look like our alignment code in PositionedLayoutConstraints
has any sort of logic to handle this type of alignment, so this patch
serves as a first step towards that goal by introducing some skeleton
code that will be implemented piecemeal.
* Source/WebCore/rendering/PositionedLayoutConstraints.cpp:
(WebCore::PositionedLayoutConstraints::isEligibleForStaticRangeAlignment const):
This will be the primary function that determines whether or not the
content is eligible to use the new logic. Since the definition of the
static position rectangle is dependent upon the formatting context the
box would have participated in, this is the main gate that will make any
other additional restrictions. For example, items that would have
participated in a Grid Formatting Context would fall into the RenderGrid
case, and that branch may have additional criteria specific to it which
may impact the eligibility.
(WebCore::PositionedLayoutConstraints::resolvePosition const):
This is where we will call into the eligibility code and build up our
logic as we allow more content to take this path. From a cursory look, we
should be able to hook into resolveAlignmentShift to compute the correct
for the box's alignment, but we will do this on a case-by-case basis.
Canonical link: https://commits.webkit.org/297724@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