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

Unified Diff: third_party/WebKit/Source/core/css/cssom/TransformValue.cpp

Issue 1689723004: CSS Typed OM: Implement TransformValue::asMatrix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@computeLengthValue
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/css/cssom/TransformValue.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp b/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp
index 4efb5692eb49f18913a41b28c8cced02895bff96..72524f313b77beca4d7c33c6e36efb035cb5d4f1 100644
--- a/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp
@@ -4,7 +4,9 @@
#include "core/css/cssom/TransformValue.h"
+#include "bindings/core/v8/ExceptionState.h"
#include "core/css/CSSValueList.h"
+#include "core/css/cssom/MatrixTransformComponent.h"
#include "core/css/cssom/TransformComponent.h"
namespace blink {
@@ -60,7 +62,20 @@ PassRefPtrWillBeRawPtr<CSSValue> TransformValue::toCSSValue() const
for (size_t i = 0; i < m_transformComponents.size(); i++) {
transformCSSValue->append(m_transformComponents[i]->toCSSValue());
}
- return transformCSSValue;
+ return transformCSSValue.release();
+}
+
+MatrixTransformComponent* TransformValue::asMatrix(ExceptionState& exceptionState) const
+{
+ MatrixTransformComponent* result = new MatrixTransformComponent();
+ for (TransformComponent* component : m_transformComponents) {
+ MatrixTransformComponent* componentAsMatrix = component->asMatrix(exceptionState);
+ if (exceptionState.hadException()) {
+ return nullptr;
+ }
+ result->multiplySelf(componentAsMatrix);
+ }
+ return result;
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/TransformValue.h ('k') | third_party/WebKit/Source/core/css/cssom/TransformValue.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698