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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h

Issue 2958233002: [CSS Typed OM] Implement CSSUnit::to for fixed length types (Closed)
Patch Set: Use new constants Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CSSUnitValue_h 5 #ifndef CSSUnitValue_h
6 #define CSSUnitValue_h 6 #define CSSUnitValue_h
7 7
8 #include "core/css/CSSPrimitiveValue.h" 8 #include "core/css/CSSPrimitiveValue.h"
9 #include "core/css/cssom/CSSNumericValue.h" 9 #include "core/css/cssom/CSSNumericValue.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 bool ContainsPercent() const final { 45 bool ContainsPercent() const final {
46 return unit_ == CSSPrimitiveValue::UnitType::kPercentage; 46 return unit_ == CSSPrimitiveValue::UnitType::kPercentage;
47 } 47 }
48 const CSSValue* ToCSSValue() const final; 48 const CSSValue* ToCSSValue() const final;
49 49
50 private: 50 private:
51 51
52 CSSUnitValue(double value, CSSPrimitiveValue::UnitType unit) 52 CSSUnitValue(double value, CSSPrimitiveValue::UnitType unit)
53 : CSSNumericValue(), value_(value), unit_(unit) {} 53 : CSSNumericValue(), value_(value), unit_(unit) {}
54 54
55 double ConvertFixedLength(CSSPrimitiveValue::UnitType) const;
55 double ConvertAngle(CSSPrimitiveValue::UnitType) const; 56 double ConvertAngle(CSSPrimitiveValue::UnitType) const;
56 57
57 double value_; 58 double value_;
58 CSSPrimitiveValue::UnitType unit_; 59 CSSPrimitiveValue::UnitType unit_;
59 }; 60 };
60 61
61 DEFINE_TYPE_CASTS(CSSUnitValue, 62 DEFINE_TYPE_CASTS(CSSUnitValue,
62 CSSNumericValue, 63 CSSNumericValue,
63 value, 64 value,
64 !value->IsCalculated(), 65 !value->IsCalculated(),
65 !value.IsCalculated()); 66 !value.IsCalculated());
66 67
67 } // namespace blink 68 } // namespace blink
68 69
69 #endif // CSSUnitValue_h 70 #endif // CSSUnitValue_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSHelper.h ('k') | third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698