[webkit-reviews] review granted: [Bug 224538] [css-grid] last-baseline shouldn't affect baseline alignment : [Attachment 426201] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 17 20:59:15 PDT 2021


Darin Adler <darin at apple.com> has granted zsun at igalia.com's request for review:
Bug 224538: [css-grid] last-baseline shouldn't affect baseline alignment
https://bugs.webkit.org/show_bug.cgi?id=224538

Attachment 426201: Patch

https://bugs.webkit.org/attachment.cgi?id=426201&action=review




--- Comment #5 from Darin Adler <darin at apple.com> ---
Comment on attachment 426201
  --> https://bugs.webkit.org/attachment.cgi?id=426201
Patch

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

> Source/WebCore/rendering/RenderGrid.cpp:1272
> +	       if (isBaselineAlignmentForChild(*child) &&
!(alignSelfForChild(*child).position() == ItemPosition::LastBaseline ||
justifySelfForChild(*child).position() == ItemPosition::LastBaseline)) {

Is this the most elegant way to write it? I have trouble understanding the
code. Also, consider the Demorgan’s Law equivalent:

    if (isBaselineAlignmentForChild(*child) &&
alignSelfForChild(*child).position() != ItemPosition::LastBaseline &&
justifySelfForChild(*child).position() != ItemPosition::LastBaseline) {

Maybe another named helper function like isBaselineAlignmentForChild could make
the code more readable, although I don’t know what I’d name it.


More information about the webkit-reviews mailing list