Changeset 99409 in webkit
- Timestamp:
- Nov 7, 2011, 5:31:31 AM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
css/CSSInheritedValue.cpp (modified) (1 diff)
-
css/CSSInheritedValue.h (modified) (1 diff)
-
css/CSSInitialValue.cpp (modified) (1 diff)
-
css/CSSInitialValue.h (modified) (2 diffs)
-
css/CSSPrimitiveValue.cpp (modified) (7 diffs)
-
css/CSSPrimitiveValue.h (modified) (1 diff)
-
css/CSSValue.h (modified) (3 diffs)
-
css/CSSValueList.cpp (modified) (2 diffs)
-
css/CSSValueList.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r99408 r99409 1 2011-11-06 Andreas Kling <kling@webkit.org> 2 3 CSSValue: Devirtualize cssValueType(). 4 <http://webkit.org/b/71667> 5 6 Reviewed by Antti Koivisto. 7 8 Keep the cssValueType in a CSSValue member instead of using 9 virtual functions. 10 11 This is part of a project to completely devirtualize CSSValue 12 <http://webkit.org/b/71666> and will incur a temporary object 13 size regression for CSSValue while the work is ongoing. 14 15 * css/CSSInheritedValue.cpp: 16 * css/CSSInheritedValue.h: 17 (WebCore::CSSInheritedValue::CSSInheritedValue): 18 * css/CSSInitialValue.cpp: 19 * css/CSSInitialValue.h: 20 (WebCore::CSSInitialValue::CSSInitialValue): 21 * css/CSSPrimitiveValue.cpp: 22 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): 23 * css/CSSPrimitiveValue.h: 24 * css/CSSValue.h: 25 (WebCore::CSSValue::cssValueType): 26 (WebCore::CSSValue::CSSValue): 27 * css/CSSValueList.cpp: 28 (WebCore::CSSValueList::CSSValueList): 29 * css/CSSValueList.h: 30 1 31 2011-11-07 Pavel Feldman <pfeldman@chromium.org> 2 32 -
trunk/Source/WebCore/css/CSSInheritedValue.cpp
r50583 r99409 26 26 namespace WebCore { 27 27 28 unsigned short CSSInheritedValue::cssValueType() const29 {30 return CSS_INHERIT;31 }32 33 28 String CSSInheritedValue::cssText() const 34 29 { -
trunk/Source/WebCore/css/CSSInheritedValue.h
r34627 r99409 37 37 38 38 private: 39 CSSInheritedValue() { } 40 virtual unsigned short cssValueType() const; 39 CSSInheritedValue() 40 : CSSValue(CSS_INHERIT) 41 { 42 } 41 43 }; 42 44 -
trunk/Source/WebCore/css/CSSInitialValue.cpp
r97854 r99409 26 26 namespace WebCore { 27 27 28 unsigned short CSSInitialValue::cssValueType() const29 {30 return CSS_INITIAL;31 }32 33 28 String CSSInitialValue::cssText() const 34 29 { -
trunk/Source/WebCore/css/CSSInitialValue.h
r97854 r99409 44 44 private: 45 45 CSSInitialValue(bool implicit) 46 : m_implicit(implicit) 46 : CSSValue(CSS_INITIAL) 47 , m_implicit(implicit) 47 48 { 48 49 } … … 53 54 } 54 55 55 virtual unsigned short cssValueType() const;56 56 virtual bool isImplicitInitialValue() const { return m_implicit; } 57 57 -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r97854 r99409 165 165 166 166 CSSPrimitiveValue::CSSPrimitiveValue() 167 : m_type(0) 167 : CSSValue(CSS_PRIMITIVE_VALUE) 168 , m_type(0) 168 169 , m_hasCachedCSSText(false) 169 170 , m_isQuirkValue(false) … … 172 173 173 174 CSSPrimitiveValue::CSSPrimitiveValue(int ident) 174 : m_type(CSS_IDENT) 175 : CSSValue(CSS_PRIMITIVE_VALUE) 176 , m_type(CSS_IDENT) 175 177 , m_hasCachedCSSText(false) 176 178 , m_isQuirkValue(false) … … 180 182 181 183 CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitTypes type) 182 : m_type(type) 184 : CSSValue(CSS_PRIMITIVE_VALUE) 185 , m_type(type) 183 186 , m_hasCachedCSSText(false) 184 187 , m_isQuirkValue(false) … … 189 192 190 193 CSSPrimitiveValue::CSSPrimitiveValue(const String& str, UnitTypes type) 191 : m_type(type) 194 : CSSValue(CSS_PRIMITIVE_VALUE) 195 , m_type(type) 192 196 , m_hasCachedCSSText(false) 193 197 , m_isQuirkValue(false) … … 198 202 199 203 CSSPrimitiveValue::CSSPrimitiveValue(RGBA32 color) 200 : m_type(CSS_RGBCOLOR) 204 : CSSValue(CSS_PRIMITIVE_VALUE) 205 , m_type(CSS_RGBCOLOR) 201 206 , m_hasCachedCSSText(false) 202 207 , m_isQuirkValue(false) … … 206 211 207 212 CSSPrimitiveValue::CSSPrimitiveValue(const Length& length) 208 : m_hasCachedCSSText(false) 213 : CSSValue(CSS_PRIMITIVE_VALUE) 214 , m_hasCachedCSSText(false) 209 215 , m_isQuirkValue(false) 210 216 { … … 663 669 664 670 return m_value.pair; 665 }666 667 unsigned short CSSPrimitiveValue::cssValueType() const668 {669 return CSS_PRIMITIVE_VALUE;670 671 } 671 672 -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r97854 r99409 253 253 virtual bool isPrimitiveValue() const { return true; } 254 254 255 virtual unsigned short cssValueType() const;256 257 255 signed m_type : UnitTypesBits; 258 256 mutable unsigned m_hasCachedCSSText : 1; -
trunk/Source/WebCore/css/CSSValue.h
r98316 r99409 35 35 class CSSValue : public RefCounted<CSSValue> { 36 36 public: 37 // FIXME: Change name to Type. 38 enum UnitTypes { 37 enum Type { 39 38 CSS_INHERIT = 0, 40 39 CSS_PRIMITIVE_VALUE = 1, … … 46 45 virtual ~CSSValue() { } 47 46 48 // FIXME: Change this to return UnitTypes. 49 virtual unsigned short cssValueType() const { return CSS_CUSTOM; } 47 Type cssValueType() const { return static_cast<Type>(m_type); } 50 48 51 49 virtual String cssText() const = 0; … … 82 80 83 81 virtual void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*) { } 82 83 protected: 84 CSSValue(Type type = CSS_CUSTOM) 85 : m_type(type) 86 { 87 } 88 89 private: 90 // FIXME: This class is currently a little bloated, but that will change. 91 // See <http://webkit.org/b/71666> for more information. 92 unsigned m_type : 3; // Type 84 93 }; 85 94 -
trunk/Source/WebCore/css/CSSValueList.cpp
r97854 r99409 29 29 30 30 CSSValueList::CSSValueList(bool isSpaceSeparated) 31 : m_isSpaceSeparated(isSpaceSeparated) 31 : CSSValue(CSS_VALUE_LIST) 32 , m_isSpaceSeparated(isSpaceSeparated) 32 33 { 33 34 } 34 35 35 36 CSSValueList::CSSValueList(CSSParserValueList* list) 36 : m_isSpaceSeparated(true) 37 : CSSValue(CSS_VALUE_LIST) 38 , m_isSpaceSeparated(true) 37 39 { 38 40 if (list) { … … 45 47 CSSValueList::~CSSValueList() 46 48 { 47 }48 49 unsigned short CSSValueList::cssValueType() const50 {51 return CSS_VALUE_LIST;52 49 } 53 50 -
trunk/Source/WebCore/css/CSSValueList.h
r96870 r99409 68 68 virtual bool isValueList() const { return true; } 69 69 70 virtual unsigned short cssValueType() const;71 72 70 Vector<RefPtr<CSSValue> > m_values; 73 71 bool m_isSpaceSeparated;
Note:
See TracChangeset
for help on using the changeset viewer.