OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 if (snapTo(*it, touchHotspot, touchArea, adjustedPoint)) { | 466 if (snapTo(*it, touchHotspot, touchArea, adjustedPoint)) { |
467 if (node->isDescendantOf(targetNode)) { | 467 if (node->isDescendantOf(targetNode)) { |
468 // Try to always return the inner-most element. | 468 // Try to always return the inner-most element. |
469 targetPoint = adjustedPoint; | 469 targetPoint = adjustedPoint; |
470 targetNode = node; | 470 targetNode = node; |
471 targetArea = it->boundingBox(); | 471 targetArea = it->boundingBox(); |
472 } | 472 } |
473 } | 473 } |
474 } | 474 } |
475 } | 475 } |
| 476 |
| 477 // As for HitTestResult.innerNode, we skip over pseudo elements. |
| 478 if (targetNode && targetNode->isPseudoElement()) |
| 479 targetNode = targetNode->parentOrShadowHostNode(); |
| 480 |
476 if (targetNode) { | 481 if (targetNode) { |
477 targetArea = targetNode->document().view()->contentsToWindow(targetArea)
; | 482 targetArea = targetNode->document().view()->contentsToWindow(targetArea)
; |
478 } | 483 } |
479 return (targetNode); | 484 return (targetNode); |
480 } | 485 } |
481 | 486 |
482 } // namespace TouchAdjustment | 487 } // namespace TouchAdjustment |
483 | 488 |
484 bool findBestClickableCandidate(Node*& targetNode, IntPoint& targetPoint, const
IntPoint& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrW
illBeMember<Node> >& nodes) | 489 bool findBestClickableCandidate(Node*& targetNode, IntPoint& targetPoint, const
IntPoint& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrW
illBeMember<Node> >& nodes) |
485 { | 490 { |
(...skipping 13 matching lines...) Expand all Loading... |
499 | 504 |
500 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint
& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem
ber<Node> >& nodes) | 505 bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint
& touchHotspot, const IntRect& touchArea, const WillBeHeapVector<RefPtrWillBeMem
ber<Node> >& nodes) |
501 { | 506 { |
502 IntPoint targetPoint; | 507 IntPoint targetPoint; |
503 TouchAdjustment::SubtargetGeometryList subtargets; | 508 TouchAdjustment::SubtargetGeometryList subtargets; |
504 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); | 509 TouchAdjustment::compileZoomableSubtargets(nodes, subtargets); |
505 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP
oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable
IntersectionQuotient); | 510 return TouchAdjustment::findNodeWithLowestDistanceMetric(targetNode, targetP
oint, targetArea, touchHotspot, touchArea, subtargets, TouchAdjustment::zoomable
IntersectionQuotient); |
506 } | 511 } |
507 | 512 |
508 } // namespace blink | 513 } // namespace blink |
OLD | NEW |