Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index 1d3f446d1e4acd57d7eb6a03c54d22d081d766d6..2e925397e2b32ec3bc853d7687d9414950067502 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -687,6 +687,7 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) |
if (!m_client) |
return false; |
+ |
bool eventSwallowed = false; |
bool eventCancelled = false; // for disambiguation |
@@ -707,6 +708,12 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) |
scheduleAnimation(); |
eventSwallowed = true; |
+ // Plugins may need to see GestureFlingStart to balance |
+ // GestureScrollBegin (since the former replaces GestureScrollEnd when |
+ // transitioning to a fling). |
+ PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event); |
+ mainFrameImpl()->frame()->eventHandler().handleGestureScrollEvent(platformEvent); |
+ |
m_client->didHandleGestureEvent(event, eventCancelled); |
return eventSwallowed; |
} |
@@ -745,6 +752,7 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) |
// Perhaps we could simplify things by rewriting scroll handling to work inner frame |
// out, and then unify with other gesture events. |
eventSwallowed = mainFrameImpl()->frame()->eventHandler().handleGestureScrollEvent(platformEvent); |
+ if (event.type == WebInputEvent::GestureFlingStart) |
tdresser
2015/09/11 15:25:20
Is the indentation here a little off?
wjmaclean
2015/09/11 15:31:01
Ooops, you're right ... will fix this in the next
wjmaclean
2015/09/11 15:37:23
Actually, I don't think this should even be here .
|
m_client->didHandleGestureEvent(event, eventCancelled); |
return eventSwallowed; |
case WebInputEvent::GesturePinchBegin: |
@@ -1864,7 +1872,7 @@ void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime) |
PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd, |
m_positionOnFlingStart, m_globalPositionOnFlingStart, |
IntSize(), 0, false, false, false, false); |
- endScrollEvent.setScrollGestureData(0, 0, 0, 0, true, false); |
+ endScrollEvent.setScrollGestureData(0, 0, 0, 0, true, false, 0); |
mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endScrollEvent); |
} |