Chromium Code Reviews| 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 8fb1989aeac1d01e1a82051d1e5c418a1f46c09a..446b080ae4f6b449162f9f9bb0843e591d6b4b8b 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -417,7 +417,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, |
| m_rootLayer(nullptr), |
| m_rootGraphicsLayer(nullptr), |
| m_visualViewportContainerLayer(nullptr), |
| - m_matchesHeuristicsForGpuRasterization(false), |
| + m_viewportSpecifiedByAuthor(false), |
| m_flingModifier(0), |
| m_flingSourceDevice(WebGestureDeviceUninitialized), |
| m_fullscreenController(FullscreenController::create(this)), |
| @@ -869,8 +869,7 @@ WebInputEventResult WebViewImpl::handleGestureEvent( |
| WebDevToolsAgentImpl* devTools = mainFrameDevToolsAgentImpl(); |
| VisualViewport& visualViewport = page()->frameHost().visualViewport(); |
| bool screencastEnabled = devTools && devTools->screencastEnabled(); |
| - if (event.data.tap.width > 0 && |
| - !visualViewport.shouldDisableDesktopWorkarounds() && |
| + if (event.data.tap.width > 0 && !m_viewportSpecifiedByAuthor && |
| !screencastEnabled) { |
| IntRect boundingBox(visualViewport.viewportToRootFrame( |
| IntRect(event.x - event.data.tap.width / 2, |
| @@ -2941,7 +2940,7 @@ bool WebViewImpl::scrollFocusedEditableElementIntoRect( |
| bool zoomInToLegibleScale = |
| m_webSettings->autoZoomFocusedNodeToLegibleScale() && |
| - !page()->frameHost().visualViewport().shouldDisableDesktopWorkarounds(); |
| + !m_viewportSpecifiedByAuthor; |
| if (zoomInToLegibleScale) { |
| // When deciding whether to zoom in on a focused text box, we should decide |
| @@ -3357,20 +3356,21 @@ void WebViewImpl::updatePageDefinedViewportConstraints( |
| updateMainFrameLayoutSize(); |
| // If we don't support mobile viewports, allow GPU rasterization. |
| - m_matchesHeuristicsForGpuRasterization = true; |
| - if (m_layerTreeView) |
| + m_viewportSpecifiedByAuthor = true; |
|
aelias_OOO_until_Jul13
2016/10/28 01:11:51
Hmm, I realized this line here makes the variable
wychen
2016/10/28 21:21:38
Good catch! Done.
|
| + if (m_layerTreeView) { |
| m_layerTreeView->heuristicsForGpuRasterizationUpdated( |
| - m_matchesHeuristicsForGpuRasterization); |
| + m_viewportSpecifiedByAuthor); |
| + } |
| return; |
| } |
| Document* document = page()->deprecatedLocalMainFrame()->document(); |
| - m_matchesHeuristicsForGpuRasterization = |
| - description.matchesHeuristicsForGpuRasterization(); |
| - if (m_layerTreeView) |
| + m_viewportSpecifiedByAuthor = description.isSpecifiedByAuthor(); |
| + if (m_layerTreeView) { |
| m_layerTreeView->heuristicsForGpuRasterizationUpdated( |
| - m_matchesHeuristicsForGpuRasterization); |
| + m_viewportSpecifiedByAuthor); |
| + } |
| Length defaultMinWidth = document->viewportDefaultMinWidth(); |
| if (defaultMinWidth.isAuto()) |