Bug 222245

Summary: [Paint Timing] Return early from contentful paint check when no contentful pixels/characters at all
Product: WebKit Reporter: Noam Rosenthal <noam>
Component: Layout and RenderingAssignee: Noam Rosenthal <noam>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cdumez, esprehn+autocc, ews-watchlist, kangil.han, sabouhallawa, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=222186
Bug Depends on:    
Bug Blocks: 211736    
Attachments:
Description Flags
Patch none

Description Noam Rosenthal 2021-02-21 03:48:18 PST
The MotionMark tests captured an edge case that causes expensive contentfulness computations.
See https://browserbench.org/MotionMark1.1/developer.html (Focus/Multiply tests)

This edge case is not plausible in real websites, but happens in this benchmark:
- There are lots of elements, performing rendering-intensive rendering
- There is nothing "contentful" in the page, so "first contenful paint" has to be computed multiple times.
Comment 1 Noam Rosenthal 2021-02-21 03:53:05 PST
Created attachment 421136 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-02-21 09:23:53 PST
Comment on attachment 421136 [details]
Patch

If the test elements contained one glyph each, what would happen?
Comment 3 Noam Rosenthal 2021-02-21 10:09:42 PST
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 421136 [details]
> Patch
> 
> If the test elements contained one glyph each, what would happen?

FCP will be marked the moment one of them become visible, and from that point on the check wouldn't run (as it only measures the *first* contentful paint).
Comment 4 EWS 2021-02-21 11:07:38 PST
Committed r273220: <https://commits.webkit.org/r273220>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421136 [details].
Comment 5 Radar WebKit Bug Importer 2021-02-21 11:08:14 PST
<rdar://problem/74570604>