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

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

Issue 2938353002: [CSS Typed OM] Add missing error handling for CSSRotation constructor (Closed)
Patch Set: rebase Created 3 years, 6 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/CSSRotation.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp b/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
index d1567d219276257fb422e722dba0e3eaf9ef4799..c0ffda82a5d2fb8937f2169c01bab6501d78828b 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
@@ -4,6 +4,7 @@
#include "core/css/cssom/CSSRotation.h"
+#include "bindings/core/v8/ExceptionState.h"
#include "core/css/CSSFunctionValue.h"
#include "core/css/CSSPrimitiveValue.h"
@@ -60,6 +61,26 @@ CSSRotation* FromCSSRotateXYZ(const CSSFunctionValue& value) {
} // namespace
+CSSRotation* CSSRotation::Create(double x,
+ double y,
+ double z,
+ CSSNumericValue* angle,
+ ExceptionState& exception_state) {
+ if (angle->GetType() != CSSStyleValue::StyleValueType::kAngleType) {
+ exception_state.ThrowTypeError("Must pass an angle to CSSRotation");
+ return nullptr;
+ }
+ return new CSSRotation(x, y, z, angle);
+}
+
+CSSRotation* CSSRotation::Create(double x,
+ double y,
+ double z,
+ CSSNumericValue* angle) {
+ DCHECK_EQ(angle->GetType(), CSSStyleValue::StyleValueType::kAngleType);
+ return new CSSRotation(x, y, z, angle);
+}
+
CSSRotation* CSSRotation::FromCSSValue(const CSSFunctionValue& value) {
switch (value.FunctionType()) {
case CSSValueRotate:

Powered by Google App Engine
This is Rietveld 408576698