WebKit Bugzilla
Attachment 359960 Details for
Bug 193741
: DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193741-20190123154056.patch (text/plain), 6.42 KB, created by
zalan
on 2019-01-23 15:40:59 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-23 15:40:59 PST
Size:
6.42 KB
patch
obsolete
>Subversion Revision: 239927 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2870e6b8095f05a11adae1efb068f71a2f7dea95..6f563dbfe6457aee7e36112492754e36abe2292c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2019-01-23 Zalan Bujtas <zalan@apple.com> >+ >+ DidFirstVisuallyNonEmptyLayout milestone should always fire at some point. >+ https://bugs.webkit.org/show_bug.cgi?id=193741 >+ <rdar://problem/47135030> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch ensures that we always fire the DidFirstVisuallyNonEmptyLayout (if requested). >+ Either when >+ 1. mainframe finished loading completely >+ 2. or on a 4s watchdog timer >+ >+ * page/FrameView.cpp: >+ (WebCore::FrameView::FrameView): >+ (WebCore::FrameView::resetLayoutMilestones): >+ (WebCore::FrameView::loadProgressingStatusChanged): >+ (WebCore::FrameView::qualifiesAsVisuallyNonEmpty): >+ (WebCore::FrameView::updateIsVisuallyNonEmpty): >+ (WebCore::FrameView::firstVisuallyNonEmptyLayoutMilestoneWatchdogFired): >+ (WebCore::FrameView::fireFirstVisuallyNonEmptyLayoutMilestoneIfRequested): >+ (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): Deleted. >+ * page/FrameView.h: >+ > 2019-01-14 Zan Dobersek <zdobersek@igalia.com> > > DOMCacheStorage: use-after-move in doSequentialMatch() >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index d25a7e61a7ae34cb257e14f0e525c73982282de9..3bc416e24fb619a33cc44ca30ee4b29b15781eed 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -187,6 +187,7 @@ FrameView::FrameView(Frame& frame) > , m_canHaveScrollbars(true) > , m_updateEmbeddedObjectsTimer(*this, &FrameView::updateEmbeddedObjectsTimerFired) > , m_updateWidgetPositionsTimer(*this, &FrameView::updateWidgetPositionsTimerFired) >+ , m_firstVisuallyNonEmptyMilestoneWatchdog(*this, &FrameView::firstVisuallyNonEmptyLayoutMilestoneWatchdogFired) > , m_isTransparent(false) > , m_baseBackgroundColor(Color::white) > , m_mediaType("screen") >@@ -292,6 +293,7 @@ void FrameView::reset() > > void FrameView::resetLayoutMilestones() > { >+ m_firstVisuallyNonEmptyMilestoneWatchdog.stop(); > m_firstLayoutCallbackPending = false; > m_isVisuallyNonEmpty = false; > m_firstVisuallyNonEmptyLayoutCallbackPending = true; >@@ -2841,6 +2843,9 @@ void FrameView::disableLayerFlushThrottlingTemporarilyForInteraction() > > void FrameView::loadProgressingStatusChanged() > { >+ auto hasPendingVisuallyNonEmptyCallback = m_firstVisuallyNonEmptyLayoutCallbackPending && !m_isVisuallyNonEmpty; >+ if (hasPendingVisuallyNonEmptyCallback && frame().loader().isComplete()) >+ fireFirstVisuallyNonEmptyLayoutMilestoneIfRequested(); > updateLayerFlushThrottling(); > adjustTiledBackingCoverage(); > } >@@ -4431,7 +4436,7 @@ static bool elementOverflowRectIsLargerThanThreshold(const Element& element) > return false; > } > >-bool FrameView::qualifiesAsVisuallyNonEmpty() const >+bool FrameView::qualifiesAsVisuallyNonEmpty() > { > // No content yet. > Element* documentElement = frame().document()->documentElement(); >@@ -4443,9 +4448,12 @@ bool FrameView::qualifiesAsVisuallyNonEmpty() const > return false; > > auto finishedParsingMainDocument = frame().loader().stateMachine().committedFirstRealDocumentLoad() && !frame().document()->parsing(); >- // Ensure that we always fire visually non-empty milestone eventually. >- if (finishedParsingMainDocument && frame().loader().isComplete()) >- return true; >+ if (finishedParsingMainDocument) { >+ if (frame().loader().isComplete()) >+ return true; >+ // Ensure that we always fire visually non-empty milestone eventually. >+ m_firstVisuallyNonEmptyMilestoneWatchdog.startOneShot(4_s); >+ } > > auto isVisible = [](const Element* element) { > if (!element || !element->renderer()) >@@ -4535,9 +4543,36 @@ void FrameView::updateIsVisuallyNonEmpty() > if (!qualifiesAsVisuallyNonEmpty()) > return; > m_isVisuallyNonEmpty = true; >+ m_firstVisuallyNonEmptyMilestoneWatchdog.stop(); > adjustTiledBackingCoverage(); > } > >+void FrameView::firstVisuallyNonEmptyLayoutMilestoneWatchdogFired() >+{ >+ if (!m_firstVisuallyNonEmptyLayoutCallbackPending && m_isVisuallyNonEmpty) >+ return; >+ >+ RELEASE_LOG_IF_ALLOWED("FrameView::firstVisuallyNonEmptyLayoutMilestoneWatchdogFired() - delayed first paint (is main frame %d)", frame().isMainFrame()); >+ fireFirstVisuallyNonEmptyLayoutMilestoneIfRequested(); >+} >+ >+void FrameView::fireFirstVisuallyNonEmptyLayoutMilestoneIfRequested() >+{ >+ ASSERT(!m_isVisuallyNonEmpty); >+ ASSERT(m_firstVisuallyNonEmptyLayoutCallbackPending); >+ m_isVisuallyNonEmpty = true; >+ m_firstVisuallyNonEmptyLayoutCallbackPending = false; >+ m_firstVisuallyNonEmptyMilestoneWatchdog.stop(); >+ addPaintPendingMilestones(DidFirstMeaningfulPaint); >+ >+ auto* page = frame().page(); >+ if (!page || !page->requestedLayoutMilestones().contains(DidFirstVisuallyNonEmptyLayout)) >+ return; >+ if (!frame().isMainFrame()) >+ return; >+ frame().loader().didReachLayoutMilestone(DidFirstVisuallyNonEmptyLayout); >+} >+ > bool FrameView::isViewForDocumentInFrame() const > { > RenderView* renderView = this->renderView(); >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index 2976b567dbf0a19789b76e609a117e62b511825b..660989e275cec9edb19c8ba50b4ec66ee1aff555 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -788,7 +788,7 @@ private: > > void markRootOrBodyRendererDirty() const; > >- bool qualifiesAsVisuallyNonEmpty() const; >+ bool qualifiesAsVisuallyNonEmpty(); > bool isViewForDocumentInFrame() const; > > AXObjectCache* axObjectCache() const; >@@ -809,6 +809,9 @@ private: > }; > void overrideViewportSizeForCSSViewportUnits(OverrideViewportSize); > >+ void fireFirstVisuallyNonEmptyLayoutMilestoneIfRequested(); >+ void firstVisuallyNonEmptyLayoutMilestoneWatchdogFired(); >+ > HashSet<Widget*> m_widgetsInRenderTree; > > static MonotonicTime sCurrentPaintTimeStamp; // used for detecting decoded resource thrash in the cache >@@ -830,6 +833,7 @@ private: > Timer m_updateWidgetPositionsTimer; > > bool m_firstLayoutCallbackPending; >+ Timer m_firstVisuallyNonEmptyMilestoneWatchdog; > > bool m_isTransparent; > #if ENABLE(DARK_MODE_CSS)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193741
:
359960
|
359983
|
360014
|
360020
|
360022
|
360034
|
360039