[Webkit-unassigned] [Bug 224538] [css-grid] last-baseline shouldn't affect baseline alignment

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 19 10:41:40 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=224538

--- Comment #7 from Javier Fernandez <jfernandez at igalia.com> ---
Comment on attachment 426399
  --> https://bugs.webkit.org/attachment.cgi?id=426399
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426399&action=review

> Source/WebCore/rendering/RenderGrid.cpp:1277
> +            if (isBaselineAlignmentForChild(*child) && !iSelfAlignmentForChildAtLastBaseline(*child)) {

If you let me suggest something, I'd rather create a new function in GridBaselineAlignment.h for checking only first-line baseline (although such keyword doesn't exist formally in the spec). Then, we can pass that function as an argument for RenderGrid::isBaselineAlignmentForChild (perhaps use a template here ?). Something like this:

static inline bool isFirstBaselinePosition(ItemPosition position) { return position == ItemPosition::Baseline; }

template <typename F>
bool RenderGrid::isBaselineAlignmentForChild(const RenderBox& child, F isBaseline) const;

template <typename F>
bool RenderGrid::isBaselineAlignmentForChild(const RenderBox& child, GridAxis baselineAxis, F isBaseline) const;

Then, we can make the non-template versions of these 2 methods so that they use the "isBaselinePosition" function we already have. This way we don't need to apply any change on the many callers of isBaselineAlignmentForChild. 

For the case we are changing the behavior in this patch, we would use the new isFirstBaseline call we are defining now.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210419/452e4948/attachment-0001.htm>


More information about the webkit-unassigned mailing list