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

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

Issue 2867883003: [CSS Typed OM] Delete obsolete number and length classes from Typed OM (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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CSSNumberValue_h
6 #define CSSNumberValue_h
7
8 #include "core/CoreExport.h"
9 #include "core/css/CSSPrimitiveValue.h"
10 #include "core/css/cssom/CSSStyleValue.h"
11 #include "platform/bindings/ScriptWrappable.h"
12 #include "platform/wtf/text/WTFString.h"
13
14 namespace blink {
15
16 class CORE_EXPORT CSSNumberValue final : public CSSStyleValue {
17 WTF_MAKE_NONCOPYABLE(CSSNumberValue);
18 DEFINE_WRAPPERTYPEINFO();
19
20 public:
21 static CSSNumberValue* Create(double value) {
22 return new CSSNumberValue(value);
23 }
24
25 double value() const { return value_; }
26
27 CSSValue* ToCSSValue() const override {
28 return CSSPrimitiveValue::Create(value_,
29 CSSPrimitiveValue::UnitType::kNumber);
30 }
31
32 StyleValueType GetType() const override {
33 return StyleValueType::kNumberType;
34 }
35
36 private:
37 CSSNumberValue(double value) : value_(value) {}
38
39 double value_;
40 };
41
42 } // namespace blink
43
44 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698