7daf3d0a2b6a9495132c2831296ebbe31c023cb8
[WebKit-https.git] / Source / WebCore / css / CSSStyleApplyProperty.cpp
1 /*
2  * Copyright (C) 2011 Google Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1.  Redistributions of source code must retain the above copyright
8  *     notice, this list of conditions and the following disclaimer.
9  * 2.  Redistributions in binary form must reproduce the above copyright
10  *     notice, this list of conditions and the following disclaimer in the
11  *     documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16  * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  */
24
25 #include "config.h"
26 #include "CSSStyleApplyProperty.h"
27
28 #include "CSSCursorImageValue.h"
29 #include "CSSFlexValue.h"
30 #include "CSSPrimitiveValueMappings.h"
31 #include "CSSStyleSelector.h"
32 #include "CSSValueList.h"
33 #include "CursorList.h"
34 #include "Document.h"
35 #include "Element.h"
36 #include "Pair.h"
37 #include "RenderStyle.h"
38 #include <wtf/StdLibExtras.h>
39 #include <wtf/UnusedParam.h>
40
41 using namespace std;
42
43 namespace WebCore {
44
45 enum ExpandValueBehavior {SuppressValue = 0, ExpandValue};
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)
103     {
104         if (!expandValue)
105             return;
106
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)
132     {
133         if (value->isPrimitiveValue())
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     }
152 };
153
154 enum AutoValueType {Number = 0, ComputeLength};
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)
164     {
165         if (hasAuto(selector->parentStyle()))
166             setAuto(selector->style());
167         else
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)
174     {
175         if (!value->isPrimitiveValue())
176             return;
177
178         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
179         if (primitiveValue->getIdent() == autoIdentity)
180             setAuto(selector->style());
181         else if (valueType == Number)
182             setValue(selector->style(), *primitiveValue);
183         else if (valueType == ComputeLength)
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); }
188 };
189
190 enum ColorInherit {NoInheritFromParent = 0, InheritFromParent};
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)
202     {
203         // Visited link style can never explicitly inherit from parent visited link style so no separate getters are needed.
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)
214     {
215         if (!value->isPrimitiveValue())
216             return;
217
218         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
219         if (inheritColorFromParent && primitiveValue->getIdent() == CSSValueCurrentcolor)
220             applyInheritValue(selector);
221         else {
222             if (selector->applyPropertyToRegularStyle())
223                 (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)
230     {
231         if (selector->applyPropertyToRegularStyle())
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);
246         Element* element = selector->element();
247         if (element && selector->element() == element->document()->documentElement())
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);
255     }
256 };
257
258 enum LengthAuto { AutoDisabled = 0, AutoEnabled };
259 enum LengthIntrinsic { IntrinsicDisabled = 0, IntrinsicEnabled };
260 enum LengthMinIntrinsic { MinIntrinsicDisabled = 0, MinIntrinsicEnabled };
261 enum LengthNone { NoneDisabled = 0, NoneEnabled };
262 enum LengthUndefined { UndefinedDisabled = 0, UndefinedEnabled };
263 enum LengthFlexDirection { FlexDirectionDisabled = 0, FlexWidth, FlexHeight };
264 template <Length (RenderStyle::*getterFunction)() const,
265           void (RenderStyle::*setterFunction)(Length),
266           Length (*initialFunction)(),
267           LengthAuto autoEnabled = AutoDisabled,
268           LengthIntrinsic intrinsicEnabled = IntrinsicDisabled,
269           LengthMinIntrinsic minIntrinsicEnabled = MinIntrinsicDisabled,
270           LengthNone noneEnabled = NoneDisabled,
271           LengthUndefined noneUndefined = UndefinedDisabled,
272           LengthFlexDirection flexDirection = FlexDirectionDisabled>
273 class ApplyPropertyLength {
274 public:
275     static void setValue(RenderStyle* style, Length value) { (style->*setterFunction)(value); }
276     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
277     {
278         if (!value->isPrimitiveValue()) {
279             if (!flexDirection || !value->isFlexValue())
280                 return;
281
282             CSSFlexValue* flexValue = static_cast<CSSFlexValue*>(value);
283             value = flexValue->preferredSize();
284
285             if (flexDirection == FlexWidth) {
286                 selector->style()->setFlexboxWidthPositiveFlex(flexValue->positiveFlex());
287                 selector->style()->setFlexboxWidthNegativeFlex(flexValue->negativeFlex());
288             } else if (flexDirection == FlexHeight) {
289                 selector->style()->setFlexboxHeightPositiveFlex(flexValue->positiveFlex());
290                 selector->style()->setFlexboxHeightNegativeFlex(flexValue->negativeFlex());
291             }
292         }
293
294         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
295         if (noneEnabled && primitiveValue->getIdent() == CSSValueNone)
296             if (noneUndefined)
297                 setValue(selector->style(), Length(Undefined));
298             else
299                 setValue(selector->style(), Length());
300         else if (intrinsicEnabled && primitiveValue->getIdent() == CSSValueIntrinsic)
301             setValue(selector->style(), Length(Intrinsic));
302         else if (minIntrinsicEnabled && primitiveValue->getIdent() == CSSValueMinIntrinsic)
303             setValue(selector->style(), Length(MinIntrinsic));
304         else if (autoEnabled && primitiveValue->getIdent() == CSSValueAuto)
305             setValue(selector->style(), Length());
306         else {
307             int type = primitiveValue->primitiveType();
308             if (CSSPrimitiveValue::isUnitTypeLength(type)) {
309                 Length length = primitiveValue->computeLength<Length>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());
310                 length.setQuirk(primitiveValue->isQuirkValue());
311                 setValue(selector->style(), length);
312             } else if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
313                 setValue(selector->style(), Length(primitiveValue->getDoubleValue(), Percent));
314         }
315     }
316
317     static PropertyHandler createHandler()
318     {
319         PropertyHandler handler = ApplyPropertyDefaultBase<Length, getterFunction, Length, setterFunction, Length, initialFunction>::createHandler();
320         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
321     }
322 };
323
324 enum StringIdentBehavior { NothingMapsToNull = 0, MapNoneToNull, MapAutoToNull };
325 template <StringIdentBehavior identBehavior, const AtomicString& (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(const AtomicString&), const AtomicString& (*initialFunction)()>
326 class ApplyPropertyString {
327 public:
328     static void setValue(RenderStyle* style, const AtomicString& value) { (style->*setterFunction)(value); }
329     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
330     {
331         if (!value->isPrimitiveValue())
332             return;
333         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
334         if ((identBehavior == MapNoneToNull && primitiveValue->getIdent() == CSSValueNone)
335             || (identBehavior == MapAutoToNull && primitiveValue->getIdent() == CSSValueAuto))
336             setValue(selector->style(), nullAtom);
337         else
338             setValue(selector->style(), primitiveValue->getStringValue());
339     }
340     static PropertyHandler createHandler()
341     {
342         PropertyHandler handler = ApplyPropertyDefaultBase<const AtomicString&, getterFunction, const AtomicString&, setterFunction, const AtomicString&, initialFunction>::createHandler();
343         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
344     }
345 };
346
347 template <LengthSize (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(LengthSize), LengthSize (*initialFunction)()>
348 class ApplyPropertyBorderRadius {
349 public:
350     static void setValue(RenderStyle* style, LengthSize value) { (style->*setterFunction)(value); }
351     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
352     {
353         if (!value->isPrimitiveValue())
354             return;
355
356         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
357         Pair* pair = primitiveValue->getPairValue();
358         if (!pair || !pair->first() || !pair->second())
359             return;
360
361         Length radiusWidth;
362         Length radiusHeight;
363         if (pair->first()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE)
364             radiusWidth = Length(pair->first()->getDoubleValue(), Percent);
365         else
366             radiusWidth = Length(max(intMinForLength, min(intMaxForLength, pair->first()->computeLength<int>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()))), Fixed);
367         if (pair->second()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE)
368             radiusHeight = Length(pair->second()->getDoubleValue(), Percent);
369         else
370             radiusHeight = Length(max(intMinForLength, min(intMaxForLength, pair->second()->computeLength<int>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()))), Fixed);
371         int width = radiusWidth.value();
372         int height = radiusHeight.value();
373         if (width < 0 || height < 0)
374             return;
375         if (!width)
376             radiusHeight = radiusWidth; // Null out the other value.
377         else if (!height)
378             radiusWidth = radiusHeight; // Null out the other value.
379
380         LengthSize size(radiusWidth, radiusHeight);
381         setValue(selector->style(), size);
382     }
383     static PropertyHandler createHandler()
384     {
385         PropertyHandler handler = ApplyPropertyDefaultBase<LengthSize, getterFunction, LengthSize, setterFunction, LengthSize, initialFunction>::createHandler();
386         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
387     }
388 };
389
390 template <typename T,
391           CSSPropertyID propertyId,
392           EFillLayerType fillLayerType,
393           FillLayer* (RenderStyle::*accessLayersFunction)(),
394           const FillLayer* (RenderStyle::*layersFunction)() const,
395           bool (FillLayer::*testFunction)() const,
396           T (FillLayer::*getFunction)() const,
397           void (FillLayer::*setFunction)(T),
398           void (FillLayer::*clearFunction)(),
399           T (*initialFunction)(EFillLayerType),
400           void (CSSStyleSelector::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)>
401 class ApplyPropertyFillLayer {
402 public:
403     static void applyInheritValue(CSSStyleSelector* selector)
404     {
405         FillLayer* currChild = (selector->style()->*accessLayersFunction)();
406         FillLayer* prevChild = 0;
407         const FillLayer* currParent = (selector->parentStyle()->*layersFunction)();
408         while (currParent && (currParent->*testFunction)()) {
409             if (!currChild) {
410                 /* Need to make a new layer.*/
411                 currChild = new FillLayer(fillLayerType);
412                 prevChild->setNext(currChild);
413             }
414             (currChild->*setFunction)((currParent->*getFunction)());
415             prevChild = currChild;
416             currChild = prevChild->next();
417             currParent = currParent->next();
418         }
419
420         while (currChild) {
421             /* Reset any remaining layers to not have the property set. */
422             (currChild->*clearFunction)();
423             currChild = currChild->next();
424         }
425     }
426
427     static void applyInitialValue(CSSStyleSelector* selector)
428     {
429         FillLayer* currChild = (selector->style()->*accessLayersFunction)();
430         (currChild->*setFunction)((*initialFunction)(fillLayerType));
431         for (currChild = currChild->next(); currChild; currChild = currChild->next())
432             (currChild->*clearFunction)();
433     }
434
435     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
436     {
437         FillLayer* currChild = (selector->style()->*accessLayersFunction)();
438         FillLayer* prevChild = 0;
439         if (value->isValueList()) {
440             /* Walk each value and put it into a layer, creating new layers as needed. */
441             CSSValueList* valueList = static_cast<CSSValueList*>(value);
442             for (unsigned int i = 0; i < valueList->length(); i++) {
443                 if (!currChild) {
444                     /* Need to make a new layer to hold this value */
445                     currChild = new FillLayer(fillLayerType);
446                     prevChild->setNext(currChild);
447                 }
448                 (selector->*mapFillFunction)(propertyId, currChild, valueList->itemWithoutBoundsCheck(i));
449                 prevChild = currChild;
450                 currChild = currChild->next();
451             }
452         } else {
453             (selector->*mapFillFunction)(propertyId, currChild, value);
454             currChild = currChild->next();
455         }
456         while (currChild) {
457             /* Reset all remaining layers to not have the property set. */
458             (currChild->*clearFunction)();
459             currChild = currChild->next();
460         }
461     }
462
463     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
464 };
465
466 enum ComputeLengthNormal {NormalDisabled = 0, NormalEnabled};
467 enum ComputeLengthThickness {ThicknessDisabled = 0, ThicknessEnabled};
468 enum ComputeLengthSVGZoom {SVGZoomDisabled = 0, SVGZoomEnabled};
469 template <typename T,
470           T (RenderStyle::*getterFunction)() const,
471           void (RenderStyle::*setterFunction)(T),
472           T (*initialFunction)(),
473           ComputeLengthNormal normalEnabled = NormalDisabled,
474           ComputeLengthThickness thicknessEnabled = ThicknessDisabled,
475           ComputeLengthSVGZoom svgZoomEnabled = SVGZoomDisabled>
476 class ApplyPropertyComputeLength {
477 public:
478     static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
479     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
480     {
481         // note: CSSPropertyLetter/WordSpacing right now sets to zero if it's not a primitive value for some reason...
482         if (!value->isPrimitiveValue())
483             return;
484
485         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
486
487         int ident = primitiveValue->getIdent();
488         T length;
489         if (normalEnabled && ident == CSSValueNormal) {
490             length = 0;
491         } else if (thicknessEnabled && ident == CSSValueThin) {
492             length = 1;
493         } else if (thicknessEnabled && ident == CSSValueMedium) {
494             length = 3;
495         } else if (thicknessEnabled && ident == CSSValueThick) {
496             length = 5;
497         } else if (ident == CSSValueInvalid) {
498             float zoom = (svgZoomEnabled && selector->useSVGZoomRules()) ? 1.0f : selector->style()->effectiveZoom();
499             length = primitiveValue->computeLength<T>(selector->style(), selector->rootElementStyle(), zoom);
500         } else {
501             ASSERT_NOT_REACHED();
502             length = 0;
503         }
504
505         setValue(selector->style(), length);
506     }
507     static PropertyHandler createHandler()
508     {
509         PropertyHandler handler = ApplyPropertyDefaultBase<T, getterFunction, T, setterFunction, T, initialFunction>::createHandler();
510         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
511     }
512 };
513
514 template <typename T, T (FontDescription::*getterFunction)() const, void (FontDescription::*setterFunction)(T), T initialValue>
515 class ApplyPropertyFont {
516 public:
517     static void applyInheritValue(CSSStyleSelector* selector)
518     {
519         FontDescription fontDescription = selector->fontDescription();
520         (fontDescription.*setterFunction)((selector->parentFontDescription().*getterFunction)());
521         selector->setFontDescription(fontDescription);
522     }
523
524     static void applyInitialValue(CSSStyleSelector* selector)
525     {
526         FontDescription fontDescription = selector->fontDescription();
527         (fontDescription.*setterFunction)(initialValue);
528         selector->setFontDescription(fontDescription);
529     }
530
531     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
532     {
533         if (!value->isPrimitiveValue())
534             return;
535         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
536         FontDescription fontDescription = selector->fontDescription();
537         (fontDescription.*setterFunction)(*primitiveValue);
538         selector->setFontDescription(fontDescription);
539     }
540
541     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
542 };
543
544 class ApplyPropertyFontWeight {
545 public:
546     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
547     {
548         if (!value->isPrimitiveValue())
549             return;
550         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
551         FontDescription fontDescription = selector->fontDescription();
552         switch (primitiveValue->getIdent()) {
553         case CSSValueInvalid:
554             ASSERT_NOT_REACHED();
555             break;
556         case CSSValueBolder:
557             fontDescription.setWeight(fontDescription.bolderWeight());
558             break;
559         case CSSValueLighter:
560             fontDescription.setWeight(fontDescription.lighterWeight());
561             break;
562         default:
563             fontDescription.setWeight(*primitiveValue);
564         }
565         selector->setFontDescription(fontDescription);
566     }
567     static PropertyHandler createHandler()
568     {
569         PropertyHandler handler = ApplyPropertyFont<FontWeight, &FontDescription::weight, &FontDescription::setWeight, FontWeightNormal>::createHandler();
570         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
571     }
572 };
573
574 enum CounterBehavior {Increment = 0, Reset};
575 template <CounterBehavior counterBehavior>
576 class ApplyPropertyCounter {
577 public:
578     static void emptyFunction(CSSStyleSelector*) { }
579     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
580     {
581         if (!value->isValueList())
582             return;
583
584         CSSValueList* list = static_cast<CSSValueList*>(value);
585
586         CounterDirectiveMap& map = selector->style()->accessCounterDirectives();
587         typedef CounterDirectiveMap::iterator Iterator;
588
589         Iterator end = map.end();
590         for (Iterator it = map.begin(); it != end; ++it)
591             if (counterBehavior)
592                 it->second.m_reset = false;
593             else
594                 it->second.m_increment = false;
595
596         int length = list ? list->length() : 0;
597         for (int i = 0; i < length; ++i) {
598             CSSValue* currValue = list->itemWithoutBoundsCheck(i);
599             if (!currValue->isPrimitiveValue())
600                 continue;
601
602             Pair* pair = static_cast<CSSPrimitiveValue*>(currValue)->getPairValue();
603             if (!pair || !pair->first() || !pair->second())
604                 continue;
605
606             AtomicString identifier = static_cast<CSSPrimitiveValue*>(pair->first())->getStringValue();
607             // FIXME: What about overflow?
608             int value = static_cast<CSSPrimitiveValue*>(pair->second())->getIntValue();
609             CounterDirectives& directives = map.add(identifier.impl(), CounterDirectives()).first->second;
610             if (counterBehavior) {
611                 directives.m_reset = true;
612                 directives.m_resetValue = value;
613             } else {
614                 if (directives.m_increment)
615                     directives.m_incrementValue += value;
616                 else {
617                     directives.m_increment = true;
618                     directives.m_incrementValue = value;
619                 }
620             }
621         }
622     }
623     static PropertyHandler createHandler() { return PropertyHandler(&emptyFunction, &emptyFunction, &applyValue); }
624 };
625
626
627 class ApplyPropertyCursor {
628 public:
629     static void applyInheritValue(CSSStyleSelector* selector)
630     {
631         selector->style()->setCursor(selector->parentStyle()->cursor());
632         selector->style()->setCursorList(selector->parentStyle()->cursors());
633     }
634
635     static void applyInitialValue(CSSStyleSelector* selector)
636     {
637         selector->style()->clearCursorList();
638         selector->style()->setCursor(RenderStyle::initialCursor());
639     }
640
641     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
642     {
643         selector->style()->clearCursorList();
644         if (value->isValueList()) {
645             CSSValueList* list = static_cast<CSSValueList*>(value);
646             int len = list->length();
647             selector->style()->setCursor(CURSOR_AUTO);
648             for (int i = 0; i < len; i++) {
649                 CSSValue* item = list->itemWithoutBoundsCheck(i);
650                 if (!item->isPrimitiveValue())
651                     continue;
652                 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
653                 int type = primitiveValue->primitiveType();
654                 if (type == CSSPrimitiveValue::CSS_URI) {
655                     if (primitiveValue->isCursorImageValue()) {
656                         CSSCursorImageValue* image = static_cast<CSSCursorImageValue*>(primitiveValue);
657                         if (image->updateIfSVGCursorIsUsed(selector->element())) // Elements with SVG cursors are not allowed to share style.
658                             selector->style()->setUnique();
659                         selector->style()->addCursor(selector->cachedOrPendingFromValue(CSSPropertyCursor, image), image->hotSpot());
660                     }
661                 } else if (type == CSSPrimitiveValue::CSS_IDENT)
662                     selector->style()->setCursor(*primitiveValue);
663             }
664         } else if (value->isPrimitiveValue()) {
665             CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
666             int type = primitiveValue->primitiveType();
667             if (type == CSSPrimitiveValue::CSS_IDENT && selector->style()->cursor() != ECursor(*primitiveValue))
668                 selector->style()->setCursor(*primitiveValue);
669         }
670     }
671
672     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
673 };
674
675 class ApplyPropertyTextEmphasisStyle {
676 public:
677     static void applyInheritValue(CSSStyleSelector* selector)
678     {
679         selector->style()->setTextEmphasisFill(selector->parentStyle()->textEmphasisFill());
680         selector->style()->setTextEmphasisMark(selector->parentStyle()->textEmphasisMark());
681         selector->style()->setTextEmphasisCustomMark(selector->parentStyle()->textEmphasisCustomMark());
682     }
683
684     static void applyInitialValue(CSSStyleSelector* selector)
685     {
686         selector->style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill());
687         selector->style()->setTextEmphasisMark(RenderStyle::initialTextEmphasisMark());
688         selector->style()->setTextEmphasisCustomMark(RenderStyle::initialTextEmphasisCustomMark());
689     }
690
691     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
692     {
693         if (value->isValueList()) {
694             CSSValueList* list = static_cast<CSSValueList*>(value);
695             ASSERT(list->length() == 2);
696             if (list->length() != 2)
697                 return;
698             for (unsigned i = 0; i < 2; ++i) {
699                 CSSValue* item = list->itemWithoutBoundsCheck(i);
700                 if (!item->isPrimitiveValue())
701                     continue;
702
703                 CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(item);
704                 if (value->getIdent() == CSSValueFilled || value->getIdent() == CSSValueOpen)
705                     selector->style()->setTextEmphasisFill(*value);
706                 else
707                     selector->style()->setTextEmphasisMark(*value);
708             }
709             selector->style()->setTextEmphasisCustomMark(nullAtom);
710             return;
711         }
712
713         if (!value->isPrimitiveValue())
714             return;
715         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
716
717         if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_STRING) {
718             selector->style()->setTextEmphasisFill(TextEmphasisFillFilled);
719             selector->style()->setTextEmphasisMark(TextEmphasisMarkCustom);
720             selector->style()->setTextEmphasisCustomMark(primitiveValue->getStringValue());
721             return;
722         }
723
724         selector->style()->setTextEmphasisCustomMark(nullAtom);
725
726         if (primitiveValue->getIdent() == CSSValueFilled || primitiveValue->getIdent() == CSSValueOpen) {
727             selector->style()->setTextEmphasisFill(*primitiveValue);
728             selector->style()->setTextEmphasisMark(TextEmphasisMarkAuto);
729         } else {
730             selector->style()->setTextEmphasisFill(TextEmphasisFillFilled);
731             selector->style()->setTextEmphasisMark(*primitiveValue);
732         }
733     }
734
735     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
736 };
737
738 template <typename T,
739           T (Animation::*getterFunction)() const,
740           void (Animation::*setterFunction)(T),
741           bool (Animation::*testFunction)() const,
742           void (Animation::*clearFunction)(),
743           T (*initialFunction)(),
744           void (CSSStyleSelector::*mapFunction)(Animation*, CSSValue*),
745           AnimationList* (RenderStyle::*animationGetterFunction)(),
746           const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
747 class ApplyPropertyAnimation {
748 public:
749     static void setValue(Animation* animation, T value) { (animation->*setterFunction)(value); }
750     static T value(const Animation* animation) { return (animation->*getterFunction)(); }
751     static bool test(const Animation* animation) { return (animation->*testFunction)(); }
752     static void clear(Animation* animation) { (animation->*clearFunction)(); }
753     static T initial() { return (*initialFunction)(); }
754     static void map(CSSStyleSelector* selector, Animation* animation, CSSValue* value) { (selector->*mapFunction)(animation, value); }
755     static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
756     static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
757
758     static void applyInheritValue(CSSStyleSelector* selector)
759     {
760         AnimationList* list = accessAnimations(selector->style());
761         const AnimationList* parentList = animations(selector->parentStyle());
762         size_t i = 0, parentSize = parentList ? parentList->size() : 0;
763         for ( ; i < parentSize && test(parentList->animation(i)); ++i) {
764             if (list->size() <= i)
765                 list->append(Animation::create());
766             setValue(list->animation(i), value(parentList->animation(i)));
767         }
768
769         /* Reset any remaining animations to not have the property set. */
770         for ( ; i < list->size(); ++i)
771             clear(list->animation(i));
772     }
773
774     static void applyInitialValue(CSSStyleSelector* selector)
775     {
776         AnimationList* list = accessAnimations(selector->style());
777         if (list->isEmpty())
778             list->append(Animation::create());
779         setValue(list->animation(0), initial());
780         for (size_t i = 1; i < list->size(); ++i)
781             clear(list->animation(i));
782     }
783
784     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
785     {
786         AnimationList* list = accessAnimations(selector->style());
787         size_t childIndex = 0;
788         if (value->isValueList()) {
789             /* Walk each value and put it into an animation, creating new animations as needed. */
790             for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
791                 if (childIndex <= list->size())
792                     list->append(Animation::create());
793                 map(selector, list->animation(childIndex), i.value());
794                 ++childIndex;
795             }
796         } else {
797             if (list->isEmpty())
798                 list->append(Animation::create());
799             map(selector, list->animation(childIndex), value);
800             childIndex = 1;
801         }
802         for ( ; childIndex < list->size(); ++childIndex) {
803             /* Reset all remaining animations to not have the property set. */
804             clear(list->animation(childIndex));
805         }
806     }
807
808     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
809 };
810
811 class ApplyPropertyOutlineStyle {
812 public:
813     static void applyInheritValue(CSSStyleSelector* selector)
814     {
815         ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInheritValue(selector);
816         ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInheritValue(selector);
817     }
818
819     static void applyInitialValue(CSSStyleSelector* selector)
820     {
821         ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInitialValue(selector);
822         ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInitialValue(selector);
823     }
824
825     static void applyValue(CSSStyleSelector* selector, CSSValue* value)
826     {
827         ApplyPropertyDefault<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyValue(selector, value);
828         ApplyPropertyDefault<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyValue(selector, value);
829     }
830
831     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
832 };
833
834 const CSSStyleApplyProperty& CSSStyleApplyProperty::sharedCSSStyleApplyProperty()
835 {
836     DEFINE_STATIC_LOCAL(CSSStyleApplyProperty, cssStyleApplyPropertyInstance, ());
837     return cssStyleApplyPropertyInstance;
838 }
839
840 CSSStyleApplyProperty::CSSStyleApplyProperty()
841 {
842     for (int i = 0; i < numCSSProperties; ++i)
843         m_propertyMap[i] = PropertyHandler();
844
845     setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler());
846     setPropertyHandler(CSSPropertyDirection, ApplyPropertyDirection<&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection>::createHandler());
847
848     setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
849                        &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment>::createHandler());
850     setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
851                        &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip>::createHandler());
852     setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
853     setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
854                        &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite>::createHandler());
855
856     setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
857                        &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage>::createHandler());
858
859     setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
860                        &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin>::createHandler());
861     setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
862
863     setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
864                        &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition>::createHandler());
865     setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
866                        &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition>::createHandler());
867     setPropertyHandler(CSSPropertyBackgroundPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundPositionX, CSSPropertyBackgroundPositionY>::createHandler());
868
869     setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
870                        &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX>::createHandler());
871     setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
872                        &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY>::createHandler());
873     setPropertyHandler(CSSPropertyBackgroundRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
874
875     setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
876                        &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize>::createHandler());
877     setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
878
879     setPropertyHandler(CSSPropertyWebkitMaskAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyWebkitMaskAttachment, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
880                        &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment>::createHandler());
881     setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
882                        &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip>::createHandler());
883     setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
884                        &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite>::createHandler());
885
886     setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
887                        &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage>::createHandler());
888
889     setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
890                        &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin>::createHandler());
891     setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
892                        &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize>::createHandler());
893
894     setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
895                        &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition>::createHandler());
896     setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
897                        &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition>::createHandler());
898     setPropertyHandler(CSSPropertyWebkitMaskPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMaskPositionX, CSSPropertyWebkitMaskPositionY>::createHandler());
899
900     setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
901                        &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX>::createHandler());
902     setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
903                        &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY>::createHandler());
904     setPropertyHandler(CSSPropertyWebkitMaskRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
905
906     setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler());
907     setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
908     setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
909     setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
910     setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler());
911
912     setPropertyHandler(CSSPropertyBorderTopStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderTopStyle, EBorderStyle, &RenderStyle::setBorderTopStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
913     setPropertyHandler(CSSPropertyBorderRightStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderRightStyle, EBorderStyle, &RenderStyle::setBorderRightStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
914     setPropertyHandler(CSSPropertyBorderBottomStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderBottomStyle, EBorderStyle, &RenderStyle::setBorderBottomStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
915     setPropertyHandler(CSSPropertyBorderLeftStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderLeftStyle, EBorderStyle, &RenderStyle::setBorderLeftStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
916
917     setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
918     setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
919     setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
920     setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
921     setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
922     setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
923
924     setPropertyHandler(CSSPropertyBorderTop, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderTopStyle, CSSPropertyBorderTopWidth>::createHandler());
925     setPropertyHandler(CSSPropertyBorderRight, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderRightColor, CSSPropertyBorderRightStyle, CSSPropertyBorderRightWidth>::createHandler());
926     setPropertyHandler(CSSPropertyBorderBottom, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderBottomColor, CSSPropertyBorderBottomStyle, CSSPropertyBorderBottomWidth>::createHandler());
927     setPropertyHandler(CSSPropertyBorderLeft, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderLeftColor, CSSPropertyBorderLeftStyle, CSSPropertyBorderLeftWidth>::createHandler());
928
929     setPropertyHandler(CSSPropertyBorderStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle>::createHandler());
930     setPropertyHandler(CSSPropertyBorderWidth, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopWidth, CSSPropertyBorderRightWidth, CSSPropertyBorderBottomWidth, CSSPropertyBorderLeftWidth>::createHandler());
931     setPropertyHandler(CSSPropertyBorderColor, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderRightColor, CSSPropertyBorderBottomColor, CSSPropertyBorderLeftColor>::createHandler());
932     setPropertyHandler(CSSPropertyBorder, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderStyle, CSSPropertyBorderWidth, CSSPropertyBorderColor>::createHandler());
933
934     setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
935     setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
936     setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
937     setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
938     setPropertyHandler(CSSPropertyBorderRadius, ApplyPropertyExpanding<ExpandValue, CSSPropertyBorderTopLeftRadius, CSSPropertyBorderTopRightRadius, CSSPropertyBorderBottomLeftRadius, CSSPropertyBorderBottomRightRadius>::createHandler());
939     setPropertyHandler(CSSPropertyWebkitBorderRadius, CSSPropertyBorderRadius);
940
941     setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler());
942     setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing>::createHandler());
943     setPropertyHandler(CSSPropertyBorderSpacing, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitBorderHorizontalSpacing, CSSPropertyWebkitBorderVerticalSpacing>::createHandler());
944
945     setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength<int, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
946     setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<int, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
947
948     setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler());
949
950     setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::createHandler());
951     setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler());
952
953     setPropertyHandler(CSSPropertyWebkitFlexOrder, ApplyPropertyDefault<int, &RenderStyle::flexOrder, int, &RenderStyle::setFlexOrder, int, &RenderStyle::initialFlexOrder>::createHandler());
954     setPropertyHandler(CSSPropertyWebkitFlexPack, ApplyPropertyDefault<EFlexPack, &RenderStyle::flexPack, EFlexPack, &RenderStyle::setFlexPack, EFlexPack, &RenderStyle::initialFlexPack>::createHandler());
955     setPropertyHandler(CSSPropertyWebkitFlexAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexAlign, EFlexAlign, &RenderStyle::setFlexAlign, EFlexAlign, &RenderStyle::initialFlexAlign>::createHandler());
956     setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyDefault<EFlexFlow, &RenderStyle::flexFlow, EFlexFlow, &RenderStyle::setFlexFlow, EFlexFlow, &RenderStyle::initialFlexFlow>::createHandler());
957
958     setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
959     setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
960     setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
961     setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
962     setPropertyHandler(CSSPropertyWebkitTextOrientation, ApplyPropertyFont<TextOrientation, &FontDescription::textOrientation, &FontDescription::setTextOrientation, TextOrientationVerticalRight>::createHandler());
963     setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
964
965     setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
966     setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
967     setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength<int, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset>::createHandler());
968
969     setPropertyHandler(CSSPropertyOverflowX, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowX, EOverflow, &RenderStyle::setOverflowX, EOverflow, &RenderStyle::initialOverflowX>::createHandler());
970     setPropertyHandler(CSSPropertyOverflowY, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowY, EOverflow, &RenderStyle::setOverflowY, EOverflow, &RenderStyle::initialOverflowY>::createHandler());
971     setPropertyHandler(CSSPropertyOverflow, ApplyPropertyExpanding<ExpandValue, CSSPropertyOverflowX, CSSPropertyOverflowY>::createHandler());
972
973     setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
974     setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
975     setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
976     setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
977
978     setPropertyHandler(CSSPropertyTop, ApplyPropertyLength<&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
979     setPropertyHandler(CSSPropertyRight, ApplyPropertyLength<&RenderStyle::right, &RenderStyle::setRight, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
980     setPropertyHandler(CSSPropertyBottom, ApplyPropertyLength<&RenderStyle::bottom, &RenderStyle::setBottom, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
981     setPropertyHandler(CSSPropertyLeft, ApplyPropertyLength<&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
982
983     setPropertyHandler(CSSPropertyWidth, ApplyPropertyLength<&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexWidth>::createHandler());
984     setPropertyHandler(CSSPropertyHeight, ApplyPropertyLength<&RenderStyle::height, &RenderStyle::setHeight, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexHeight>::createHandler());
985
986     setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
987
988     setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
989     setPropertyHandler(CSSPropertyListStylePosition, ApplyPropertyDefault<EListStylePosition, &RenderStyle::listStylePosition, EListStylePosition, &RenderStyle::setListStylePosition, EListStylePosition, &RenderStyle::initialListStylePosition>::createHandler());
990     setPropertyHandler(CSSPropertyListStyleType, ApplyPropertyDefault<EListStyleType, &RenderStyle::listStyleType, EListStyleType, &RenderStyle::setListStyleType, EListStyleType, &RenderStyle::initialListStyleType>::createHandler());
991     setPropertyHandler(CSSPropertyListStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyListStyleType, CSSPropertyListStyleImage, CSSPropertyListStylePosition>::createHandler());
992
993     setPropertyHandler(CSSPropertyMaxHeight, ApplyPropertyLength<&RenderStyle::maxHeight, &RenderStyle::setMaxHeight, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
994     setPropertyHandler(CSSPropertyMaxWidth, ApplyPropertyLength<&RenderStyle::maxWidth, &RenderStyle::setMaxWidth, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
995     setPropertyHandler(CSSPropertyMinHeight, ApplyPropertyLength<&RenderStyle::minHeight, &RenderStyle::setMinHeight, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler());
996     setPropertyHandler(CSSPropertyMinWidth, ApplyPropertyLength<&RenderStyle::minWidth, &RenderStyle::setMinWidth, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler());
997
998     setPropertyHandler(CSSPropertyMarginTop, ApplyPropertyLength<&RenderStyle::marginTop, &RenderStyle::setMarginTop, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
999     setPropertyHandler(CSSPropertyMarginRight, ApplyPropertyLength<&RenderStyle::marginRight, &RenderStyle::setMarginRight, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1000     setPropertyHandler(CSSPropertyMarginBottom, ApplyPropertyLength<&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1001     setPropertyHandler(CSSPropertyMarginLeft, ApplyPropertyLength<&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1002     setPropertyHandler(CSSPropertyMargin, ApplyPropertyExpanding<SuppressValue, CSSPropertyMarginTop, CSSPropertyMarginRight, CSSPropertyMarginBottom, CSSPropertyMarginLeft>::createHandler());
1003
1004     setPropertyHandler(CSSPropertyWebkitMarginBeforeCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginBeforeCollapse, EMarginCollapse, &RenderStyle::setMarginBeforeCollapse, EMarginCollapse, &RenderStyle::initialMarginBeforeCollapse>::createHandler());
1005     setPropertyHandler(CSSPropertyWebkitMarginAfterCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginAfterCollapse, EMarginCollapse, &RenderStyle::setMarginAfterCollapse, EMarginCollapse, &RenderStyle::initialMarginAfterCollapse>::createHandler());
1006     setPropertyHandler(CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBeforeCollapse);
1007     setPropertyHandler(CSSPropertyWebkitMarginBottomCollapse, CSSPropertyWebkitMarginAfterCollapse);
1008     setPropertyHandler(CSSPropertyWebkitMarginCollapse, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse>::createHandler());
1009
1010     setPropertyHandler(CSSPropertyPaddingTop, ApplyPropertyLength<&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding>::createHandler());
1011     setPropertyHandler(CSSPropertyPaddingRight, ApplyPropertyLength<&RenderStyle::paddingRight, &RenderStyle::setPaddingRight, &RenderStyle::initialPadding>::createHandler());
1012     setPropertyHandler(CSSPropertyPaddingBottom, ApplyPropertyLength<&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding>::createHandler());
1013     setPropertyHandler(CSSPropertyPaddingLeft, ApplyPropertyLength<&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding>::createHandler());
1014     setPropertyHandler(CSSPropertyPadding, ApplyPropertyExpanding<SuppressValue, CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft>::createHandler());
1015
1016     setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, ApplyPropertyLength<&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX>::createHandler());
1017     setPropertyHandler(CSSPropertyWebkitPerspectiveOriginY, ApplyPropertyLength<&RenderStyle::perspectiveOriginY, &RenderStyle::setPerspectiveOriginY, &RenderStyle::initialPerspectiveOriginY>::createHandler());
1018     setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
1019     setPropertyHandler(CSSPropertyWebkitTransformOriginX, ApplyPropertyLength<&RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX, &RenderStyle::initialTransformOriginX>::createHandler());
1020     setPropertyHandler(CSSPropertyWebkitTransformOriginY, ApplyPropertyLength<&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY>::createHandler());
1021     setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler());
1022     setPropertyHandler(CSSPropertyWebkitTransformOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitTransformOriginX, CSSPropertyWebkitTransformOriginY, CSSPropertyWebkitTransformOriginZ>::createHandler());
1023
1024     setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1025     setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSStyleSelector::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1026     setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1027     setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSStyleSelector::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1028     setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<int, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSStyleSelector::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1029     setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSStyleSelector::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1030     setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSStyleSelector::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1031     setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1032
1033     setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1034     setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1035     setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<int, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSStyleSelector::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1036     setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1037
1038     setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
1039     setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
1040     setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
1041     setPropertyHandler(CSSPropertyWebkitColumns, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitColumnWidth, CSSPropertyWebkitColumnCount>::createHandler());
1042
1043     setPropertyHandler(CSSPropertyWebkitHighlight, ApplyPropertyString<MapNoneToNull, &RenderStyle::highlight, &RenderStyle::setHighlight, &RenderStyle::initialHighlight>::createHandler());
1044     setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());
1045
1046     setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler());
1047     setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler());
1048     setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
1049
1050     setPropertyHandler(CSSPropertyWebkitWrapMargin, ApplyPropertyLength<&RenderStyle::wrapMargin, &RenderStyle::setWrapMargin, &RenderStyle::initialWrapMargin>::createHandler());
1051     setPropertyHandler(CSSPropertyWebkitWrapPadding, ApplyPropertyLength<&RenderStyle::wrapPadding, &RenderStyle::setWrapPadding, &RenderStyle::initialWrapPadding>::createHandler());
1052
1053     setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
1054 }
1055
1056
1057 }