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

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, 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/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 b97ab66accb313afda0cdacc12d9f575a977de7b..190abbb5130c4b2e05385c1cf2087a38bb370d0c 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; }
shend 2017/05/29 23:42:08 I don't this is that bad. The only alternative I c
meade_UTC10 2017/05/30 04:11:05 Yeah, the alternative isn't thaaat bad, but it's a
+
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