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

Unified Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 2096783004: Seperate visualviewportchanged event into scroll and resize events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/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();

Powered by Google App Engine
This is Rietveld 408576698