Changeset 97583 in webkit
- Timestamp:
- Oct 16, 2011 9:27:09 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r97581 r97583 1 2011-10-16 David Barr <davidbarr@chromium.org> 2 3 Inline CSSPrimitiveValue::isQuirkValue() as non-virtual function 4 https://bugs.webkit.org/show_bug.cgi?id=64865 5 6 Reviewed by Darin Adler. 7 8 Based on profiling and patch from: 9 Tamas Czene <Czene.Tamas@stud.u-szeged.hu> 10 11 This is expected to produce a small performance progression. 12 Additional memory overhead is avoided by using spare bits. 13 CSSQuirkPrimitiveValue is removed as it becomes just a factory. 14 15 * GNUmakefile.list.am: 16 * WebCore.gypi: 17 * WebCore.order: 18 * WebCore.vcproj/WebCore.vcproj: 19 * WebCore.xcodeproj/project.pbxproj: 20 * css/CSSParser.cpp: 21 (WebCore::CSSParser::parseValidPrimitive): 22 * css/CSSParserValues.cpp: 23 (WebCore::CSSParserValue::createCSSValue): 24 * css/CSSPrimitiveValue.cpp: 25 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): 26 * css/CSSPrimitiveValue.h: 27 (WebCore::CSSPrimitiveValue::createAllowingMarginQuirk): 28 Moved from CSSQuirkPrimitiveValue::create. 29 (WebCore::CSSPrimitiveValue::isQuirkValue): 30 * css/CSSQuirkPrimitiveValue.h: Removed. 31 * css/SVGCSSParser.cpp: 32 (WebCore::CSSParser::parseSVGValue): 33 1 34 2011-10-16 Kentaro Hara <haraken@chromium.org> 2 35 -
trunk/Source/WebCore/GNUmakefile.list.am
r97574 r97583 994 994 Source/WebCore/css/CSSPropertySourceData.cpp \ 995 995 Source/WebCore/css/CSSPropertySourceData.h \ 996 Source/WebCore/css/CSSQuirkPrimitiveValue.h \997 996 Source/WebCore/css/CSSReflectionDirection.h \ 998 997 Source/WebCore/css/CSSReflectValue.cpp \ -
trunk/Source/WebCore/WebCore.gypi
r97557 r97583 2381 2381 'css/CSSPropertyLonghand.h', 2382 2382 'css/CSSPropertySourceData.cpp', 2383 'css/CSSQuirkPrimitiveValue.h',2384 2383 'css/CSSReflectValue.cpp', 2385 2384 'css/CSSRule.cpp', -
trunk/Source/WebCore/WebCore.order
r95331 r97583 3244 3244 __ZN7WebCore16CSSStyleSelector27checkForGenericFamilyChangeEPNS_11RenderStyleES2_ 3245 3245 __ZN7WebCore16CSSStyleSelector18checkForZoomChangeEPNS_11RenderStyleES2_ 3246 __ZN7WebCore22CSSQuirkPrimitiveValue12isQuirkValueEv3247 3246 __ZN7WebCore11RenderStyle16setLetterSpacingEi 3248 3247 __ZN7WebCore11RenderStyle14setWordSpacingEi … … 26364 26363 __ZN3WTF13tryMakeStringIPKccNS_6StringEEENS_10PassRefPtrINS_10StringImplEEET_T0_T1_ 26365 26364 __ZNK7WebCore15GraphicsContext25imageInterpolationQualityEv 26366 __ZN7WebCore22CSSQuirkPrimitiveValueD0Ev26367 26365 __ZN7WebCore20jsSVGSVGElementStyleEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE 26368 26366 __ZN7WebCore16JSSVGPathElement3putEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r97471 r97583 33275 33275 </File> 33276 33276 <File 33277 RelativePath="..\css\CSSQuirkPrimitiveValue.h"33278 >33279 </File>33280 <File33281 33277 RelativePath="..\css\CSSReflectionDirection.h" 33282 33278 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r97471 r97583 3460 3460 A80E6CE80A1989CA007FB8C5 /* ShadowValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CBE0A1989CA007FB8C5 /* ShadowValue.h */; }; 3461 3461 A80E6CE90A1989CA007FB8C5 /* CSSValueList.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CBF0A1989CA007FB8C5 /* CSSValueList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3462 A80E6CEA0A1989CA007FB8C5 /* CSSQuirkPrimitiveValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CC00A1989CA007FB8C5 /* CSSQuirkPrimitiveValue.h */; };3463 3462 A80E6CEB0A1989CA007FB8C5 /* CSSImportRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6CC10A1989CA007FB8C5 /* CSSImportRule.cpp */; }; 3464 3463 A80E6CEC0A1989CA007FB8C5 /* FontFamilyValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6CC20A1989CA007FB8C5 /* FontFamilyValue.cpp */; }; … … 10636 10635 A80E6CBE0A1989CA007FB8C5 /* ShadowValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ShadowValue.h; sourceTree = "<group>"; }; 10637 10636 A80E6CBF0A1989CA007FB8C5 /* CSSValueList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSValueList.h; sourceTree = "<group>"; }; 10638 A80E6CC00A1989CA007FB8C5 /* CSSQuirkPrimitiveValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSQuirkPrimitiveValue.h; sourceTree = "<group>"; };10639 10637 A80E6CC10A1989CA007FB8C5 /* CSSImportRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSImportRule.cpp; sourceTree = "<group>"; }; 10640 10638 A80E6CC20A1989CA007FB8C5 /* FontFamilyValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontFamilyValue.cpp; sourceTree = "<group>"; }; … … 20580 20578 82E3D8DC122EA0D1003AE5BC /* CSSPropertySourceData.cpp */, 20581 20579 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */, 20582 A80E6CC00A1989CA007FB8C5 /* CSSQuirkPrimitiveValue.h */,20583 20580 9362640A0DE1137D009D5A00 /* CSSReflectionDirection.h */, 20584 20581 BC5A12DD0DC0414800C9AFAD /* CSSReflectValue.cpp */, … … 21857 21854 656580F409D12B20000E61D7 /* CSSPropertyNames.h in Headers */, 21858 21855 82E3D8DF122EA0D1003AE5BC /* CSSPropertySourceData.h in Headers */, 21859 A80E6CEA0A1989CA007FB8C5 /* CSSQuirkPrimitiveValue.h in Headers */,21860 21856 9362640B0DE1137D009D5A00 /* CSSReflectionDirection.h in Headers */, 21861 21857 BC5A12E00DC0414800C9AFAD /* CSSReflectValue.h in Headers */, -
trunk/Source/WebCore/css/CSSParser.cpp
r97511 r97583 48 48 #include "CSSPropertyNames.h" 49 49 #include "CSSPropertySourceData.h" 50 #include "CSSQuirkPrimitiveValue.h"51 50 #include "CSSReflectValue.h" 52 51 #include "CSSRuleList.h" … … 810 809 return createPrimitiveNumericValue(value); 811 810 if (value->unit >= CSSParserValue::Q_EMS) 812 return CSS QuirkPrimitiveValue::create(value->fValue, CSSPrimitiveValue::CSS_EMS);811 return CSSPrimitiveValue::createAllowingMarginQuirk(value->fValue, CSSPrimitiveValue::CSS_EMS); 813 812 return 0; 814 813 } -
trunk/Source/WebCore/css/CSSParserValues.cpp
r95901 r97583 24 24 #include "CSSPrimitiveValue.h" 25 25 #include "CSSFunctionValue.h" 26 #include "CSSQuirkPrimitiveValue.h"27 26 #include "CSSSelector.h" 28 27 #include "CSSSelectorList.h" … … 84 83 parsedValue = CSSPrimitiveValue::create(fValue, (CSSPrimitiveValue::UnitTypes)unit); 85 84 else if (unit >= CSSParserValue::Q_EMS) 86 parsedValue = CSS QuirkPrimitiveValue::create(fValue, CSSPrimitiveValue::CSS_EMS);85 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(fValue, CSSPrimitiveValue::CSS_EMS); 87 86 return parsedValue; 88 87 } -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r96547 r97583 168 168 : m_type(0) 169 169 , m_hasCachedCSSText(false) 170 , m_isQuirkValue(false) 170 171 { 171 172 } … … 174 175 : m_type(CSS_IDENT) 175 176 , m_hasCachedCSSText(false) 177 , m_isQuirkValue(false) 176 178 { 177 179 m_value.ident = ident; … … 181 183 : m_type(type) 182 184 , m_hasCachedCSSText(false) 185 , m_isQuirkValue(false) 183 186 { 184 187 ASSERT(isfinite(num)); … … 189 192 : m_type(type) 190 193 , m_hasCachedCSSText(false) 194 , m_isQuirkValue(false) 191 195 { 192 196 if ((m_value.string = str.impl())) … … 197 201 : m_type(CSS_RGBCOLOR) 198 202 , m_hasCachedCSSText(false) 203 , m_isQuirkValue(false) 199 204 { 200 205 m_value.rgbcolor = color; … … 203 208 CSSPrimitiveValue::CSSPrimitiveValue(const Length& length) 204 209 : m_hasCachedCSSText(false) 210 , m_isQuirkValue(false) 205 211 { 206 212 switch (length.type()) { -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r94593 r97583 53 53 class CSSPrimitiveValue : public CSSValue { 54 54 public: 55 static const int UnitTypesBits = 8; 55 56 enum UnitTypes { 56 57 CSS_UNKNOWN = 0, … … 133 134 } 134 135 136 // This value is used to handle quirky margins in reflow roots (body, td, and th) like WinIE. 137 // The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em. 138 // When the quirky value is used, if you're in quirks mode, the margin will collapse away 139 // inside a table cell. 140 static PassRefPtr<CSSPrimitiveValue> createAllowingMarginQuirk(double value, UnitTypes type) 141 { 142 CSSPrimitiveValue* quirkValue = new CSSPrimitiveValue(value, type); 143 quirkValue->m_isQuirkValue = true; 144 return adoptRef(quirkValue); 145 } 146 135 147 virtual ~CSSPrimitiveValue(); 136 148 … … 200 212 virtual String cssText() const; 201 213 202 virtual bool isQuirkValue() { return false; }214 bool isQuirkValue() { return m_isQuirkValue; } 203 215 204 216 virtual void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*); … … 244 256 virtual unsigned short cssValueType() const; 245 257 246 signed m_type : 31;258 signed m_type : UnitTypesBits; 247 259 mutable unsigned m_hasCachedCSSText : 1; 260 unsigned m_isQuirkValue : 1; 248 261 union { 249 262 int ident; -
trunk/Source/WebCore/css/SVGCSSParser.cpp
r89490 r97583 29 29 #include "CSSProperty.h" 30 30 #include "CSSPropertyNames.h" 31 #include "CSSQuirkPrimitiveValue.h"32 31 #include "CSSValueKeywords.h" 33 32 #include "CSSValueList.h" … … 308 307 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit); 309 308 else if (value->unit >= CSSParserValue::Q_EMS) 310 parsedValue = CSS QuirkPrimitiveValue::create(value->fValue, CSSPrimitiveValue::CSS_EMS);309 parsedValue = CSSPrimitiveValue::createAllowingMarginQuirk(value->fValue, CSSPrimitiveValue::CSS_EMS); 311 310 m_valueList->next(); 312 311 }
Note: See TracChangeset
for help on using the changeset viewer.