Changeset 163645 in webkit
- Timestamp:
- Feb 7, 2014 2:01:38 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r163644 r163645 1 2014-02-07 Benjamin Poulain <bpoulain@apple.com> 2 3 [WK2] Fitler touch events only based on touch start 4 https://bugs.webkit.org/show_bug.cgi?id=128354 5 6 Reviewed by Simon Fraser. 7 8 Touch Events track their target, we should not test the touch regions 9 again after a touch sequence starts. 10 11 This patch adds a boolean flag to know if we are sending events to the WebProcess 12 (m_isTrackingTouchEvents). The flag is updated every time a touch sequence starts. 13 14 * UIProcess/WebPageProxy.cpp: 15 (WebKit::WebPageProxy::WebPageProxy): 16 (WebKit::WebPageProxy::shouldStartTrackingTouchEvents): 17 (WebKit::WebPageProxy::handleTouchEvent): 18 * UIProcess/WebPageProxy.h: 19 1 20 2014-02-07 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r163609 r163645 298 298 , m_syncNavigationActionPolicyDownloadID(0) 299 299 , m_processingMouseMoveEvent(false) 300 #if ENABLE(TOUCH_EVENTS) 301 , m_isTrackingTouchEvents(false) 302 #endif 300 303 , m_pageID(pageID) 301 304 , m_session(session) … … 1383 1386 1384 1387 #if ENABLE(TOUCH_EVENTS) 1388 1389 bool WebPageProxy::shouldStartTrackingTouchEvents(const WebTouchEvent& touchStartEvent) const 1390 { 1385 1391 #if ENABLE(ASYNC_SCROLLING) 1386 static bool anyTouchIsInNonFastScrollableRegion(RemoteScrollingCoordinatorProxy& scrollingCoordinator, const WebTouchEvent& event) 1387 { 1388 for (auto touchPoint : event.touchPoints()) { 1389 if (scrollingCoordinator.isPointInNonFastScrollableRegion(touchPoint.location())) 1392 for (auto touchPoint : touchStartEvent.touchPoints()) { 1393 if (m_scrollingCoordinatorProxy->isPointInNonFastScrollableRegion(touchPoint.location())) 1390 1394 return true; 1391 1395 } 1392 1396 1393 1397 return false; 1394 }1395 1398 #endif // ENABLE(ASYNC_SCROLLING) 1399 return true; 1400 } 1396 1401 1397 1402 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event) 1398 1403 { 1399 1404 if (!isValid()) 1405 return; 1406 1407 if (event.type() == WebEvent::TouchStart) 1408 m_isTrackingTouchEvents = shouldStartTrackingTouchEvents(event); 1409 1410 if (!m_isTrackingTouchEvents) 1400 1411 return; 1401 1412 … … 1404 1415 // we do not send any of the events to the page even if is has listeners. 1405 1416 if (!m_isPageSuspended) { 1406 1407 #if ENABLE(ASYNC_SCROLLING)1408 // FIXME: we should only do this check for the start of a touch gesture.1409 if (!anyTouchIsInNonFastScrollableRegion(*m_scrollingCoordinatorProxy, event))1410 return;1411 #endif1412 1413 1417 m_touchEventQueue.append(event); 1414 1418 m_process->responsivenessTimer()->start(); … … 1430 1434 } 1431 1435 } 1436 1437 if (event.type() == WebEvent::TouchEnd || event.type() == WebEvent::TouchCancel) 1438 m_isTrackingTouchEvents = false; 1432 1439 } 1433 1440 #endif // ENABLE(TOUCH_EVENTS) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r163600 r163645 1010 1010 #endif 1011 1011 1012 #if ENABLE(TOUCH_EVENTS)1013 void needTouchEvents(bool);1014 #endif1015 1016 1012 #if ENABLE(INPUT_TYPE_COLOR) 1017 1013 void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&); … … 1175 1171 void sendWheelEvent(const WebWheelEvent&); 1176 1172 1173 #if ENABLE(TOUCH_EVENTS) 1174 bool shouldStartTrackingTouchEvents(const WebTouchEvent&) const; 1175 #endif 1176 1177 1177 #if ENABLE(NETSCAPE_PLUGIN_API) 1178 1178 void findPlugin(const String& mimeType, uint32_t processType, const String& urlString, const String& frameURLString, const String& pageURLString, bool allowOnlyApplicationPlugins, uint64_t& pluginProcessToken, String& newMIMEType, uint32_t& pluginLoadPolicy, String& unavailabilityDescription); … … 1332 1332 1333 1333 #if ENABLE(TOUCH_EVENTS) 1334 bool m_isTrackingTouchEvents; 1334 1335 Deque<QueuedTouchEvents> m_touchEventQueue; 1335 1336 #endif
Note: See TracChangeset
for help on using the changeset viewer.