Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp |
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
index 031199d6675b7907a7f77c7e2eb8dc81a63a6c7d..94171f98337b9a81e85dd022734205ae39f45f0f 100644 |
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
@@ -1323,13 +1323,18 @@ void FrameLoader::commitProvisionalLoad() { |
return; |
if (isLoadingMainFrame()) { |
+ // TODO(wjmaclean): Instead of passing |m_frame| here we pass nullptr |
+ // instead so the properties will be set on the WebView. We do this since, |
+ // while we are loading, the WebFrameWidget for m_frame may not yet |
+ // be available. |
m_frame->page()->chromeClient().setEventListenerProperties( |
- WebEventListenerClass::TouchStartOrMove, |
+ nullptr, WebEventListenerClass::TouchStartOrMove, |
WebEventListenerProperties::Nothing); |
m_frame->page()->chromeClient().setEventListenerProperties( |
- WebEventListenerClass::MouseWheel, WebEventListenerProperties::Nothing); |
+ nullptr, WebEventListenerClass::MouseWheel, |
+ WebEventListenerProperties::Nothing); |
m_frame->page()->chromeClient().setEventListenerProperties( |
- WebEventListenerClass::TouchEndOrCancel, |
+ nullptr, WebEventListenerClass::TouchEndOrCancel, |
WebEventListenerProperties::Nothing); |
} |
@@ -1410,6 +1415,7 @@ void FrameLoader::restoreScrollPositionAndViewState() { |
} |
VisualViewport& visualViewport = m_frame->host()->visualViewport(); |
+ float originalScale = visualViewport.scale(); |
if (shouldRestoreScale && shouldRestoreScroll) { |
visualViewport.setScaleAndLocation(m_currentItem->pageScaleFactor(), |
FloatPoint(visualViewportOffset)); |
@@ -1418,6 +1424,9 @@ void FrameLoader::restoreScrollPositionAndViewState() { |
} else if (shouldRestoreScroll) { |
visualViewport.setLocation(FloatPoint(visualViewportOffset)); |
} |
+ // If necessary, notify client we've restored page scale. |
+ if (shouldRestoreScale && (originalScale != visualViewport.scale())) |
+ client()->didRestorePageScaleFactorOnLoad(visualViewport.scale()); |
if (ScrollingCoordinator* scrollingCoordinator = |
m_frame->page()->scrollingCoordinator()) |