| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 2601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2612 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active, touchRadius); | 2612 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active, touchRadius); |
| 2613 | 2613 |
| 2614 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); | 2614 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); |
| 2615 Vector<RefPtr<Node>, 11> nodes; | 2615 Vector<RefPtr<Node>, 11> nodes; |
| 2616 copyToVector(result.rectBasedTestResult(), nodes); | 2616 copyToVector(result.rectBasedTestResult(), nodes); |
| 2617 | 2617 |
| 2618 // FIXME: Should be able to handle targetNode being a shadow DOM node to avo
id performing uncessary hit tests | 2618 // FIXME: Should be able to handle targetNode being a shadow DOM node to avo
id performing uncessary hit tests |
| 2619 // in the case where further processing on the node is required. Returning t
he shadow ancestor prevents a | 2619 // in the case where further processing on the node is required. Returning t
he shadow ancestor prevents a |
| 2620 // regression in touchadjustment/html-label.html. Some refinement is require
d to testing/internals to | 2620 // regression in touchadjustment/html-label.html. Some refinement is require
d to testing/internals to |
| 2621 // handle targetNode being a shadow DOM node. | 2621 // handle targetNode being a shadow DOM node. |
| 2622 bool success = findBestClickableCandidate(targetNode, targetPoint, touchCent
er, touchRect, nodes); | 2622 bool success = findBestClickableCandidate(targetNode, targetPoint, touchCent
er, touchRect, Vector<RefPtr<Node> > (nodes)); |
| 2623 if (success && targetNode) | 2623 if (success && targetNode) |
| 2624 targetNode = targetNode->deprecatedShadowAncestorNode(); | 2624 targetNode = targetNode->deprecatedShadowAncestorNode(); |
| 2625 return success; | 2625 return success; |
| 2626 } | 2626 } |
| 2627 | 2627 |
| 2628 bool EventHandler::bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter,
const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode) | 2628 bool EventHandler::bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter,
const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode) |
| 2629 { | 2629 { |
| 2630 IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter); | 2630 IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter); |
| 2631 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active, touchRadius); | 2631 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active, touchRadius); |
| 2632 | 2632 |
| 2633 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); | 2633 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); |
| 2634 Vector<RefPtr<Node>, 11> nodes; | 2634 Vector<RefPtr<Node>, 11> nodes; |
| 2635 copyToVector(result.rectBasedTestResult(), nodes); | 2635 copyToVector(result.rectBasedTestResult(), nodes); |
| 2636 return findBestContextMenuCandidate(targetNode, targetPoint, touchCenter, to
uchRect, nodes); | 2636 return findBestContextMenuCandidate(targetNode, targetPoint, touchCenter, to
uchRect, Vector<RefPtr<Node> >(nodes)); |
| 2637 } | 2637 } |
| 2638 | 2638 |
| 2639 bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, co
nst IntSize& touchRadius, IntRect& targetArea, Node*& targetNode) | 2639 bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, co
nst IntSize& touchRadius, IntRect& targetArea, Node*& targetNode) |
| 2640 { | 2640 { |
| 2641 IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter); | 2641 IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter); |
| 2642 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent, touchRa
dius); | 2642 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent, touchRa
dius); |
| 2643 | 2643 |
| 2644 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); | 2644 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); |
| 2645 Vector<RefPtr<Node>, 11> nodes; | 2645 Vector<RefPtr<Node>, 11> nodes; |
| 2646 copyToVector(result.rectBasedTestResult(), nodes); | 2646 copyToVector(result.rectBasedTestResult(), nodes); |
| 2647 return findBestZoomableArea(targetNode, targetArea, touchCenter, touchRect,
nodes); | 2647 return findBestZoomableArea(targetNode, targetArea, touchCenter, touchRect,
Vector<RefPtr<Node> >(nodes)); |
| 2648 } | 2648 } |
| 2649 | 2649 |
| 2650 bool EventHandler::adjustGesturePosition(const PlatformGestureEvent& gestureEven
t, IntPoint& adjustedPoint) | 2650 bool EventHandler::adjustGesturePosition(const PlatformGestureEvent& gestureEven
t, IntPoint& adjustedPoint) |
| 2651 { | 2651 { |
| 2652 if (!shouldApplyTouchAdjustment(gestureEvent)) | 2652 if (!shouldApplyTouchAdjustment(gestureEvent)) |
| 2653 return false; | 2653 return false; |
| 2654 | 2654 |
| 2655 Node* targetNode = 0; | 2655 Node* targetNode = 0; |
| 2656 switch (gestureEvent.type()) { | 2656 switch (gestureEvent.type()) { |
| 2657 case PlatformEvent::GestureTap: | 2657 case PlatformEvent::GestureTap: |
| (...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3834 unsigned EventHandler::accessKeyModifiers() | 3834 unsigned EventHandler::accessKeyModifiers() |
| 3835 { | 3835 { |
| 3836 #if OS(MACOSX) | 3836 #if OS(MACOSX) |
| 3837 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3837 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 3838 #else | 3838 #else |
| 3839 return PlatformEvent::AltKey; | 3839 return PlatformEvent::AltKey; |
| 3840 #endif | 3840 #endif |
| 3841 } | 3841 } |
| 3842 | 3842 |
| 3843 } // namespace WebCore | 3843 } // namespace WebCore |
| OLD | NEW |