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

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSLengthValue.h

Issue 2371673002: [CSS Typed OM] Implement support for CSSValue -> CSSCalcLength (Closed)
Patch Set: sync Created 3 years, 11 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/CSSLengthValue.h
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.h b/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.h
index 2b1118773ae026db31e438d4dc1615e550a2238c..9916c41f6c11597121d82c0ab27c28aa27690b7c 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSLengthValue.h
@@ -18,6 +18,20 @@ class CORE_EXPORT CSSLengthValue : public CSSStyleValue {
DEFINE_WRAPPERTYPEINFO();
public:
+ static const int kNumSupportedUnits = 15;
+
+ static CSSLengthValue* from(const String& cssText, ExceptionState&);
+ static CSSLengthValue* from(double value,
+ const String& typeStr,
+ ExceptionState&);
+ static CSSLengthValue* from(const CSSCalcDictionary&, ExceptionState&);
+
+ static bool isSupportedLengthUnit(CSSPrimitiveValue::UnitType unit) {
+ return (CSSPrimitiveValue::isLength(unit) ||
+ unit == CSSPrimitiveValue::UnitType::Percentage) &&
+ unit != CSSPrimitiveValue::UnitType::QuirkyEms &&
+ unit != CSSPrimitiveValue::UnitType::UserUnits;
+ }
static CSSPrimitiveValue::UnitType unitFromName(const String& name);
static CSSLengthValue* fromCSSValue(const CSSPrimitiveValue&);
@@ -28,28 +42,13 @@ class CORE_EXPORT CSSLengthValue : public CSSStyleValue {
virtual bool containsPercent() const = 0;
- static CSSLengthValue* from(const String& cssText, ExceptionState&);
- static CSSLengthValue* from(double value,
- const String& typeStr,
- ExceptionState&);
- static CSSLengthValue* from(const CSSCalcDictionary&, ExceptionState&);
-
protected:
- static const int kNumSupportedUnits = 15;
-
CSSLengthValue() {}
virtual CSSLengthValue* addInternal(const CSSLengthValue* other);
virtual CSSLengthValue* subtractInternal(const CSSLengthValue* other);
virtual CSSLengthValue* multiplyInternal(double);
virtual CSSLengthValue* divideInternal(double);
-
- static bool isSupportedLengthUnit(CSSPrimitiveValue::UnitType unit) {
- return (CSSPrimitiveValue::isLength(unit) ||
- unit == CSSPrimitiveValue::UnitType::Percentage) &&
- unit != CSSPrimitiveValue::UnitType::QuirkyEms &&
- unit != CSSPrimitiveValue::UnitType::UserUnits;
- }
};
DEFINE_TYPE_CASTS(CSSLengthValue,

Powered by Google App Engine
This is Rietveld 408576698