Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/cssom/CSSTransformValue.cpp |
| diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTransformValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSTransformValue.cpp |
| index 989d2e8ae240f11ff8373588729f2396b16a0e1d..dfecf4e390e7f04417793fc9a90599e90a016ef2 100644 |
| --- a/third_party/WebKit/Source/core/css/cssom/CSSTransformValue.cpp |
| +++ b/third_party/WebKit/Source/core/css/cssom/CSSTransformValue.cpp |
| @@ -5,7 +5,9 @@ |
| #include "core/css/cssom/CSSTransformValue.h" |
| #include "core/css/CSSValueList.h" |
| +#include "core/css/cssom/CSSMatrixComponent.h" |
| #include "core/css/cssom/CSSTransformComponent.h" |
| +#include "core/geometry/DOMMatrix.h" |
| namespace blink { |
| @@ -34,6 +36,18 @@ bool CSSTransformValue::is2D() const { |
| return true; |
| } |
| +DOMMatrix* CSSTransformValue::toMatrix() const { |
| + DOMMatrixInit init; |
| + DOMMatrix* matrix = DOMMatrix::fromMatrix(init, ASSERT_NO_EXCEPTION); |
|
zino
2017/06/02 02:31:21
IMHO, we don't need to copy the matrix from DOMMat
Hwanseung Lee
2017/06/02 13:25:51
Done.
|
| + for (size_t i = 0; i < transform_components_.size(); i++) { |
| + CSSMatrixComponent* matrixComponent = transform_components_[i]->asMatrix(); |
| + if (matrixComponent) { |
| + matrix->multiplySelf(matrixComponent->matrix()); |
| + } |
| + } |
| + return matrix; |
| +} |
| + |
| const CSSValue* CSSTransformValue::ToCSSValue() const { |
| CSSValueList* transform_css_value = CSSValueList::CreateSpaceSeparated(); |
| for (size_t i = 0; i < transform_components_.size(); i++) { |