Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(980)

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 1701283002: Implement DOMPoint using v8 extras. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index b64438310952189c839cc91f4cd6784215ab5d59..97a0abd1bc10feb9d6771c1b14b6f8d863b27a48 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -28,6 +28,7 @@
#include "bindings/core/v8/ExceptionMessages.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/GeometryInterfaces.h"
#include "bindings/core/v8/ScriptFunction.h"
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
@@ -46,7 +47,6 @@
#include "core/dom/ClientRectList.h"
#include "core/dom/DOMArrayBuffer.h"
#include "core/dom/DOMNodeIds.h"
-#include "core/dom/DOMPoint.h"
#include "core/dom/DOMStringList.h"
#include "core/dom/Document.h"
#include "core/dom/Element.h"
@@ -1074,12 +1074,12 @@ String Internals::rangeAsText(const Range* range)
// FIXME: The next four functions are very similar - combine them once
// bestClickableNode/bestContextMenuNode have been combined..
-DOMPoint* Internals::touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
+ScriptValue Internals::touchPositionAdjustedToBestClickableNode(ScriptState* scriptState, long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
{
ASSERT(document);
if (!document->frame()) {
exceptionState.throwDOMException(InvalidAccessError, "The document provided is invalid.");
- return 0;
+ return ScriptValue();
}
document->updateLayout();
@@ -1096,9 +1096,9 @@ DOMPoint* Internals::touchPositionAdjustedToBestClickableNode(long x, long y, lo
bool foundNode = eventHandler.bestClickableNodeForHitTestResult(result, adjustedPoint, targetNode);
if (foundNode)
- return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y());
+ return GeometryInterfaces::createDOMPoint(scriptState, adjustedPoint.x(), adjustedPoint.y());
- return 0;
+ return ScriptValue();
}
Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
@@ -1124,12 +1124,12 @@ Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width
return targetNode;
}
-DOMPoint* Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
+ScriptValue Internals::touchPositionAdjustedToBestContextMenuNode(ScriptState* scriptState, long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
{
ASSERT(document);
if (!document->frame()) {
exceptionState.throwDOMException(InvalidAccessError, "The document provided is invalid.");
- return 0;
+ return ScriptValue();
}
document->updateLayout();
@@ -1146,9 +1146,9 @@ DOMPoint* Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y,
bool foundNode = eventHandler.bestContextMenuNodeForHitTestResult(result, adjustedPoint, targetNode);
if (foundNode)
- return DOMPoint::create(adjustedPoint.x(), adjustedPoint.y());
+ return GeometryInterfaces::createDOMPoint(scriptState, adjustedPoint.x(), adjustedPoint.y());
- return DOMPoint::create(x, y);
+ return ScriptValue();
}
Node* Internals::touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionState& exceptionState)
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.h ('k') | third_party/WebKit/Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698