summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-08-12 12:11:09 +0100
committerSteve Block <steveblock@google.com>2010-08-27 12:08:54 +0100
commit08c1068d9fd18289b9812c3d1fbcfccb8dfa3e60 (patch)
tree469af86f91a7ff00b9a9294b825f79ba7cea824d /WebKit
parentd6a678bd9ba533f341e478d39d4d37328e56edc0 (diff)
downloadexternal_webkit-08c1068d9fd18289b9812c3d1fbcfccb8dfa3e60.zip
external_webkit-08c1068d9fd18289b9812c3d1fbcfccb8dfa3e60.tar.gz
external_webkit-08c1068d9fd18289b9812c3d1fbcfccb8dfa3e60.tar.bz2
Use upstream version of ANDROID_HITTEST_WITHSIZE
This change removes the last occurrences of ANDROID_HITTEST_WITHSIZE and updates WebKit to use the upstream version of this logic. This follows on from https://android-git.corp.google.com/g/#change,60166 which merged the upstream logic into the Android tree but maintained the existing behaviour for Android, guarded with ANDROID_HITTEST_WITHSIZE. This change introduces the following functional changes ... - HitTestResult::addNodeToRectBasedTestResult() The Android version proceeded with the containment test if the node is null. We now early out and continue the hit test. We also record the node's shadowAncestorNode, rather than the node itself. - RenderLayer::hitTestList() The android version always updates the result, but only updates the result layer if the result is not a rect based result. We now always update result layer, but only update the result if the result is not a rect based result. - RenderSVGRoot::nodeAtPoint() The Android version returned true only if it's not a rect based hit test. Now we return true always. - HitTestResult::m_isRectBased In the Android version, a padding must have positive width and height. Now we allow one of the two to be zero, provided the other is positive All other changes are non-functional and should probably have been done as part of https://android-git.corp.google.com/g/#change,60166 Note that the change to RenderBlock::nodeAtPoint() is a non-functional change because we don't pass a rect to addNodeToRectBasedTestResult(), so the default zero rect is used and the hit test always fails. Change-Id: I4163fddad59ad6485df40cd48794aa262f76ced7
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index e81e335..42aa718 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1403,7 +1403,6 @@ Vector<IntRect> WebViewCore::getTouchHighlightRects(int x, int y, int slop)
{
Vector<IntRect> rects;
m_mousePos = IntPoint(x - m_scrollOffsetX, y - m_scrollOffsetY);
-#ifdef ANDROID_HITTEST_WITHSIZE
HitTestResult hitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(IntPoint(x, y),
false, false, DontHitTestScrollbars, HitTestRequest::Active | HitTestRequest::ReadOnly, IntSize(slop, slop));
if (!hitTestResult.innerNode() || !hitTestResult.innerNode()->inDocument()) {
@@ -1437,7 +1436,7 @@ Vector<IntRect> WebViewCore::getTouchHighlightRects(int x, int y, int slop)
found = true;
break;
}
- // the nodes in the rawNodeList() are ordered based on z-index during hit testing.
+ // the nodes in the rectBasedTestResult() are ordered based on z-index during hit testing.
// so do not search for the eventNode across explicit z-index border.
// TODO: this is a hard one to call. z-index is quite complicated as its value only
// matters when you compare two RenderLayer in the same hierarchy level. e.g. in
@@ -1618,7 +1617,6 @@ Vector<IntRect> WebViewCore::getTouchHighlightRects(int x, int y, int slop)
m_scrollOffsetX, m_scrollOffsetY);
}
}
-#endif
return rects;
}
@@ -2340,15 +2338,15 @@ void WebViewCore::touchUp(int touchGeneration,
frame = 0;
DBG_NAV_LOGD("touch up on (%d, %d), scrollOffset is (%d, %d), node:%p, frame:%p", m_mousePos.x() + m_scrollOffsetX, m_mousePos.y() + m_scrollOffsetY, m_scrollOffsetX, m_scrollOffsetY, node, frame);
} else {
- if (m_touchGeneration > touchGeneration) {
- DBG_NAV_LOGD("m_touchGeneration=%d > touchGeneration=%d"
- " x=%d y=%d", m_touchGeneration, touchGeneration, x, y);
- return; // short circuit if a newer touch has been generated
- }
- // This moves m_mousePos to the correct place, and handleMouseClick uses
- // m_mousePos to determine where the click happens.
- moveMouse(frame, x, y);
- m_lastGeneration = touchGeneration;
+ if (m_touchGeneration > touchGeneration) {
+ DBG_NAV_LOGD("m_touchGeneration=%d > touchGeneration=%d"
+ " x=%d y=%d", m_touchGeneration, touchGeneration, x, y);
+ return; // short circuit if a newer touch has been generated
+ }
+ // This moves m_mousePos to the correct place, and handleMouseClick uses
+ // m_mousePos to determine where the click happens.
+ moveMouse(frame, x, y);
+ m_lastGeneration = touchGeneration;
}
if (frame && CacheBuilder::validNode(m_mainFrame, frame, 0)) {
frame->loader()->resetMultipleFormSubmissionProtection();