Bug 240317 - TextBoxPainter::paintBackground should bail out early when nothing to paint
Summary: TextBoxPainter::paintBackground should bail out early when nothing to paint
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-05-11 14:23 PDT by zalan
Modified: 2022-05-12 06:14 PDT (History)
12 users (show)

See Also:


Attachments
Patch (3.67 KB, patch)
2022-05-11 14:31 PDT, zalan
simon.fraser: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (3.70 KB, patch)
2022-05-11 14:55 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (5.09 KB, patch)
2022-05-11 19:45 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (5.10 KB, patch)
2022-05-11 19:51 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (5.10 KB, patch)
2022-05-11 19:55 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-05-11 14:23:16 PDT
ssia
Comment 1 zalan 2022-05-11 14:31:49 PDT
Created attachment 459182 [details]
Patch
Comment 2 zalan 2022-05-11 14:55:34 PDT
Created attachment 459184 [details]
Patch
Comment 3 Simon Fraser (smfr) 2022-05-11 15:03:40 PDT
Comment on attachment 459182 [details]
Patch

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

> Source/WebCore/rendering/TextBoxPainter.cpp:140
> +        if (m_document.hasHighlightRegister())

Maybe "has highlight register and has a non-zero number of highlights"?
Comment 4 zalan 2022-05-11 19:45:55 PDT
Created attachment 459203 [details]
Patch
Comment 5 Simon Fraser (smfr) 2022-05-11 19:47:56 PDT
Comment on attachment 459203 [details]
Patch

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

> Source/WebCore/dom/Document.cpp:2891
> +    return (m_highlightRegister && !m_highlightRegister->isEmpty()) || (m_fragmentHighlightRegister && !m_fragmentHighlightRegister->isEmpty()) 

I'd wrap the || ... onto a new line, indented.

> Source/WebCore/dom/Document.cpp:2893
> +    || (m_appHighlightRegister && m_appHighlightRegister->isEmpty())

Indent this line
Comment 6 zalan 2022-05-11 19:51:09 PDT
Created attachment 459204 [details]
Patch
Comment 7 zalan 2022-05-11 19:54:03 PDT
(In reply to Simon Fraser (smfr) from comment #5)
> Comment on attachment 459203 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=459203&action=review
> 
> > Source/WebCore/dom/Document.cpp:2891
> > +    return (m_highlightRegister && !m_highlightRegister->isEmpty()) || (m_fragmentHighlightRegister && !m_fragmentHighlightRegister->isEmpty()) 
> 
> I'd wrap the || ... onto a new line, indented.
> 
> > Source/WebCore/dom/Document.cpp:2893
> > +    || (m_appHighlightRegister && m_appHighlightRegister->isEmpty())
> 
> Indent this line
oops
Comment 8 zalan 2022-05-11 19:55:24 PDT
Created attachment 459205 [details]
Patch
Comment 9 EWS 2022-05-12 06:13:32 PDT
Committed r294099 (250484@main): <https://commits.webkit.org/250484@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 459205 [details].
Comment 10 Radar WebKit Bug Importer 2022-05-12 06:14:13 PDT
<rdar://problem/93170251>