Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 30864f828c216943fd2ec5272f053f45757f7ffe
https://github.com/WebKit/WebKit/commit/30864f828c216943fd2ec5272f053f45757f7ffe
Author: Sammy Gill <[email protected]>
Date: 2024-11-08 (Fri, 08 Nov 2024)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-align-items-center-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-align-items-center.html
M Source/WebCore/rendering/RenderGrid.cpp
Log Message:
-----------
[Grid][aspect-ratio] Block size computed from aspect ratio is definite for
grid layout.
https://bugs.webkit.org/show_bug.cgi?id=282764
rdar://139444773
Reviewed by Brent Fulgham.
If a grid computes its block size from its inline size and aspect ratio, then
that block
size should be treated as definite for the purposes of grid layout. In the
attached test
case, the grid computes its inline size from the available space and its
resulting block
size from that and the 1/1 aspect ratio.
While the grid ends up getting sized correctly in the end, we fail to take into
consideration this definite size for grid layout, which could have a result of
not properly
aligning items correctly. This can be seen in the state-of-html-2024 survey
within a button
to delete series from filters.
Let's fix this by expanding hasDefiniteLogicalHeight to consider
logical heights computed from the aspect ratio. Later on during grid layout, we
will recognize
this, compute a logical height from the aspect ratio, and use it for the
purposes of
row sizing.
Aside: In theory, we should be able to resolve this by hoisting up
updateLogicalWidth
to right before we compute hasDefiniteLogicalHeight, and it should get resolved
in
RenderBlock::hasDefiniteLogicalHeight, which already has logic to handle this
scenario.
Sadly, this does not quite work, however, because that logic ends up bailing
out early if the
grid's preferredLogicalWidths bits are dirty even if we do not use them for
layout.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-align-items-center-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-align-items-center.html:
Added.
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutGrid):
Canonical link: https://commits.webkit.org/286367@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