Merge from Chromium at DEPS revision 262940
This commit was generated by merge_to_master.py.
Change-Id: I767658f35150c8e0099156a5a5daf4bdf7e8ae0f
diff --git a/Source/core/css/CSSPrimitiveValue.h b/Source/core/css/CSSPrimitiveValue.h
index 7d92eb8..aecea7c 100644
--- a/Source/core/css/CSSPrimitiveValue.h
+++ b/Source/core/css/CSSPrimitiveValue.h
@@ -140,6 +140,29 @@
CSS_VALUE_ID = 118
};
+ enum LengthUnitType {
+ UnitTypePixels = 0,
+ UnitTypePercentage,
+ UnitTypeFontSize,
+ UnitTypeFontXSize,
+ UnitTypeRootFontSize,
+ UnitTypeZeroCharacterWidth,
+ UnitTypeViewportWidth,
+ UnitTypeViewportHeight,
+ UnitTypeViewportMin,
+ UnitTypeViewportMax,
+
+ // This value must come after the last length unit type to enable iteration over the length unit types.
+ LengthUnitTypeCount,
+
+ // FIXME: This is used by AnimatableLength to represent calc objects and is not a type of length value.
+ // Remove this once we no longer need the distinction.
+ UnitTypeCalc,
+ };
+
+ typedef Vector<double, CSSPrimitiveValue::LengthUnitTypeCount> CSSLengthArray;
+ void accumulateLengthArray(CSSLengthArray&, double multiplier = 1) const;
+
// This enum follows the BisonCSSParser::Units enum augmented with UNIT_FREQUENCY for frequencies.
enum UnitCategory {
UNumber,
@@ -347,6 +370,10 @@
static UnitTypes canonicalUnitTypeForCategory(UnitCategory);
static double conversionToCanonicalUnitsScaleFactor(unsigned short unitType);
+ // Returns true and populates lengthUnitType, if unitType is a length unit. Otherwise, returns false.
+ static bool unitTypeToLengthUnitType(unsigned short unitType, LengthUnitType&);
+ static unsigned short lengthUnitTypeToUnitType(LengthUnitType);
+
private:
CSSPrimitiveValue(CSSValueID);
CSSPrimitiveValue(CSSPropertyID);
@@ -409,6 +436,8 @@
} m_value;
};
+typedef CSSPrimitiveValue::CSSLengthArray CSSLengthArray;
+
DEFINE_CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue());
} // namespace WebCore