[Webkit-unassigned] [Bug 222376] [css-grid] Replace the use of -1 with WTF::nullopt

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 8 07:52:29 PST 2021


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

--- Comment #7 from Sergio Villar Senin <svillar at igalia.com> ---
Comment on attachment 422559
  --> https://bugs.webkit.org/attachment.cgi?id=422559
Patch

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

Definitely a step in the right direction. There are some changes that need to be done though

> Source/WebCore/ChangeLog:6
> +        This change replaces -1 with nullopt in grid to indicate indefinte for funtions that

nit: indefinite

> Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:912
> +        overrideSize = WTF::nullopt;

Instead of doing this, change estimatedGridAreaBreadthForChild() so that it returns an Optional<LayoutUnit> and make it return nullopt instead of -1_lu

> Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:1064
> +            overridingSize = WTF::nullopt;

You can do it with a ternary operator:
auto overridingSize = direction() == childInlineDirection ? makeOptional(0_lu) : WTF::nullopt;

In that case maybe you don't even need the overridingSize variable and pass the value directly as argument to setOverriding...

> Source/WebCore/rendering/RenderGrid.cpp:928
>  }

If we change estimatedGridAreaBreadthForChild() as I suggested above then we don't need this change.

-- 
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/20210308/3626a290/attachment.htm>


More information about the webkit-unassigned mailing list