diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
commit | 8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch) | |
tree | cdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/WebCore/testing/Internals.cpp | |
parent | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff) | |
download | qtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz |
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
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 |