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

Unified Diff: third_party/WebKit/Source/core/css/CSSValue.h

Issue 2346193002: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Rebase Created 4 years, 3 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/CSSValue.h
diff --git a/third_party/WebKit/Source/core/css/CSSValue.h b/third_party/WebKit/Source/core/css/CSSValue.h
index e2346ca3359c0359a6a32a03bd586004b15b3923..03b3680e928661010b51637ce219211b1d751b30 100644
--- a/third_party/WebKit/Source/core/css/CSSValue.h
+++ b/third_party/WebKit/Source/core/css/CSSValue.h
@@ -27,6 +27,17 @@
namespace blink {
+class Length;
+
+// CSSValue stores parsed representations of values on the RHS of a CSS declaration.
+// For example:
+// width: 30px;
+// Would create a CSSValue to represent '30px'.
+//
+// CSSValues are property-independent; they can be created for any property, but
Timothy Loh 2016/09/30 05:44:35 This sounds contradictory (and is probably wrong b
sashab 2016/09/30 06:45:48 Done, removed entire header comment in this file.
+// not all CSSValues are valid for all properties.
+//
+// All CSSValues should be immutable.
class CORE_EXPORT CSSValue : public GarbageCollectedFinalized<CSSValue> {
public:
// Override operator new to allocate CSSValue subtype objects onto
@@ -43,9 +54,13 @@ public:
return ThreadHeap::allocateOnArenaIndex(state, size, isEager ? BlinkGC::EagerSweepArenaIndex : BlinkGC::CSSValueArenaIndex, GCInfoTrait<CSSValue>::index(), typeName);
}
+ // TODO(sashab): Remove this method and move logic to the caller.
+ static CSSValue* create(const Length& value, float zoom);
+
String cssText() const;
bool isPrimitiveValue() const { return m_classType == PrimitiveClass; }
+ bool isIdentifierValue() const { return m_classType == IdentifierClass; }
bool isValuePair() const { return m_classType == ValuePairClass; }
bool isValueList() const { return m_classType >= ValueListClass; }
@@ -114,6 +129,7 @@ protected:
static const size_t ClassTypeBits = 6;
enum ClassType {
PrimitiveClass,
+ IdentifierClass,
ColorClass,
CounterClass,
QuadClass,

Powered by Google App Engine
This is Rietveld 408576698