Chromium Code Reviews| Index: LayoutTests/touchadjustment/resources/touchadjustment.js |
| diff --git a/LayoutTests/touchadjustment/resources/touchadjustment.js b/LayoutTests/touchadjustment/resources/touchadjustment.js |
| index 2a3aa3d6716a82bb9f2589f1bbfbffadda3372e0..3b7ac5cf81d0330e5769a82303604d05d6528e50 100644 |
| --- a/LayoutTests/touchadjustment/resources/touchadjustment.js |
| +++ b/LayoutTests/touchadjustment/resources/touchadjustment.js |
| @@ -63,9 +63,20 @@ function shouldBeWithin(adjustedPoint, targetArea) { |
| } |
| } |
| -function testTouchPoint(touchpoint, targetNode, allowTextNodes) |
| +function touchNodeAdjustedToBestClickableNode(left, top, width, height, doc, allowShadowDOM) |
| { |
| - var adjustedNode = internals.touchNodeAdjustedToBestClickableNode(touchpoint.left, touchpoint.top, touchpoint.width, touchpoint.height, document); |
| + var adjustedNode = internals.touchNodeAdjustedToBestClickableNode(left, top, width, height, doc); |
| + if (!allowShadowDOM && adjustedNode && adjustedNode.nodeType == 1) { |
|
Rick Byers
2014/07/07 18:25:44
There's probably only the one test that actually r
Zeeshan Qureshi
2014/07/09 16:10:14
There's a couple of tests that do adjustment on <i
|
| + while (internals.shadowHost(adjustedNode)) { |
|
Rick Byers
2014/07/07 18:25:44
Rather than add shadowHost to internals, you shoul
Zeeshan Qureshi
2014/07/09 16:10:14
Looks like this is for traversing down the tree.
Rick Byers
2014/07/09 19:46:58
Ah right. Still I think we can avoid adding a new
|
| + adjustedNode = internals.shadowHost(adjustedNode); |
| + } |
| + } |
| + return adjustedNode; |
| +} |
| + |
| +function testTouchPoint(touchpoint, targetNode, allowTextNodes, allowShadowDOM) |
| +{ |
| + var adjustedNode = touchNodeAdjustedToBestClickableNode(touchpoint.left, touchpoint.top, touchpoint.width, touchpoint.height, document, allowShadowDOM); |
| if (!allowTextNodes && adjustedNode && adjustedNode.nodeType == 3) |
| adjustedNode = adjustedNode.parentNode; |
| shouldBeNode(adjustedNode, targetNode); |