[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 12:59:50 PST 2021


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

--- Comment #10 from Javier Fernandez <jfernandez 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

>>> 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
> 
> I tried this approach. The main issue is that LayoutUnit GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild(const RenderBox& child, GridTrackSizingDirection direction) is called by LayoutSize GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild(const RenderBox& child) const. LayoutSize doesn't like Optional<LayoutUnit>, especially when it's WTF::nullopt. I'm not sure how feasible this approach is. Any suggestions?

Umm, the only solution I see now is that we remove the estimatedGridAreaBreadthForChild(child), and the caller takes the responsibility of building the LayoutSize instance, based on the results of the function; this should also be the responsible of handling the nullopt. I'm not sure how big would be the change, though.

-- 
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/043df63c/attachment.htm>


More information about the webkit-unassigned mailing list