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

Unified Diff: third_party/WebKit/Source/core/dom/DOMRectReadOnly.cpp

Issue 2612263002: Adding fromRect to DOMRect and DOMRectReadOnly interfaces following spec. (Closed)
Patch Set: Adding fromRect to DOMRect and DOMRectReadOnly interfaces following spec. Created 3 years, 11 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/dom/DOMRectReadOnly.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMRectReadOnly.cpp b/third_party/WebKit/Source/core/dom/DOMRectReadOnly.cpp
index 3b09920df6ed806de5715b72aeff6ee9a89f1750..6b6e5154c45cc9fcfd9cddba2b5ff6c5ec36828c 100644
--- a/third_party/WebKit/Source/core/dom/DOMRectReadOnly.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMRectReadOnly.cpp
@@ -6,6 +6,7 @@
#include "bindings/core/v8/ScriptValue.h"
#include "bindings/core/v8/V8ObjectBuilder.h"
+#include "core/dom/DOMRectInit.h"
namespace blink {
@@ -29,6 +30,10 @@ ScriptValue DOMRectReadOnly::toJSONForBinding(ScriptState* scriptState) const {
return result.scriptValue();
}
+DOMRectReadOnly* DOMRectReadOnly::fromRect(const DOMRectInit& other) {
+ return new DOMRectReadOnly(other.x(), other.y(), other.width(), other.height());
+}
+
DOMRectReadOnly::DOMRectReadOnly(double x,
double y,
double width,
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMRectReadOnly.h ('k') | third_party/WebKit/Source/core/dom/DOMRectReadOnly.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698