Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 1596573002: Remove extra calls of didMeaningfulLayout() during the same navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 7be5f1006676c7800988794aeae343f3fe494fa6..dbc95cea10b156ae6382562a2ec2922b3bffd873 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -3990,14 +3990,17 @@ void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor,
#endif
}
-void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage)
+void WebViewImpl::didCommitLoad(HistoryCommitType commitType, bool isNavigationWithinPage)
{
if (!isNavigationWithinPage) {
- m_shouldDispatchFirstVisuallyNonEmptyLayout = true;
- m_shouldDispatchFirstLayoutAfterFinishedParsing = true;
- m_shouldDispatchFirstLayoutAfterFinishedLoading = true;
+ if (commitType == StandardCommit || commitType == BackForwardCommit) {
+ m_shouldDispatchFirstVisuallyNonEmptyLayout = true;
+ m_shouldDispatchFirstLayoutAfterFinishedParsing = true;
+ m_shouldDispatchFirstLayoutAfterFinishedLoading = true;
+ }
- if (isNewNavigation) {
+ if (commitType == StandardCommit) {
+ // A new session history item should be created for this load.
pageScaleConstraintsSet().setNeedsReset(true);
m_pageImportanceSignals.onCommitLoad();
}
@@ -4298,6 +4301,12 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
// attempt to paint too early in the next page load.
m_layerTreeView->setDeferCommits(true);
m_layerTreeView->clearRootLayer();
+
+ // didMeaningfulLayout() should be dispatched again.
+ m_shouldDispatchFirstVisuallyNonEmptyLayout = true;
dglazkov 2016/01/15 19:41:48 Interesting! This is a partial revert of https://c
wychen 2016/01/15 22:31:02 This is still needed, for cases like refreshing, o
dglazkov 2016/01/15 22:36:43 Both refresh and redirect will result in a new did
wychen 2016/01/21 01:47:52 Ah. I filtered out HistoryInertCommit in this patc
+ m_shouldDispatchFirstLayoutAfterFinishedParsing = true;
+ m_shouldDispatchFirstLayoutAfterFinishedLoading = true;
+
visualViewport.clearLayersForTreeView(m_layerTreeView);
}
}

Powered by Google App Engine
This is Rietveld 408576698