Title: [256999] trunk/Source/WebCore
Revision
256999
Author
za...@apple.com
Date
2020-02-19 16:48:04 -0800 (Wed, 19 Feb 2020)

Log Message

[First paint] Introduce FrameView::m_firstVisuallyNonEmptyLayoutMilestoneIsPending
https://bugs.webkit.org/show_bug.cgi?id=207966
<rdar://problem/59606528>

Reviewed by Simon Fraser.

This is in preparation for decoupling the "content is qualified as visually non-empty" check and layout, when
the check happens soon after style recalc/render tree building and we need to wait until after layout to
issue the milestone.

* page/FrameView.cpp:
(WebCore::FrameView::resetLayoutMilestones):
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
* page/FrameView.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (256998 => 256999)


--- trunk/Source/WebCore/ChangeLog	2020-02-20 00:45:17 UTC (rev 256998)
+++ trunk/Source/WebCore/ChangeLog	2020-02-20 00:48:04 UTC (rev 256999)
@@ -1,3 +1,20 @@
+2020-02-19  Zalan Bujtas  <za...@apple.com>
+
+        [First paint] Introduce FrameView::m_firstVisuallyNonEmptyLayoutMilestoneIsPending
+        https://bugs.webkit.org/show_bug.cgi?id=207966
+        <rdar://problem/59606528>
+
+        Reviewed by Simon Fraser.
+
+        This is in preparation for decoupling the "content is qualified as visually non-empty" check and layout, when
+        the check happens soon after style recalc/render tree building and we need to wait until after layout to
+        issue the milestone.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::resetLayoutMilestones):
+        (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
+        * page/FrameView.h:
+
 2020-02-19  Youenn Fablet  <you...@apple.com>
 
         [mac debug] Regression: http/tests/websocket/tests/hybi/workers/worker-reload.html is a flaky crash

Modified: trunk/Source/WebCore/page/FrameView.cpp (256998 => 256999)


--- trunk/Source/WebCore/page/FrameView.cpp	2020-02-20 00:45:17 UTC (rev 256998)
+++ trunk/Source/WebCore/page/FrameView.cpp	2020-02-20 00:48:04 UTC (rev 256999)
@@ -264,7 +264,8 @@
 void FrameView::resetLayoutMilestones()
 {
     m_firstLayoutCallbackPending = false;
-    m_isVisuallyNonEmpty = false;
+    m_firstVisuallyNonEmptyLayoutMilestoneIsPending = true;
+    m_contentQualifiesAsVisuallyNonEmpty = false;
     m_hasReachedSignificantRenderedTextThreshold = false;
     m_renderedSignificantAmountOfText = false;
     m_visuallyNonEmptyCharacterCount = 0;
@@ -2849,7 +2850,7 @@
 
 void FrameView::loadProgressingStatusChanged()
 {
-    if (!m_isVisuallyNonEmpty && frame().loader().isComplete())
+    if (!m_contentQualifiesAsVisuallyNonEmpty && frame().loader().isComplete())
         fireLayoutRelatedMilestonesIfNeeded();
     updateLayerFlushThrottling();
     adjustTiledBackingCoverage();
@@ -5135,11 +5136,15 @@
             page->startCountingRelevantRepaintedObjects();
     }
 
-    if (!m_isVisuallyNonEmpty && qualifiesAsVisuallyNonEmpty()) {
-        m_isVisuallyNonEmpty = true;
-        addPaintPendingMilestones(DidFirstMeaningfulPaint);
-        if (requestedMilestones & DidFirstVisuallyNonEmptyLayout)
-            milestonesAchieved.add(DidFirstVisuallyNonEmptyLayout);
+    if (m_firstVisuallyNonEmptyLayoutMilestoneIsPending) {
+        if (!m_contentQualifiesAsVisuallyNonEmpty && qualifiesAsVisuallyNonEmpty()) {
+            m_contentQualifiesAsVisuallyNonEmpty = true;
+            m_firstVisuallyNonEmptyLayoutMilestoneIsPending = false;
+
+            addPaintPendingMilestones(DidFirstMeaningfulPaint);
+            if (requestedMilestones & DidFirstVisuallyNonEmptyLayout)
+                milestonesAchieved.add(DidFirstVisuallyNonEmptyLayout);
+        }
     }
 
     if (!m_renderedSignificantAmountOfText && qualifiesAsSignificantRenderedText()) {

Modified: trunk/Source/WebCore/page/FrameView.h (256998 => 256999)


--- trunk/Source/WebCore/page/FrameView.h	2020-02-20 00:45:17 UTC (rev 256998)
+++ trunk/Source/WebCore/page/FrameView.h	2020-02-20 00:48:04 UTC (rev 256999)
@@ -396,7 +396,7 @@
 
     void incrementVisuallyNonEmptyCharacterCount(const String&);
     void incrementVisuallyNonEmptyPixelCount(const IntSize&);
-    bool isVisuallyNonEmpty() const { return m_isVisuallyNonEmpty; }
+    bool isVisuallyNonEmpty() const { return m_contentQualifiesAsVisuallyNonEmpty; }
     WEBCORE_EXPORT bool qualifiesAsVisuallyNonEmpty() const;
 
     WEBCORE_EXPORT void enableAutoSizeMode(bool enable, const IntSize& minSize);
@@ -920,7 +920,8 @@
 
     bool m_isPainting { false };
 
-    bool m_isVisuallyNonEmpty { false };
+    bool m_contentQualifiesAsVisuallyNonEmpty { false };
+    bool m_firstVisuallyNonEmptyLayoutMilestoneIsPending { true };
 
     bool m_renderedSignificantAmountOfText { false };
     bool m_hasReachedSignificantRenderedTextThreshold { false };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to