| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "CSSValue.h" | 25 #include "CSSValue.h" |
| 26 #include "Color.h" | 26 #include "Color.h" |
| 27 #include <wtf/Forward.h> | 27 #include <wtf/Forward.h> |
| 28 #include <wtf/MathExtras.h> | 28 #include <wtf/MathExtras.h> |
| 29 #include <wtf/PassRefPtr.h> | 29 #include <wtf/PassRefPtr.h> |
| 30 | 30 |
| 31 namespace WebCore { | 31 namespace WebCore { |
| 32 | 32 |
| 33 class CSSCalcValue; | 33 class CSSCalcValue; |
| 34 class Counter; | 34 class Counter; |
| 35 class DashboardRegion; | |
| 36 class Pair; | 35 class Pair; |
| 37 class Quad; | 36 class Quad; |
| 38 class RGBColor; | 37 class RGBColor; |
| 39 class Rect; | 38 class Rect; |
| 40 class RenderStyle; | 39 class RenderStyle; |
| 41 class CSSBasicShape; | 40 class CSSBasicShape; |
| 42 | 41 |
| 43 struct Length; | 42 struct Length; |
| 44 | 43 |
| 45 // Dimension calculations are imprecise, often resulting in values of e.g. | 44 // Dimension calculations are imprecise, often resulting in values of e.g. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 CSS_RGBCOLOR = 25, | 92 CSS_RGBCOLOR = 25, |
| 94 // From CSS Values and Units. Viewport-percentage Lengths (vw/vh/vmin/vm
ax). | 93 // From CSS Values and Units. Viewport-percentage Lengths (vw/vh/vmin/vm
ax). |
| 95 CSS_VW = 26, | 94 CSS_VW = 26, |
| 96 CSS_VH = 27, | 95 CSS_VH = 27, |
| 97 CSS_VMIN = 28, | 96 CSS_VMIN = 28, |
| 98 CSS_VMAX = 29, | 97 CSS_VMAX = 29, |
| 99 CSS_DPPX = 30, | 98 CSS_DPPX = 30, |
| 100 CSS_DPI = 31, | 99 CSS_DPI = 31, |
| 101 CSS_DPCM = 32, | 100 CSS_DPCM = 32, |
| 102 CSS_PAIR = 100, // We envision this being exposed as a means of getting
computed style values for pairs (border-spacing/radius, background-position, etc
.) | 101 CSS_PAIR = 100, // We envision this being exposed as a means of getting
computed style values for pairs (border-spacing/radius, background-position, etc
.) |
| 103 #if ENABLE(DASHBOARD_SUPPORT) | |
| 104 CSS_DASHBOARD_REGION = 101, // FIXME: Dashboard region should not be a p
rimitive value. | |
| 105 #endif | |
| 106 CSS_UNICODE_RANGE = 102, | 102 CSS_UNICODE_RANGE = 102, |
| 107 | 103 |
| 108 // These next types are just used internally to allow us to translate ba
ck and forth from CSSPrimitiveValues to CSSParserValues. | 104 // These next types are just used internally to allow us to translate ba
ck and forth from CSSPrimitiveValues to CSSParserValues. |
| 109 CSS_PARSER_OPERATOR = 103, | 105 CSS_PARSER_OPERATOR = 103, |
| 110 CSS_PARSER_INTEGER = 104, | 106 CSS_PARSER_INTEGER = 104, |
| 111 CSS_PARSER_HEXCOLOR = 105, | 107 CSS_PARSER_HEXCOLOR = 105, |
| 112 | 108 |
| 113 // This is used internally for unknown identifiers | 109 // This is used internally for unknown identifiers |
| 114 CSS_PARSER_IDENTIFIER = 106, | 110 CSS_PARSER_IDENTIFIER = 106, |
| 115 | 111 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 282 |
| 287 Quad* getQuadValue(ExceptionCode&) const; | 283 Quad* getQuadValue(ExceptionCode&) const; |
| 288 Quad* getQuadValue() const { return m_primitiveUnitType != CSS_QUAD ? 0 : m_
value.quad; } | 284 Quad* getQuadValue() const { return m_primitiveUnitType != CSS_QUAD ? 0 : m_
value.quad; } |
| 289 | 285 |
| 290 PassRefPtr<RGBColor> getRGBColorValue(ExceptionCode&) const; | 286 PassRefPtr<RGBColor> getRGBColorValue(ExceptionCode&) const; |
| 291 RGBA32 getRGBA32Value() const { return m_primitiveUnitType != CSS_RGBCOLOR ?
0 : m_value.rgbcolor; } | 287 RGBA32 getRGBA32Value() const { return m_primitiveUnitType != CSS_RGBCOLOR ?
0 : m_value.rgbcolor; } |
| 292 | 288 |
| 293 Pair* getPairValue(ExceptionCode&) const; | 289 Pair* getPairValue(ExceptionCode&) const; |
| 294 Pair* getPairValue() const { return m_primitiveUnitType != CSS_PAIR ? 0 : m_
value.pair; } | 290 Pair* getPairValue() const { return m_primitiveUnitType != CSS_PAIR ? 0 : m_
value.pair; } |
| 295 | 291 |
| 296 #if ENABLE(DASHBOARD_SUPPORT) | |
| 297 DashboardRegion* getDashboardRegionValue() const { return m_primitiveUnitTyp
e != CSS_DASHBOARD_REGION ? 0 : m_value.region; } | |
| 298 #endif | |
| 299 | |
| 300 CSSBasicShape* getShapeValue() const { return m_primitiveUnitType != CSS_SHA
PE ? 0 : m_value.shape; } | 292 CSSBasicShape* getShapeValue() const { return m_primitiveUnitType != CSS_SHA
PE ? 0 : m_value.shape; } |
| 301 | 293 |
| 302 CSSCalcValue* cssCalcValue() const { return m_primitiveUnitType != CSS_CALC
? 0 : m_value.calc; } | 294 CSSCalcValue* cssCalcValue() const { return m_primitiveUnitType != CSS_CALC
? 0 : m_value.calc; } |
| 303 | 295 |
| 304 int getIdent() const { return m_primitiveUnitType == CSS_IDENT ? m_value.ide
nt : 0; } | 296 int getIdent() const { return m_primitiveUnitType == CSS_IDENT ? m_value.ide
nt : 0; } |
| 305 | 297 |
| 306 template<typename T> inline operator T() const; // Defined in CSSPrimitiveVa
lueMappings.h | 298 template<typename T> inline operator T() const; // Defined in CSSPrimitiveVa
lueMappings.h |
| 307 | 299 |
| 308 String customCssText() const; | 300 String customCssText() const; |
| 309 #if ENABLE(CSS_VARIABLES) | 301 #if ENABLE(CSS_VARIABLES) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 static void create(int); // compile-time guard | 340 static void create(int); // compile-time guard |
| 349 static void create(unsigned); // compile-time guard | 341 static void create(unsigned); // compile-time guard |
| 350 template<typename T> operator T*(); // compile-time guard | 342 template<typename T> operator T*(); // compile-time guard |
| 351 | 343 |
| 352 static UnitTypes canonicalUnitTypeForCategory(UnitCategory category); | 344 static UnitTypes canonicalUnitTypeForCategory(UnitCategory category); |
| 353 | 345 |
| 354 void init(PassRefPtr<Counter>); | 346 void init(PassRefPtr<Counter>); |
| 355 void init(PassRefPtr<Rect>); | 347 void init(PassRefPtr<Rect>); |
| 356 void init(PassRefPtr<Pair>); | 348 void init(PassRefPtr<Pair>); |
| 357 void init(PassRefPtr<Quad>); | 349 void init(PassRefPtr<Quad>); |
| 358 void init(PassRefPtr<DashboardRegion>); // FIXME: Dashboard region should no
t be a primitive value. | |
| 359 void init(PassRefPtr<CSSBasicShape>); | 350 void init(PassRefPtr<CSSBasicShape>); |
| 360 void init(PassRefPtr<CSSCalcValue>); | 351 void init(PassRefPtr<CSSCalcValue>); |
| 361 bool getDoubleValueInternal(UnitTypes targetUnitType, double* result) const; | 352 bool getDoubleValueInternal(UnitTypes targetUnitType, double* result) const; |
| 362 | 353 |
| 363 double computeLengthDouble(RenderStyle* currentStyle, RenderStyle* rootStyle
, float multiplier, bool computingFontSize); | 354 double computeLengthDouble(RenderStyle* currentStyle, RenderStyle* rootStyle
, float multiplier, bool computingFontSize); |
| 364 | 355 |
| 365 union { | 356 union { |
| 366 int ident; | 357 int ident; |
| 367 double num; | 358 double num; |
| 368 StringImpl* string; | 359 StringImpl* string; |
| 369 Counter* counter; | 360 Counter* counter; |
| 370 Rect* rect; | 361 Rect* rect; |
| 371 Quad* quad; | 362 Quad* quad; |
| 372 unsigned rgbcolor; | 363 unsigned rgbcolor; |
| 373 Pair* pair; | 364 Pair* pair; |
| 374 DashboardRegion* region; | |
| 375 CSSBasicShape* shape; | 365 CSSBasicShape* shape; |
| 376 CSSCalcValue* calc; | 366 CSSCalcValue* calc; |
| 377 } m_value; | 367 } m_value; |
| 378 }; | 368 }; |
| 379 | 369 |
| 380 } // namespace WebCore | 370 } // namespace WebCore |
| 381 | 371 |
| 382 #endif // CSSPrimitiveValue_h | 372 #endif // CSSPrimitiveValue_h |
| OLD | NEW |