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

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

Issue 2482743002: [GeometryInterface] add toJson() function in DOMMatrixReadOnly. (Closed)
Patch Set: add test for DOMMatrix Created 4 years, 1 month 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/DOMMatrixReadOnly.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp b/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp
index 1922a50b0872e2c1c044a280031071651191fa5a..b0a49af8abac3ee38fd3451ed6d6656ba891a2fe 100644
--- a/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.cpp
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "core/dom/DOMMatrixReadOnly.h"
+
+#include "bindings/core/v8/V8ObjectBuilder.h"
#include "core/dom/DOMMatrix.h"
#include "core/dom/DOMMatrixInit.h"
@@ -267,4 +270,34 @@ const String DOMMatrixReadOnly::toString() const {
return String(stream.str().c_str());
}
+ScriptValue DOMMatrixReadOnly::toJSONForBinding(
+ ScriptState* scriptState) const {
+ V8ObjectBuilder result(scriptState);
+ result.addNumber("a", a());
+ result.addNumber("b", b());
+ result.addNumber("c", c());
+ result.addNumber("d", d());
+ result.addNumber("e", e());
+ result.addNumber("f", f());
+ result.addNumber("m11", m11());
+ result.addNumber("m12", m12());
+ result.addNumber("m13", m13());
+ result.addNumber("m14", m14());
+ result.addNumber("m21", m21());
+ result.addNumber("m22", m22());
+ result.addNumber("m23", m23());
+ result.addNumber("m24", m24());
+ result.addNumber("m31", m31());
+ result.addNumber("m32", m32());
+ result.addNumber("m33", m33());
+ result.addNumber("m34", m34());
+ result.addNumber("m41", m41());
+ result.addNumber("m42", m42());
+ result.addNumber("m43", m43());
+ result.addNumber("m44", m44());
+ result.addBoolean("is2D", is2D());
+ result.addBoolean("isIdentity", isIdentity());
+ return result.scriptValue();
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h ('k') | third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698