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

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

Issue 1689573002: CSS Typed OM: asMatrix for TransformComponent with LengthValue types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@asMatrixMethod
Patch Set: Add in Translation and use exceptionState.hadException 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/PerspectiveTransformComponent.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp b/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp
index 56e633860af5d54c461eea46d1cb7d5239065dba..f82677915bcdeaaa7de374495cdbc38a0f2e2e70 100644
--- a/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/PerspectiveTransformComponent.cpp
@@ -5,6 +5,7 @@
#include "core/css/cssom/PerspectiveTransformComponent.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "core/css/cssom/MatrixTransformComponent.h"
namespace blink {
@@ -17,6 +18,14 @@ PerspectiveTransformComponent* PerspectiveTransformComponent::create(const Lengt
return new PerspectiveTransformComponent(length);
}
+MatrixTransformComponent* PerspectiveTransformComponent::asMatrix(ExceptionState& exceptionState) const
+{
+ double lengthPx = m_length->computeLengthPx(exceptionState);
+ if (exceptionState.hadException())
+ return nullptr;
+ return MatrixTransformComponent::perspective(lengthPx);
+}
+
PassRefPtrWillBeRawPtr<CSSFunctionValue> PerspectiveTransformComponent::toCSSValue() const
{
RefPtrWillBeRawPtr<CSSFunctionValue> result = CSSFunctionValue::create(CSSValuePerspective);

Powered by Google App Engine
This is Rietveld 408576698