Chromium Code Reviews| Index: Source/core/page/EventHandler.cpp |
| diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp |
| index 0bc19a21a3ae478648db1867035abbfdf6b072c4..b31c751257e5900b8e3a02bd795c6368ec9adfc8 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,24 @@ 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) |
| + // if the hittest node doesn't support touchAction, then bailout immediately. |
| + if (node.renderer() && !node.renderer()->supportsTouchAction()) |
|
gnana
2014/06/12 14:02:08
This check is added for below testcase.
<div clas
Rick Byers
2014/06/12 19:27:25
This is the case we need to change the test for.
|
| 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) |