From 8d473cf9743f1d30a16a27114e93bd5af5648d23 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 18 May 2012 14:03:11 +0200 Subject: Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578) Weekly snapshot --- Source/WebCore/testing/Internals.cpp | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'Source/WebCore/testing/Internals.cpp') diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp index bf7deb9f0..e17185fc2 100644 --- a/Source/WebCore/testing/Internals.cpp +++ b/Source/WebCore/testing/Internals.cpp @@ -634,6 +634,22 @@ void Internals::setSuggestedValue(Element* element, const String& value, Excepti inputElement->setSuggestedValue(value); } +void Internals::setEditingValue(Element* element, const String& value, ExceptionCode& ec) +{ + if (!element) { + ec = INVALID_ACCESS_ERR; + return; + } + + HTMLInputElement* inputElement = element->toInputElement(); + if (!inputElement) { + ec = INVALID_NODE_TYPE_ERR; + return; + } + + inputElement->setEditingValue(value); +} + void Internals::scrollElementToRect(Element* element, long x, long y, long w, long h, ExceptionCode& ec) { if (!element || !element->document() || !element->document()->view()) { @@ -725,11 +741,12 @@ PassRefPtr Internals::touchPositionAdjustedToBestClickableNode(long Node* targetNode; IntPoint adjustedPoint; - document->frame()->eventHandler()->bestClickableNodeForTouchPoint(point, radius, adjustedPoint, targetNode); - if (targetNode) - adjustedPoint = targetNode->document()->view()->contentsToWindow(adjustedPoint); - return WebKitPoint::create(adjustedPoint.x(), adjustedPoint.y()); + bool foundNode = document->frame()->eventHandler()->bestClickableNodeForTouchPoint(point, radius, adjustedPoint, targetNode); + if (foundNode) + return WebKitPoint::create(adjustedPoint.x(), adjustedPoint.y()); + + return 0; } Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document* document, ExceptionCode& ec) @@ -760,9 +777,11 @@ PassRefPtr Internals::bestZoomableAreaForTouchPoint(long x, long y, Node* targetNode; IntRect zoomableArea; - document->frame()->eventHandler()->bestZoomableAreaForTouchPoint(point, radius, zoomableArea, targetNode); + bool foundNode = document->frame()->eventHandler()->bestZoomableAreaForTouchPoint(point, radius, zoomableArea, targetNode); + if (foundNode) + return ClientRect::create(zoomableArea); - return ClientRect::create(zoomableArea); + return 0; } #endif -- cgit v1.2.1