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

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

Issue 2867883003: [CSS Typed OM] Delete obsolete number and length classes from Typed OM (Closed)
Patch Set: rebase Created 3 years, 7 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/CSSAngleValue.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp
deleted file mode 100644
index 272c957875e1f16631f7010882ae506971d44b58..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "core/css/cssom/CSSAngleValue.h"
-
-#include "bindings/core/v8/ExceptionState.h"
-#include "core/css/CSSPrimitiveValue.h"
-#include "platform/wtf/MathExtras.h"
-
-namespace blink {
-
-CSSAngleValue* CSSAngleValue::Create(double value,
- CSSPrimitiveValue::UnitType unit) {
- DCHECK(CSSPrimitiveValue::IsAngle(unit));
- return new CSSAngleValue(value, unit);
-}
-
-CSSAngleValue* CSSAngleValue::Create(double value, const String& unit) {
- CSSPrimitiveValue::UnitType primitive_unit =
- CSSPrimitiveValue::StringToUnitType(unit);
- return Create(value, primitive_unit);
-}
-
-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 (unit_) {
- case CSSPrimitiveValue::UnitType::kDegrees:
- return value_;
- case CSSPrimitiveValue::UnitType::kRadians:
- return rad2deg(value_);
- case CSSPrimitiveValue::UnitType::kGradians:
- return grad2deg(value_);
- case CSSPrimitiveValue::UnitType::kTurns:
- return turn2deg(value_);
- default:
- NOTREACHED();
- return 0;
- }
-}
-
-double CSSAngleValue::radians() const {
- return deg2rad(degrees());
-}
-
-double CSSAngleValue::gradians() const {
- return deg2grad(degrees());
-}
-
-double CSSAngleValue::turns() const {
- return deg2turn(degrees());
-}
-
-CSSValue* CSSAngleValue::ToCSSValue() const {
- return CSSPrimitiveValue::Create(value_, unit_);
-}
-
-} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSAngleValue.h ('k') | third_party/WebKit/Source/core/css/cssom/CSSAngleValue.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698