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

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

Issue 2346193002: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Replaced ASSERTs with DCHECKS in presubmit warnings 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/CSSPrimitiveValue.h
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h
index 7bf785bbd689f718e58784961770994bdfee7007..3c662ac0994d6ed342ad468a41ca919b9e72deeb 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h
@@ -29,7 +29,6 @@
#include "wtf/BitVector.h"
#include "wtf/Forward.h"
#include "wtf/MathExtras.h"
-#include "wtf/TypeTraits.h"
#include "wtf/text/StringHash.h"
#include "wtf/text/StringView.h"
@@ -107,7 +106,6 @@ public:
CalcPercentageWithLength,
CalcLengthWithNumber,
CalcPercentageWithLengthAndNumber,
- ValueID,
// This value is used to handle quirky margins in reflow roots (body, td, and th) like WinIE.
// The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em.
@@ -202,18 +200,16 @@ public:
bool isCalculatedPercentageWithLength() const { return typeWithCalcResolved() == UnitType::CalcPercentageWithLength; }
static bool isResolution(UnitType type) { return type >= UnitType::DotsPerPixel && type <= UnitType::DotsPerCentimeter; }
bool isFlex() const { return typeWithCalcResolved() == UnitType::Fraction; }
- bool isValueID() const { return type() == UnitType::ValueID; }
- bool colorIsDerivedFromElement() const;
- static CSSPrimitiveValue* createIdentifier(CSSValueID);
static CSSPrimitiveValue* create(double value, UnitType);
static CSSPrimitiveValue* create(const Length& value, float zoom)
{
return new CSSPrimitiveValue(value, zoom);
}
+
+ // TODO(sashab): Remove this.
template<typename T> static CSSPrimitiveValue* create(T value)
{
- static_assert(!std::is_same<T, CSSValueID>::value, "Do not call create() with a CSSValueID; call createIdentifier() instead");
return new CSSPrimitiveValue(value);
}
@@ -237,8 +233,6 @@ public:
CSSCalcValue* cssCalcValue() const { ASSERT(isCalculated()); return m_value.calc; }
- CSSValueID getValueID() const { return type() == UnitType::ValueID ? m_value.valueID : CSSValueInvalid; }
-
template<typename T> inline T convertTo() const; // Defined in CSSPrimitiveValueMappings.h
static const char* unitTypeToString(UnitType);
@@ -263,7 +257,6 @@ public:
static UnitType lengthUnitTypeToUnitType(LengthUnitType);
private:
- CSSPrimitiveValue(CSSValueID);
CSSPrimitiveValue(const Length&, float zoom);
CSSPrimitiveValue(double, UnitType);
@@ -292,7 +285,6 @@ private:
inline UnitType type() const { return static_cast<UnitType>(m_primitiveUnitType); }
union {
- CSSValueID valueID;
double num;
// FIXME: oilpan: Should be a member, but no support for members in unions. Just trace the raw ptr for now.
CSSCalcValue* calc;

Powered by Google App Engine
This is Rietveld 408576698