Changeset 98310 in webkit
- Timestamp:
- Oct 24, 2011 7:38:26 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r98309 r98310 1 2011-10-24 Luke Macpherson <macpherson@chromium.org> 2 3 REGRESSION(80893): HTML5 spec takes 2s longer to load due to time spent in CSSStyleSelector 4 https://bugs.webkit.org/show_bug.cgi?id=68944 5 6 Reviewed by Antti Koivisto. 7 8 No new tests / Covered by existing tests. 9 10 Removes all virtual dispatch from CSSStyleApplyProperty by converting to use static function pointers for dispatch. 11 Uses class templates instead of function templates to allow default parameters and also to share parameter declarations across static functions. 12 All constructor parameters become template parameters. This improves the level of compiler optimization that can be achieved. 13 Overall this achieved a ~2% overall speedup on run-safari PerformanceTests/Parser/html5-full-render.html, 14 and profiling showed a reduction in the time spent inside CSSStyleSelector::applyProperty(). 15 16 * css/CSSStyleApplyProperty.cpp: 17 (WebCore::ApplyPropertyExpanding::applyInheritValue): 18 (WebCore::ApplyPropertyExpanding::applyInitialValue): 19 (WebCore::ApplyPropertyExpanding::applyValue): 20 (WebCore::ApplyPropertyExpanding::createHandler): 21 (WebCore::ApplyPropertyDefaultBase::setValue): 22 (WebCore::ApplyPropertyDefaultBase::value): 23 (WebCore::ApplyPropertyDefaultBase::initial): 24 (WebCore::ApplyPropertyDefaultBase::applyInheritValue): 25 (WebCore::ApplyPropertyDefaultBase::applyInitialValue): 26 (WebCore::ApplyPropertyDefaultBase::applyValue): 27 (WebCore::ApplyPropertyDefaultBase::createHandler): 28 (WebCore::ApplyPropertyDefault::setValue): 29 (WebCore::ApplyPropertyDefault::applyValue): 30 (WebCore::ApplyPropertyDefault::createHandler): 31 (WebCore::ApplyPropertyStyleImage::applyValue): 32 (WebCore::ApplyPropertyStyleImage::createHandler): 33 (WebCore::ApplyPropertyAuto::setValue): 34 (WebCore::ApplyPropertyAuto::value): 35 (WebCore::ApplyPropertyAuto::hasAuto): 36 (WebCore::ApplyPropertyAuto::setAuto): 37 (WebCore::ApplyPropertyAuto::applyInheritValue): 38 (WebCore::ApplyPropertyAuto::applyInitialValue): 39 (WebCore::ApplyPropertyAuto::applyValue): 40 (WebCore::ApplyPropertyAuto::createHandler): 41 (WebCore::defaultInitialColor): 42 (WebCore::ApplyPropertyColor::applyInheritValue): 43 (WebCore::ApplyPropertyColor::applyInitialValue): 44 (WebCore::ApplyPropertyColor::applyValue): 45 (WebCore::ApplyPropertyColor::createHandler): 46 (WebCore::ApplyPropertyDirection::applyValue): 47 (WebCore::ApplyPropertyDirection::createHandler): 48 (WebCore::ApplyPropertyLength::setValue): 49 (WebCore::ApplyPropertyLength::applyValue): 50 (WebCore::ApplyPropertyLength::createHandler): 51 (WebCore::ApplyPropertyString::setValue): 52 (WebCore::ApplyPropertyString::applyValue): 53 (WebCore::ApplyPropertyString::createHandler): 54 (WebCore::ApplyPropertyBorderRadius::setValue): 55 (WebCore::ApplyPropertyBorderRadius::applyValue): 56 (WebCore::ApplyPropertyBorderRadius::createHandler): 57 (WebCore::ApplyPropertyFillLayer::applyInheritValue): 58 (WebCore::ApplyPropertyFillLayer::applyInitialValue): 59 (WebCore::ApplyPropertyFillLayer::applyValue): 60 (WebCore::ApplyPropertyFillLayer::createHandler): 61 (WebCore::ApplyPropertyComputeLength::setValue): 62 (WebCore::ApplyPropertyComputeLength::applyValue): 63 (WebCore::ApplyPropertyComputeLength::createHandler): 64 (WebCore::ApplyPropertyFont::applyInheritValue): 65 (WebCore::ApplyPropertyFont::applyInitialValue): 66 (WebCore::ApplyPropertyFont::applyValue): 67 (WebCore::ApplyPropertyFont::createHandler): 68 (WebCore::ApplyPropertyFontWeight::applyValue): 69 (WebCore::ApplyPropertyFontWeight::createHandler): 70 (WebCore::ApplyPropertyCounter::emptyFunction): 71 (WebCore::ApplyPropertyCounter::applyValue): 72 (WebCore::ApplyPropertyCounter::createHandler): 73 (WebCore::ApplyPropertyCursor::applyInheritValue): 74 (WebCore::ApplyPropertyCursor::applyInitialValue): 75 (WebCore::ApplyPropertyCursor::applyValue): 76 (WebCore::ApplyPropertyCursor::createHandler): 77 (WebCore::ApplyPropertyTextEmphasisStyle::applyInheritValue): 78 (WebCore::ApplyPropertyTextEmphasisStyle::applyInitialValue): 79 (WebCore::ApplyPropertyTextEmphasisStyle::applyValue): 80 (WebCore::ApplyPropertyTextEmphasisStyle::createHandler): 81 (WebCore::ApplyPropertyAnimation::setValue): 82 (WebCore::ApplyPropertyAnimation::value): 83 (WebCore::ApplyPropertyAnimation::test): 84 (WebCore::ApplyPropertyAnimation::clear): 85 (WebCore::ApplyPropertyAnimation::initial): 86 (WebCore::ApplyPropertyAnimation::map): 87 (WebCore::ApplyPropertyAnimation::accessAnimations): 88 (WebCore::ApplyPropertyAnimation::animations): 89 (WebCore::ApplyPropertyAnimation::applyInheritValue): 90 (WebCore::ApplyPropertyAnimation::applyInitialValue): 91 (WebCore::ApplyPropertyAnimation::applyValue): 92 (WebCore::ApplyPropertyAnimation::createHandler): 93 (WebCore::ApplyPropertyOutlineStyle::applyInheritValue): 94 (WebCore::ApplyPropertyOutlineStyle::applyInitialValue): 95 (WebCore::ApplyPropertyOutlineStyle::applyValue): 96 (WebCore::ApplyPropertyOutlineStyle::createHandler): 97 (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): 98 * css/CSSStyleApplyProperty.h: 99 (WebCore::PropertyHandler::PropertyHandler): 100 (WebCore::PropertyHandler::applyInheritValue): 101 (WebCore::PropertyHandler::applyInitialValue): 102 (WebCore::PropertyHandler::applyValue): 103 (WebCore::PropertyHandler::isValid): 104 (WebCore::PropertyHandler::inheritFunction): 105 (WebCore::PropertyHandler::initialFunction): 106 (WebCore::PropertyHandler::applyFunction): 107 (WebCore::CSSStyleApplyProperty::propertyHandler): 108 (WebCore::CSSStyleApplyProperty::setPropertyHandler): 109 * css/CSSStyleSelector.cpp: 110 (WebCore::CSSStyleSelector::applyProperty): 111 * rendering/style/RenderStyle.h: 112 (WebCore::InheritedFlags::invalidColor): 113 1 114 2011-10-24 Ben Wells <benwells@chromium.org> 2 115 -
trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp
r97854 r98310 44 44 45 45 enum ExpandValueBehavior {SuppressValue = 0, ExpandValue}; 46 template <ExpandValueBehavior expandValue> 47 class ApplyPropertyExpanding : public ApplyPropertyBase { 48 public: 49 ApplyPropertyExpanding(ApplyPropertyBase* one = 0, ApplyPropertyBase* two = 0, ApplyPropertyBase *three = 0, ApplyPropertyBase* four = 0) 50 { 51 m_propertyMap[0] = one; 52 m_propertyMap[1] = two; 53 m_propertyMap[2] = three; 54 m_propertyMap[3] = four; 55 m_propertyMap[4] = 0; // always null terminated 56 } 57 58 virtual void applyInheritValue(CSSStyleSelector* selector) const 59 { 60 for (ApplyPropertyBase* const* e = m_propertyMap; *e; e++) 61 (*e)->applyInheritValue(selector); 62 } 63 64 virtual void applyInitialValue(CSSStyleSelector* selector) const 65 { 66 for (ApplyPropertyBase* const* e = m_propertyMap; *e; e++) 67 (*e)->applyInitialValue(selector); 68 } 69 70 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 46 template <ExpandValueBehavior expandValue, CSSPropertyID one = CSSPropertyInvalid, CSSPropertyID two = CSSPropertyInvalid, CSSPropertyID three = CSSPropertyInvalid, CSSPropertyID four = CSSPropertyInvalid> 47 class ApplyPropertyExpanding { 48 public: 49 50 template <CSSPropertyID id> 51 static inline void applyInheritValue(CSSStyleSelector* selector) 52 { 53 if (id == CSSPropertyInvalid) 54 return; 55 56 const CSSStyleApplyProperty& table = CSSStyleApplyProperty::sharedCSSStyleApplyProperty(); 57 const PropertyHandler& handler = table.propertyHandler(id); 58 if (handler.isValid()) 59 handler.applyInheritValue(selector); 60 } 61 62 static void applyInheritValue(CSSStyleSelector* selector) 63 { 64 applyInheritValue<one>(selector); 65 applyInheritValue<two>(selector); 66 applyInheritValue<three>(selector); 67 applyInheritValue<four>(selector); 68 } 69 70 template <CSSPropertyID id> 71 static inline void applyInitialValue(CSSStyleSelector* selector) 72 { 73 if (id == CSSPropertyInvalid) 74 return; 75 76 const CSSStyleApplyProperty& table = CSSStyleApplyProperty::sharedCSSStyleApplyProperty(); 77 const PropertyHandler& handler = table.propertyHandler(id); 78 if (handler.isValid()) 79 handler.applyInitialValue(selector); 80 } 81 82 static void applyInitialValue(CSSStyleSelector* selector) 83 { 84 applyInitialValue<one>(selector); 85 applyInitialValue<two>(selector); 86 applyInitialValue<three>(selector); 87 applyInitialValue<four>(selector); 88 } 89 90 template <CSSPropertyID id> 91 static inline void applyValue(CSSStyleSelector* selector, CSSValue* value) 92 { 93 if (id == CSSPropertyInvalid) 94 return; 95 96 const CSSStyleApplyProperty& table = CSSStyleApplyProperty::sharedCSSStyleApplyProperty(); 97 const PropertyHandler& handler = table.propertyHandler(id); 98 if (handler.isValid()) 99 handler.applyValue(selector, value); 100 } 101 102 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 71 103 { 72 104 if (!expandValue) 73 105 return; 74 106 75 for (ApplyPropertyBase* const* e = m_propertyMap; *e; e++) 76 (*e)->applyValue(selector, value); 77 } 78 private: 79 ApplyPropertyBase* m_propertyMap[5]; 80 }; 81 82 template <typename GetterType, typename SetterType = GetterType, typename InitialType = GetterType> 83 class ApplyPropertyDefaultBase : public ApplyPropertyBase { 84 public: 85 typedef GetterType (RenderStyle::*GetterFunction)() const; 86 typedef void (RenderStyle::*SetterFunction)(SetterType); 87 typedef InitialType (*InitialFunction)(); 88 89 ApplyPropertyDefaultBase(GetterFunction getter, SetterFunction setter, InitialFunction initial) 90 : m_getter(getter) 91 , m_setter(setter) 92 , m_initial(initial) 93 { 94 } 95 96 private: 97 virtual void applyInheritValue(CSSStyleSelector* selector) const 98 { 99 setValue(selector->style(), value(selector->parentStyle())); 100 } 101 102 virtual void applyInitialValue(CSSStyleSelector* selector) const 103 { 104 setValue(selector->style(), initial()); 105 } 106 107 protected: 108 void setValue(RenderStyle* style, SetterType value) const 109 { 110 (style->*m_setter)(value); 111 } 112 113 GetterType value(RenderStyle* style) const 114 { 115 return (style->*m_getter)(); 116 } 117 118 InitialType initial() const 119 { 120 return (*m_initial)(); 121 } 122 123 GetterFunction m_getter; 124 SetterFunction m_setter; 125 InitialFunction m_initial; 126 }; 127 128 129 template <typename T> 130 class ApplyPropertyDefault : public ApplyPropertyDefaultBase<T> { 131 public: 132 ApplyPropertyDefault(typename ApplyPropertyDefaultBase<T>::GetterFunction getter, typename ApplyPropertyDefaultBase<T>::SetterFunction setter, typename ApplyPropertyDefaultBase<T>::InitialFunction initial) 133 : ApplyPropertyDefaultBase<T>(getter, setter, initial) 134 { 135 } 136 137 protected: 138 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 107 applyValue<one>(selector, value); 108 applyValue<two>(selector, value); 109 applyValue<three>(selector, value); 110 applyValue<four>(selector, value); 111 } 112 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 113 }; 114 115 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()> 116 class ApplyPropertyDefaultBase { 117 public: 118 static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); } 119 static GetterType value(RenderStyle* style) { return (style->*getterFunction)(); } 120 static InitialType initial() { return (*initialFunction)(); } 121 static void applyInheritValue(CSSStyleSelector* selector) { setValue(selector->style(), value(selector->parentStyle())); } 122 static void applyInitialValue(CSSStyleSelector* selector) { setValue(selector->style(), initial()); } 123 static void applyValue(CSSStyleSelector*, CSSValue*) { } 124 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 125 }; 126 127 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()> 128 class ApplyPropertyDefault { 129 public: 130 static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); } 131 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 139 132 { 140 133 if (value->isPrimitiveValue()) 141 ApplyPropertyDefaultBase<T>::setValue(selector->style(), *static_cast<CSSPrimitiveValue*>(value)); 142 } 143 }; 144 145 class ApplyPropertyStyleImage : public ApplyPropertyDefaultBase<StyleImage*, PassRefPtr<StyleImage> > { 146 public: 147 ApplyPropertyStyleImage(GetterFunction getter, SetterFunction setter, InitialFunction initial, CSSPropertyID property) 148 : ApplyPropertyDefaultBase<StyleImage*, PassRefPtr<StyleImage> >(getter, setter, initial) 149 , m_property(property) 150 { 151 } 152 153 private: 154 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 155 { 156 setValue(selector->style(), selector->styleImage(m_property, value)); 157 } 158 159 CSSPropertyID m_property; 134 setValue(selector->style(), *static_cast<CSSPrimitiveValue*>(value)); 135 } 136 static PropertyHandler createHandler() 137 { 138 PropertyHandler handler = ApplyPropertyDefaultBase<GetterType, getterFunction, SetterType, setterFunction, InitialType, initialFunction>::createHandler(); 139 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); 140 } 141 }; 142 143 template <StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)(), CSSPropertyID property> 144 class ApplyPropertyStyleImage { 145 public: 146 static void applyValue(CSSStyleSelector* selector, CSSValue* value) { (selector->style()->*setterFunction)(selector->styleImage(property, value)); } 147 static PropertyHandler createHandler() 148 { 149 PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler(); 150 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); 151 } 160 152 }; 161 153 162 154 enum AutoValueType {Number = 0, ComputeLength}; 163 template <typename T, AutoValueType valueType = Number, int autoIdentity = CSSValueAuto> 164 class ApplyPropertyAuto : public ApplyPropertyDefaultBase<T> { 165 public: 166 typedef bool (RenderStyle::*HasAutoFunction)() const; 167 typedef void (RenderStyle::*SetAutoFunction)(); 168 169 ApplyPropertyAuto(typename ApplyPropertyDefaultBase<T>::GetterFunction getter, typename ApplyPropertyDefaultBase<T>::SetterFunction setter, HasAutoFunction hasAuto, SetAutoFunction setAuto) 170 : ApplyPropertyDefaultBase<T>(getter, setter, 0) 171 , m_hasAuto(hasAuto) 172 , m_setAuto(setAuto) 173 { 174 } 175 176 protected: 177 virtual void applyInheritValue(CSSStyleSelector* selector) const 155 template <typename T, T (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(T), bool (RenderStyle::*hasAutoFunction)() const, void (RenderStyle::*setAutoFunction)(), AutoValueType valueType = Number, int autoIdentity = CSSValueAuto> 156 class ApplyPropertyAuto { 157 public: 158 static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); } 159 static T value(RenderStyle* style) { return (style->*getterFunction)(); } 160 static bool hasAuto(RenderStyle* style) { return (style->*hasAutoFunction)(); } 161 static void setAuto(RenderStyle* style) { (style->*setAutoFunction)(); } 162 163 static void applyInheritValue(CSSStyleSelector* selector) 178 164 { 179 165 if (hasAuto(selector->parentStyle())) 180 166 setAuto(selector->style()); 181 167 else 182 ApplyPropertyDefaultBase<T>::setValue(selector->style(), ApplyPropertyDefaultBase<T>::value(selector->parentStyle())); 183 } 184 185 virtual void applyInitialValue(CSSStyleSelector* selector) const 186 { 187 setAuto(selector->style()); 188 } 189 190 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 168 setValue(selector->style(), value(selector->parentStyle())); 169 } 170 171 static void applyInitialValue(CSSStyleSelector* selector) { setAuto(selector->style()); } 172 173 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 191 174 { 192 175 if (!value->isPrimitiveValue()) … … 197 180 setAuto(selector->style()); 198 181 else if (valueType == Number) 199 ApplyPropertyDefaultBase<T>::setValue(selector->style(), *primitiveValue);182 setValue(selector->style(), *primitiveValue); 200 183 else if (valueType == ComputeLength) 201 ApplyPropertyDefaultBase<T>::setValue(selector->style(), primitiveValue->computeLength<T>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom())); 202 } 203 204 bool hasAuto(RenderStyle* style) const 205 { 206 return (style->*m_hasAuto)(); 207 } 208 209 void setAuto(RenderStyle* style) const 210 { 211 (style->*m_setAuto)(); 212 } 213 214 HasAutoFunction m_hasAuto; 215 SetAutoFunction m_setAuto; 184 setValue(selector->style(), primitiveValue->computeLength<T>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom())); 185 } 186 187 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 216 188 }; 217 189 218 190 enum ColorInherit {NoInheritFromParent = 0, InheritFromParent}; 219 template <ColorInherit inheritColorFromParent> 220 class ApplyPropertyColor : public ApplyPropertyBase { 221 public: 222 typedef const Color& (RenderStyle::*GetterFunction)() const; 223 typedef void (RenderStyle::*SetterFunction)(const Color&); 224 typedef const Color& (RenderStyle::*DefaultFunction)() const; 225 typedef Color (*InitialFunction)(); 226 227 ApplyPropertyColor(GetterFunction getter, SetterFunction setter, SetterFunction visitedLinkSetter, DefaultFunction defaultFunction, InitialFunction initialFunction = 0) 228 : m_getter(getter) 229 , m_setter(setter) 230 , m_visitedLinkSetter(visitedLinkSetter) 231 , m_default(defaultFunction) 232 , m_initial(initialFunction) 233 { 234 } 235 236 private: 237 virtual void applyInheritValue(CSSStyleSelector* selector) const 191 Color defaultInitialColor(); 192 Color defaultInitialColor() { return Color(); } 193 template <ColorInherit inheritColorFromParent, 194 const Color& (RenderStyle::*getterFunction)() const, 195 void (RenderStyle::*setterFunction)(const Color&), 196 void (RenderStyle::*visitedLinkSetterFunction)(const Color&), 197 const Color& (RenderStyle::*defaultFunction)() const, 198 Color (*initialFunction)() = &defaultInitialColor> 199 class ApplyPropertyColor { 200 public: 201 static void applyInheritValue(CSSStyleSelector* selector) 238 202 { 239 203 // Visited link style can never explicitly inherit from parent visited link style so no separate getters are needed. 240 const Color& color = (selector->parentStyle()->*m_getter)(); 241 if (m_default && !color.isValid()) 242 applyColorValue(selector, (selector->parentStyle()->*m_default)()); 243 else 244 applyColorValue(selector, color); 245 } 246 247 virtual void applyInitialValue(CSSStyleSelector* selector) const 248 { 249 applyColorValue(selector, m_initial ? m_initial() : Color()); 250 } 251 252 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 204 const Color& color = (selector->parentStyle()->*getterFunction)(); 205 applyColorValue(selector, color.isValid() ? color : (selector->parentStyle()->*defaultFunction)()); 206 } 207 208 static void applyInitialValue(CSSStyleSelector* selector) 209 { 210 applyColorValue(selector, initialFunction()); 211 } 212 213 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 253 214 { 254 215 if (!value->isPrimitiveValue()) … … 260 221 else { 261 222 if (selector->applyPropertyToRegularStyle()) 262 (selector->style()->* m_setter)(selector->getColorFromPrimitiveValue(primitiveValue, false));263 if (selector->applyPropertyToVisitedLinkStyle() && m_visitedLinkSetter)264 (selector->style()->* m_visitedLinkSetter)(selector->getColorFromPrimitiveValue(primitiveValue, true));265 } 266 } 267 268 void applyColorValue(CSSStyleSelector* selector, const Color& color) const223 (selector->style()->*setterFunction)(selector->getColorFromPrimitiveValue(primitiveValue, false)); 224 if (selector->applyPropertyToVisitedLinkStyle()) 225 (selector->style()->*visitedLinkSetterFunction)(selector->getColorFromPrimitiveValue(primitiveValue, true)); 226 } 227 } 228 229 static void applyColorValue(CSSStyleSelector* selector, const Color& color) 269 230 { 270 231 if (selector->applyPropertyToRegularStyle()) 271 (selector->style()->*m_setter)(color); 272 if (selector->applyPropertyToVisitedLinkStyle() && m_visitedLinkSetter) 273 (selector->style()->*m_visitedLinkSetter)(color); 274 } 275 276 GetterFunction m_getter; 277 SetterFunction m_setter; 278 SetterFunction m_visitedLinkSetter; 279 DefaultFunction m_default; 280 InitialFunction m_initial; 281 }; 282 283 class ApplyPropertyDirection : public ApplyPropertyDefault<TextDirection> { 284 public: 285 ApplyPropertyDirection(GetterFunction getter, SetterFunction setter, InitialFunction initial) 286 : ApplyPropertyDefault<TextDirection>(getter, setter, initial) 287 { 288 } 289 290 private: 291 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 292 { 293 ApplyPropertyDefault<TextDirection>::applyValue(selector, value); 232 (selector->style()->*setterFunction)(color); 233 if (selector->applyPropertyToVisitedLinkStyle()) 234 (selector->style()->*visitedLinkSetterFunction)(color); 235 } 236 237 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 238 }; 239 240 template <TextDirection (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(TextDirection), TextDirection (*initialFunction)()> 241 class ApplyPropertyDirection { 242 public: 243 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 244 { 245 ApplyPropertyDefault<TextDirection, getterFunction, TextDirection, setterFunction, TextDirection, initialFunction>::applyValue(selector, value); 294 246 Element* element = selector->element(); 295 247 if (element && selector->element() == element->document()->documentElement()) 296 248 element->document()->setDirectionSetOnDocumentElement(true); 249 } 250 251 static PropertyHandler createHandler() 252 { 253 PropertyHandler handler = ApplyPropertyDefault<TextDirection, getterFunction, TextDirection, setterFunction, TextDirection, initialFunction>::createHandler(); 254 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); 297 255 } 298 256 }; … … 304 262 enum LengthUndefined { UndefinedDisabled = 0, UndefinedEnabled }; 305 263 enum LengthFlexDirection { FlexDirectionDisabled = 0, FlexWidth, FlexHeight }; 306 template <LengthAuto autoEnabled = AutoDisabled, 264 template <Length (RenderStyle::*getterFunction)() const, 265 void (RenderStyle::*setterFunction)(Length), 266 Length (*initialFunction)(), 267 LengthAuto autoEnabled = AutoDisabled, 307 268 LengthIntrinsic intrinsicEnabled = IntrinsicDisabled, 308 269 LengthMinIntrinsic minIntrinsicEnabled = MinIntrinsicDisabled, … … 310 271 LengthUndefined noneUndefined = UndefinedDisabled, 311 272 LengthFlexDirection flexDirection = FlexDirectionDisabled> 312 class ApplyPropertyLength : public ApplyPropertyDefaultBase<Length> { 313 public: 314 ApplyPropertyLength(GetterFunction getter, SetterFunction setter, InitialFunction initial) 315 : ApplyPropertyDefaultBase<Length>(getter, setter, initial) 316 { 317 } 318 319 private: 320 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 273 class ApplyPropertyLength { 274 public: 275 static void setValue(RenderStyle* style, Length value) { (style->*setterFunction)(value); } 276 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 321 277 { 322 278 #if ENABLE(CSS3_FLEXBOX) … … 363 319 } 364 320 } 321 322 static PropertyHandler createHandler() 323 { 324 PropertyHandler handler = ApplyPropertyDefaultBase<Length, getterFunction, Length, setterFunction, Length, initialFunction>::createHandler(); 325 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); 326 } 365 327 }; 366 328 367 329 enum StringIdentBehavior { NothingMapsToNull = 0, MapNoneToNull, MapAutoToNull }; 368 template <StringIdentBehavior identBehavior = NothingMapsToNull> 369 class ApplyPropertyString : public ApplyPropertyDefaultBase<const AtomicString&> { 370 public: 371 ApplyPropertyString(GetterFunction getter, SetterFunction setter, InitialFunction initial) 372 : ApplyPropertyDefaultBase<const AtomicString&>(getter, setter, initial) 373 { 374 } 375 376 private: 377 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 330 template <StringIdentBehavior identBehavior, const AtomicString& (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(const AtomicString&), const AtomicString& (*initialFunction)()> 331 class ApplyPropertyString { 332 public: 333 static void setValue(RenderStyle* style, const AtomicString& value) { (style->*setterFunction)(value); } 334 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 378 335 { 379 336 if (!value->isPrimitiveValue()) … … 386 343 setValue(selector->style(), primitiveValue->getStringValue()); 387 344 } 388 }; 389 390 class ApplyPropertyBorderRadius : public ApplyPropertyDefaultBase<LengthSize> { 391 public: 392 ApplyPropertyBorderRadius(GetterFunction getter, SetterFunction setter, InitialFunction initial) 393 : ApplyPropertyDefaultBase<LengthSize>(getter, setter, initial) 394 { 395 } 396 private: 397 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 345 static PropertyHandler createHandler() 346 { 347 PropertyHandler handler = ApplyPropertyDefaultBase<const AtomicString&, getterFunction, const AtomicString&, setterFunction, const AtomicString&, initialFunction>::createHandler(); 348 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); 349 } 350 }; 351 352 template <LengthSize (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(LengthSize), LengthSize (*initialFunction)()> 353 class ApplyPropertyBorderRadius { 354 public: 355 static void setValue(RenderStyle* style, LengthSize value) { (style->*setterFunction)(value); } 356 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 398 357 { 399 358 if (!value->isPrimitiveValue()) … … 427 386 setValue(selector->style(), size); 428 387 } 429 }; 430 431 template <typename T> 432 class ApplyPropertyFillLayer : public ApplyPropertyBase { 433 public: 434 ApplyPropertyFillLayer(CSSPropertyID propertyId, EFillLayerType fillLayerType, FillLayer* (RenderStyle::*accessLayers)(), 435 const FillLayer* (RenderStyle::*layers)() const, bool (FillLayer::*test)() const, T (FillLayer::*get)() const, 436 void (FillLayer::*set)(T), void (FillLayer::*clear)(), T (*initial)(EFillLayerType), 437 void (CSSStyleSelector::*mapFill)(CSSPropertyID, FillLayer*, CSSValue*)) 438 : m_propertyId(propertyId) 439 , m_fillLayerType(fillLayerType) 440 , m_accessLayers(accessLayers) 441 , m_layers(layers) 442 , m_test(test) 443 , m_get(get) 444 , m_set(set) 445 , m_clear(clear) 446 , m_initial(initial) 447 , m_mapFill(mapFill) 448 { 449 } 450 451 private: 452 virtual void applyInheritValue(CSSStyleSelector* selector) const 453 { 454 FillLayer* currChild = (selector->style()->*m_accessLayers)(); 388 static PropertyHandler createHandler() 389 { 390 PropertyHandler handler = ApplyPropertyDefaultBase<LengthSize, getterFunction, LengthSize, setterFunction, LengthSize, initialFunction>::createHandler(); 391 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); 392 } 393 }; 394 395 template <typename T, 396 CSSPropertyID propertyId, 397 EFillLayerType fillLayerType, 398 FillLayer* (RenderStyle::*accessLayersFunction)(), 399 const FillLayer* (RenderStyle::*layersFunction)() const, 400 bool (FillLayer::*testFunction)() const, 401 T (FillLayer::*getFunction)() const, 402 void (FillLayer::*setFunction)(T), 403 void (FillLayer::*clearFunction)(), 404 T (*initialFunction)(EFillLayerType), 405 void (CSSStyleSelector::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)> 406 class ApplyPropertyFillLayer { 407 public: 408 static void applyInheritValue(CSSStyleSelector* selector) 409 { 410 FillLayer* currChild = (selector->style()->*accessLayersFunction)(); 455 411 FillLayer* prevChild = 0; 456 const FillLayer* currParent = (selector->parentStyle()->* m_layers)();457 while (currParent && (currParent->* m_test)()) {412 const FillLayer* currParent = (selector->parentStyle()->*layersFunction)(); 413 while (currParent && (currParent->*testFunction)()) { 458 414 if (!currChild) { 459 415 /* Need to make a new layer.*/ 460 currChild = new FillLayer( m_fillLayerType);416 currChild = new FillLayer(fillLayerType); 461 417 prevChild->setNext(currChild); 462 418 } 463 (currChild->* m_set)((currParent->*m_get)());419 (currChild->*setFunction)((currParent->*getFunction)()); 464 420 prevChild = currChild; 465 421 currChild = prevChild->next(); … … 469 425 while (currChild) { 470 426 /* Reset any remaining layers to not have the property set. */ 471 (currChild->* m_clear)();427 (currChild->*clearFunction)(); 472 428 currChild = currChild->next(); 473 429 } 474 430 } 475 431 476 virtual void applyInitialValue(CSSStyleSelector* selector) const477 { 478 FillLayer* currChild = (selector->style()->* m_accessLayers)();479 (currChild->* m_set)((*m_initial)(m_fillLayerType));432 static void applyInitialValue(CSSStyleSelector* selector) 433 { 434 FillLayer* currChild = (selector->style()->*accessLayersFunction)(); 435 (currChild->*setFunction)((*initialFunction)(fillLayerType)); 480 436 for (currChild = currChild->next(); currChild; currChild = currChild->next()) 481 (currChild->* m_clear)();482 } 483 484 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const485 { 486 FillLayer* currChild = (selector->style()->* m_accessLayers)();437 (currChild->*clearFunction)(); 438 } 439 440 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 441 { 442 FillLayer* currChild = (selector->style()->*accessLayersFunction)(); 487 443 FillLayer* prevChild = 0; 488 444 if (value->isValueList()) { … … 492 448 if (!currChild) { 493 449 /* Need to make a new layer to hold this value */ 494 currChild = new FillLayer( m_fillLayerType);450 currChild = new FillLayer(fillLayerType); 495 451 prevChild->setNext(currChild); 496 452 } 497 (selector->*m _mapFill)(m_propertyId, currChild, valueList->itemWithoutBoundsCheck(i));453 (selector->*mapFillFunction)(propertyId, currChild, valueList->itemWithoutBoundsCheck(i)); 498 454 prevChild = currChild; 499 455 currChild = currChild->next(); 500 456 } 501 457 } else { 502 (selector->*m _mapFill)(m_propertyId, currChild, value);458 (selector->*mapFillFunction)(propertyId, currChild, value); 503 459 currChild = currChild->next(); 504 460 } 505 461 while (currChild) { 506 462 /* Reset all remaining layers to not have the property set. */ 507 (currChild->* m_clear)();463 (currChild->*clearFunction)(); 508 464 currChild = currChild->next(); 509 465 } 510 466 } 511 467 512 protected: 513 CSSPropertyID m_propertyId; 514 EFillLayerType m_fillLayerType; 515 FillLayer* (RenderStyle::*m_accessLayers)(); 516 const FillLayer* (RenderStyle::*m_layers)() const; 517 bool (FillLayer::*m_test)() const; 518 T (FillLayer::*m_get)() const; 519 void (FillLayer::*m_set)(T); 520 void (FillLayer::*m_clear)(); 521 T (*m_initial)(EFillLayerType); 522 void (CSSStyleSelector::*m_mapFill)(CSSPropertyID, FillLayer*, CSSValue*); 468 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 523 469 }; 524 470 … … 527 473 enum ComputeLengthSVGZoom {SVGZoomDisabled = 0, SVGZoomEnabled}; 528 474 template <typename T, 475 T (RenderStyle::*getterFunction)() const, 476 void (RenderStyle::*setterFunction)(T), 477 T (*initialFunction)(), 529 478 ComputeLengthNormal normalEnabled = NormalDisabled, 530 479 ComputeLengthThickness thicknessEnabled = ThicknessDisabled, 531 480 ComputeLengthSVGZoom svgZoomEnabled = SVGZoomDisabled> 532 class ApplyPropertyComputeLength : public ApplyPropertyDefaultBase<T> { 533 public: 534 ApplyPropertyComputeLength(typename ApplyPropertyDefaultBase<T>::GetterFunction getter, typename ApplyPropertyDefaultBase<T>::SetterFunction setter, typename ApplyPropertyDefaultBase<T>::InitialFunction initial) 535 : ApplyPropertyDefaultBase<T>(getter, setter, initial) 536 { 537 } 538 539 private: 540 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 481 class ApplyPropertyComputeLength { 482 public: 483 static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); } 484 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 541 485 { 542 486 // note: CSSPropertyLetter/WordSpacing right now sets to zero if it's not a primitive value for some reason... … … 564 508 } 565 509 566 this->setValue(selector->style(), length); 567 } 568 }; 569 570 template <typename T> 571 class ApplyPropertyFont : public ApplyPropertyBase { 572 public: 573 typedef T (FontDescription::*GetterFunction)() const; 574 typedef void (FontDescription::*SetterFunction)(T); 575 576 ApplyPropertyFont(GetterFunction getter, SetterFunction setter, T initial) 577 : m_getter(getter) 578 , m_setter(setter) 579 , m_initial(initial) 580 { 581 } 582 583 private: 584 virtual void applyInheritValue(CSSStyleSelector* selector) const 510 setValue(selector->style(), length); 511 } 512 static PropertyHandler createHandler() 513 { 514 PropertyHandler handler = ApplyPropertyDefaultBase<T, getterFunction, T, setterFunction, T, initialFunction>::createHandler(); 515 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); 516 } 517 }; 518 519 template <typename T, T (FontDescription::*getterFunction)() const, void (FontDescription::*setterFunction)(T), T initialValue> 520 class ApplyPropertyFont { 521 public: 522 static void applyInheritValue(CSSStyleSelector* selector) 585 523 { 586 524 FontDescription fontDescription = selector->fontDescription(); 587 (fontDescription.* m_setter)((selector->parentFontDescription().*m_getter)());525 (fontDescription.*setterFunction)((selector->parentFontDescription().*getterFunction)()); 588 526 selector->setFontDescription(fontDescription); 589 527 } 590 528 591 virtual void applyInitialValue(CSSStyleSelector* selector) const529 static void applyInitialValue(CSSStyleSelector* selector) 592 530 { 593 531 FontDescription fontDescription = selector->fontDescription(); 594 (fontDescription.* m_setter)(m_initial);532 (fontDescription.*setterFunction)(initialValue); 595 533 selector->setFontDescription(fontDescription); 596 534 } 597 535 598 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const536 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 599 537 { 600 538 if (!value->isPrimitiveValue()) … … 602 540 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 603 541 FontDescription fontDescription = selector->fontDescription(); 604 (fontDescription.* m_setter)(*primitiveValue);542 (fontDescription.*setterFunction)(*primitiveValue); 605 543 selector->setFontDescription(fontDescription); 606 544 } 607 545 608 GetterFunction m_getter; 609 SetterFunction m_setter; 610 T m_initial; 611 }; 612 613 class ApplyPropertyFontWeight : public ApplyPropertyFont<FontWeight> { 614 public: 615 ApplyPropertyFontWeight() 616 : ApplyPropertyFont<FontWeight>(&FontDescription::weight, &FontDescription::setWeight, FontWeightNormal) 617 { 618 } 619 620 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 546 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 547 }; 548 549 class ApplyPropertyFontWeight { 550 public: 551 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 621 552 { 622 553 if (!value->isPrimitiveValue()) … … 639 570 selector->setFontDescription(fontDescription); 640 571 } 572 static PropertyHandler createHandler() 573 { 574 PropertyHandler handler = ApplyPropertyFont<FontWeight, &FontDescription::weight, &FontDescription::setWeight, FontWeightNormal>::createHandler(); 575 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); 576 } 641 577 }; 642 578 643 579 enum CounterBehavior {Increment = 0, Reset}; 644 580 template <CounterBehavior counterBehavior> 645 class ApplyPropertyCounter : public ApplyPropertyBase { 646 private: 647 virtual void applyInheritValue(CSSStyleSelector*) const { } 648 virtual void applyInitialValue(CSSStyleSelector*) const { } 649 650 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const 581 class ApplyPropertyCounter { 582 public: 583 static void emptyFunction(CSSStyleSelector*) { } 584 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 651 585 { 652 586 if (!value->isValueList()) … … 692 626 } 693 627 } 694 }; 695 696 697 class ApplyPropertyCursor : public ApplyPropertyBase { 698 private: 699 virtual void applyInheritValue(CSSStyleSelector* selector) const 628 static PropertyHandler createHandler() { return PropertyHandler(&emptyFunction, &emptyFunction, &applyValue); } 629 }; 630 631 632 class ApplyPropertyCursor { 633 public: 634 static void applyInheritValue(CSSStyleSelector* selector) 700 635 { 701 636 selector->style()->setCursor(selector->parentStyle()->cursor()); … … 703 638 } 704 639 705 virtual void applyInitialValue(CSSStyleSelector* selector) const640 static void applyInitialValue(CSSStyleSelector* selector) 706 641 { 707 642 selector->style()->clearCursorList(); … … 709 644 } 710 645 711 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const646 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 712 647 { 713 648 selector->style()->clearCursorList(); … … 739 674 } 740 675 } 741 }; 742 743 class ApplyPropertyTextEmphasisStyle : public ApplyPropertyBase { 744 private: 745 virtual void applyInheritValue(CSSStyleSelector* selector) const 676 677 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 678 }; 679 680 class ApplyPropertyTextEmphasisStyle { 681 public: 682 static void applyInheritValue(CSSStyleSelector* selector) 746 683 { 747 684 selector->style()->setTextEmphasisFill(selector->parentStyle()->textEmphasisFill()); … … 750 687 } 751 688 752 virtual void applyInitialValue(CSSStyleSelector* selector) const689 static void applyInitialValue(CSSStyleSelector* selector) 753 690 { 754 691 selector->style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill()); … … 757 694 } 758 695 759 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const696 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 760 697 { 761 698 if (value->isValueList()) { … … 799 736 selector->style()->setTextEmphasisMark(*primitiveValue); 800 737 } 801 802 } 803 }; 804 805 template <typename T> 806 class ApplyPropertyAnimation : public ApplyPropertyBase { 807 public: 808 typedef T (Animation::*GetterFunction)() const; 809 typedef void (Animation::*SetterFunction)(T); 810 typedef bool (Animation::*TestFunction)() const; 811 typedef void (Animation::*ClearFunction)(); 812 typedef T (*InitialFunction)(); 813 typedef void (CSSStyleSelector::*MapFunction)(Animation*, CSSValue*); 814 typedef AnimationList* (RenderStyle::*AnimationGetter)(); 815 typedef const AnimationList* (RenderStyle::*ImmutableAnimationGetter)() const; 816 817 ApplyPropertyAnimation(GetterFunction getter, SetterFunction setter, TestFunction test, ClearFunction clear, InitialFunction initial, MapFunction map, 818 AnimationGetter animationGetter, ImmutableAnimationGetter immutableAnimationGetter) 819 : m_getter(getter) 820 , m_setter(setter) 821 , m_test(test) 822 , m_clear(clear) 823 , m_initial(initial) 824 , m_map(map) 825 , m_animationGetter(animationGetter) 826 , m_immutableAnimationGetter(immutableAnimationGetter) 827 { 828 } 829 830 private: 831 virtual void applyInheritValue(CSSStyleSelector* selector) const 738 } 739 740 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 741 }; 742 743 template <typename T, 744 T (Animation::*getterFunction)() const, 745 void (Animation::*setterFunction)(T), 746 bool (Animation::*testFunction)() const, 747 void (Animation::*clearFunction)(), 748 T (*initialFunction)(), 749 void (CSSStyleSelector::*mapFunction)(Animation*, CSSValue*), 750 AnimationList* (RenderStyle::*animationGetterFunction)(), 751 const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const> 752 class ApplyPropertyAnimation { 753 public: 754 static void setValue(Animation* animation, T value) { (animation->*setterFunction)(value); } 755 static T value(const Animation* animation) { return (animation->*getterFunction)(); } 756 static bool test(const Animation* animation) { return (animation->*testFunction)(); } 757 static void clear(Animation* animation) { (animation->*clearFunction)(); } 758 static T initial() { return (*initialFunction)(); } 759 static void map(CSSStyleSelector* selector, Animation* animation, CSSValue* value) { (selector->*mapFunction)(animation, value); } 760 static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); } 761 static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); } 762 763 static void applyInheritValue(CSSStyleSelector* selector) 832 764 { 833 765 AnimationList* list = accessAnimations(selector->style()); … … 845 777 } 846 778 847 virtual void applyInitialValue(CSSStyleSelector* selector) const779 static void applyInitialValue(CSSStyleSelector* selector) 848 780 { 849 781 AnimationList* list = accessAnimations(selector->style()); … … 855 787 } 856 788 857 virtual void applyValue(CSSStyleSelector* selector, CSSValue* value) const789 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 858 790 { 859 791 AnimationList* list = accessAnimations(selector->style()); … … 879 811 } 880 812 881 void setValue(Animation* animation, T value) const { (animation->*m_setter)(value); } 882 T value(const Animation* animation) const { return (animation->*m_getter)(); } 883 bool test(const Animation* animation) const { return (animation->*m_test)(); } 884 void clear(Animation* animation) const { (animation->*m_clear)(); } 885 T initial() const { return (*m_initial)(); } 886 void map(CSSStyleSelector* selector, Animation* animation, CSSValue* value) const { (selector->*m_map)(animation, value); } 887 AnimationList* accessAnimations(RenderStyle* style) const { return (style->*m_animationGetter)(); } 888 const AnimationList* animations(RenderStyle* style) const { return (style->*m_immutableAnimationGetter)(); } 889 890 GetterFunction m_getter; 891 SetterFunction m_setter; 892 TestFunction m_test; 893 ClearFunction m_clear; 894 InitialFunction m_initial; 895 MapFunction m_map; 896 AnimationGetter m_animationGetter; 897 ImmutableAnimationGetter m_immutableAnimationGetter; 813 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 814 }; 815 816 class ApplyPropertyOutlineStyle { 817 public: 818 static void applyInheritValue(CSSStyleSelector* selector) 819 { 820 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInheritValue(selector); 821 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInheritValue(selector); 822 } 823 824 static void applyInitialValue(CSSStyleSelector* selector) 825 { 826 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInitialValue(selector); 827 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInitialValue(selector); 828 } 829 830 static void applyValue(CSSStyleSelector* selector, CSSValue* value) 831 { 832 ApplyPropertyDefault<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyValue(selector, value); 833 ApplyPropertyDefault<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyValue(selector, value); 834 } 835 836 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } 898 837 }; 899 838 … … 907 846 { 908 847 for (int i = 0; i < numCSSProperties; ++i) 909 m_propertyMap[i] = 0;910 911 setPropertyHandler(CSSPropertyColor, new ApplyPropertyColor<InheritFromParent>(&RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, 0, RenderStyle::initialColor));912 setPropertyHandler(CSSPropertyDirection, new ApplyPropertyDirection(&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection));913 914 setPropertyHandler(CSSPropertyBackgroundAttachment, new ApplyPropertyFillLayer<EFillAttachment>(CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,915 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment));916 setPropertyHandler(CSSPropertyBackgroundClip, new ApplyPropertyFillLayer<EFillBox>(CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,917 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip));848 m_propertyMap[i] = PropertyHandler(); 849 850 setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler()); 851 setPropertyHandler(CSSPropertyDirection, ApplyPropertyDirection<&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection>::createHandler()); 852 853 setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 854 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment>::createHandler()); 855 setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 856 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip>::createHandler()); 918 857 setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip); 919 setPropertyHandler(CSSPropertyWebkitBackgroundComposite, new ApplyPropertyFillLayer<CompositeOperator>(CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,920 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite));921 922 setPropertyHandler(CSSPropertyBackgroundImage, new ApplyPropertyFillLayer<StyleImage*>(CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,923 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage));924 925 setPropertyHandler(CSSPropertyBackgroundOrigin, new ApplyPropertyFillLayer<EFillBox>(CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,926 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin));858 setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 859 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite>::createHandler()); 860 861 setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 862 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage>::createHandler()); 863 864 setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 865 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin>::createHandler()); 927 866 setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin); 928 867 929 setPropertyHandler(CSSPropertyBackgroundPositionX, new ApplyPropertyFillLayer<Length>(CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,930 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition));931 setPropertyHandler(CSSPropertyBackgroundPositionY, new ApplyPropertyFillLayer<Length>(CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,932 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition));933 setPropertyHandler(CSSPropertyBackgroundPosition, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBackgroundPositionX), propertyHandler(CSSPropertyBackgroundPositionY)));934 935 setPropertyHandler(CSSPropertyBackgroundRepeatX, new ApplyPropertyFillLayer<EFillRepeat>(CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,936 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX));937 setPropertyHandler(CSSPropertyBackgroundRepeatY, new ApplyPropertyFillLayer<EFillRepeat>(CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,938 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY));939 setPropertyHandler(CSSPropertyBackgroundRepeat, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBackgroundRepeatX), propertyHandler(CSSPropertyBackgroundRepeatY)));940 941 setPropertyHandler(CSSPropertyBackgroundSize, new ApplyPropertyFillLayer<FillSize>(CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,942 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize));868 setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 869 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition>::createHandler()); 870 setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 871 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition>::createHandler()); 872 setPropertyHandler(CSSPropertyBackgroundPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundPositionX, CSSPropertyBackgroundPositionY>::createHandler()); 873 874 setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 875 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX>::createHandler()); 876 setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 877 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY>::createHandler()); 878 setPropertyHandler(CSSPropertyBackgroundRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler()); 879 880 setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, 881 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize>::createHandler()); 943 882 setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize); 944 883 945 setPropertyHandler(CSSPropertyWebkitMaskAttachment, new ApplyPropertyFillLayer<EFillAttachment>(CSSPropertyWebkitMaskAttachment, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,946 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment));947 setPropertyHandler(CSSPropertyWebkitMaskClip, new ApplyPropertyFillLayer<EFillBox>(CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,948 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip));949 setPropertyHandler(CSSPropertyWebkitMaskComposite, new ApplyPropertyFillLayer<CompositeOperator>(CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,950 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite));951 952 setPropertyHandler(CSSPropertyWebkitMaskImage, new ApplyPropertyFillLayer<StyleImage*>(CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,953 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage));954 955 setPropertyHandler(CSSPropertyWebkitMaskOrigin, new ApplyPropertyFillLayer<EFillBox>(CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,956 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin));957 setPropertyHandler(CSSPropertyWebkitMaskSize, new ApplyPropertyFillLayer<FillSize>(CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,958 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize));959 960 setPropertyHandler(CSSPropertyWebkitMaskPositionX, new ApplyPropertyFillLayer<Length>(CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,961 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition));962 setPropertyHandler(CSSPropertyWebkitMaskPositionY, new ApplyPropertyFillLayer<Length>(CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,963 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition));964 setPropertyHandler(CSSPropertyWebkitMaskPosition, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyWebkitMaskPositionX), propertyHandler(CSSPropertyWebkitMaskPositionY)));965 966 setPropertyHandler(CSSPropertyWebkitMaskRepeatX, new ApplyPropertyFillLayer<EFillRepeat>(CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,967 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX));968 setPropertyHandler(CSSPropertyWebkitMaskRepeatY, new ApplyPropertyFillLayer<EFillRepeat>(CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,969 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY));970 setPropertyHandler(CSSPropertyWebkitMaskRepeat, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBackgroundRepeatX), propertyHandler(CSSPropertyBackgroundRepeatY)));971 972 setPropertyHandler(CSSPropertyBackgroundColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, 0));973 setPropertyHandler(CSSPropertyBorderBottomColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color));974 setPropertyHandler(CSSPropertyBorderLeftColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color));975 setPropertyHandler(CSSPropertyBorderRightColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color));976 setPropertyHandler(CSSPropertyBorderTopColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color));977 978 setPropertyHandler(CSSPropertyBorderTopStyle, new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::borderTopStyle, &RenderStyle::setBorderTopStyle, &RenderStyle::initialBorderStyle));979 setPropertyHandler(CSSPropertyBorderRightStyle, new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::borderRightStyle, &RenderStyle::setBorderRightStyle, &RenderStyle::initialBorderStyle));980 setPropertyHandler(CSSPropertyBorderBottomStyle, new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::borderBottomStyle, &RenderStyle::setBorderBottomStyle, &RenderStyle::initialBorderStyle));981 setPropertyHandler(CSSPropertyBorderLeftStyle, new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::borderLeftStyle, &RenderStyle::setBorderLeftStyle, &RenderStyle::initialBorderStyle));982 983 setPropertyHandler(CSSPropertyBorderTopWidth, new ApplyPropertyComputeLength<unsigned short, NormalDisabled, ThicknessEnabled>(&RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth));984 setPropertyHandler(CSSPropertyBorderRightWidth, new ApplyPropertyComputeLength<unsigned short, NormalDisabled, ThicknessEnabled>(&RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth));985 setPropertyHandler(CSSPropertyBorderBottomWidth, new ApplyPropertyComputeLength<unsigned short, NormalDisabled, ThicknessEnabled>(&RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth));986 setPropertyHandler(CSSPropertyBorderLeftWidth, new ApplyPropertyComputeLength<unsigned short, NormalDisabled, ThicknessEnabled>(&RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth));987 setPropertyHandler(CSSPropertyOutlineWidth, new ApplyPropertyComputeLength<unsigned short, NormalDisabled, ThicknessEnabled>(&RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialBorderWidth));988 setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, new ApplyPropertyComputeLength<unsigned short, NormalDisabled, ThicknessEnabled>(&RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialBorderWidth));989 990 setPropertyHandler(CSSPropertyBorderTop, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBorderTopColor), propertyHandler(CSSPropertyBorderTopStyle), propertyHandler(CSSPropertyBorderTopWidth)));991 setPropertyHandler(CSSPropertyBorderRight, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBorderRightColor), propertyHandler(CSSPropertyBorderRightStyle), propertyHandler(CSSPropertyBorderRightWidth)));992 setPropertyHandler(CSSPropertyBorderBottom, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBorderBottomColor), propertyHandler(CSSPropertyBorderBottomStyle), propertyHandler(CSSPropertyBorderBottomWidth)));993 setPropertyHandler(CSSPropertyBorderLeft, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBorderLeftColor), propertyHandler(CSSPropertyBorderLeftStyle), propertyHandler(CSSPropertyBorderLeftWidth)));994 995 setPropertyHandler(CSSPropertyBorderStyle, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBorderTopStyle), propertyHandler(CSSPropertyBorderRightStyle), propertyHandler(CSSPropertyBorderBottomStyle), propertyHandler(CSSPropertyBorderLeftStyle)));996 setPropertyHandler(CSSPropertyBorderWidth, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBorderTopWidth), propertyHandler(CSSPropertyBorderRightWidth), propertyHandler(CSSPropertyBorderBottomWidth), propertyHandler(CSSPropertyBorderLeftWidth)));997 setPropertyHandler(CSSPropertyBorderColor, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBorderTopColor), propertyHandler(CSSPropertyBorderRightColor), propertyHandler(CSSPropertyBorderBottomColor), propertyHandler(CSSPropertyBorderLeftColor)));998 setPropertyHandler(CSSPropertyBorder, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBorderStyle), propertyHandler(CSSPropertyBorderWidth), propertyHandler(CSSPropertyBorderColor)));999 1000 setPropertyHandler(CSSPropertyBorderTopLeftRadius, new ApplyPropertyBorderRadius(&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius));1001 setPropertyHandler(CSSPropertyBorderTopRightRadius, new ApplyPropertyBorderRadius(&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius));1002 setPropertyHandler(CSSPropertyBorderBottomLeftRadius, new ApplyPropertyBorderRadius(&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius));1003 setPropertyHandler(CSSPropertyBorderBottomRightRadius, new ApplyPropertyBorderRadius(&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius));1004 setPropertyHandler(CSSPropertyBorderRadius, new ApplyPropertyExpanding<ExpandValue>(propertyHandler(CSSPropertyBorderTopLeftRadius), propertyHandler(CSSPropertyBorderTopRightRadius), propertyHandler(CSSPropertyBorderBottomLeftRadius), propertyHandler(CSSPropertyBorderBottomRightRadius)));884 setPropertyHandler(CSSPropertyWebkitMaskAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyWebkitMaskAttachment, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 885 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment>::createHandler()); 886 setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 887 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip>::createHandler()); 888 setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 889 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite>::createHandler()); 890 891 setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 892 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage>::createHandler()); 893 894 setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 895 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin>::createHandler()); 896 setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 897 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize>::createHandler()); 898 899 setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 900 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition>::createHandler()); 901 setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 902 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition>::createHandler()); 903 setPropertyHandler(CSSPropertyWebkitMaskPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMaskPositionX, CSSPropertyWebkitMaskPositionY>::createHandler()); 904 905 setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 906 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX>::createHandler()); 907 setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, 908 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY>::createHandler()); 909 setPropertyHandler(CSSPropertyWebkitMaskRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler()); 910 911 setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler()); 912 setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler()); 913 setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler()); 914 setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler()); 915 setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler()); 916 917 setPropertyHandler(CSSPropertyBorderTopStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderTopStyle, EBorderStyle, &RenderStyle::setBorderTopStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler()); 918 setPropertyHandler(CSSPropertyBorderRightStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderRightStyle, EBorderStyle, &RenderStyle::setBorderRightStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler()); 919 setPropertyHandler(CSSPropertyBorderBottomStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderBottomStyle, EBorderStyle, &RenderStyle::setBorderBottomStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler()); 920 setPropertyHandler(CSSPropertyBorderLeftStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderLeftStyle, EBorderStyle, &RenderStyle::setBorderLeftStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler()); 921 922 setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 923 setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 924 setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 925 setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 926 setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 927 setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler()); 928 929 setPropertyHandler(CSSPropertyBorderTop, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderTopStyle, CSSPropertyBorderTopWidth>::createHandler()); 930 setPropertyHandler(CSSPropertyBorderRight, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderRightColor, CSSPropertyBorderRightStyle, CSSPropertyBorderRightWidth>::createHandler()); 931 setPropertyHandler(CSSPropertyBorderBottom, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderBottomColor, CSSPropertyBorderBottomStyle, CSSPropertyBorderBottomWidth>::createHandler()); 932 setPropertyHandler(CSSPropertyBorderLeft, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderLeftColor, CSSPropertyBorderLeftStyle, CSSPropertyBorderLeftWidth>::createHandler()); 933 934 setPropertyHandler(CSSPropertyBorderStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle>::createHandler()); 935 setPropertyHandler(CSSPropertyBorderWidth, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopWidth, CSSPropertyBorderRightWidth, CSSPropertyBorderBottomWidth, CSSPropertyBorderLeftWidth>::createHandler()); 936 setPropertyHandler(CSSPropertyBorderColor, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderRightColor, CSSPropertyBorderBottomColor, CSSPropertyBorderLeftColor>::createHandler()); 937 setPropertyHandler(CSSPropertyBorder, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderStyle, CSSPropertyBorderWidth, CSSPropertyBorderColor>::createHandler()); 938 939 setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler()); 940 setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler()); 941 setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler()); 942 setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler()); 943 setPropertyHandler(CSSPropertyBorderRadius, ApplyPropertyExpanding<ExpandValue, CSSPropertyBorderTopLeftRadius, CSSPropertyBorderTopRightRadius, CSSPropertyBorderBottomLeftRadius, CSSPropertyBorderBottomRightRadius>::createHandler()); 1005 944 setPropertyHandler(CSSPropertyWebkitBorderRadius, CSSPropertyBorderRadius); 1006 945 1007 setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, new ApplyPropertyComputeLength<short>(&RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing));1008 setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, new ApplyPropertyComputeLength<short>(&RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing));1009 setPropertyHandler(CSSPropertyBorderSpacing, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyWebkitBorderHorizontalSpacing), propertyHandler(CSSPropertyWebkitBorderVerticalSpacing)));1010 1011 setPropertyHandler(CSSPropertyLetterSpacing, new ApplyPropertyComputeLength<int, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>(&RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterWordSpacing));1012 setPropertyHandler(CSSPropertyWordSpacing, new ApplyPropertyComputeLength<int, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>(&RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing));1013 1014 setPropertyHandler(CSSPropertyCursor, new ApplyPropertyCursor());1015 1016 setPropertyHandler(CSSPropertyCounterIncrement, new ApplyPropertyCounter<Increment>());1017 setPropertyHandler(CSSPropertyCounterReset, new ApplyPropertyCounter<Reset>());946 setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler()); 947 setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing>::createHandler()); 948 setPropertyHandler(CSSPropertyBorderSpacing, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitBorderHorizontalSpacing, CSSPropertyWebkitBorderVerticalSpacing>::createHandler()); 949 950 setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength<int, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler()); 951 setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<int, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler()); 952 953 setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler()); 954 955 setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::createHandler()); 956 setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler()); 1018 957 1019 958 #if ENABLE(CSS3_FLEXBOX) 1020 setPropertyHandler(CSSPropertyWebkitFlexOrder, new ApplyPropertyDefault<int>(&RenderStyle::flexOrder, &RenderStyle::setFlexOrder, &RenderStyle::initialFlexOrder));1021 setPropertyHandler(CSSPropertyWebkitFlexPack, new ApplyPropertyDefault<EFlexPack>(&RenderStyle::flexPack, &RenderStyle::setFlexPack, &RenderStyle::initialFlexPack));1022 setPropertyHandler(CSSPropertyWebkitFlexAlign, new ApplyPropertyDefault<EFlexAlign>(&RenderStyle::flexAlign, &RenderStyle::setFlexAlign, &RenderStyle::initialFlexAlign));1023 setPropertyHandler(CSSPropertyWebkitFlexFlow, new ApplyPropertyDefault<EFlexFlow>(&RenderStyle::flexFlow, &RenderStyle::setFlexFlow, &RenderStyle::initialFlexFlow));959 setPropertyHandler(CSSPropertyWebkitFlexOrder, ApplyPropertyDefault<int, &RenderStyle::flexOrder, int, &RenderStyle::setFlexOrder, int, &RenderStyle::initialFlexOrder>::createHandler()); 960 setPropertyHandler(CSSPropertyWebkitFlexPack, ApplyPropertyDefault<EFlexPack, &RenderStyle::flexPack, EFlexPack, &RenderStyle::setFlexPack, EFlexPack, &RenderStyle::initialFlexPack>::createHandler()); 961 setPropertyHandler(CSSPropertyWebkitFlexAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexAlign, EFlexAlign, &RenderStyle::setFlexAlign, EFlexAlign, &RenderStyle::initialFlexAlign>::createHandler()); 962 setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyDefault<EFlexFlow, &RenderStyle::flexFlow, EFlexFlow, &RenderStyle::setFlexFlow, EFlexFlow, &RenderStyle::initialFlexFlow>::createHandler()); 1024 963 #endif 1025 964 1026 setPropertyHandler(CSSPropertyFontStyle, new ApplyPropertyFont<FontItalic>(&FontDescription::italic, &FontDescription::setItalic, FontItalicOff));1027 setPropertyHandler(CSSPropertyFontVariant, new ApplyPropertyFont<FontSmallCaps>(&FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff));1028 setPropertyHandler(CSSPropertyTextRendering, new ApplyPropertyFont<TextRenderingMode>(&FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering));1029 setPropertyHandler(CSSPropertyWebkitFontSmoothing, new ApplyPropertyFont<FontSmoothingMode>(&FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing));1030 setPropertyHandler(CSSPropertyWebkitTextOrientation, new ApplyPropertyFont<TextOrientation>(&FontDescription::textOrientation, &FontDescription::setTextOrientation, RenderStyle::initialTextOrientation()));1031 setPropertyHandler(CSSPropertyFontWeight, new ApplyPropertyFontWeight());1032 1033 setPropertyHandler(CSSPropertyOutlineStyle, new ApplyPropertyExpanding<ExpandValue>(new ApplyPropertyDefault<OutlineIsAuto>(&RenderStyle::outlineStyleIsAuto, &RenderStyle::setOutlineStyleIsAuto, &RenderStyle::initialOutlineStyleIsAuto), new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::outlineStyle, &RenderStyle::setOutlineStyle, &RenderStyle::initialBorderStyle)));1034 setPropertyHandler(CSSPropertyOutlineColor, new ApplyPropertyColor<InheritFromParent>(&RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color));1035 setPropertyHandler(CSSPropertyOutlineOffset, new ApplyPropertyComputeLength<int>(&RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset));1036 1037 setPropertyHandler(CSSPropertyOverflowX, new ApplyPropertyDefault<EOverflow>(&RenderStyle::overflowX, &RenderStyle::setOverflowX, &RenderStyle::initialOverflowX));1038 setPropertyHandler(CSSPropertyOverflowY, new ApplyPropertyDefault<EOverflow>(&RenderStyle::overflowY, &RenderStyle::setOverflowY, &RenderStyle::initialOverflowY));1039 setPropertyHandler(CSSPropertyOverflow, new ApplyPropertyExpanding<ExpandValue>(propertyHandler(CSSPropertyOverflowX), propertyHandler(CSSPropertyOverflowY)));1040 1041 setPropertyHandler(CSSPropertyWebkitColumnRuleColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color));1042 setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color));1043 setPropertyHandler(CSSPropertyWebkitTextFillColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color));1044 setPropertyHandler(CSSPropertyWebkitTextStrokeColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color));1045 1046 setPropertyHandler(CSSPropertyTop, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset));1047 setPropertyHandler(CSSPropertyRight, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::right, &RenderStyle::setRight, &RenderStyle::initialOffset));1048 setPropertyHandler(CSSPropertyBottom, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::bottom, &RenderStyle::setBottom, &RenderStyle::initialOffset));1049 setPropertyHandler(CSSPropertyLeft, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset));1050 1051 setPropertyHandler(CSSPropertyWidth, new ApplyPropertyLength<AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexWidth>(&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize));1052 setPropertyHandler(CSSPropertyHeight, new ApplyPropertyLength<AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexHeight>(&RenderStyle::height, &RenderStyle::setHeight, &RenderStyle::initialSize));1053 1054 setPropertyHandler(CSSPropertyTextIndent, new ApplyPropertyLength<>(&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent));1055 1056 setPropertyHandler(CSSPropertyListStyleImage, new ApplyPropertyStyleImage(&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage));1057 setPropertyHandler(CSSPropertyListStylePosition, new ApplyPropertyDefault<EListStylePosition>(&RenderStyle::listStylePosition, &RenderStyle::setListStylePosition, &RenderStyle::initialListStylePosition));1058 setPropertyHandler(CSSPropertyListStyleType, new ApplyPropertyDefault<EListStyleType>(&RenderStyle::listStyleType, &RenderStyle::setListStyleType, &RenderStyle::initialListStyleType));1059 setPropertyHandler(CSSPropertyListStyle, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyListStyleType), propertyHandler(CSSPropertyListStyleImage), propertyHandler(CSSPropertyListStylePosition)));1060 1061 setPropertyHandler(CSSPropertyMaxHeight, new ApplyPropertyLength<AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>(&RenderStyle::maxHeight, &RenderStyle::setMaxHeight, &RenderStyle::initialMaxSize));1062 setPropertyHandler(CSSPropertyMaxWidth, new ApplyPropertyLength<AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>(&RenderStyle::maxWidth, &RenderStyle::setMaxWidth, &RenderStyle::initialMaxSize));1063 setPropertyHandler(CSSPropertyMinHeight, new ApplyPropertyLength<AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>(&RenderStyle::minHeight, &RenderStyle::setMinHeight, &RenderStyle::initialMinSize));1064 setPropertyHandler(CSSPropertyMinWidth, new ApplyPropertyLength<AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>(&RenderStyle::minWidth, &RenderStyle::setMinWidth, &RenderStyle::initialMinSize));1065 1066 setPropertyHandler(CSSPropertyMarginTop, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::marginTop, &RenderStyle::setMarginTop, &RenderStyle::initialMargin));1067 setPropertyHandler(CSSPropertyMarginRight, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::marginRight, &RenderStyle::setMarginRight, &RenderStyle::initialMargin));1068 setPropertyHandler(CSSPropertyMarginBottom, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin));1069 setPropertyHandler(CSSPropertyMarginLeft, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin));1070 setPropertyHandler(CSSPropertyMargin, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyMarginTop), propertyHandler(CSSPropertyMarginRight), propertyHandler(CSSPropertyMarginBottom), propertyHandler(CSSPropertyMarginLeft)));1071 1072 setPropertyHandler(CSSPropertyWebkitMarginBeforeCollapse, new ApplyPropertyDefault<EMarginCollapse>(&RenderStyle::marginBeforeCollapse, &RenderStyle::setMarginBeforeCollapse, &RenderStyle::initialMarginBeforeCollapse));1073 setPropertyHandler(CSSPropertyWebkitMarginAfterCollapse, new ApplyPropertyDefault<EMarginCollapse>(&RenderStyle::marginAfterCollapse, &RenderStyle::setMarginAfterCollapse, &RenderStyle::initialMarginAfterCollapse));965 setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler()); 966 setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler()); 967 setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler()); 968 setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler()); 969 setPropertyHandler(CSSPropertyWebkitTextOrientation, ApplyPropertyFont<TextOrientation, &FontDescription::textOrientation, &FontDescription::setTextOrientation, TextOrientationVerticalRight>::createHandler()); 970 setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler()); 971 972 setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler()); 973 setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler()); 974 setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength<int, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset>::createHandler()); 975 976 setPropertyHandler(CSSPropertyOverflowX, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowX, EOverflow, &RenderStyle::setOverflowX, EOverflow, &RenderStyle::initialOverflowX>::createHandler()); 977 setPropertyHandler(CSSPropertyOverflowY, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowY, EOverflow, &RenderStyle::setOverflowY, EOverflow, &RenderStyle::initialOverflowY>::createHandler()); 978 setPropertyHandler(CSSPropertyOverflow, ApplyPropertyExpanding<ExpandValue, CSSPropertyOverflowX, CSSPropertyOverflowY>::createHandler()); 979 980 setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler()); 981 setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler()); 982 setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler()); 983 setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler()); 984 985 setPropertyHandler(CSSPropertyTop, ApplyPropertyLength<&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset, AutoEnabled>::createHandler()); 986 setPropertyHandler(CSSPropertyRight, ApplyPropertyLength<&RenderStyle::right, &RenderStyle::setRight, &RenderStyle::initialOffset, AutoEnabled>::createHandler()); 987 setPropertyHandler(CSSPropertyBottom, ApplyPropertyLength<&RenderStyle::bottom, &RenderStyle::setBottom, &RenderStyle::initialOffset, AutoEnabled>::createHandler()); 988 setPropertyHandler(CSSPropertyLeft, ApplyPropertyLength<&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset, AutoEnabled>::createHandler()); 989 990 setPropertyHandler(CSSPropertyWidth, ApplyPropertyLength<&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexWidth>::createHandler()); 991 setPropertyHandler(CSSPropertyHeight, ApplyPropertyLength<&RenderStyle::height, &RenderStyle::setHeight, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexHeight>::createHandler()); 992 993 setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler()); 994 995 setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler()); 996 setPropertyHandler(CSSPropertyListStylePosition, ApplyPropertyDefault<EListStylePosition, &RenderStyle::listStylePosition, EListStylePosition, &RenderStyle::setListStylePosition, EListStylePosition, &RenderStyle::initialListStylePosition>::createHandler()); 997 setPropertyHandler(CSSPropertyListStyleType, ApplyPropertyDefault<EListStyleType, &RenderStyle::listStyleType, EListStyleType, &RenderStyle::setListStyleType, EListStyleType, &RenderStyle::initialListStyleType>::createHandler()); 998 setPropertyHandler(CSSPropertyListStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyListStyleType, CSSPropertyListStyleImage, CSSPropertyListStylePosition>::createHandler()); 999 1000 setPropertyHandler(CSSPropertyMaxHeight, ApplyPropertyLength<&RenderStyle::maxHeight, &RenderStyle::setMaxHeight, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler()); 1001 setPropertyHandler(CSSPropertyMaxWidth, ApplyPropertyLength<&RenderStyle::maxWidth, &RenderStyle::setMaxWidth, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler()); 1002 setPropertyHandler(CSSPropertyMinHeight, ApplyPropertyLength<&RenderStyle::minHeight, &RenderStyle::setMinHeight, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler()); 1003 setPropertyHandler(CSSPropertyMinWidth, ApplyPropertyLength<&RenderStyle::minWidth, &RenderStyle::setMinWidth, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler()); 1004 1005 setPropertyHandler(CSSPropertyMarginTop, ApplyPropertyLength<&RenderStyle::marginTop, &RenderStyle::setMarginTop, &RenderStyle::initialMargin, AutoEnabled>::createHandler()); 1006 setPropertyHandler(CSSPropertyMarginRight, ApplyPropertyLength<&RenderStyle::marginRight, &RenderStyle::setMarginRight, &RenderStyle::initialMargin, AutoEnabled>::createHandler()); 1007 setPropertyHandler(CSSPropertyMarginBottom, ApplyPropertyLength<&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin, AutoEnabled>::createHandler()); 1008 setPropertyHandler(CSSPropertyMarginLeft, ApplyPropertyLength<&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin, AutoEnabled>::createHandler()); 1009 setPropertyHandler(CSSPropertyMargin, ApplyPropertyExpanding<SuppressValue, CSSPropertyMarginTop, CSSPropertyMarginRight, CSSPropertyMarginBottom, CSSPropertyMarginLeft>::createHandler()); 1010 1011 setPropertyHandler(CSSPropertyWebkitMarginBeforeCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginBeforeCollapse, EMarginCollapse, &RenderStyle::setMarginBeforeCollapse, EMarginCollapse, &RenderStyle::initialMarginBeforeCollapse>::createHandler()); 1012 setPropertyHandler(CSSPropertyWebkitMarginAfterCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginAfterCollapse, EMarginCollapse, &RenderStyle::setMarginAfterCollapse, EMarginCollapse, &RenderStyle::initialMarginAfterCollapse>::createHandler()); 1074 1013 setPropertyHandler(CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBeforeCollapse); 1075 1014 setPropertyHandler(CSSPropertyWebkitMarginBottomCollapse, CSSPropertyWebkitMarginAfterCollapse); 1076 setPropertyHandler(CSSPropertyWebkitMarginCollapse, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyWebkitMarginBeforeCollapse), propertyHandler(CSSPropertyWebkitMarginAfterCollapse))); 1077 1078 setPropertyHandler(CSSPropertyPaddingTop, new ApplyPropertyLength<>(&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding)); 1079 setPropertyHandler(CSSPropertyPaddingRight, new ApplyPropertyLength<>(&RenderStyle::paddingRight, &RenderStyle::setPaddingRight, &RenderStyle::initialPadding)); 1080 setPropertyHandler(CSSPropertyPaddingBottom, new ApplyPropertyLength<>(&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding)); 1081 setPropertyHandler(CSSPropertyPaddingLeft, new ApplyPropertyLength<>(&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding)); 1082 setPropertyHandler(CSSPropertyPadding, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyPaddingTop), propertyHandler(CSSPropertyPaddingRight), propertyHandler(CSSPropertyPaddingBottom), propertyHandler(CSSPropertyPaddingLeft))); 1083 1084 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, new ApplyPropertyLength<>(&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX)); 1085 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginY, new ApplyPropertyLength<>(&RenderStyle::perspectiveOriginY, &RenderStyle::setPerspectiveOriginY, &RenderStyle::initialPerspectiveOriginY)); 1086 setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyWebkitPerspectiveOriginX), propertyHandler(CSSPropertyWebkitPerspectiveOriginY))); 1087 setPropertyHandler(CSSPropertyWebkitTransformOriginX, new ApplyPropertyLength<>(&RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX, &RenderStyle::initialTransformOriginX)); 1088 setPropertyHandler(CSSPropertyWebkitTransformOriginY, new ApplyPropertyLength<>(&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY)); 1089 setPropertyHandler(CSSPropertyWebkitTransformOriginZ, new ApplyPropertyComputeLength<float>(&RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ)); 1090 setPropertyHandler(CSSPropertyWebkitTransformOrigin, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyWebkitTransformOriginX), propertyHandler(CSSPropertyWebkitTransformOriginY), propertyHandler(CSSPropertyWebkitTransformOriginZ))); 1091 1092 setPropertyHandler(CSSPropertyWebkitAnimationDelay, new ApplyPropertyAnimation<double>(&Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations)); 1093 setPropertyHandler(CSSPropertyWebkitAnimationDirection, new ApplyPropertyAnimation<Animation::AnimationDirection>(&Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSStyleSelector::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations)); 1094 setPropertyHandler(CSSPropertyWebkitAnimationDuration, new ApplyPropertyAnimation<double>(&Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations)); 1095 setPropertyHandler(CSSPropertyWebkitAnimationFillMode, new ApplyPropertyAnimation<unsigned>(&Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSStyleSelector::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations)); 1096 setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, new ApplyPropertyAnimation<int>(&Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSStyleSelector::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations)); 1097 setPropertyHandler(CSSPropertyWebkitAnimationName, new ApplyPropertyAnimation<const String&>(&Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSStyleSelector::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations)); 1098 setPropertyHandler(CSSPropertyWebkitAnimationPlayState, new ApplyPropertyAnimation<EAnimPlayState>(&Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSStyleSelector::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations)); 1099 setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, new ApplyPropertyAnimation<const PassRefPtr<TimingFunction> >(&Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations)); 1100 1101 setPropertyHandler(CSSPropertyWebkitTransitionDelay, new ApplyPropertyAnimation<double>(&Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions)); 1102 setPropertyHandler(CSSPropertyWebkitTransitionDuration, new ApplyPropertyAnimation<double>(&Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions)); 1103 setPropertyHandler(CSSPropertyWebkitTransitionProperty, new ApplyPropertyAnimation<int>(&Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSStyleSelector::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions)); 1104 setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, new ApplyPropertyAnimation<const PassRefPtr<TimingFunction> >(&Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions)); 1105 1106 1107 setPropertyHandler(CSSPropertyWebkitColumnCount, new ApplyPropertyAuto<unsigned short>(&RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount)); 1108 setPropertyHandler(CSSPropertyWebkitColumnGap, new ApplyPropertyAuto<float, ComputeLength, CSSValueNormal>(&RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap)); 1109 setPropertyHandler(CSSPropertyWebkitColumnWidth, new ApplyPropertyAuto<float, ComputeLength>(&RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth)); 1110 setPropertyHandler(CSSPropertyWebkitColumns, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyWebkitColumnWidth), propertyHandler(CSSPropertyWebkitColumnCount))); 1111 1112 setPropertyHandler(CSSPropertyWebkitHighlight, new ApplyPropertyString<MapNoneToNull>(&RenderStyle::highlight, &RenderStyle::setHighlight, &RenderStyle::initialHighlight)); 1113 setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, new ApplyPropertyString<MapAutoToNull>(&RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString)); 1114 1115 setPropertyHandler(CSSPropertyWebkitTextCombine, new ApplyPropertyDefault<TextCombine>(&RenderStyle::textCombine, &RenderStyle::setTextCombine, &RenderStyle::initialTextCombine)); 1116 setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, new ApplyPropertyDefault<TextEmphasisPosition>(&RenderStyle::textEmphasisPosition, &RenderStyle::setTextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition)); 1117 setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, new ApplyPropertyTextEmphasisStyle()); 1118 1119 setPropertyHandler(CSSPropertyZIndex, new ApplyPropertyAuto<int>(&RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex)); 1015 setPropertyHandler(CSSPropertyWebkitMarginCollapse, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse>::createHandler()); 1016 1017 setPropertyHandler(CSSPropertyPaddingTop, ApplyPropertyLength<&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding>::createHandler()); 1018 setPropertyHandler(CSSPropertyPaddingRight, ApplyPropertyLength<&RenderStyle::paddingRight, &RenderStyle::setPaddingRight, &RenderStyle::initialPadding>::createHandler()); 1019 setPropertyHandler(CSSPropertyPaddingBottom, ApplyPropertyLength<&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding>::createHandler()); 1020 setPropertyHandler(CSSPropertyPaddingLeft, ApplyPropertyLength<&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding>::createHandler()); 1021 setPropertyHandler(CSSPropertyPadding, ApplyPropertyExpanding<SuppressValue, CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft>::createHandler()); 1022 1023 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, ApplyPropertyLength<&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX>::createHandler()); 1024 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginY, ApplyPropertyLength<&RenderStyle::perspectiveOriginY, &RenderStyle::setPerspectiveOriginY, &RenderStyle::initialPerspectiveOriginY>::createHandler()); 1025 setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler()); 1026 setPropertyHandler(CSSPropertyWebkitTransformOriginX, ApplyPropertyLength<&RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX, &RenderStyle::initialTransformOriginX>::createHandler()); 1027 setPropertyHandler(CSSPropertyWebkitTransformOriginY, ApplyPropertyLength<&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY>::createHandler()); 1028 setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler()); 1029 setPropertyHandler(CSSPropertyWebkitTransformOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitTransformOriginX, CSSPropertyWebkitTransformOriginY, CSSPropertyWebkitTransformOriginZ>::createHandler()); 1030 1031 setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler()); 1032 setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSStyleSelector::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler()); 1033 setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler()); 1034 setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSStyleSelector::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler()); 1035 setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<int, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSStyleSelector::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler()); 1036 setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSStyleSelector::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler()); 1037 setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSStyleSelector::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler()); 1038 setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler()); 1039 1040 setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler()); 1041 setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler()); 1042 setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<int, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSStyleSelector::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler()); 1043 setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler()); 1044 1045 setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler()); 1046 setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler()); 1047 setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler()); 1048 setPropertyHandler(CSSPropertyWebkitColumns, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitColumnWidth, CSSPropertyWebkitColumnCount>::createHandler()); 1049 1050 setPropertyHandler(CSSPropertyWebkitHighlight, ApplyPropertyString<MapNoneToNull, &RenderStyle::highlight, &RenderStyle::setHighlight, &RenderStyle::initialHighlight>::createHandler()); 1051 setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler()); 1052 1053 setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler()); 1054 setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler()); 1055 setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler()); 1056 1057 setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler()); 1120 1058 } 1121 1059 -
trunk/Source/WebCore/css/CSSStyleApplyProperty.h
r96168 r98310 34 34 class CSSStyleSelector; 35 35 class CSSValue; 36 class ApplyPropertyBase {37 WTF_MAKE_NONCOPYABLE(ApplyPropertyBase); 38 WTF_MAKE_FAST_ALLOCATED; 36 class CSSStyleApplyProperty; 37 38 class PropertyHandler { 39 39 public: 40 ApplyPropertyBase() { } 41 virtual ~ApplyPropertyBase() { } 42 virtual void applyInheritValue(CSSStyleSelector*) const = 0; 43 virtual void applyInitialValue(CSSStyleSelector*) const = 0; 44 virtual void applyValue(CSSStyleSelector*, CSSValue*) const = 0; 40 typedef void (*InheritFunction)(CSSStyleSelector*); 41 typedef void (*InitialFunction)(CSSStyleSelector*); 42 typedef void (*ApplyFunction)(CSSStyleSelector*, CSSValue*); 43 PropertyHandler() : m_inherit(0), m_initial(0), m_apply(0) { } 44 PropertyHandler(InheritFunction inherit, InitialFunction initial, ApplyFunction apply) : m_inherit(inherit), m_initial(initial), m_apply(apply) { } 45 void applyInheritValue(CSSStyleSelector* selector) const { ASSERT(m_inherit); (*m_inherit)(selector); } 46 void applyInitialValue(CSSStyleSelector* selector) const { ASSERT(m_initial); (*m_initial)(selector); } 47 void applyValue(CSSStyleSelector* selector, CSSValue* value) const { ASSERT(m_apply); (*m_apply)(selector, value); } 48 bool isValid() const { return m_inherit && m_initial && m_apply; } 49 InheritFunction inheritFunction() const { return m_inherit; } 50 InitialFunction initialFunction() { return m_initial; } 51 ApplyFunction applyFunction() { return m_apply; } 52 private: 53 InheritFunction m_inherit; 54 InitialFunction m_initial; 55 ApplyFunction m_apply; 45 56 }; 46 57 … … 50 61 static const CSSStyleApplyProperty& sharedCSSStyleApplyProperty(); 51 62 52 ApplyPropertyBase*propertyHandler(CSSPropertyID property) const63 const PropertyHandler& propertyHandler(CSSPropertyID property) const 53 64 { 54 65 ASSERT(valid(property)); … … 68 79 } 69 80 70 void setPropertyHandler(CSSPropertyID property, ApplyPropertyBase* value)81 void setPropertyHandler(CSSPropertyID property, PropertyHandler handler) 71 82 { 72 83 ASSERT(valid(property)); 73 ASSERT(!propertyHandler(property) );74 m_propertyMap[index(property)] = value;84 ASSERT(!propertyHandler(property).isValid()); 85 m_propertyMap[index(property)] = handler; 75 86 } 76 87 … … 79 90 ASSERT(valid(newProperty)); 80 91 ASSERT(valid(equivalentProperty)); 81 ASSERT(!propertyHandler(newProperty) );92 ASSERT(!propertyHandler(newProperty).isValid()); 82 93 m_propertyMap[index(newProperty)] = m_propertyMap[index(equivalentProperty)]; 83 94 } 84 95 85 ApplyPropertyBase*m_propertyMap[numCSSProperties];96 PropertyHandler m_propertyMap[numCSSProperties]; 86 97 }; 87 98 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r97962 r98310 2363 2363 2364 2364 // check lookup table for implementations and use when available 2365 if (ApplyPropertyBase* handler = m_applyProperty.propertyHandler(property)) { 2365 const PropertyHandler& handler = m_applyProperty.propertyHandler(property); 2366 if (handler.isValid()) { 2366 2367 if (isInherit) 2367 handler ->applyInheritValue(this);2368 handler.applyInheritValue(this); 2368 2369 else if (isInitial) 2369 handler ->applyInitialValue(this);2370 handler.applyInitialValue(this); 2370 2371 else 2371 handler ->applyValue(this, value);2372 handler.applyValue(this, value); 2372 2373 return; 2373 2374 } -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r97712 r98310 1519 1519 1520 1520 // Color accessors are all private to make sure callers use visitedDependentColor instead to access them. 1521 const Color& invalidColor() const { static Color invalid; return invalid; } 1521 1522 const Color& borderLeftColor() const { return surround->border.left().color(); } 1522 1523 const Color& borderRightColor() const { return surround->border.right().color(); }
Note: See TracChangeset
for help on using the changeset viewer.