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 3751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3762 return true; | 3762 return true; |
3763 | 3763 |
3764 Document* doc = node->document(); | 3764 Document* doc = node->document(); |
3765 // Record the originating touch document even if it does not have a
touch listener. | 3765 // Record the originating touch document even if it does not have a
touch listener. |
3766 if (freshTouchEvents) { | 3766 if (freshTouchEvents) { |
3767 m_originatingTouchPointDocument = doc; | 3767 m_originatingTouchPointDocument = doc; |
3768 freshTouchEvents = false; | 3768 freshTouchEvents = false; |
3769 } | 3769 } |
3770 if (!doc) | 3770 if (!doc) |
3771 continue; | 3771 continue; |
3772 if (!doc->hasTouchEventHandlers()) | 3772 if (!doc->touchEventHandlerCount()) |
3773 continue; | 3773 continue; |
3774 m_originatingTouchPointTargets.set(touchPointTargetKey, node); | 3774 m_originatingTouchPointTargets.set(touchPointTargetKey, node); |
3775 touchTarget = node; | 3775 touchTarget = node; |
3776 } else if (pointState == PlatformTouchPoint::TouchReleased || pointState
== PlatformTouchPoint::TouchCancelled) { | 3776 } else if (pointState == PlatformTouchPoint::TouchReleased || pointState
== PlatformTouchPoint::TouchCancelled) { |
3777 // We only perform a hittest on release or cancel to unset :active o
r :hover state. | 3777 // We only perform a hittest on release or cancel to unset :active o
r :hover state. |
3778 if (touchPointTargetKey == m_originatingTouchPointTargetKey) { | 3778 if (touchPointTargetKey == m_originatingTouchPointTargetKey) { |
3779 hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, fa
lse, DontHitTestScrollbars, hitType); | 3779 hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, fa
lse, DontHitTestScrollbars, hitType); |
3780 m_originatingTouchPointTargetKey = 0; | 3780 m_originatingTouchPointTargetKey = 0; |
3781 } else if (m_originatingTouchPointDocument.get() && m_originatingTou
chPointDocument->frame()) { | 3781 } else if (m_originatingTouchPointDocument.get() && m_originatingTou
chPointDocument->frame()) { |
3782 LayoutPoint pagePointInOriginatingDocument = documentPointForWin
dowPoint(m_originatingTouchPointDocument->frame(), point.pos()); | 3782 LayoutPoint pagePointInOriginatingDocument = documentPointForWin
dowPoint(m_originatingTouchPointDocument->frame(), point.pos()); |
3783 hitTestResultInFrame(m_originatingTouchPointDocument->frame(), p
agePointInOriginatingDocument, hitType); | 3783 hitTestResultInFrame(m_originatingTouchPointDocument->frame(), p
agePointInOriginatingDocument, hitType); |
3784 } | 3784 } |
3785 // The target should be the original target for this touch, so get i
t from the hashmap. As it's a release or cancel | 3785 // The target should be the original target for this touch, so get i
t from the hashmap. As it's a release or cancel |
3786 // we also remove it from the map. | 3786 // we also remove it from the map. |
3787 touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKe
y); | 3787 touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKe
y); |
3788 } else | 3788 } else |
3789 // No hittest is performed on move or stationary, since the target i
s not allowed to change anyway. | 3789 // No hittest is performed on move or stationary, since the target i
s not allowed to change anyway. |
3790 touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey
); | 3790 touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey
); |
3791 | 3791 |
3792 if (!touchTarget.get()) | 3792 if (!touchTarget.get()) |
3793 continue; | 3793 continue; |
3794 Document* doc = touchTarget->toNode()->document(); | 3794 Document* doc = touchTarget->toNode()->document(); |
3795 if (!doc) | 3795 if (!doc) |
3796 continue; | 3796 continue; |
3797 if (!doc->hasTouchEventHandlers()) | 3797 if (!doc->touchEventHandlerCount()) |
3798 continue; | 3798 continue; |
3799 Frame* targetFrame = doc->frame(); | 3799 Frame* targetFrame = doc->frame(); |
3800 if (!targetFrame) | 3800 if (!targetFrame) |
3801 continue; | 3801 continue; |
3802 | 3802 |
3803 if (m_frame != targetFrame) { | 3803 if (m_frame != targetFrame) { |
3804 // pagePoint should always be relative to the target elements contai
ning frame. | 3804 // pagePoint should always be relative to the target elements contai
ning frame. |
3805 pagePoint = documentPointForWindowPoint(targetFrame, point.pos()); | 3805 pagePoint = documentPointForWindowPoint(targetFrame, point.pos()); |
3806 } | 3806 } |
3807 | 3807 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3901 #endif | 3901 #endif |
3902 | 3902 |
3903 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) | 3903 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) |
3904 { | 3904 { |
3905 m_mousePositionIsUnknown = false; | 3905 m_mousePositionIsUnknown = false; |
3906 m_lastKnownMousePosition = event.position(); | 3906 m_lastKnownMousePosition = event.position(); |
3907 m_lastKnownMouseGlobalPosition = event.globalPosition(); | 3907 m_lastKnownMouseGlobalPosition = event.globalPosition(); |
3908 } | 3908 } |
3909 | 3909 |
3910 } // namespace WebCore | 3910 } // namespace WebCore |
OLD | NEW |