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