Merge from Chromium at DEPS revision r205460
This commit was generated by merge_to_master.py.
Change-Id: Id50fcfa40590db3bd322348190cb5192c432eadf
diff --git a/Source/core/css/CSSPrimitiveValue.h b/Source/core/css/CSSPrimitiveValue.h
index 2284218..f3a350b 100644
--- a/Source/core/css/CSSPrimitiveValue.h
+++ b/Source/core/css/CSSPrimitiveValue.h
@@ -22,11 +22,13 @@
#ifndef CSSPrimitiveValue_h
#define CSSPrimitiveValue_h
+#include "CSSPropertyNames.h"
+#include "CSSValueKeywords.h"
#include "core/css/CSSValue.h"
#include "core/platform/graphics/Color.h"
-#include <wtf/Forward.h>
-#include <wtf/MathExtras.h>
-#include <wtf/PassRefPtr.h>
+#include "wtf/Forward.h"
+#include "wtf/MathExtras.h"
+#include "wtf/PassRefPtr.h"
namespace WebCore {
@@ -128,6 +130,9 @@
CSS_CALC_PERCENTAGE_WITH_NUMBER = 114,
CSS_CALC_PERCENTAGE_WITH_LENGTH = 115,
CSS_VARIABLE_NAME = 116,
+
+ CSS_PROPERTY_ID = 117,
+ CSS_VALUE_ID = 118
};
// This enum follows the CSSParser::Units enum augmented with UNIT_FREQUENCY for frequencies.
@@ -160,7 +165,6 @@
|| m_primitiveUnitType == CSS_REMS
|| m_primitiveUnitType == CSS_CHS;
}
- bool isIdent() const { return m_primitiveUnitType == CSS_IDENT; }
bool isLength() const
{
unsigned short type = primitiveType();
@@ -189,8 +193,11 @@
bool isVariableName() const { return primitiveType() == CSS_VARIABLE_NAME; }
bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_VW && m_primitiveUnitType <= CSS_VMAX; }
bool isFlex() const { return primitiveType() == CSS_FR; }
+ bool isValueID() const { return m_primitiveUnitType == CSS_VALUE_ID; }
- static PassRefPtr<CSSPrimitiveValue> createIdentifier(int identifier) { return adoptRef(new CSSPrimitiveValue(identifier)); }
+ static PassRefPtr<CSSPrimitiveValue> createIdentifier(CSSValueID valueID) { return adoptRef(new CSSPrimitiveValue(valueID)); }
+ static PassRefPtr<CSSPrimitiveValue> createIdentifier(CSSPropertyID propertyID) { return adoptRef(new CSSPrimitiveValue(propertyID)); }
+ static PassRefPtr<CSSPrimitiveValue> createParserOperator(int parserOperator) { return adoptRef(new CSSPrimitiveValue(parserOperator)); }
static PassRefPtr<CSSPrimitiveValue> createColor(unsigned rgbValue) { return adoptRef(new CSSPrimitiveValue(rgbValue)); }
static PassRefPtr<CSSPrimitiveValue> create(double value, UnitTypes type) { return adoptRef(new CSSPrimitiveValue(value, type)); }
static PassRefPtr<CSSPrimitiveValue> create(const String& value, UnitTypes type) { return adoptRef(new CSSPrimitiveValue(value, type)); }
@@ -292,7 +299,8 @@
CSSCalcValue* cssCalcValue() const { return m_primitiveUnitType != CSS_CALC ? 0 : m_value.calc; }
- int getIdent() const { return m_primitiveUnitType == CSS_IDENT ? m_value.ident : 0; }
+ CSSPropertyID getPropertyID() const { return m_primitiveUnitType == CSS_PROPERTY_ID ? m_value.propertyID : CSSPropertyInvalid; }
+ CSSValueID getValueID() const { return m_primitiveUnitType == CSS_VALUE_ID ? m_value.valueID : CSSValueInvalid; }
template<typename T> inline operator T() const; // Defined in CSSPrimitiveValueMappings.h
@@ -314,8 +322,10 @@
void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
private:
- // FIXME: int vs. unsigned overloading is too subtle to distinguish the color and identifier cases.
- CSSPrimitiveValue(int ident);
+ CSSPrimitiveValue(CSSValueID);
+ CSSPrimitiveValue(CSSPropertyID);
+ // FIXME: int vs. unsigned overloading is too subtle to distinguish the color and operator cases.
+ CSSPrimitiveValue(int parserOperator);
CSSPrimitiveValue(unsigned color); // RGB value
CSSPrimitiveValue(const Length&);
CSSPrimitiveValue(const String&, UnitTypes);
@@ -351,7 +361,9 @@
double computeLengthDouble(RenderStyle* currentStyle, RenderStyle* rootStyle, float multiplier, bool computingFontSize);
union {
- int ident;
+ CSSPropertyID propertyID;
+ CSSValueID valueID;
+ int parserOperator;
double num;
StringImpl* string;
Counter* counter;