diff options
author | Ben Murdoch <benm@google.com> | 2011-05-16 16:35:58 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-23 18:54:14 +0100 |
commit | 6fbaea61d241814b015fd7e022796e68d8ef3e8e (patch) | |
tree | 09be7d423f6dbab5995e21265a9a54650d013a64 /Source/WebCore/page/EventHandler.cpp | |
parent | 61f2d6a1f71aa7a52ec56b93958324b8b6de1b6a (diff) | |
download | external_webkit-6fbaea61d241814b015fd7e022796e68d8ef3e8e.zip external_webkit-6fbaea61d241814b015fd7e022796e68d8ef3e8e.tar.gz external_webkit-6fbaea61d241814b015fd7e022796e68d8ef3e8e.tar.bz2 |
Merge WebKit at r76408: Fix conflicts.
Android.jscbindings.mk
Conflict due to local addition of EntrySyncCustom.cpp and http://trac.webkit.org/changeset/76216
V8NPUtils.cpp
Conflict due to local cherry pick of http://trac.webkit.org/changeset/78994 and
merge of http://trac.webkit.org/changeset/76264
FrameView.h
Conflict due to local addition of updatePositionedObjects() and http://trac.webkit.org/changeset/76278
RangeInputType.cpp
SliderThumbElement.cpp
Conflicts due to Android addition of touch handling code in slider code.
See http://trac.webkit.org/changeset/76147
.gitignore - keep ours
Change-Id: I38aeb361a37e7939f805c6689d7cc8fc720b3e52
Diffstat (limited to 'Source/WebCore/page/EventHandler.cpp')
-rw-r--r-- | Source/WebCore/page/EventHandler.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp index 476921e..8432c10 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/Source/WebCore/page/EventHandler.cpp @@ -249,6 +249,9 @@ void EventHandler::clear() m_previousWheelScrolledNode = 0; #if ENABLE(TOUCH_EVENTS) m_originatingTouchPointTargets.clear(); +#if PLATFORM(ANDROID) + m_capturingTouchEventsNode = 0; +#endif #endif } @@ -1788,6 +1791,13 @@ void EventHandler::clearDragState() } #endif // ENABLE(DRAG_SUPPORT) +#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS) +void EventHandler::setCapturingTouchEventsNode(PassRefPtr<Node> n) +{ + m_capturingTouchEventsNode = n; +} +#endif + void EventHandler::setCapturingMouseEventsNode(PassRefPtr<Node> n) { m_capturingMouseEventsNode = n; @@ -2921,7 +2931,20 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) default: break; } +#if PLATFORM(ANDROID) + Node* node = 0; + if (m_capturingTouchEventsNode) + node = m_capturingTouchEventsNode.get(); + else { + HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, hitType); + node = result.innerNode(); + ASSERT(node); + // Touch events should not go to text nodes + if (node->isTextNode()) + node = node->parentNode(); + } +#else HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, hitType); Node* node = result.innerNode(); ASSERT(node); @@ -2929,6 +2952,8 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) // Touch events should not go to text nodes if (node->isTextNode()) node = node->parentNode(); +#endif + Document* doc = node->document(); if (!doc) @@ -2947,6 +2972,11 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) // Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap. unsigned touchPointTargetKey = point.id() + 1; RefPtr<EventTarget> touchTarget; +#if PLATFORM(ANDROID) + if (m_capturingTouchEventsNode) + touchTarget = node; + else { +#endif if (pointState == PlatformTouchPoint::TouchPressed) { m_originatingTouchPointTargets.set(touchPointTargetKey, node); touchTarget = node; @@ -2956,7 +2986,9 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey); } else touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey); - +#if PLATFORM(ANDROID) + } +#endif if (!touchTarget.get()) continue; |