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 |
| 2623 // FIXME: the explicit Vector conversion copies into a temporary and is |
| 2624 // wasteful. |
| 2625 bool success = findBestClickableCandidate(targetNode, targetPoint, touchCent
er, touchRect, Vector<RefPtr<Node> > (nodes)); |
2623 if (success && targetNode) | 2626 if (success && targetNode) |
2624 targetNode = targetNode->deprecatedShadowAncestorNode(); | 2627 targetNode = targetNode->deprecatedShadowAncestorNode(); |
2625 return success; | 2628 return success; |
2626 } | 2629 } |
2627 | 2630 |
2628 bool EventHandler::bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter,
const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode) | 2631 bool EventHandler::bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter,
const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode) |
2629 { | 2632 { |
2630 IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter); | 2633 IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter); |
2631 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active, touchRadius); | 2634 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active, touchRadius); |
2632 | 2635 |
2633 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); | 2636 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); |
2634 Vector<RefPtr<Node>, 11> nodes; | 2637 Vector<RefPtr<Node>, 11> nodes; |
2635 copyToVector(result.rectBasedTestResult(), nodes); | 2638 copyToVector(result.rectBasedTestResult(), nodes); |
2636 return findBestContextMenuCandidate(targetNode, targetPoint, touchCenter, to
uchRect, nodes); | 2639 |
| 2640 // FIXME: the explicit Vector conversion copies into a temporary and is |
| 2641 // wasteful. |
| 2642 return findBestContextMenuCandidate(targetNode, targetPoint, touchCenter, to
uchRect, Vector<RefPtr<Node> >(nodes)); |
2637 } | 2643 } |
2638 | 2644 |
2639 bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, co
nst IntSize& touchRadius, IntRect& targetArea, Node*& targetNode) | 2645 bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, co
nst IntSize& touchRadius, IntRect& targetArea, Node*& targetNode) |
2640 { | 2646 { |
2641 IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter); | 2647 IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter); |
2642 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent, touchRa
dius); | 2648 HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::Re
adOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent, touchRa
dius); |
2643 | 2649 |
2644 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); | 2650 IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius); |
2645 Vector<RefPtr<Node>, 11> nodes; | 2651 Vector<RefPtr<Node>, 11> nodes; |
2646 copyToVector(result.rectBasedTestResult(), nodes); | 2652 copyToVector(result.rectBasedTestResult(), nodes); |
2647 return findBestZoomableArea(targetNode, targetArea, touchCenter, touchRect,
nodes); | 2653 |
| 2654 // FIXME: the explicit Vector conversion copies into a temporary and is |
| 2655 // wasteful. |
| 2656 return findBestZoomableArea(targetNode, targetArea, touchCenter, touchRect,
Vector<RefPtr<Node> >(nodes)); |
2648 } | 2657 } |
2649 | 2658 |
2650 bool EventHandler::adjustGesturePosition(const PlatformGestureEvent& gestureEven
t, IntPoint& adjustedPoint) | 2659 bool EventHandler::adjustGesturePosition(const PlatformGestureEvent& gestureEven
t, IntPoint& adjustedPoint) |
2651 { | 2660 { |
2652 if (!shouldApplyTouchAdjustment(gestureEvent)) | 2661 if (!shouldApplyTouchAdjustment(gestureEvent)) |
2653 return false; | 2662 return false; |
2654 | 2663 |
2655 Node* targetNode = 0; | 2664 Node* targetNode = 0; |
2656 switch (gestureEvent.type()) { | 2665 switch (gestureEvent.type()) { |
2657 case PlatformEvent::GestureTap: | 2666 case PlatformEvent::GestureTap: |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3834 unsigned EventHandler::accessKeyModifiers() | 3843 unsigned EventHandler::accessKeyModifiers() |
3835 { | 3844 { |
3836 #if OS(MACOSX) | 3845 #if OS(MACOSX) |
3837 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3846 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3838 #else | 3847 #else |
3839 return PlatformEvent::AltKey; | 3848 return PlatformEvent::AltKey; |
3840 #endif | 3849 #endif |
3841 } | 3850 } |
3842 | 3851 |
3843 } // namespace WebCore | 3852 } // namespace WebCore |
OLD | NEW |