Bug 244735 - [LFC][IFC] Cleanup InlineFormattingContext::lineLayout
Summary: [LFC][IFC] Cleanup InlineFormattingContext::lineLayout
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-09-02 15:49 PDT by zalan
Modified: 2022-09-04 15:09 PDT (History)
5 users (show)

See Also:


Attachments
Patch (16.93 KB, patch)
2022-09-02 15:54 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (16.93 KB, patch)
2022-09-04 10:03 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (16.98 KB, patch)
2022-09-04 10:17 PDT, zalan
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (16.86 KB, patch)
2022-09-04 11:24 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-09-02 15:49:59 PDT
ssia
Comment 1 zalan 2022-09-02 15:54:27 PDT
Created attachment 462106 [details]
Patch
Comment 2 Antti Koivisto 2022-09-04 07:36:12 PDT
Comment on attachment 462106 [details]
Patch

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

> Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:219
> +    if (!previousLine)
> +        return lineContentRange.end - 1;
> +
> +    auto lineLayoutHasAdvanced = lineContentRange.end > previousLineLastInlineItemIndex
> +        || (previousLine->partialOverflowingContent && previousLine->partialOverflowingContent->length > lineContent.partialOverflowingContent->length);
> +    if (!lineLayoutHasAdvanced) {
> +        // Move over to the next run if we are stuck on this partial content (when the overflow content length remains the same).
> +        // We certainly lose some content, but we would be busy looping otherwise.
> +        ASSERT_NOT_REACHED();
> +        return lineContentRange.end;
> +    }
> +    ASSERT(lineContentRange.end);
> +    return lineContentRange.end - 1;

Isn't this whole thing equivalent of just 

return lineContentRange.end - 1;

(except for the path that asserst.
Comment 3 zalan 2022-09-04 09:45:41 PDT
(In reply to Antti Koivisto from comment #2)
> Comment on attachment 462106 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=462106&action=review
> 
> > Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:219
> > +    if (!previousLine)
> > +        return lineContentRange.end - 1;
> > +
> > +    auto lineLayoutHasAdvanced = lineContentRange.end > previousLineLastInlineItemIndex
> > +        || (previousLine->partialOverflowingContent && previousLine->partialOverflowingContent->length > lineContent.partialOverflowingContent->length);
> > +    if (!lineLayoutHasAdvanced) {
> > +        // Move over to the next run if we are stuck on this partial content (when the overflow content length remains the same).
> > +        // We certainly lose some content, but we would be busy looping otherwise.
> > +        ASSERT_NOT_REACHED();
> > +        return lineContentRange.end;
> > +    }
> > +    ASSERT(lineContentRange.end);
> > +    return lineContentRange.end - 1;
> 
> Isn't this whole thing equivalent of just 
> 
> return lineContentRange.end - 1;
> 
> (except for the path that asserst.
Yeah you are right, I should collapse them.
Comment 4 zalan 2022-09-04 10:03:59 PDT
Created attachment 462120 [details]
Patch
Comment 5 zalan 2022-09-04 10:17:57 PDT
Created attachment 462121 [details]
Patch
Comment 6 zalan 2022-09-04 11:24:41 PDT
Created attachment 462123 [details]
Patch
Comment 7 EWS 2022-09-04 15:08:13 PDT
Committed 254150@main (29727b096d48): <https://commits.webkit.org/254150@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 462123 [details].
Comment 8 Radar WebKit Bug Importer 2022-09-04 15:09:15 PDT
<rdar://problem/99551574>