Bug 223480

Summary: Add a fast path for subdivideAndResolveStyle()
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, dbates, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, mmaxfield, pdr, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
mmaxfield: review+
Patch ews-feeder: commit-queue-

Description Simon Fraser (smfr) 2021-03-18 14:35:57 PDT
Add a fast path for subdivideAndResolveStyle()
Comment 1 Simon Fraser (smfr) 2021-03-18 14:44:36 PDT
Created attachment 423661 [details]
Patch
Comment 2 Myles C. Maxfield 2021-03-18 15:11:15 PDT
Comment on attachment 423661 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        Most of the time, InlineTextBox::paint() will be painting text runs with no marked text,
> +        so optimize subdivideAndResolveStyle() for this case.

Is the motivation cleanliness or performance? If performance, would be good to validate with a perf test.

> Source/WebCore/rendering/MarkedTextStyle.cpp:157
> +    if (textsToCoalesce.size() < 2)

nit: I think 1 is a more obvious sentinel than 2, so I would say "<= 1" instead of "< 2".
Comment 3 Simon Fraser (smfr) 2021-03-18 16:04:48 PDT
Created attachment 423665 [details]
Patch
Comment 4 Daniel Bates 2021-03-18 18:51:17 PDT
Looks good
Comment 5 Daniel Bates 2021-03-18 18:52:52 PDT
Comment on attachment 423665 [details]
Patch

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

> Source/WebCore/rendering/MarkedTextStyle.cpp:123
> +    Vector<StyledMarkedText> frontmostMarkedTexts;

Consider moving this back to avoid allocating inline storage.
Comment 6 EWS 2021-03-18 21:21:40 PDT
Committed r274700: <https://commits.webkit.org/r274700>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 423665 [details].
Comment 7 Radar WebKit Bug Importer 2021-03-18 21:22:17 PDT
<rdar://problem/75605441>