Modified: trunk/Source/WebCore/ChangeLog (116649 => 116650)
--- trunk/Source/WebCore/ChangeLog 2012-05-10 15:59:36 UTC (rev 116649)
+++ trunk/Source/WebCore/ChangeLog 2012-05-10 16:17:53 UTC (rev 116650)
@@ -1,3 +1,20 @@
+2012-05-10 Allan Sandfeld Jensen <[email protected]>
+
+ TouchAdjustment doesn't correct for scroll-offsets.
+ https://bugs.webkit.org/show_bug.cgi?id=86083
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Already tested by: touchadjustment/scroll-delegation
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::bestClickableNodeForTouchPoint):
+ (WebCore::EventHandler::bestZoomableAreaForTouchPoint):
+ * page/TouchAdjustment.cpp:
+ (WebCore::TouchAdjustment::findNodeWithLowestDistanceMetric):
+ * testing/Internals.cpp:
+ (WebCore::Internals::bestZoomableAreaForTouchPoint):
+
2012-05-10 Konrad Piascik <[email protected]>
Fix typo in filename
Modified: trunk/Source/WebCore/page/EventHandler.cpp (116649 => 116650)
--- trunk/Source/WebCore/page/EventHandler.cpp 2012-05-10 15:59:36 UTC (rev 116649)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2012-05-10 16:17:53 UTC (rev 116650)
@@ -2478,7 +2478,8 @@
bool EventHandler::bestClickableNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode)
{
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
- HitTestResult result = hitTestResultAtPoint(touchCenter, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
+ IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
+ HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
IntRect touchRect = result.rectForPoint(touchCenter);
RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
@@ -2488,7 +2489,8 @@
bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntRect& targetArea, Node*& targetNode)
{
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
- HitTestResult result = hitTestResultAtPoint(touchCenter, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
+ IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
+ HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
IntRect touchRect = result.rectForPoint(touchCenter);
RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
Modified: trunk/Source/WebCore/page/TouchAdjustment.cpp (116649 => 116650)
--- trunk/Source/WebCore/page/TouchAdjustment.cpp 2012-05-10 15:59:36 UTC (rev 116649)
+++ trunk/Source/WebCore/page/TouchAdjustment.cpp 2012-05-10 16:17:53 UTC (rev 116650)
@@ -265,6 +265,10 @@
}
}
}
+ if (targetNode) {
+ targetArea = targetNode->document()->view()->contentsToWindow(targetArea);
+ targetPoint = targetNode->document()->view()->contentsToWindow(targetPoint);
+ }
return (targetNode);
}
Modified: trunk/Source/WebCore/testing/Internals.cpp (116649 => 116650)
--- trunk/Source/WebCore/testing/Internals.cpp 2012-05-10 15:59:36 UTC (rev 116649)
+++ trunk/Source/WebCore/testing/Internals.cpp 2012-05-10 16:17:53 UTC (rev 116650)
@@ -774,8 +774,6 @@
Node* targetNode;
IntRect zoomableArea;
document->frame()->eventHandler()->bestZoomableAreaForTouchPoint(point, radius, zoomableArea, targetNode);
- if (targetNode)
- zoomableArea = targetNode->document()->view()->contentsToWindow(zoomableArea);
return ClientRect::create(zoomableArea);
}