Bug 248854

Summary: [leading-trim][IFC] Add support for nested block containers with leading-trim: end
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, esprehn+autocc, ews-watchlist, glenn, koivisto, kondapallykalyan, pdr, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 245599    
Attachments:
Description Flags
Patch
none
Patch
none
[fast-cq]Patch
none
[fast-cq]Patch none

Description zalan 2022-12-06 19:48:33 PST
ssia
Comment 1 zalan 2022-12-06 20:52:58 PST
Created attachment 463913 [details]
Patch
Comment 2 zalan 2022-12-07 07:16:47 PST
Created attachment 463915 [details]
Patch
Comment 3 Antti Koivisto 2022-12-07 07:25:18 PST
Comment on attachment 463915 [details]
Patch

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

> Source/WebCore/rendering/RenderBlockFlow.cpp:725
> +    if (childrenInline()) {
> +        setLeadingTrimForSubtree(this);
> +        layoutInlineChildren(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
> +        adjustLeadingTrimAfterLayout();
> +        return;
> +    }
> +
> +    // With block children, there's no way to tell what the last formatted line is until after we finished laying out the subtree.
> +    setLeadingTrimForSubtree();
> +    layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom);
> +    adjustLeadingTrimAfterLayout();

setLeadingTrimForSubtree(this) vs setLeadingTrimForSubtree() is but subtle.

Maybe a stack helper (LeadingTrimmer!) could make this bit less intrusive.
Comment 4 zalan 2022-12-07 07:27:57 PST
(In reply to Antti Koivisto from comment #3)
> Comment on attachment 463915 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=463915&action=review
> 
> > Source/WebCore/rendering/RenderBlockFlow.cpp:725
> > +    if (childrenInline()) {
> > +        setLeadingTrimForSubtree(this);
> > +        layoutInlineChildren(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
> > +        adjustLeadingTrimAfterLayout();
> > +        return;
> > +    }
> > +
> > +    // With block children, there's no way to tell what the last formatted line is until after we finished laying out the subtree.
> > +    setLeadingTrimForSubtree();
> > +    layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom);
> > +    adjustLeadingTrimAfterLayout();
> 
> setLeadingTrimForSubtree(this) vs setLeadingTrimForSubtree() is but subtle.
> 
> Maybe a stack helper (LeadingTrimmer!) could make this bit less intrusive.
yeah, good point!
Comment 5 zalan 2022-12-07 11:01:00 PST
Created attachment 463925 [details]
[fast-cq]Patch
Comment 6 zalan 2022-12-07 16:45:25 PST
Created attachment 463929 [details]
[fast-cq]Patch
Comment 7 EWS 2022-12-07 17:23:48 PST
Committed 257526@main (be3537314eb4): <https://commits.webkit.org/257526@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 463929 [details].
Comment 8 Radar WebKit Bug Importer 2022-12-07 17:24:17 PST
<rdar://problem/103097237>