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

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

Issue 2943303002: [CSS Typed OM] Refactor is2D handling in CSSTransformComponents to match new spec (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 0d8607f9096b3a12ea406816b8f8ab4e7b19a821..367e98477227c9e316c0d263551f7c6a02be57ff 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
@@ -61,6 +61,15 @@ CSSRotation* FromCSSRotateXYZ(const CSSFunctionValue& value) {
} // namespace
+CSSRotation* CSSRotation::Create(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(0, 0, 1, angle, true /* is2D */);
+}
+
CSSRotation* CSSRotation::Create(double x,
double y,
double z,
@@ -70,7 +79,12 @@ CSSRotation* CSSRotation::Create(double x,
exception_state.ThrowTypeError("Must pass an angle to CSSRotation");
return nullptr;
}
- return new CSSRotation(x, y, z, angle);
+ return new CSSRotation(x, y, z, angle, false /* is2D */);
+}
+
+CSSRotation* CSSRotation::Create(CSSNumericValue* angle) {
+ DCHECK_EQ(angle->GetType(), CSSStyleValue::StyleValueType::kAngleType);
+ return new CSSRotation(0, 0, 1, angle, true /* is2D */);
}
CSSRotation* CSSRotation::Create(double x,
@@ -78,7 +92,7 @@ CSSRotation* CSSRotation::Create(double x,
double z,
CSSNumericValue* angle) {
DCHECK_EQ(angle->GetType(), CSSStyleValue::StyleValueType::kAngleType);
- return new CSSRotation(x, y, z, angle);
+ return new CSSRotation(x, y, z, angle, false /* is2D */);
}
CSSRotation* CSSRotation::FromCSSValue(const CSSFunctionValue& value) {
@@ -115,8 +129,8 @@ CSSFunctionValue* CSSRotation::ToCSSValue() const {
// TODO(meade): Re-implement this when we finish rewriting number/length
// types.
// CSSFunctionValue* result =
- // CSSFunctionValue::Create(is2d_ ? CSSValueRotate : CSSValueRotate3d);
- // if (!is2d_) {
+ // CSSFunctionValue::Create(is2D() ? CSSValueRotate : CSSValueRotate3d);
+ // if (!is2D()) {
// result->Append(
// *CSSPrimitiveValue::Create(x_, CSSPrimitiveValue::UnitType::kNumber));
// result->Append(
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSRotation.h ('k') | third_party/WebKit/Source/core/css/cssom/CSSScale.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698