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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 329773002: Remove special touch-action hit test mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 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
« no previous file with comments | « Source/core/page/EventHandler.h ('k') | Source/core/rendering/HitTestRequest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 0bc19a21a3ae478648db1867035abbfdf6b072c4..0e316867dde4e9d182bb7dcadd68c0dd87713ab5 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -3448,7 +3448,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// See http://crbug.com/345372.
m_targetForTouchID.set(point.id(), node);
- TouchAction effectiveTouchAction = computeEffectiveTouchAction(pagePoint);
+ TouchAction effectiveTouchAction = computeEffectiveTouchAction(*node);
if (effectiveTouchAction != TouchActionAuto)
m_frame->page()->chrome().client().setTouchAction(effectiveTouchAction);
}
@@ -3622,25 +3622,20 @@ TouchAction EventHandler::intersectTouchAction(TouchAction action1, TouchAction
return action1 & action2;
}
-TouchAction EventHandler::computeEffectiveTouchAction(const LayoutPoint& point)
+TouchAction EventHandler::computeEffectiveTouchAction(const Node& node)
{
// Optimization to minimize risk of this new feature (behavior should be identical
// since there's no way to get non-default touch-action values).
if (!RuntimeEnabledFeatures::cssTouchActionEnabled())
return TouchActionAuto;
- HitTestResult taResult = hitTestResultAtPoint(point, HitTestRequest::TouchEvent | HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::TouchAction);
- Node* node = taResult.innerNode();
- if (!node)
- return TouchActionAuto;
-
// Start by permitting all actions, then walk the elements supporting
// touch-action from the target node up to the nearest scrollable ancestor
// and exclude any prohibited actions.
TouchAction effectiveTouchAction = TouchActionAuto;
- for (const Node* curNode = node; curNode; curNode = NodeRenderingTraversal::parent(curNode)) {
+ for (const Node* curNode = &node; curNode; curNode = NodeRenderingTraversal::parent(curNode)) {
if (RenderObject* renderer = curNode->renderer()) {
- if (renderer->visibleForTouchAction()) {
+ if (renderer->supportsTouchAction()) {
TouchAction action = renderer->style()->touchAction();
effectiveTouchAction = intersectTouchAction(action, effectiveTouchAction);
if (effectiveTouchAction == TouchActionNone)
« no previous file with comments | « Source/core/page/EventHandler.h ('k') | Source/core/rendering/HitTestRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698