WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
238643
Implement support for aligning baselines through subgrids
https://bugs.webkit.org/show_bug.cgi?id=238643
Summary
Implement support for aligning baselines through subgrids
Matt Woodrow
Reported
2022-03-31 18:03:23 PDT
We should recurse into subgrids when looking for items to contribute to a baseline sharing group.
Attachments
Patch
(17.14 KB, patch)
2022-03-31 18:16 PDT
,
Matt Woodrow
no flags
Details
Formatted Diff
Diff
Patch
(34.42 KB, patch)
2022-04-06 02:35 PDT
,
Matt Woodrow
no flags
Details
Formatted Diff
Diff
Patch
(34.54 KB, patch)
2022-04-06 13:38 PDT
,
Matt Woodrow
no flags
Details
Formatted Diff
Diff
Patch
(34.51 KB, patch)
2022-04-13 21:18 PDT
,
Matt Woodrow
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-03-31 18:10:46 PDT
<
rdar://problem/91138101
>
Matt Woodrow
Comment 2
2022-03-31 18:16:46 PDT
Created
attachment 456302
[details]
Patch
EWS Watchlist
Comment 3
2022-03-31 18:18:37 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see
https://trac.webkit.org/wiki/WPTExportProcess
Matt Woodrow
Comment 4
2022-04-06 02:35:24 PDT
Created
attachment 456795
[details]
Patch
Matt Woodrow
Comment 5
2022-04-06 13:38:28 PDT
Created
attachment 456856
[details]
Patch
Javier Fernandez
Comment 6
2022-04-08 02:40:58 PDT
Comment on
attachment 456856
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=456856&action=review
The change looks good, but I'd like to understand better why some ASSERTs has been removed.
> Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:-923 > - ASSERT(!child.needsLayout());
Why this ASSERT is removed ?
> Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:-948 > - ASSERT(m_renderGrid->isBaselineAlignmentForChild(item, axis));
Why this ASSERT has been removed ?
Matt Woodrow
Comment 7
2022-04-11 20:47:19 PDT
Comment on
attachment 456856
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=456856&action=review
>> Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:-923 >> - ASSERT(!child.needsLayout()); > > Why this ASSERT is removed ?
We only require the child to have completed layout if we are going to synthesise a baseline. I moved this assertion to two places within GridBaselineAlignment so that it only gets checked when we attempt to synthesise a baseline (and means we can align subgrid children that haven't been laid out yet, as long as they have a real baseline).
>> Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:-948 >> - ASSERT(m_renderGrid->isBaselineAlignmentForChild(item, axis)); > > Why this ASSERT has been removed ?
m_renderGrid is the outermost grid, and isBaselineAlignmentForChild is only guaranteed to return true on the parent grid of item. I could change this to ASSERT(downcast<RenderGrid>(item.parent())->isBaselineAlignmentForChild(item, axis));, but since the only callers of this function also check that, it didn't seem necessary.
Javier Fernandez
Comment 8
2022-04-13 10:45:04 PDT
Comment on
attachment 456856
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=456856&action=review
>>> Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:-948 >>> - ASSERT(m_renderGrid->isBaselineAlignmentForChild(item, axis)); >> >> Why this ASSERT has been removed ? > > m_renderGrid is the outermost grid, and isBaselineAlignmentForChild is only guaranteed to return true on the parent grid of item. > > I could change this to ASSERT(downcast<RenderGrid>(item.parent())->isBaselineAlignmentForChild(item, axis));, but since the only callers of this function also check that, it didn't seem necessary.
If I remember correctly, this assert was added to detect outdated elements in the cache, which might be target of a style change that could affect to the align-self or justify-self properties. Theoretically, we call cacheBaselineAlignedItem only if the items have baseline as value for theses properties, hence the ASSERT (eg, RenderGrid::computeIntrinsicLogicalWidths)
Matt Woodrow
Comment 9
2022-04-13 21:18:45 PDT
Created
attachment 457591
[details]
Patch
Matt Woodrow
Comment 10
2022-04-13 21:19:21 PDT
(In reply to Javier Fernandez from
comment #8
)
> Comment on
attachment 456856
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=456856&action=review
> > >>> Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:-948 > >>> - ASSERT(m_renderGrid->isBaselineAlignmentForChild(item, axis)); > >> > >> Why this ASSERT has been removed ? > > > > m_renderGrid is the outermost grid, and isBaselineAlignmentForChild is only guaranteed to return true on the parent grid of item. > > > > I could change this to ASSERT(downcast<RenderGrid>(item.parent())->isBaselineAlignmentForChild(item, axis));, but since the only callers of this function also check that, it didn't seem necessary. > > If I remember correctly, this assert was added to detect outdated elements > in the cache, which might be target of a style change that could affect to > the align-self or justify-self properties. Theoretically, we call > cacheBaselineAlignedItem only if the items have baseline as value for theses > properties, hence the ASSERT (eg, RenderGrid::computeIntrinsicLogicalWidths)
Alright, I've added this check back.
Javier Fernandez
Comment 11
2022-04-18 09:45:28 PDT
Comment on
attachment 457591
[details]
Patch r=me
EWS
Comment 12
2022-04-18 14:45:18 PDT
Committed
r292973
(
249736@main
): <
https://commits.webkit.org/249736@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 457591
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug