Bug 248854 - [leading-trim][IFC] Add support for nested block containers with leading-trim: end
Summary: [leading-trim][IFC] Add support for nested block containers with leading-trim...
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: 245599
  Show dependency treegraph
 
Reported: 2022-12-06 19:48 PST by zalan
Modified: 2023-01-13 09:28 PST (History)
11 users (show)

See Also:


Attachments
Patch (19.95 KB, patch)
2022-12-06 20:52 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (19.96 KB, patch)
2022-12-07 07:16 PST, zalan
no flags Details | Formatted Diff | Diff
[fast-cq]Patch (20.51 KB, patch)
2022-12-07 11:01 PST, zalan
no flags Details | Formatted Diff | Diff
[fast-cq]Patch (20.51 KB, patch)
2022-12-07 16:45 PST, 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-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>