Bug 223480 - Add a fast path for subdivideAndResolveStyle()
Summary: Add a fast path for subdivideAndResolveStyle()
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: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-18 14:35 PDT by Simon Fraser (smfr)
Modified: 2021-03-18 21:55 PDT (History)
12 users (show)

See Also:


Attachments
Patch (3.18 KB, patch)
2021-03-18 14:44 PDT, Simon Fraser (smfr)
mmaxfield: review+
Details | Formatted Diff | Diff
Patch (3.27 KB, patch)
2021-03-18 16:04 PDT, Simon Fraser (smfr)
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>