Bug 204514

Summary: [LFC][IFC] Line::Run::expand should take a range of runs to merge
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description zalan 2019-11-22 07:05:27 PST
instead of merging one by one
Comment 1 Radar WebKit Bug Importer 2019-11-22 07:06:03 PST
<rdar://problem/57428139>
Comment 2 zalan 2019-11-22 07:19:04 PST
Created attachment 384150 [details]
Patch
Comment 3 Antti Koivisto 2019-11-22 07:36:18 PST
Comment on attachment 384150 [details]
Patch

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

> Source/WebCore/layout/inlineformatting/InlineLine.cpp:315
> +            auto& trailingRun = m_inlineItemRuns[i + 1];
> +            if (!ContinousContent::canMergeRuns(*m_inlineItemRuns[i], *trailingRun))
>                  break;
> -            runList.last().expand(*nextRun);
> -            // Skip the merged run.
> -            ++i;
> +            continousContent.append(*trailingRun);

Maybe the canMergeRuns call could be done in ContinousContent too? Like instead of append do something like

continousContent.mergeIfNeeded(*m_inlineItemRuns[i], m_inlineItemRuns[i + 1]);
Comment 4 zalan 2019-11-22 08:08:40 PST
(In reply to Antti Koivisto from comment #3)
> Comment on attachment 384150 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=384150&action=review
> 
> > Source/WebCore/layout/inlineformatting/InlineLine.cpp:315
> > +            auto& trailingRun = m_inlineItemRuns[i + 1];
> > +            if (!ContinousContent::canMergeRuns(*m_inlineItemRuns[i], *trailingRun))
> >                  break;
> > -            runList.last().expand(*nextRun);
> > -            // Skip the merged run.
> > -            ++i;
> > +            continousContent.append(*trailingRun);
> 
> Maybe the canMergeRuns call could be done in ContinousContent too? Like
> instead of append do something like
> 
> continousContent.mergeIfNeeded(*m_inlineItemRuns[i], m_inlineItemRuns[i +
> 1]);
good idea!
Comment 5 zalan 2019-11-22 13:06:37 PST
Created attachment 384189 [details]
Patch
Comment 6 WebKit Commit Bot 2019-11-22 15:06:09 PST
Comment on attachment 384189 [details]
Patch

Clearing flags on attachment: 384189

Committed r252807: <https://trac.webkit.org/changeset/252807>
Comment 7 WebKit Commit Bot 2019-11-22 15:06:11 PST
All reviewed patches have been landed.  Closing bug.