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

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

Issue 2903413002: Restructure type tracking in StyleValues to work better with new numeric types (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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h b/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h
index b14739a4fe927eae3c026d27ad6286b44408a7d8..1e57d1d60f27eebdb78ba73cf1f3ec2b8133ab00 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h
@@ -27,29 +27,33 @@ class CORE_EXPORT CSSStyleValue
public:
enum StyleValueType {
- // This list corresponds to each non-abstract subclass.
- kUnknown,
+ kUnknownType,
kAngleType,
- kCalcLengthType,
+ kFlexType,
+ kFrequencyType,
kKeywordType,
+ kLengthType,
kNumberType,
+ kPercentType,
kPositionType,
- kSimpleLengthType,
+ kResolutionType,
+ kTimeType,
kTransformType,
- kUnitType,
kUnparsedType,
kURLImageType,
+ kInvalidType,
};
- virtual ~CSSStyleValue() {}
-
- virtual StyleValueType GetType() const = 0;
-
static ScriptValue parse(ScriptState*,
const String& property_name,
const String& value,
ExceptionState&);
+ virtual ~CSSStyleValue() {}
+
+ virtual StyleValueType GetType() const = 0;
+ virtual bool ContainsPercent() const { return false; }
+
virtual const CSSValue* ToCSSValue() const = 0;
virtual const CSSValue* ToCSSValueWithProperty(CSSPropertyID) const {
return ToCSSValue();
@@ -64,6 +68,8 @@ class CORE_EXPORT CSSStyleValue
DEFINE_INLINE_VIRTUAL_TRACE() {}
protected:
+ static String StyleValueTypeToString(StyleValueType);
+
CSSStyleValue() {}
};

Powered by Google App Engine
This is Rietveld 408576698