Bug 241314

Summary: [LFC][FFC] Take align-self into account when computing flex item's logical height.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, koivisto, ntim, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch ews-feeder: commit-queue-

Description zalan 2022-06-04 20:53:33 PDT
ssia
Comment 1 zalan 2022-06-04 20:56:17 PDT
Created attachment 460035 [details]
Patch
Comment 2 Tim Nguyen (:ntim) 2022-06-05 17:58:52 PDT
Comment on attachment 460035 [details]
Patch

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

> COMMIT_MESSAGE:1
> +[LFC][FFC] Take align-itself into account when computing flex item's logical height. 

nit: align-self not itself :)
Comment 3 Tim Nguyen (:ntim) 2022-06-05 18:01:55 PDT
Comment on attachment 460035 [details]
Patch

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

> Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp:275
> +        auto& flexItemAlignSelf = flexItem.style().alignSelf();
> +        auto alignValue = flexItemAlignSelf.position() != ItemPosition::Auto ? flexItemAlignSelf : flexBoxAlignItems;
> +        switch (alignValue.position()) {

Also, not sure you want to use them, but there's actually helper functions in RenderStyle: https://webkit-search.igalia.com/webkit/rev/572c4442ee7f1dc075302d3b9855403acd5fd651/Source/WebCore/rendering/style/RenderStyle.cpp#272-279 (RenderStyle::resolvedAlignSelf(const RenderStyle* parentStyle, ItemPosition normalValueBehaviour))
Comment 4 zalan 2022-06-05 19:29:37 PDT
(In reply to Tim Nguyen (:ntim) from comment #3)
> Comment on attachment 460035 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=460035&action=review
> 
> > Source/WebCore/layout/formattingContexts/flex/FlexLayout.cpp:275
> > +        auto& flexItemAlignSelf = flexItem.style().alignSelf();
> > +        auto alignValue = flexItemAlignSelf.position() != ItemPosition::Auto ? flexItemAlignSelf : flexBoxAlignItems;
> > +        switch (alignValue.position()) {
> 
> Also, not sure you want to use them, but there's actually helper functions
> in RenderStyle:
> https://webkit-search.igalia.com/webkit/rev/
> 572c4442ee7f1dc075302d3b9855403acd5fd651/Source/WebCore/rendering/style/
> RenderStyle.cpp#272-279 (RenderStyle::resolvedAlignSelf(const RenderStyle*
> parentStyle, ItemPosition normalValueBehaviour))
We are planning on removing all these from style. They don't belong in there.
Comment 5 zalan 2022-06-05 21:29:05 PDT
Created attachment 460043 [details]
Patch
Comment 6 EWS 2022-06-05 22:20:20 PDT
Committed r295277 (251323@main): <https://commits.webkit.org/251323@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 460043 [details].
Comment 7 Radar WebKit Bug Importer 2022-06-05 22:21:15 PDT
<rdar://problem/94418719>