Bug 242560 - [LFC][FFC] FlexLayout should return a set of logical LayoutRects
Summary: [LFC][FFC] FlexLayout should return a set of logical LayoutRects
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-07-09 16:19 PDT by zalan
Modified: 2022-07-10 14:44 PDT (History)
5 users (show)

See Also:


Attachments
Patch (29.03 KB, patch)
2022-07-09 17:06 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2022-07-09 16:19:55 PDT
instead of setting the used geometry on the incoming LogicalFlexItems
Comment 1 zalan 2022-07-09 17:06:19 PDT
Created attachment 460779 [details]
Patch
Comment 2 Antti Koivisto 2022-07-10 11:40:53 PDT
Comment on attachment 460779 [details]
Patch

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

> COMMIT_MESSAGE:9
> +This patch decouples the input and the output types, where the incoming LogicalFlexItems only has width/height values, while layout() returns a list of rectangles.

Noice

> Source/WebCore/layout/formattingContexts/flex/FlexLayout.h:88
> +    void computeLogicalWidthForFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);
> +    void computeLogicalWidthForStretchingFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);
> +    void computeLogicalWidthForShrinkingFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);
> +    void computeLogicalHeightForFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);
> +    void alignFlexItems(const LogicalFlexItems&, const LineRange&, VerticalConstraints, LogicalFlexItemRects&);
> +    void justifyFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);

Is LogicalFlexItemRects not a return value for efficiency reasons?
Comment 3 zalan 2022-07-10 12:40:20 PDT
(In reply to Antti Koivisto from comment #2)
> Comment on attachment 460779 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=460779&action=review
> 
> > COMMIT_MESSAGE:9
> > +This patch decouples the input and the output types, where the incoming LogicalFlexItems only has width/height values, while layout() returns a list of rectangles.
> 
> Noice
> 
> > Source/WebCore/layout/formattingContexts/flex/FlexLayout.h:88
> > +    void computeLogicalWidthForFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);
> > +    void computeLogicalWidthForStretchingFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);
> > +    void computeLogicalWidthForShrinkingFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);
> > +    void computeLogicalHeightForFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);
> > +    void alignFlexItems(const LogicalFlexItems&, const LineRange&, VerticalConstraints, LogicalFlexItemRects&);
> > +    void justifyFlexItems(const LogicalFlexItems&, const LineRange&, LayoutUnit availableSpace, LogicalFlexItemRects&);
> 
> Is LogicalFlexItemRects not a return value for efficiency reasons?
Yeah, that's the idea.
Comment 4 EWS 2022-07-10 14:43:12 PDT
Committed 252329@main (7aaa7ee9d522): <https://commits.webkit.org/252329@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 460779 [details].
Comment 5 Radar WebKit Bug Importer 2022-07-10 14:44:16 PDT
<rdar://problem/96802604>