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 85c73df4a0db2517f8a404a18985d24c889f91ff..85d0fa1415ebc8866d381cb6422fc1d5cf534816 100644 |
| --- a/third_party/WebKit/Source/core/frame/VisualViewport.cpp |
| +++ b/third_party/WebKit/Source/core/frame/VisualViewport.cpp |
| @@ -96,13 +96,22 @@ void VisualViewport::updateStyleAndLayoutIgnorePendingStylesheets() |
| document->updateStyleAndLayoutIgnorePendingStylesheets(); |
| } |
| -void VisualViewport::enqueueChangedEvent() |
| +void VisualViewport::enqueueScrollEvent() |
| { |
| if (!RuntimeEnabledFeatures::visualViewportAPIEnabled()) |
| return; |
| if (Document* document = mainFrame()->document()) |
| - document->enqueueVisualViewportChangedEvent(); |
| + document->enqueueVisualViewportScrollEvent(); |
| +} |
| + |
| +void VisualViewport::enqueueResizeEvent() |
| +{ |
| + if (!RuntimeEnabledFeatures::visualViewportAPIEnabled()) |
| + return; |
| + |
| + if (Document* document = mainFrame()->document()) |
| + document->enqueueVisualViewportResizeEvent(); |
| } |
| void VisualViewport::setSize(const IntSize& size) |
| @@ -124,7 +133,7 @@ void VisualViewport::setSize(const IntSize& size) |
| if (!mainFrame()) |
| return; |
| - enqueueChangedEvent(); |
| + enqueueScrollEvent(); |
|
bokan
2016/06/24 21:52:37
Why are we sending a scroll event when the size ch
ymalik
2016/06/27 14:10:01
Yes!
|
| bool autosizerNeedsUpdating = widthDidChange |
| && mainFrame()->settings() |
| @@ -291,6 +300,7 @@ void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location |
| m_scale = scale; |
| valuesChanged = true; |
| frameHost().chromeClient().pageScaleFactorChanged(); |
| + enqueueResizeEvent(); |
| } |
| FloatPoint clampedOffset(clampOffsetToBoundaries(location)); |
| @@ -308,6 +318,8 @@ void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location |
| document->enqueueScrollEventForNode(document); |
| } |
| + enqueueScrollEvent(); |
| + |
| mainFrame()->loader().client()->didChangeScrollOffset(); |
| valuesChanged = true; |
| } |
| @@ -315,8 +327,6 @@ void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location |
| if (!valuesChanged) |
| return; |
| - enqueueChangedEvent(); |
| - |
| InspectorInstrumentation::didUpdateLayout(mainFrame()); |
| mainFrame()->loader().saveScrollState(); |