diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/css/CSSPrimitiveValue.h')
-rw-r--r-- | src/3rdparty/webkit/WebCore/css/CSSPrimitiveValue.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/3rdparty/webkit/WebCore/css/CSSPrimitiveValue.h b/src/3rdparty/webkit/WebCore/css/CSSPrimitiveValue.h index 8abeb4d37..85a0ba339 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSPrimitiveValue.h +++ b/src/3rdparty/webkit/WebCore/css/CSSPrimitiveValue.h @@ -23,6 +23,7 @@ #define CSSPrimitiveValue_h #include "CSSValue.h" +#include "Color.h" #include <wtf/PassRefPtr.h> namespace WebCore { @@ -30,6 +31,7 @@ namespace WebCore { class Counter; class DashboardRegion; class Pair; +class RGBColor; class Rect; class RenderStyle; class StringImpl; @@ -78,11 +80,13 @@ public: // This is used internally for unknown identifiers CSS_PARSER_IDENTIFIER = 107, - // This unit is in CSS 3, but that isn't a finished standard yet - CSS_TURN = 108 + // These are from CSS3 Values and Units, but that isn't a finished standard yet + CSS_TURN = 108, + CSS_REMS = 109 }; - static bool isUnitTypeLength(int type) { return type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG; } + static bool isUnitTypeLength(int type) { return (type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG) || + type == CSSPrimitiveValue::CSS_REMS; } static PassRefPtr<CSSPrimitiveValue> createIdentifier(int ident); static PassRefPtr<CSSPrimitiveValue> createColor(unsigned rgbValue); @@ -112,15 +116,15 @@ public: * this is screen/printer dependent, so we probably need a config option for this, * and some tool to calibrate. */ - int computeLengthInt(RenderStyle*); - int computeLengthInt(RenderStyle*, double multiplier); - int computeLengthIntForLength(RenderStyle*); - int computeLengthIntForLength(RenderStyle*, double multiplier); - short computeLengthShort(RenderStyle*); - short computeLengthShort(RenderStyle*, double multiplier); - float computeLengthFloat(RenderStyle*, bool computingFontSize = false); - float computeLengthFloat(RenderStyle*, double multiplier, bool computingFontSize = false); - double computeLengthDouble(RenderStyle*, double multiplier = 1.0, bool computingFontSize = false); + int computeLengthInt(RenderStyle* currStyle, RenderStyle* rootStyle); + int computeLengthInt(RenderStyle* currStyle, RenderStyle* rootStyle, double multiplier); + int computeLengthIntForLength(RenderStyle* currStyle, RenderStyle* rootStyle); + int computeLengthIntForLength(RenderStyle* currStyle, RenderStyle* rootStyle, double multiplier); + short computeLengthShort(RenderStyle* currStyle, RenderStyle* rootStyle); + short computeLengthShort(RenderStyle* currStyle, RenderStyle* rootStyle, double multiplier); + float computeLengthFloat(RenderStyle* currStyle, RenderStyle* rootStyle, bool computingFontSize = false); + float computeLengthFloat(RenderStyle* currStyle, RenderStyle* rootStyle, double multiplier, bool computingFontSize = false); + double computeLengthDouble(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false); // use with care!!! void setPrimitiveType(unsigned short type) { m_type = type; } @@ -148,8 +152,8 @@ public: Rect* getRectValue(ExceptionCode&) const; Rect* getRectValue() const { return m_type != CSS_RECT ? 0 : m_value.rect; } - unsigned getRGBColorValue(ExceptionCode&) const; - unsigned getRGBColorValue() const { return m_type != CSS_RGBCOLOR ? 0 : m_value.rgbcolor; } + RGBColor* getRGBColorValue(ExceptionCode&) const; + RGBA32 getRGBA32Value() const { return m_type != CSS_RGBCOLOR ? 0 : m_value.rgbcolor; } Pair* getPairValue(ExceptionCode&) const; Pair* getPairValue() const { return m_type != CSS_PAIR ? 0 : m_value.pair; } |