Index: third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp |
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp |
index fd09781ae4727015e83006bf86f86971163d5b6c..e179448cacafaf3ce33e9224b093b6a410df2f2b 100644 |
--- a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp |
+++ b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp |
@@ -304,20 +304,57 @@ NotShared<DOMFloat64Array> DOMMatrixReadOnly::toFloat64Array() const { |
} |
const String DOMMatrixReadOnly::toString() const { |
- std::stringstream stream; |
+ String result; |
if (is2D()) { |
- stream << "matrix(" << a() << ", " << b() << ", " << c() << ", " << d() |
zino
2017/05/09 09:32:04
Looks good to me.
BTW, don't we use stringstream
|
- << ", " << e() << ", " << f(); |
+ result.append("matrix("); |
+ result.append(String::NumberToStringECMAScript(a())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(b())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(c())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(d())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(e())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(f())); |
} else { |
- stream << "matrix3d(" << m11() << ", " << m12() << ", " << m13() << ", " |
- << m14() << ", " << m21() << ", " << m22() << ", " << m23() << ", " |
- << m24() << ", " << m31() << ", " << m32() << ", " << m33() << ", " |
- << m34() << ", " << m41() << ", " << m42() << ", " << m43() << ", " |
- << m44(); |
+ result.append("matrix3d("); |
+ result.append(String::NumberToStringECMAScript(m11())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m12())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m13())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m14())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m21())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m22())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m23())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m24())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m31())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m32())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m33())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m34())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m41())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m42())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m43())); |
+ result.append(", "); |
+ result.append(String::NumberToStringECMAScript(m44())); |
} |
- stream << ")"; |
+ result.append(")"); |
- return String(stream.str().c_str()); |
+ return result; |
} |
ScriptValue DOMMatrixReadOnly::toJSONForBinding( |