Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/VisualViewport.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.cpp b/third_party/WebKit/Source/core/frame/VisualViewport.cpp |
| index 5f61223528a847ff9b6a4834cd76ab341e7c3f3a..47e290f41ceaa5d7ae3b71c5549874d701b72abd 100644 |
| --- a/third_party/WebKit/Source/core/frame/VisualViewport.cpp |
| +++ b/third_party/WebKit/Source/core/frame/VisualViewport.cpp |
| @@ -89,15 +89,11 @@ DEFINE_TRACE(VisualViewport) |
| void VisualViewport::setSize(const IntSize& size) |
| { |
| - // When the main frame is remote, we won't have an associated frame. |
| - if (!mainFrame()) |
| - return; |
| - |
| if (m_size == size) |
| return; |
| - bool autosizerNeedsUpdating = |
| - (size.width() != m_size.width()) |
| + bool autosizerNeedsUpdating = (size.width() != m_size.width()) |
| + && mainFrame() |
| && mainFrame()->settings() |
| && mainFrame()->settings()->textAutosizingEnabled(); |
| @@ -194,9 +190,6 @@ void VisualViewport::setScale(float scale) |
| void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location) |
|
dcheng
2016/01/08 21:36:06
What actually needs to run in here for a WebView w
bokan
2016/01/11 16:36:34
Can a remote frame even be pinch-zoomed? I think m
kenrb
2016/01/11 17:07:24
Pinch zoom doesn't really make sense on remote fra
bokan
2016/01/11 18:18:58
It sounds fine in principle but practically speaki
kenrb
2016/01/11 20:50:26
I've removed this in the most recent patchset, sin
|
| { |
| - if (!mainFrame()) |
| - return; |
| - |
| bool valuesChanged = false; |
| if (scale != m_scale) { |
| @@ -215,20 +208,23 @@ void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location |
| if (ScrollingCoordinator* coordinator = frameHost().page().scrollingCoordinator()) |
| coordinator->scrollableAreaScrollLayerDidChange(this); |
| - if (!frameHost().settings().inertVisualViewport()) { |
| + if (!frameHost().settings().inertVisualViewport() && mainFrame()) { |
| if (Document* document = mainFrame()->document()) |
| document->enqueueScrollEventForNode(document); |
| } |
| - mainFrame()->loader().client()->didChangeScrollOffset(); |
| + if (mainFrame()) |
| + mainFrame()->loader().client()->didChangeScrollOffset(); |
| valuesChanged = true; |
| } |
| if (!valuesChanged) |
| return; |
| - InspectorInstrumentation::didUpdateLayout(mainFrame()); |
| - mainFrame()->loader().saveScrollState(); |
| + if (mainFrame()) { |
| + InspectorInstrumentation::didUpdateLayout(mainFrame()); |
| + mainFrame()->loader().saveScrollState(); |
| + } |
| clampToBoundaries(); |
| } |