Title: [273396] branches/safari-611-branch/Source/WebCore
Revision
273396
Author
repst...@apple.com
Date
2021-02-24 09:10:31 -0800 (Wed, 24 Feb 2021)

Log Message

Cherry-pick r273220. rdar://problem/74623537

    [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:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273220 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (273395 => 273396)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-24 17:10:27 UTC (rev 273395)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-24 17:10:31 UTC (rev 273396)
@@ -1,5 +1,44 @@
 2021-02-23  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r273220. rdar://problem/74623537
+
+    [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:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-21  Noam Rosenthal  <n...@webkit.org>
+
+            [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:
+
+2021-02-23  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r273158. rdar://problem/74623451
 
     Allow to use BigInt as key identifier

Modified: branches/safari-611-branch/Source/WebCore/dom/Document.cpp (273395 => 273396)


--- branches/safari-611-branch/Source/WebCore/dom/Document.cpp	2021-02-24 17:10:27 UTC (rev 273395)
+++ branches/safari-611-branch/Source/WebCore/dom/Document.cpp	2021-02-24 17:10:31 UTC (rev 273396)
@@ -3273,6 +3273,9 @@
     if (!view()->isVisuallyNonEmpty() || view()->needsLayout())
         return;
 
+    if (!view()->hasContenfulDescendants())
+        return;
+
     if (!ContentfulPaintChecker::qualifiesForContentfulPaint(*view()))
         return;
 

Modified: branches/safari-611-branch/Source/WebCore/page/FrameView.cpp (273395 => 273396)


--- branches/safari-611-branch/Source/WebCore/page/FrameView.cpp	2021-02-24 17:10:27 UTC (rev 273395)
+++ branches/safari-611-branch/Source/WebCore/page/FrameView.cpp	2021-02-24 17:10:31 UTC (rev 273396)
@@ -4605,6 +4605,11 @@
         frame().loader().didReachVisuallyNonEmptyState();
 }
 
+bool FrameView::hasContenfulDescendants() const
+{
+    return m_visuallyNonEmptyCharacterCount || m_visuallyNonEmptyPixelCount;
+}
+
 bool FrameView::isViewForDocumentInFrame() const
 {
     RenderView* renderView = this->renderView();

Modified: branches/safari-611-branch/Source/WebCore/page/FrameView.h (273395 => 273396)


--- branches/safari-611-branch/Source/WebCore/page/FrameView.h	2021-02-24 17:10:27 UTC (rev 273395)
+++ branches/safari-611-branch/Source/WebCore/page/FrameView.h	2021-02-24 17:10:31 UTC (rev 273396)
@@ -413,6 +413,7 @@
     void incrementVisuallyNonEmptyCharacterCount(const String&);
     void incrementVisuallyNonEmptyPixelCount(const IntSize&);
     bool isVisuallyNonEmpty() const { return m_contentQualifiesAsVisuallyNonEmpty; }
+    bool hasContenfulDescendants() const;
     void checkAndDispatchDidReachVisuallyNonEmptyState();
 
     WEBCORE_EXPORT void enableFixedWidthAutoSizeMode(bool enable, const IntSize& minSize);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to