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

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

Issue 2550063002: Remove double constructors that assume degrees from CSSRotation (Closed)
Patch Set: Fix test Created 4 years 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/CSSAngleValue.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp
index 1d35a17c113f615aabba54680412d40dd6418061..a1216f52b1544f6e6a910796069551ca8eebb482 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp
@@ -17,6 +17,14 @@ CSSAngleValue* CSSAngleValue::create(double value, const String& unit) {
return new CSSAngleValue(value, primitiveUnit);
}
+CSSAngleValue* CSSAngleValue::fromCSSValue(const CSSPrimitiveValue& value) {
+ DCHECK(value.isAngle());
+ if (value.isCalculated())
+ return nullptr;
+ return new CSSAngleValue(value.getDoubleValue(),
+ value.typeWithCalcResolved());
+}
+
double CSSAngleValue::degrees() const {
switch (m_unit) {
case CSSPrimitiveValue::UnitType::Degrees:
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSAngleValue.h ('k') | third_party/WebKit/Source/core/css/cssom/CSSRotation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698