Bug 216591

Summary: REGRESSION(r266677): ASSERTION FAILED in PaintFrequencyTracker::end()
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: Layout and RenderingAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, esprehn+autocc, ews-watchlist, fred.wang, glenn, kondapallykalyan, pdr, simon.fraser, webkit-bug-importer, wenson_hsieh, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
simon.fraser: review+
Patch
none
Patch none

Description Said Abou-Hallawa 2020-09-15 17:03:14 PDT
Painting RenderLayers can be called from code paths which do not schedule RenderingUpdate through RenderingUpdateScheduler. This means RenderLayer::paintLayerContents() may be called while Page::updateRendering() is not on the call stack. This will make timestampForPaintFrequencyTracking() returns zero in this case. So PaintFrequencyTracker::end() will fail the assertion ASSERT(m_firstPaintTime). An example for this case is taking a snapshot of the page, or calling FrameView::paintContentsForSnapshot(). Another example is updating control tints or calling FrameView::updateControlTints().
Comment 1 Wenson Hsieh 2020-09-15 17:32:14 PDT
(In reply to Said Abou-Hallawa from comment #0)
> Painting RenderLayers can be called from code paths which do not schedule
> RenderingUpdate through RenderingUpdateScheduler. This means
> RenderLayer::paintLayerContents() may be called while
> Page::updateRendering() is not on the call stack. This will make
> timestampForPaintFrequencyTracking() returns zero in this case. So
> PaintFrequencyTracker::end() will fail the assertion
> ASSERT(m_firstPaintTime). An example for this case is taking a snapshot of
> the page, or calling FrameView::paintContentsForSnapshot(). Another example
> is updating control tints or calling FrameView::updateControlTints().

To clarify — `timestampForPaintFrequencyTracking()` will only return 0 if `Page::updateRendering()` has never been called (not if `RenderLayer::paintLayerContents()` is called while `Page::updateRendering()` is not on the call stack).
Comment 2 Said Abou-Hallawa 2020-09-15 17:54:47 PDT
Created attachment 408881 [details]
Patch
Comment 3 Said Abou-Hallawa 2020-09-15 18:36:53 PDT
<rdar://problem/68635418>
Comment 4 Said Abou-Hallawa 2020-09-15 19:03:45 PDT
Created attachment 408885 [details]
Patch
Comment 5 Said Abou-Hallawa 2020-09-15 21:27:00 PDT
Created attachment 408896 [details]
Patch
Comment 6 EWS 2020-09-15 23:33:20 PDT
Committed r267137: <https://trac.webkit.org/changeset/267137>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 408896 [details].