Chromium Code Reviews| 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 // FIXME: targetNode and success are only used by Internals functions. We sh ould |
|
Zeeshan Qureshi
2014/07/05 03:22:13
Will remove this comment too before landing.
Rick Byers
2014/07/07 18:25:44
Yeah I don't think it's true for 'targetNode' anym
Zeeshan Qureshi
2014/07/09 16:10:15
Done.
| |
| 2500 // instead have dedicated test methods so we only do this work in tests. | 2495 // 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)); | 2496 return findBestClickableCandidate(targetNode, targetPoint, touchCenter, touc hRect, WillBeHeapVector<RefPtrWillBeMember<Node> > (nodes)); |
| 2502 if (success && targetNode) | |
| 2503 targetNode = targetNode->deprecatedShadowAncestorNode(); | |
| 2504 return success; | |
| 2505 } | 2497 } |
| 2506 | 2498 |
| 2507 bool EventHandler::bestContextMenuNodeForHitTestResult(const HitTestResult& resu lt, IntPoint& targetPoint, Node*& targetNode) | 2499 bool EventHandler::bestContextMenuNodeForHitTestResult(const HitTestResult& resu lt, IntPoint& targetPoint, Node*& targetNode) |
| 2508 { | 2500 { |
| 2509 ASSERT(result.isRectBasedTest()); | 2501 ASSERT(result.isRectBasedTest()); |
| 2510 IntPoint touchCenter = m_frame->view()->contentsToWindow(result.roundedPoint InMainFrame()); | 2502 IntPoint touchCenter = m_frame->view()->contentsToWindow(result.roundedPoint InMainFrame()); |
| 2511 IntRect touchRect = m_frame->view()->contentsToWindow(result.hitTestLocation ().boundingBox()); | 2503 IntRect touchRect = m_frame->view()->contentsToWindow(result.hitTestLocation ().boundingBox()); |
| 2512 WillBeHeapVector<RefPtrWillBeMember<Node>, 11> nodes; | 2504 WillBeHeapVector<RefPtrWillBeMember<Node>, 11> nodes; |
| 2513 copyToVector(result.rectBasedTestResult(), nodes); | 2505 copyToVector(result.rectBasedTestResult(), nodes); |
| 2514 | 2506 |
| (...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3817 unsigned EventHandler::accessKeyModifiers() | 3809 unsigned EventHandler::accessKeyModifiers() |
| 3818 { | 3810 { |
| 3819 #if OS(MACOSX) | 3811 #if OS(MACOSX) |
| 3820 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3812 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 3821 #else | 3813 #else |
| 3822 return PlatformEvent::AltKey; | 3814 return PlatformEvent::AltKey; |
| 3823 #endif | 3815 #endif |
| 3824 } | 3816 } |
| 3825 | 3817 |
| 3826 } // namespace WebCore | 3818 } // namespace WebCore |
| OLD | NEW |