Changeset 273220 in webkit


Ignore:
Timestamp:
Feb 21, 2021 11:07:33 AM (3 years ago)
Author:
Noam Rosenthal
Message:

[Paint Timing] Return early from contentful paint check when no contentful pixels/characters at all
https://bugs.webkit.org/show_bug.cgi?id=222245

Reviewed by Simon Fraser.

Bail from recursive contenful-paint check if there are no pixels/text characters in the entire document.

Covered by existing tests, an optimization only.

  • dom/Document.cpp:

(WebCore::Document::enqueuePaintTimingEntryIfNeeded):

  • page/FrameView.cpp:

(WebCore::FrameView::hasContenfulDescendants const):

  • page/FrameView.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r273219 r273220  
     12021-02-21  Noam Rosenthal  <noam@webkit.org>
     2
     3        [Paint Timing] Return early from contentful paint check when no contentful pixels/characters at all
     4        https://bugs.webkit.org/show_bug.cgi?id=222245
     5
     6        Reviewed by Simon Fraser.
     7
     8        Bail from recursive contenful-paint check if there are no pixels/text characters in the entire document.
     9       
     10        Covered by existing tests, an optimization only.
     11
     12        * dom/Document.cpp:
     13        (WebCore::Document::enqueuePaintTimingEntryIfNeeded):
     14        * page/FrameView.cpp:
     15        (WebCore::FrameView::hasContenfulDescendants const):
     16        * page/FrameView.h:
     17
    1182021-02-21  Martin Robinson  <mrobinson@igalia.com>
    219
  • trunk/Source/WebCore/dom/Document.cpp

    r273203 r273220  
    32453245        return;
    32463246
     3247    if (!view()->hasContenfulDescendants())
     3248        return;
     3249
    32473250    if (!ContentfulPaintChecker::qualifiesForContentfulPaint(*view()))
    32483251        return;
  • trunk/Source/WebCore/page/FrameView.cpp

    r272805 r273220  
    46174617}
    46184618
     4619bool FrameView::hasContenfulDescendants() const
     4620{
     4621    return m_visuallyNonEmptyCharacterCount || m_visuallyNonEmptyPixelCount;
     4622}
     4623
    46194624bool FrameView::isViewForDocumentInFrame() const
    46204625{
  • trunk/Source/WebCore/page/FrameView.h

    r271788 r273220  
    414414    void incrementVisuallyNonEmptyPixelCount(const IntSize&);
    415415    bool isVisuallyNonEmpty() const { return m_contentQualifiesAsVisuallyNonEmpty; }
     416    bool hasContenfulDescendants() const;
    416417    void checkAndDispatchDidReachVisuallyNonEmptyState();
    417418
Note: See TracChangeset for help on using the changeset viewer.