| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/input/PointerEventManager.h" | 5 #include "core/input/PointerEventManager.h" |
| 6 | 6 |
| 7 #include "core/dom/DocumentUserGestureToken.h" | 7 #include "core/dom/DocumentUserGestureToken.h" |
| 8 #include "core/dom/ElementTraversal.h" | 8 #include "core/dom/ElementTraversal.h" |
| 9 #include "core/dom/shadow/FlatTreeTraversal.h" | 9 #include "core/dom/shadow/FlatTreeTraversal.h" |
| 10 #include "core/events/MouseEvent.h" | 10 #include "core/events/MouseEvent.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // is not captured. |m_pendingPointerCaptureTarget| indicates the target | 342 // is not captured. |m_pendingPointerCaptureTarget| indicates the target |
| 343 // that will be capturing this event. |m_pointerCaptureTarget| may not | 343 // that will be capturing this event. |m_pointerCaptureTarget| may not |
| 344 // have this target yet since the processing of that will be done right | 344 // have this target yet since the processing of that will be done right |
| 345 // before firing the event. | 345 // before firing the event. |
| 346 if (RuntimeEnabledFeatures::pointerEventV1SpecCapturingEnabled() || | 346 if (RuntimeEnabledFeatures::pointerEventV1SpecCapturingEnabled() || |
| 347 touchInfo.point.state() == PlatformTouchPoint::TouchPressed || | 347 touchInfo.point.state() == PlatformTouchPoint::TouchPressed || |
| 348 !m_pendingPointerCaptureTarget.contains(pointerId)) { | 348 !m_pendingPointerCaptureTarget.contains(pointerId)) { |
| 349 HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent | | 349 HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent | |
| 350 HitTestRequest::ReadOnly | | 350 HitTestRequest::ReadOnly | |
| 351 HitTestRequest::Active; | 351 HitTestRequest::Active; |
| 352 LayoutPoint pagePoint = roundedLayoutPoint( | 352 LayoutPoint pagePoint = LayoutPoint( |
| 353 m_frame->view()->rootFrameToContents(touchInfo.point.pos())); | 353 m_frame->view()->rootFrameToContents(touchInfo.point.pos())); |
| 354 HitTestResult hitTestTesult = | 354 HitTestResult hitTestTesult = |
| 355 m_frame->eventHandler().hitTestResultAtPoint(pagePoint, hitType); | 355 m_frame->eventHandler().hitTestResultAtPoint(pagePoint, hitType); |
| 356 Node* node = hitTestTesult.innerNode(); | 356 Node* node = hitTestTesult.innerNode(); |
| 357 if (node) { | 357 if (node) { |
| 358 touchInfo.targetFrame = node->document().frame(); | 358 touchInfo.targetFrame = node->document().frame(); |
| 359 if (isHTMLCanvasElement(node)) { | 359 if (isHTMLCanvasElement(node)) { |
| 360 HitTestCanvasResult* hitTestCanvasResult = | 360 HitTestCanvasResult* hitTestCanvasResult = |
| 361 toHTMLCanvasElement(node)->getControlAndIdIfHitRegionExists( | 361 toHTMLCanvasElement(node)->getControlAndIdIfHitRegionExists( |
| 362 hitTestTesult.pointInInnerNodeFrame()); | 362 hitTestTesult.pointInInnerNodeFrame()); |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 return true; | 718 return true; |
| 719 } | 719 } |
| 720 return false; | 720 return false; |
| 721 } | 721 } |
| 722 | 722 |
| 723 EventTarget* PointerEventManager::getMouseCapturingNode() { | 723 EventTarget* PointerEventManager::getMouseCapturingNode() { |
| 724 return getCapturingNode(PointerEventFactory::s_mouseId); | 724 return getCapturingNode(PointerEventFactory::s_mouseId); |
| 725 } | 725 } |
| 726 | 726 |
| 727 } // namespace blink | 727 } // namespace blink |
| OLD | NEW |