| 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 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2483 // scrollbars being untouchable. | 2483 // scrollbars being untouchable. |
| 2484 if (result.scrollbar()) | 2484 if (result.scrollbar()) |
| 2485 return false; | 2485 return false; |
| 2486 | 2486 |
| 2487 IntPoint touchCenter = m_frame->view()->contentsToWindow(result.roundedPoint
InMainFrame()); | 2487 IntPoint touchCenter = m_frame->view()->contentsToWindow(result.roundedPoint
InMainFrame()); |
| 2488 IntRect touchRect = m_frame->view()->contentsToWindow(result.hitTestLocation
().boundingBox()); | 2488 IntRect touchRect = m_frame->view()->contentsToWindow(result.hitTestLocation
().boundingBox()); |
| 2489 | 2489 |
| 2490 WillBeHeapVector<RefPtrWillBeMember<Node>, 11> nodes; | 2490 WillBeHeapVector<RefPtrWillBeMember<Node>, 11> nodes; |
| 2491 copyToVector(result.rectBasedTestResult(), nodes); | 2491 copyToVector(result.rectBasedTestResult(), nodes); |
| 2492 | 2492 |
| 2493 // FIXME: Should be able to handle targetNode being a shadow DOM node to avo
id performing uncessary hit tests | |
| 2494 // in the case where further processing on the node is required. Returning t
he shadow ancestor prevents a | |
| 2495 // regression in touchadjustment/html-label.html. Some refinement is require
d to testing/internals to | |
| 2496 // handle targetNode being a shadow DOM node. | |
| 2497 | |
| 2498 // FIXME: the explicit Vector conversion copies into a temporary and is wast
eful. | 2493 // FIXME: the explicit Vector conversion copies into a temporary and is wast
eful. |
| 2499 // FIXME: targetNode and success are only used by Internals functions. We sh
ould | 2494 return findBestClickableCandidate(targetNode, targetPoint, touchCenter, touc
hRect, WillBeHeapVector<RefPtrWillBeMember<Node> > (nodes)); |
| 2500 // instead have dedicated test methods so we only do this work in tests. | |
| 2501 bool success = findBestClickableCandidate(targetNode, targetPoint, touchCent
er, touchRect, WillBeHeapVector<RefPtrWillBeMember<Node> > (nodes)); | |
| 2502 if (success && targetNode) | |
| 2503 targetNode = targetNode->deprecatedShadowAncestorNode(); | |
| 2504 return success; | |
| 2505 } | 2495 } |
| 2506 | 2496 |
| 2507 bool EventHandler::bestContextMenuNodeForHitTestResult(const HitTestResult& resu
lt, IntPoint& targetPoint, Node*& targetNode) | 2497 bool EventHandler::bestContextMenuNodeForHitTestResult(const HitTestResult& resu
lt, IntPoint& targetPoint, Node*& targetNode) |
| 2508 { | 2498 { |
| 2509 ASSERT(result.isRectBasedTest()); | 2499 ASSERT(result.isRectBasedTest()); |
| 2510 IntPoint touchCenter = m_frame->view()->contentsToWindow(result.roundedPoint
InMainFrame()); | 2500 IntPoint touchCenter = m_frame->view()->contentsToWindow(result.roundedPoint
InMainFrame()); |
| 2511 IntRect touchRect = m_frame->view()->contentsToWindow(result.hitTestLocation
().boundingBox()); | 2501 IntRect touchRect = m_frame->view()->contentsToWindow(result.hitTestLocation
().boundingBox()); |
| 2512 WillBeHeapVector<RefPtrWillBeMember<Node>, 11> nodes; | 2502 WillBeHeapVector<RefPtrWillBeMember<Node>, 11> nodes; |
| 2513 copyToVector(result.rectBasedTestResult(), nodes); | 2503 copyToVector(result.rectBasedTestResult(), nodes); |
| 2514 | 2504 |
| (...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3817 unsigned EventHandler::accessKeyModifiers() | 3807 unsigned EventHandler::accessKeyModifiers() |
| 3818 { | 3808 { |
| 3819 #if OS(MACOSX) | 3809 #if OS(MACOSX) |
| 3820 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3810 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 3821 #else | 3811 #else |
| 3822 return PlatformEvent::AltKey; | 3812 return PlatformEvent::AltKey; |
| 3823 #endif | 3813 #endif |
| 3824 } | 3814 } |
| 3825 | 3815 |
| 3826 } // namespace WebCore | 3816 } // namespace WebCore |
| OLD | NEW |