diff options
Diffstat (limited to 'Source/WebCore/testing/Internals.cpp')
-rw-r--r-- | Source/WebCore/testing/Internals.cpp | 31 |
1 files changed, 25 insertions, 6 deletions
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<WebKitPoint> 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<ClientRect> 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 |