Add feature defines for web-facing parts of CSS Regions and Exclusions
[WebKit-https.git] / Source / WebCore / css / StyleBuilder.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 "StyleBuilder.h"
27
28 #include "CSSAspectRatioValue.h"
29 #include "CSSCalculationValue.h"
30 #include "CSSCursorImageValue.h"
31 #include "CSSPrimitiveValueMappings.h"
32 #include "CSSValueList.h"
33 #include "CursorList.h"
34 #include "Document.h"
35 #include "Element.h"
36 #include "Pair.h"
37 #include "Rect.h"
38 #include "RenderObject.h"
39 #include "RenderStyle.h"
40 #include "RenderView.h"
41 #include "Settings.h"
42 #include "StyleResolver.h"
43 #include <wtf/StdLibExtras.h>
44 #include <wtf/UnusedParam.h>
45
46 using namespace std;
47
48 namespace WebCore {
49
50 enum ExpandValueBehavior {SuppressValue = 0, ExpandValue};
51 template <ExpandValueBehavior expandValue, CSSPropertyID one = CSSPropertyInvalid, CSSPropertyID two = CSSPropertyInvalid, CSSPropertyID three = CSSPropertyInvalid, CSSPropertyID four = CSSPropertyInvalid, CSSPropertyID five = CSSPropertyInvalid>
52 class ApplyPropertyExpanding {
53 public:
54
55     template <CSSPropertyID id>
56     static inline void applyInheritValue(StyleResolver* styleResolver)
57     {
58         if (id == CSSPropertyInvalid)
59             return;
60
61         const StyleBuilder& table = StyleBuilder::sharedStyleBuilder();
62         const PropertyHandler& handler = table.propertyHandler(id);
63         if (handler.isValid())
64             handler.applyInheritValue(styleResolver);
65     }
66
67     static void applyInheritValue(StyleResolver* styleResolver)
68     {
69         applyInheritValue<one>(styleResolver);
70         applyInheritValue<two>(styleResolver);
71         applyInheritValue<three>(styleResolver);
72         applyInheritValue<four>(styleResolver);
73         applyInheritValue<five>(styleResolver);
74     }
75
76     template <CSSPropertyID id>
77     static inline void applyInitialValue(StyleResolver* styleResolver)
78     {
79         if (id == CSSPropertyInvalid)
80             return;
81
82         const StyleBuilder& table = StyleBuilder::sharedStyleBuilder();
83         const PropertyHandler& handler = table.propertyHandler(id);
84         if (handler.isValid())
85             handler.applyInitialValue(styleResolver);
86     }
87
88     static void applyInitialValue(StyleResolver* styleResolver)
89     {
90         applyInitialValue<one>(styleResolver);
91         applyInitialValue<two>(styleResolver);
92         applyInitialValue<three>(styleResolver);
93         applyInitialValue<four>(styleResolver);
94         applyInitialValue<five>(styleResolver);
95     }
96
97     template <CSSPropertyID id>
98     static inline void applyValue(StyleResolver* styleResolver, CSSValue* value)
99     {
100         if (id == CSSPropertyInvalid)
101             return;
102
103         const StyleBuilder& table = StyleBuilder::sharedStyleBuilder();
104         const PropertyHandler& handler = table.propertyHandler(id);
105         if (handler.isValid())
106             handler.applyValue(styleResolver, value);
107     }
108
109     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
110     {
111         if (!expandValue)
112             return;
113
114         applyValue<one>(styleResolver, value);
115         applyValue<two>(styleResolver, value);
116         applyValue<three>(styleResolver, value);
117         applyValue<four>(styleResolver, value);
118         applyValue<five>(styleResolver, value);
119     }
120     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
121 };
122
123 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()>
124 class ApplyPropertyDefaultBase {
125 public:
126     static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); }
127     static GetterType value(RenderStyle* style) { return (style->*getterFunction)(); }
128     static InitialType initial() { return (*initialFunction)(); }
129     static void applyInheritValue(StyleResolver* styleResolver) { setValue(styleResolver->style(), value(styleResolver->parentStyle())); }
130     static void applyInitialValue(StyleResolver* styleResolver) { setValue(styleResolver->style(), initial()); }
131     static void applyValue(StyleResolver*, CSSValue*) { }
132     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
133 };
134
135 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()>
136 class ApplyPropertyDefault {
137 public:
138     static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); }
139     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
140     {
141         if (value->isPrimitiveValue())
142             setValue(styleResolver->style(), *static_cast<CSSPrimitiveValue*>(value));
143     }
144     static PropertyHandler createHandler()
145     {
146         PropertyHandler handler = ApplyPropertyDefaultBase<GetterType, getterFunction, SetterType, setterFunction, InitialType, initialFunction>::createHandler();
147         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
148     }
149 };
150
151 template <typename NumberType, NumberType (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(NumberType), NumberType (*initialFunction)(), int idMapsToMinusOne = CSSValueAuto>
152 class ApplyPropertyNumber {
153 public:
154     static void setValue(RenderStyle* style, NumberType value) { (style->*setterFunction)(value); }
155     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
156     {
157         if (!value->isPrimitiveValue())
158             return;
159
160         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
161         if (primitiveValue->getIdent() == idMapsToMinusOne)
162             setValue(styleResolver->style(), -1);
163         else
164             setValue(styleResolver->style(), primitiveValue->getValue<NumberType>(CSSPrimitiveValue::CSS_NUMBER));
165     }
166     static PropertyHandler createHandler()
167     {
168         PropertyHandler handler = ApplyPropertyDefaultBase<NumberType, getterFunction, NumberType, setterFunction, NumberType, initialFunction>::createHandler();
169         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
170     }
171 };
172
173 template <StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)(), CSSPropertyID property>
174 class ApplyPropertyStyleImage {
175 public:
176     static void applyValue(StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(property, value)); }
177     static PropertyHandler createHandler()
178     {
179         PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
180         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
181     }
182 };
183
184 enum AutoValueType {Number = 0, ComputeLength};
185 template <typename T, T (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(T), bool (RenderStyle::*hasAutoFunction)() const, void (RenderStyle::*setAutoFunction)(), AutoValueType valueType = Number, int autoIdentity = CSSValueAuto>
186 class ApplyPropertyAuto {
187 public:
188     static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
189     static T value(RenderStyle* style) { return (style->*getterFunction)(); }
190     static bool hasAuto(RenderStyle* style) { return (style->*hasAutoFunction)(); }
191     static void setAuto(RenderStyle* style) { (style->*setAutoFunction)(); }
192
193     static void applyInheritValue(StyleResolver* styleResolver)
194     {
195         if (hasAuto(styleResolver->parentStyle()))
196             setAuto(styleResolver->style());
197         else
198             setValue(styleResolver->style(), value(styleResolver->parentStyle()));
199     }
200
201     static void applyInitialValue(StyleResolver* styleResolver) { setAuto(styleResolver->style()); }
202
203     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
204     {
205         if (!value->isPrimitiveValue())
206             return;
207
208         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
209         if (primitiveValue->getIdent() == autoIdentity)
210             setAuto(styleResolver->style());
211         else if (valueType == Number)
212             setValue(styleResolver->style(), *primitiveValue);
213         else if (valueType == ComputeLength)
214             setValue(styleResolver->style(), primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()));
215     }
216
217     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
218 };
219
220 class ApplyPropertyClip {
221 private:
222     static Length convertToLength(StyleResolver* styleResolver, CSSPrimitiveValue* value)
223     {
224         return value->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | AutoConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
225     }
226 public:
227     static void applyInheritValue(StyleResolver* styleResolver)
228     {
229         RenderStyle* parentStyle = styleResolver->parentStyle();
230         if (!parentStyle->hasClip())
231             return applyInitialValue(styleResolver);
232         styleResolver->style()->setClip(parentStyle->clipTop(), parentStyle->clipRight(), parentStyle->clipBottom(), parentStyle->clipLeft());
233         styleResolver->style()->setHasClip(true);
234     }
235
236     static void applyInitialValue(StyleResolver* styleResolver)
237     {
238         styleResolver->style()->setClip(Length(), Length(), Length(), Length());
239         styleResolver->style()->setHasClip(false);
240     }
241
242     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
243     {
244         if (!value->isPrimitiveValue())
245             return;
246
247         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
248
249         if (Rect* rect = primitiveValue->getRectValue()) {
250             Length top = convertToLength(styleResolver, rect->top());
251             Length right = convertToLength(styleResolver, rect->right());
252             Length bottom = convertToLength(styleResolver, rect->bottom());
253             Length left = convertToLength(styleResolver, rect->left());
254             styleResolver->style()->setClip(top, right, bottom, left);
255             styleResolver->style()->setHasClip(true);
256         } else if (primitiveValue->getIdent() == CSSValueAuto) {
257             styleResolver->style()->setClip(Length(), Length(), Length(), Length());
258             styleResolver->style()->setHasClip(false);
259         }
260     }
261
262     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
263 };
264
265 enum ColorInherit {NoInheritFromParent = 0, InheritFromParent};
266 Color defaultInitialColor();
267 Color defaultInitialColor() { return Color(); }
268 template <ColorInherit inheritColorFromParent,
269           Color (RenderStyle::*getterFunction)() const,
270           void (RenderStyle::*setterFunction)(const Color&),
271           void (RenderStyle::*visitedLinkSetterFunction)(const Color&),
272           Color (RenderStyle::*defaultFunction)() const,
273           Color (*initialFunction)() = &defaultInitialColor>
274 class ApplyPropertyColor {
275 public:
276     static void applyInheritValue(StyleResolver* styleResolver)
277     {
278         // Visited link style can never explicitly inherit from parent visited link style so no separate getters are needed.
279         Color color = (styleResolver->parentStyle()->*getterFunction)();
280         applyColorValue(styleResolver, color.isValid() ? color : (styleResolver->parentStyle()->*defaultFunction)());
281     }
282
283     static void applyInitialValue(StyleResolver* styleResolver)
284     {
285         applyColorValue(styleResolver, initialFunction());
286     }
287
288     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
289     {
290         if (!value->isPrimitiveValue())
291             return;
292
293         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
294         if (inheritColorFromParent && primitiveValue->getIdent() == CSSValueCurrentcolor)
295             applyInheritValue(styleResolver);
296         else {
297             if (styleResolver->applyPropertyToRegularStyle())
298                 (styleResolver->style()->*setterFunction)(styleResolver->colorFromPrimitiveValue(primitiveValue));
299             if (styleResolver->applyPropertyToVisitedLinkStyle())
300                 (styleResolver->style()->*visitedLinkSetterFunction)(styleResolver->colorFromPrimitiveValue(primitiveValue, /* forVisitedLink */ true));
301         }
302     }
303
304     static void applyColorValue(StyleResolver* styleResolver, const Color& color)
305     {
306         if (styleResolver->applyPropertyToRegularStyle())
307             (styleResolver->style()->*setterFunction)(color);
308         if (styleResolver->applyPropertyToVisitedLinkStyle())
309             (styleResolver->style()->*visitedLinkSetterFunction)(color);
310     }
311
312     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
313 };
314
315 template <TextDirection (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(TextDirection), TextDirection (*initialFunction)()>
316 class ApplyPropertyDirection {
317 public:
318     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
319     {
320         ApplyPropertyDefault<TextDirection, getterFunction, TextDirection, setterFunction, TextDirection, initialFunction>::applyValue(styleResolver, value);
321         Element* element = styleResolver->element();
322         if (element && styleResolver->element() == element->document()->documentElement())
323             element->document()->setDirectionSetOnDocumentElement(true);
324     }
325
326     static PropertyHandler createHandler()
327     {
328         PropertyHandler handler = ApplyPropertyDefault<TextDirection, getterFunction, TextDirection, setterFunction, TextDirection, initialFunction>::createHandler();
329         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
330     }
331 };
332
333 enum LengthAuto { AutoDisabled = 0, AutoEnabled };
334 enum LengthIntrinsic { IntrinsicDisabled = 0, IntrinsicEnabled };
335 enum LengthMinIntrinsic { MinIntrinsicDisabled = 0, MinIntrinsicEnabled };
336 enum LengthNone { NoneDisabled = 0, NoneEnabled };
337 enum LengthUndefined { UndefinedDisabled = 0, UndefinedEnabled };
338 template <Length (RenderStyle::*getterFunction)() const,
339           void (RenderStyle::*setterFunction)(Length),
340           Length (*initialFunction)(),
341           LengthAuto autoEnabled = AutoDisabled,
342           LengthIntrinsic intrinsicEnabled = IntrinsicDisabled,
343           LengthMinIntrinsic minIntrinsicEnabled = MinIntrinsicDisabled,
344           LengthNone noneEnabled = NoneDisabled,
345           LengthUndefined noneUndefined = UndefinedDisabled>
346 class ApplyPropertyLength {
347 public:
348     static void setValue(RenderStyle* style, Length value) { (style->*setterFunction)(value); }
349     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
350     {
351         if (!value->isPrimitiveValue())
352             return;
353
354         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
355         if (noneEnabled && primitiveValue->getIdent() == CSSValueNone)
356             if (noneUndefined)
357                 setValue(styleResolver->style(), Length(Undefined));
358             else
359                 setValue(styleResolver->style(), Length());
360         else if (intrinsicEnabled && primitiveValue->getIdent() == CSSValueIntrinsic)
361             setValue(styleResolver->style(), Length(Intrinsic));
362         else if (minIntrinsicEnabled && primitiveValue->getIdent() == CSSValueMinIntrinsic)
363             setValue(styleResolver->style(), Length(MinIntrinsic));
364         else if (autoEnabled && primitiveValue->getIdent() == CSSValueAuto)
365             setValue(styleResolver->style(), Length());
366         else {
367             if (primitiveValue->isLength()) {
368                 Length length = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
369                 length.setQuirk(primitiveValue->isQuirkValue());
370                 setValue(styleResolver->style(), length);
371             } else if (primitiveValue->isPercentage())
372                 setValue(styleResolver->style(), Length(primitiveValue->getDoubleValue(), Percent));
373             else if (primitiveValue->isCalculatedPercentageWithLength())
374                 setValue(styleResolver->style(), Length(primitiveValue->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom())));
375             else if (primitiveValue->isViewportPercentageLength())
376                 setValue(styleResolver->style(), primitiveValue->viewportPercentageLength());
377         }
378     }
379
380     static PropertyHandler createHandler()
381     {
382         PropertyHandler handler = ApplyPropertyDefaultBase<Length, getterFunction, Length, setterFunction, Length, initialFunction>::createHandler();
383         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
384     }
385 };
386
387 enum StringIdentBehavior { NothingMapsToNull = 0, MapNoneToNull, MapAutoToNull };
388 template <StringIdentBehavior identBehavior, const AtomicString& (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(const AtomicString&), const AtomicString& (*initialFunction)()>
389 class ApplyPropertyString {
390 public:
391     static void setValue(RenderStyle* style, const AtomicString& value) { (style->*setterFunction)(value); }
392     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
393     {
394         if (!value->isPrimitiveValue())
395             return;
396         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
397         if ((identBehavior == MapNoneToNull && primitiveValue->getIdent() == CSSValueNone)
398             || (identBehavior == MapAutoToNull && primitiveValue->getIdent() == CSSValueAuto))
399             setValue(styleResolver->style(), nullAtom);
400         else
401             setValue(styleResolver->style(), primitiveValue->getStringValue());
402     }
403     static PropertyHandler createHandler()
404     {
405         PropertyHandler handler = ApplyPropertyDefaultBase<const AtomicString&, getterFunction, const AtomicString&, setterFunction, const AtomicString&, initialFunction>::createHandler();
406         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
407     }
408 };
409
410 template <LengthSize (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(LengthSize), LengthSize (*initialFunction)()>
411 class ApplyPropertyBorderRadius {
412 public:
413     static void setValue(RenderStyle* style, LengthSize value) { (style->*setterFunction)(value); }
414     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
415     {
416         if (!value->isPrimitiveValue())
417             return;
418
419         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
420         Pair* pair = primitiveValue->getPairValue();
421         if (!pair || !pair->first() || !pair->second())
422             return;
423
424         Length radiusWidth;
425         Length radiusHeight;
426         if (pair->first()->isPercentage())
427             radiusWidth = Length(pair->first()->getDoubleValue(), Percent);
428         else if (pair->first()->isViewportPercentageLength())
429             radiusWidth = pair->first()->viewportPercentageLength();
430         else if (pair->first()->isCalculatedPercentageWithLength()) {
431             // FIXME calc(): http://webkit.org/b/16662
432             // handle this case
433             return;
434         } else
435             radiusWidth = pair->first()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
436         if (pair->second()->isPercentage())
437             radiusHeight = Length(pair->second()->getDoubleValue(), Percent);
438         else if (pair->second()->isViewportPercentageLength())
439             radiusHeight = pair->second()->viewportPercentageLength();
440         else if (pair->second()->isCalculatedPercentageWithLength()) {
441             // FIXME calc(): http://webkit.org/b/16662
442             // handle this case
443             return;
444         } else
445             radiusHeight = pair->second()->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
446         int width = radiusWidth.value();
447         int height = radiusHeight.value();
448         if (width < 0 || height < 0)
449             return;
450         if (!width)
451             radiusHeight = radiusWidth; // Null out the other value.
452         else if (!height)
453             radiusWidth = radiusHeight; // Null out the other value.
454
455         LengthSize size(radiusWidth, radiusHeight);
456         setValue(styleResolver->style(), size);
457     }
458     static PropertyHandler createHandler()
459     {
460         PropertyHandler handler = ApplyPropertyDefaultBase<LengthSize, getterFunction, LengthSize, setterFunction, LengthSize, initialFunction>::createHandler();
461         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
462     }
463 };
464
465 template <typename T>
466 struct FillLayerAccessorTypes {
467     typedef T Setter;
468     typedef T Getter;
469 };
470
471 template <>
472 struct FillLayerAccessorTypes<StyleImage*> {
473     typedef PassRefPtr<StyleImage> Setter;
474     typedef StyleImage* Getter;
475 };
476
477 template <typename T,
478           CSSPropertyID propertyId,
479           EFillLayerType fillLayerType,
480           FillLayer* (RenderStyle::*accessLayersFunction)(),
481           const FillLayer* (RenderStyle::*layersFunction)() const,
482           bool (FillLayer::*testFunction)() const,
483           typename FillLayerAccessorTypes<T>::Getter (FillLayer::*getFunction)() const,
484           void (FillLayer::*setFunction)(typename FillLayerAccessorTypes<T>::Setter),
485           void (FillLayer::*clearFunction)(),
486           typename FillLayerAccessorTypes<T>::Getter (*initialFunction)(EFillLayerType),
487           void (StyleResolver::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)>
488 class ApplyPropertyFillLayer {
489 public:
490     static void applyInheritValue(StyleResolver* styleResolver)
491     {
492         FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
493         FillLayer* prevChild = 0;
494         const FillLayer* currParent = (styleResolver->parentStyle()->*layersFunction)();
495         while (currParent && (currParent->*testFunction)()) {
496             if (!currChild) {
497                 /* Need to make a new layer.*/
498                 currChild = new FillLayer(fillLayerType);
499                 prevChild->setNext(currChild);
500             }
501             (currChild->*setFunction)((currParent->*getFunction)());
502             prevChild = currChild;
503             currChild = prevChild->next();
504             currParent = currParent->next();
505         }
506
507         while (currChild) {
508             /* Reset any remaining layers to not have the property set. */
509             (currChild->*clearFunction)();
510             currChild = currChild->next();
511         }
512     }
513
514     static void applyInitialValue(StyleResolver* styleResolver)
515     {
516         FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
517         (currChild->*setFunction)((*initialFunction)(fillLayerType));
518         for (currChild = currChild->next(); currChild; currChild = currChild->next())
519             (currChild->*clearFunction)();
520     }
521
522     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
523     {
524         FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
525         FillLayer* prevChild = 0;
526         if (value->isValueList()
527 #if ENABLE(CSS_IMAGE_SET)
528         && !value->isImageSetValue()
529 #endif
530         ) {
531             /* Walk each value and put it into a layer, creating new layers as needed. */
532             CSSValueList* valueList = static_cast<CSSValueList*>(value);
533             for (unsigned int i = 0; i < valueList->length(); i++) {
534                 if (!currChild) {
535                     /* Need to make a new layer to hold this value */
536                     currChild = new FillLayer(fillLayerType);
537                     prevChild->setNext(currChild);
538                 }
539                 (styleResolver->*mapFillFunction)(propertyId, currChild, valueList->itemWithoutBoundsCheck(i));
540                 prevChild = currChild;
541                 currChild = currChild->next();
542             }
543         } else {
544             (styleResolver->*mapFillFunction)(propertyId, currChild, value);
545             currChild = currChild->next();
546         }
547         while (currChild) {
548             /* Reset all remaining layers to not have the property set. */
549             (currChild->*clearFunction)();
550             currChild = currChild->next();
551         }
552     }
553
554     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
555 };
556
557 enum ComputeLengthNormal {NormalDisabled = 0, NormalEnabled};
558 enum ComputeLengthThickness {ThicknessDisabled = 0, ThicknessEnabled};
559 enum ComputeLengthSVGZoom {SVGZoomDisabled = 0, SVGZoomEnabled};
560 template <typename T,
561           T (RenderStyle::*getterFunction)() const,
562           void (RenderStyle::*setterFunction)(T),
563           T (*initialFunction)(),
564           ComputeLengthNormal normalEnabled = NormalDisabled,
565           ComputeLengthThickness thicknessEnabled = ThicknessDisabled,
566           ComputeLengthSVGZoom svgZoomEnabled = SVGZoomDisabled>
567 class ApplyPropertyComputeLength {
568 public:
569     static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
570     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
571     {
572         // note: CSSPropertyLetter/WordSpacing right now sets to zero if it's not a primitive value for some reason...
573         if (!value->isPrimitiveValue())
574             return;
575
576         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
577
578         int ident = primitiveValue->getIdent();
579         T length;
580         if (normalEnabled && ident == CSSValueNormal) {
581             length = 0;
582         } else if (thicknessEnabled && ident == CSSValueThin) {
583             length = 1;
584         } else if (thicknessEnabled && ident == CSSValueMedium) {
585             length = 3;
586         } else if (thicknessEnabled && ident == CSSValueThick) {
587             length = 5;
588         } else if (ident == CSSValueInvalid) {
589             float zoom = (svgZoomEnabled && styleResolver->useSVGZoomRules()) ? 1.0f : styleResolver->style()->effectiveZoom();
590             length = primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), zoom);
591         } else {
592             ASSERT_NOT_REACHED();
593             length = 0;
594         }
595
596         setValue(styleResolver->style(), length);
597     }
598     static PropertyHandler createHandler()
599     {
600         PropertyHandler handler = ApplyPropertyDefaultBase<T, getterFunction, T, setterFunction, T, initialFunction>::createHandler();
601         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
602     }
603 };
604
605 template <typename T, T (FontDescription::*getterFunction)() const, void (FontDescription::*setterFunction)(T), T initialValue>
606 class ApplyPropertyFont {
607 public:
608     static void applyInheritValue(StyleResolver* styleResolver)
609     {
610         FontDescription fontDescription = styleResolver->fontDescription();
611         (fontDescription.*setterFunction)((styleResolver->parentFontDescription().*getterFunction)());
612         styleResolver->setFontDescription(fontDescription);
613     }
614
615     static void applyInitialValue(StyleResolver* styleResolver)
616     {
617         FontDescription fontDescription = styleResolver->fontDescription();
618         (fontDescription.*setterFunction)(initialValue);
619         styleResolver->setFontDescription(fontDescription);
620     }
621
622     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
623     {
624         if (!value->isPrimitiveValue())
625             return;
626         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
627         FontDescription fontDescription = styleResolver->fontDescription();
628         (fontDescription.*setterFunction)(*primitiveValue);
629         styleResolver->setFontDescription(fontDescription);
630     }
631
632     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
633 };
634
635 class ApplyPropertyFontSize {
636 private:
637     // When the CSS keyword "larger" is used, this function will attempt to match within the keyword
638     // table, and failing that, will simply multiply by 1.2.
639     static float largerFontSize(float size)
640     {
641         // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale up to
642         // the next size level.
643         return size * 1.2f;
644     }
645
646     // Like the previous function, but for the keyword "smaller".
647     static float smallerFontSize(float size)
648     {
649         // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale down to
650         // the next size level.
651         return size / 1.2f;
652     }
653 public:
654     static void applyInheritValue(StyleResolver* styleResolver)
655     {
656         float size = styleResolver->parentStyle()->fontDescription().specifiedSize();
657
658         if (size < 0)
659             return;
660
661         FontDescription fontDescription = styleResolver->style()->fontDescription();
662         fontDescription.setKeywordSize(styleResolver->parentStyle()->fontDescription().keywordSize());
663         styleResolver->setFontSize(fontDescription, size);
664         styleResolver->setFontDescription(fontDescription);
665         return;
666     }
667
668     static void applyInitialValue(StyleResolver* styleResolver)
669     {
670         FontDescription fontDescription = styleResolver->style()->fontDescription();
671         float size = styleResolver->fontSizeForKeyword(styleResolver->document(), CSSValueMedium, fontDescription.useFixedDefaultSize());
672
673         if (size < 0)
674             return;
675
676         fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
677         styleResolver->setFontSize(fontDescription, size);
678         styleResolver->setFontDescription(fontDescription);
679         return;
680     }
681
682     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
683     {
684         if (!value->isPrimitiveValue())
685             return;
686
687         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
688
689         FontDescription fontDescription = styleResolver->style()->fontDescription();
690         fontDescription.setKeywordSize(0);
691         float parentSize = 0;
692         bool parentIsAbsoluteSize = false;
693         float size = 0;
694
695         if (styleResolver->hasParentNode()) {
696             parentSize = styleResolver->parentStyle()->fontDescription().specifiedSize();
697             parentIsAbsoluteSize = styleResolver->parentStyle()->fontDescription().isAbsoluteSize();
698         }
699
700         if (int ident = primitiveValue->getIdent()) {
701             // Keywords are being used.
702             switch (ident) {
703             case CSSValueXxSmall:
704             case CSSValueXSmall:
705             case CSSValueSmall:
706             case CSSValueMedium:
707             case CSSValueLarge:
708             case CSSValueXLarge:
709             case CSSValueXxLarge:
710             case CSSValueWebkitXxxLarge:
711                 size = styleResolver->fontSizeForKeyword(styleResolver->document(), ident, fontDescription.useFixedDefaultSize());
712                 fontDescription.setKeywordSize(ident - CSSValueXxSmall + 1);
713                 break;
714             case CSSValueLarger:
715                 size = largerFontSize(parentSize);
716                 break;
717             case CSSValueSmaller:
718                 size = smallerFontSize(parentSize);
719                 break;
720             default:
721                 return;
722             }
723
724             fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize && (ident == CSSValueLarger || ident == CSSValueSmaller));
725         } else {
726             fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize
727                                               || !(primitiveValue->isPercentage() || primitiveValue->isFontRelativeLength()));
728             if (primitiveValue->isLength())
729                 size = primitiveValue->computeLength<float>(styleResolver->parentStyle(), styleResolver->rootElementStyle(), 1.0, true);
730             else if (primitiveValue->isPercentage())
731                 size = (primitiveValue->getFloatValue() * parentSize) / 100.0f;
732             else if (primitiveValue->isCalculatedPercentageWithLength())
733                 size = primitiveValue->cssCalcValue()->toCalcValue(styleResolver->parentStyle(), styleResolver->rootElementStyle())->evaluate(parentSize);
734             else if (primitiveValue->isViewportPercentageLength())
735                 size = valueForLength(primitiveValue->viewportPercentageLength(), 0, styleResolver->document()->renderView());
736             else
737                 return;
738         }
739
740         if (size < 0)
741             return;
742
743         styleResolver->setFontSize(fontDescription, size);
744         styleResolver->setFontDescription(fontDescription);
745         return;
746     }
747
748     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
749 };
750
751 class ApplyPropertyFontWeight {
752 public:
753     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
754     {
755         if (!value->isPrimitiveValue())
756             return;
757         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
758         FontDescription fontDescription = styleResolver->fontDescription();
759         switch (primitiveValue->getIdent()) {
760         case CSSValueInvalid:
761             ASSERT_NOT_REACHED();
762             break;
763         case CSSValueBolder:
764             fontDescription.setWeight(fontDescription.bolderWeight());
765             break;
766         case CSSValueLighter:
767             fontDescription.setWeight(fontDescription.lighterWeight());
768             break;
769         default:
770             fontDescription.setWeight(*primitiveValue);
771         }
772         styleResolver->setFontDescription(fontDescription);
773     }
774     static PropertyHandler createHandler()
775     {
776         PropertyHandler handler = ApplyPropertyFont<FontWeight, &FontDescription::weight, &FontDescription::setWeight, FontWeightNormal>::createHandler();
777         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
778     }
779 };
780
781 class ApplyPropertyFontVariantLigatures {
782 public:
783     static void applyInheritValue(StyleResolver* styleResolver)
784     {
785         const FontDescription& parentFontDescription = styleResolver->parentFontDescription();
786         FontDescription fontDescription = styleResolver->fontDescription();
787
788         fontDescription.setCommonLigaturesState(parentFontDescription.commonLigaturesState());
789         fontDescription.setDiscretionaryLigaturesState(parentFontDescription.discretionaryLigaturesState());
790         fontDescription.setHistoricalLigaturesState(parentFontDescription.historicalLigaturesState());
791
792         styleResolver->setFontDescription(fontDescription);
793     }
794
795     static void applyInitialValue(StyleResolver* styleResolver)
796     {
797         FontDescription fontDescription = styleResolver->fontDescription();
798
799         fontDescription.setCommonLigaturesState(FontDescription::NormalLigaturesState);
800         fontDescription.setDiscretionaryLigaturesState(FontDescription::NormalLigaturesState);
801         fontDescription.setHistoricalLigaturesState(FontDescription::NormalLigaturesState);
802
803         styleResolver->setFontDescription(fontDescription);
804     }
805
806     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
807     {
808         FontDescription::LigaturesState commonLigaturesState = FontDescription::NormalLigaturesState;
809         FontDescription::LigaturesState discretionaryLigaturesState = FontDescription::NormalLigaturesState;
810         FontDescription::LigaturesState historicalLigaturesState = FontDescription::NormalLigaturesState;
811
812         if (value->isValueList()) {
813             CSSValueList* valueList = static_cast<CSSValueList*>(value);
814             for (size_t i = 0; i < valueList->length(); ++i) {
815                 CSSValue* item = valueList->itemWithoutBoundsCheck(i);
816                 ASSERT(item->isPrimitiveValue());
817                 if (item->isPrimitiveValue()) {
818                     CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
819                     switch (primitiveValue->getIdent()) {
820                     case CSSValueNoCommonLigatures:
821                         commonLigaturesState = FontDescription::DisabledLigaturesState;
822                         break;
823                     case CSSValueCommonLigatures:
824                         commonLigaturesState = FontDescription::EnabledLigaturesState;
825                         break;
826                     case CSSValueNoDiscretionaryLigatures:
827                         discretionaryLigaturesState = FontDescription::DisabledLigaturesState;
828                         break;
829                     case CSSValueDiscretionaryLigatures:
830                         discretionaryLigaturesState = FontDescription::EnabledLigaturesState;
831                         break;
832                     case CSSValueNoHistoricalLigatures:
833                         historicalLigaturesState = FontDescription::DisabledLigaturesState;
834                         break;
835                     case CSSValueHistoricalLigatures:
836                         historicalLigaturesState = FontDescription::EnabledLigaturesState;
837                         break;
838                     default:
839                         ASSERT_NOT_REACHED();
840                         break;
841                     }
842                 }
843             }
844         }
845 #if !ASSERT_DISABLED
846         else {
847             ASSERT(value->isPrimitiveValue());
848             ASSERT(static_cast<CSSPrimitiveValue*>(value)->getIdent() == CSSValueNormal);
849         }
850 #endif
851
852         FontDescription fontDescription = styleResolver->fontDescription();
853         fontDescription.setCommonLigaturesState(commonLigaturesState);
854         fontDescription.setDiscretionaryLigaturesState(discretionaryLigaturesState);
855         fontDescription.setHistoricalLigaturesState(historicalLigaturesState);
856         styleResolver->setFontDescription(fontDescription);
857     }
858
859     static PropertyHandler createHandler()
860     {
861         return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
862     }
863 };
864
865 enum BorderImageType { Image = 0, Mask };
866 template <BorderImageType borderImageType,
867           CSSPropertyID property,
868           const NinePieceImage& (RenderStyle::*getterFunction)() const,
869           void (RenderStyle::*setterFunction)(const NinePieceImage&)>
870 class ApplyPropertyBorderImage {
871 public:
872     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
873     {
874         NinePieceImage image;
875         if (borderImageType == Mask)
876             image.setMaskDefaults();
877         styleResolver->mapNinePieceImage(property, value, image);
878         (styleResolver->style()->*setterFunction)(image);
879     }
880
881     static PropertyHandler createHandler()
882     {
883         PropertyHandler handler = ApplyPropertyDefaultBase<const NinePieceImage&, getterFunction, const NinePieceImage&, setterFunction, NinePieceImage, &RenderStyle::initialNinePieceImage>::createHandler();
884         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
885     }
886 };
887
888 enum BorderImageModifierType { Outset, Repeat, Slice, Width };
889 template <BorderImageType type, BorderImageModifierType modifier>
890 class ApplyPropertyBorderImageModifier {
891 private:
892     static inline const NinePieceImage& getValue(RenderStyle* style) { return type == Image ? style->borderImage() : style->maskBoxImage(); }
893     static inline void setValue(RenderStyle* style, const NinePieceImage& value) { return type == Image ? style->setBorderImage(value) : style->setMaskBoxImage(value); }
894 public:
895     static void applyInheritValue(StyleResolver* styleResolver)
896     {
897         NinePieceImage image(getValue(styleResolver->style()));
898         switch (modifier) {
899         case Outset:
900             image.copyOutsetFrom(getValue(styleResolver->parentStyle()));
901             break;
902         case Repeat:
903             image.copyRepeatFrom(getValue(styleResolver->parentStyle()));
904             break;
905         case Slice:
906             image.copyImageSlicesFrom(getValue(styleResolver->parentStyle()));
907             break;
908         case Width:
909             image.copyBorderSlicesFrom(getValue(styleResolver->parentStyle()));
910             break;
911         }
912         setValue(styleResolver->style(), image);
913     }
914
915     static void applyInitialValue(StyleResolver* styleResolver)
916     {
917         NinePieceImage image(getValue(styleResolver->style()));
918         switch (modifier) {
919         case Outset:
920             image.setOutset(LengthBox(0));
921             break;
922         case Repeat:
923             image.setHorizontalRule(StretchImageRule);
924             image.setVerticalRule(StretchImageRule);
925             break;
926         case Slice:
927             // Masks have a different initial value for slices. Preserve the value of 0 for backwards compatibility.
928             image.setImageSlices(type == Image ? LengthBox(Length(100, Percent), Length(100, Percent), Length(100, Percent), Length(100, Percent)) : LengthBox());
929             image.setFill(false);
930             break;
931         case Width:
932             // Masks have a different initial value for widths. They use an 'auto' value rather than trying to fit to the border.
933             image.setBorderSlices(type == Image ? LengthBox(Length(1, Relative), Length(1, Relative), Length(1, Relative), Length(1, Relative)) : LengthBox());
934             break;
935         }
936         setValue(styleResolver->style(), image);
937     }
938
939     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
940     {
941         NinePieceImage image(getValue(styleResolver->style()));
942         switch (modifier) {
943         case Outset:
944             image.setOutset(styleResolver->mapNinePieceImageQuad(value));
945             break;
946         case Repeat:
947             styleResolver->mapNinePieceImageRepeat(value, image);
948             break;
949         case Slice:
950             styleResolver->mapNinePieceImageSlice(value, image);
951             break;
952         case Width:
953             image.setBorderSlices(styleResolver->mapNinePieceImageQuad(value));
954             break;
955         }
956         setValue(styleResolver->style(), image);
957     }
958
959     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
960 };
961
962 template <CSSPropertyID id, StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)()>
963 class ApplyPropertyBorderImageSource {
964 public:
965     static void applyValue(StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(id, value)); }
966     static PropertyHandler createHandler()
967     {
968         PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
969         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
970     }
971 };
972
973 enum CounterBehavior {Increment = 0, Reset};
974 template <CounterBehavior counterBehavior>
975 class ApplyPropertyCounter {
976 public:
977     static void emptyFunction(StyleResolver*) { }
978     static void applyInheritValue(StyleResolver* styleResolver)
979     {
980         CounterDirectiveMap& map = styleResolver->style()->accessCounterDirectives();
981         CounterDirectiveMap& parentMap = styleResolver->parentStyle()->accessCounterDirectives();
982
983         typedef CounterDirectiveMap::iterator Iterator;
984         Iterator end = parentMap.end();
985         for (Iterator it = parentMap.begin(); it != end; ++it) {
986             CounterDirectives& directives = map.add(it->first, CounterDirectives()).iterator->second;
987             if (counterBehavior == Reset) {
988                 directives.m_reset = it->second.m_reset;
989                 directives.m_resetValue = it->second.m_resetValue;
990             } else {
991                 // Inheriting a counter-increment means taking the parent's current value for the counter
992                 // and adding it to itself.
993                 directives.m_increment = it->second.m_increment;
994                 directives.m_incrementValue = 0;
995                 if (directives.m_increment) {
996                     float incrementValue = directives.m_incrementValue;
997                     directives.m_incrementValue = clampToInteger(incrementValue + it->second.m_incrementValue);
998                 } else {
999                     directives.m_increment = true;
1000                     directives.m_incrementValue = it->second.m_incrementValue;
1001                 }
1002             }
1003         }
1004     }
1005     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1006     {
1007         if (!value->isValueList())
1008             return;
1009
1010         CSSValueList* list = static_cast<CSSValueList*>(value);
1011
1012         CounterDirectiveMap& map = styleResolver->style()->accessCounterDirectives();
1013         typedef CounterDirectiveMap::iterator Iterator;
1014
1015         Iterator end = map.end();
1016         for (Iterator it = map.begin(); it != end; ++it)
1017             if (counterBehavior == Reset)
1018                 it->second.m_reset = false;
1019             else
1020                 it->second.m_increment = false;
1021
1022         int length = list ? list->length() : 0;
1023         for (int i = 0; i < length; ++i) {
1024             CSSValue* currValue = list->itemWithoutBoundsCheck(i);
1025             if (!currValue->isPrimitiveValue())
1026                 continue;
1027
1028             Pair* pair = static_cast<CSSPrimitiveValue*>(currValue)->getPairValue();
1029             if (!pair || !pair->first() || !pair->second())
1030                 continue;
1031
1032             AtomicString identifier = static_cast<CSSPrimitiveValue*>(pair->first())->getStringValue();
1033             int value = static_cast<CSSPrimitiveValue*>(pair->second())->getIntValue();
1034             CounterDirectives& directives = map.add(identifier.impl(), CounterDirectives()).iterator->second;
1035             if (counterBehavior == Reset) {
1036                 directives.m_reset = true;
1037                 directives.m_resetValue = value;
1038             } else {
1039                 if (directives.m_increment) {
1040                     float incrementValue = directives.m_incrementValue;
1041                     directives.m_incrementValue = clampToInteger(incrementValue + value);
1042                 } else {
1043                     directives.m_increment = true;
1044                     directives.m_incrementValue = value;
1045                 }
1046             }
1047             
1048         }
1049     }
1050     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &emptyFunction, &applyValue); }
1051 };
1052
1053
1054 class ApplyPropertyCursor {
1055 public:
1056     static void applyInheritValue(StyleResolver* styleResolver)
1057     {
1058         styleResolver->style()->setCursor(styleResolver->parentStyle()->cursor());
1059         styleResolver->style()->setCursorList(styleResolver->parentStyle()->cursors());
1060     }
1061
1062     static void applyInitialValue(StyleResolver* styleResolver)
1063     {
1064         styleResolver->style()->clearCursorList();
1065         styleResolver->style()->setCursor(RenderStyle::initialCursor());
1066     }
1067
1068     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1069     {
1070         styleResolver->style()->clearCursorList();
1071         if (value->isValueList()) {
1072             CSSValueList* list = static_cast<CSSValueList*>(value);
1073             int len = list->length();
1074             styleResolver->style()->setCursor(CURSOR_AUTO);
1075             for (int i = 0; i < len; i++) {
1076                 CSSValue* item = list->itemWithoutBoundsCheck(i);
1077                 if (item->isCursorImageValue()) {
1078                     CSSCursorImageValue* image = static_cast<CSSCursorImageValue*>(item);
1079                     if (image->updateIfSVGCursorIsUsed(styleResolver->element())) // Elements with SVG cursors are not allowed to share style.
1080                         styleResolver->style()->setUnique();
1081                     styleResolver->style()->addCursor(styleResolver->cachedOrPendingFromValue(CSSPropertyCursor, image), image->hotSpot());
1082                 } else if (item->isPrimitiveValue()) {
1083                     CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
1084                     if (primitiveValue->isIdent())
1085                         styleResolver->style()->setCursor(*primitiveValue);
1086                 }
1087             }
1088         } else if (value->isPrimitiveValue()) {
1089             CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1090             if (primitiveValue->isIdent() && styleResolver->style()->cursor() != ECursor(*primitiveValue))
1091                 styleResolver->style()->setCursor(*primitiveValue);
1092         }
1093     }
1094
1095     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1096 };
1097
1098 class ApplyPropertyTextAlign {
1099 public:
1100     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1101     {
1102         if (!value->isPrimitiveValue())
1103             return;
1104
1105         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1106
1107         if (primitiveValue->getIdent() != CSSValueWebkitMatchParent)
1108             styleResolver->style()->setTextAlign(*primitiveValue);
1109         else if (styleResolver->parentStyle()->textAlign() == TASTART)
1110             styleResolver->style()->setTextAlign(styleResolver->parentStyle()->isLeftToRightDirection() ? LEFT : RIGHT);
1111         else if (styleResolver->parentStyle()->textAlign() == TAEND)
1112             styleResolver->style()->setTextAlign(styleResolver->parentStyle()->isLeftToRightDirection() ? RIGHT : LEFT);
1113         else
1114             styleResolver->style()->setTextAlign(styleResolver->parentStyle()->textAlign());
1115     }
1116     static PropertyHandler createHandler()
1117     {
1118         PropertyHandler handler = ApplyPropertyDefaultBase<ETextAlign, &RenderStyle::textAlign, ETextAlign, &RenderStyle::setTextAlign, ETextAlign, &RenderStyle::initialTextAlign>::createHandler();
1119         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1120     }
1121 };
1122
1123 class ApplyPropertyTextDecoration {
1124 public:
1125     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1126     {
1127         ETextDecoration t = RenderStyle::initialTextDecoration();
1128         for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
1129             CSSValue* item = i.value();
1130             ASSERT(item->isPrimitiveValue());
1131             t |= *static_cast<CSSPrimitiveValue*>(item);
1132         }
1133         styleResolver->style()->setTextDecoration(t);
1134     }
1135     static PropertyHandler createHandler()
1136     {
1137         PropertyHandler handler = ApplyPropertyDefaultBase<ETextDecoration, &RenderStyle::textDecoration, ETextDecoration, &RenderStyle::setTextDecoration, ETextDecoration, &RenderStyle::initialTextDecoration>::createHandler();
1138         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1139     }
1140 };
1141
1142 class ApplyPropertyUnicodeBidi {
1143 public:
1144     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1145     {
1146         if (value->isValueList()) {
1147             EUnicodeBidi rendererUnicodeBidi = RenderStyle::initialUnicodeBidi();
1148             for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
1149                 CSSValue* item = i.value();
1150                 ASSERT(item->isPrimitiveValue());
1151                 EUnicodeBidi currentValue = *static_cast<CSSPrimitiveValue*>(item);
1152                 ASSERT(currentValue == Override || currentValue == Isolate);
1153                 if (currentValue != rendererUnicodeBidi && rendererUnicodeBidi != RenderStyle::initialUnicodeBidi())
1154                     rendererUnicodeBidi = OverrideIsolate;
1155                 else
1156                     rendererUnicodeBidi = currentValue;
1157             }
1158             styleResolver->style()->setUnicodeBidi(rendererUnicodeBidi);
1159         }
1160         if (!value->isPrimitiveValue())
1161             return;
1162         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1163         styleResolver->style()->setUnicodeBidi(*primitiveValue);
1164     }
1165     static PropertyHandler createHandler()
1166     {
1167         PropertyHandler handler = ApplyPropertyDefaultBase<EUnicodeBidi, &RenderStyle::unicodeBidi, EUnicodeBidi, &RenderStyle::setUnicodeBidi, EUnicodeBidi, &RenderStyle::initialUnicodeBidi>::createHandler();
1168         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1169     }
1170 };
1171
1172 class ApplyPropertyLineHeight {
1173 public:
1174     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1175     {
1176         if (!value->isPrimitiveValue())
1177             return;
1178
1179         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1180         Length lineHeight;
1181
1182         if (primitiveValue->getIdent() == CSSValueNormal)
1183             lineHeight = Length(-100.0, Percent);
1184         else if (primitiveValue->isLength()) {
1185             double multiplier = styleResolver->style()->effectiveZoom();
1186             if (styleResolver->style()->textSizeAdjust()) {
1187                 if (Frame* frame = styleResolver->document()->frame())
1188                     multiplier *= frame->textZoomFactor();
1189             }
1190             lineHeight = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), multiplier);
1191         } else if (primitiveValue->isPercentage()) {
1192             // FIXME: percentage should not be restricted to an integer here.
1193             lineHeight = Length((styleResolver->style()->fontSize() * primitiveValue->getIntValue()) / 100, Fixed);
1194         } else if (primitiveValue->isNumber()) {
1195             // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
1196             lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
1197         } else if (primitiveValue->isViewportPercentageLength())
1198             lineHeight = primitiveValue->viewportPercentageLength();
1199         else
1200             return;
1201         styleResolver->style()->setLineHeight(lineHeight);
1202     }
1203     static PropertyHandler createHandler()
1204     {
1205         PropertyHandler handler = ApplyPropertyDefaultBase<Length, &RenderStyle::lineHeight, Length, &RenderStyle::setLineHeight, Length, &RenderStyle::initialLineHeight>::createHandler();
1206         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1207     }
1208 };
1209
1210 class ApplyPropertyPageSize {
1211 private:
1212     static Length mmLength(double mm) { return CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM)->computeLength<Length>(0, 0); }
1213     static Length inchLength(double inch) { return CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN)->computeLength<Length>(0, 0); }
1214     static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
1215     {
1216         DEFINE_STATIC_LOCAL(Length, a5Width, (mmLength(148)));
1217         DEFINE_STATIC_LOCAL(Length, a5Height, (mmLength(210)));
1218         DEFINE_STATIC_LOCAL(Length, a4Width, (mmLength(210)));
1219         DEFINE_STATIC_LOCAL(Length, a4Height, (mmLength(297)));
1220         DEFINE_STATIC_LOCAL(Length, a3Width, (mmLength(297)));
1221         DEFINE_STATIC_LOCAL(Length, a3Height, (mmLength(420)));
1222         DEFINE_STATIC_LOCAL(Length, b5Width, (mmLength(176)));
1223         DEFINE_STATIC_LOCAL(Length, b5Height, (mmLength(250)));
1224         DEFINE_STATIC_LOCAL(Length, b4Width, (mmLength(250)));
1225         DEFINE_STATIC_LOCAL(Length, b4Height, (mmLength(353)));
1226         DEFINE_STATIC_LOCAL(Length, letterWidth, (inchLength(8.5)));
1227         DEFINE_STATIC_LOCAL(Length, letterHeight, (inchLength(11)));
1228         DEFINE_STATIC_LOCAL(Length, legalWidth, (inchLength(8.5)));
1229         DEFINE_STATIC_LOCAL(Length, legalHeight, (inchLength(14)));
1230         DEFINE_STATIC_LOCAL(Length, ledgerWidth, (inchLength(11)));
1231         DEFINE_STATIC_LOCAL(Length, ledgerHeight, (inchLength(17)));
1232
1233         if (!pageSizeName)
1234             return false;
1235
1236         switch (pageSizeName->getIdent()) {
1237         case CSSValueA5:
1238             width = a5Width;
1239             height = a5Height;
1240             break;
1241         case CSSValueA4:
1242             width = a4Width;
1243             height = a4Height;
1244             break;
1245         case CSSValueA3:
1246             width = a3Width;
1247             height = a3Height;
1248             break;
1249         case CSSValueB5:
1250             width = b5Width;
1251             height = b5Height;
1252             break;
1253         case CSSValueB4:
1254             width = b4Width;
1255             height = b4Height;
1256             break;
1257         case CSSValueLetter:
1258             width = letterWidth;
1259             height = letterHeight;
1260             break;
1261         case CSSValueLegal:
1262             width = legalWidth;
1263             height = legalHeight;
1264             break;
1265         case CSSValueLedger:
1266             width = ledgerWidth;
1267             height = ledgerHeight;
1268             break;
1269         default:
1270             return false;
1271         }
1272
1273         if (pageOrientation) {
1274             switch (pageOrientation->getIdent()) {
1275             case CSSValueLandscape:
1276                 std::swap(width, height);
1277                 break;
1278             case CSSValuePortrait:
1279                 // Nothing to do.
1280                 break;
1281             default:
1282                 return false;
1283             }
1284         }
1285         return true;
1286     }
1287 public:
1288     static void applyInheritValue(StyleResolver*) { }
1289     static void applyInitialValue(StyleResolver*) { }
1290     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1291     {
1292         styleResolver->style()->resetPageSizeType();
1293         Length width;
1294         Length height;
1295         PageSizeType pageSizeType = PAGE_SIZE_AUTO;
1296         CSSValueListInspector inspector(value);
1297         switch (inspector.length()) {
1298         case 2: {
1299             // <length>{2} | <page-size> <orientation>
1300             if (!inspector.first()->isPrimitiveValue() || !inspector.second()->isPrimitiveValue())
1301                 return;
1302             CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(inspector.first());
1303             CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(inspector.second());
1304             if (first->isLength()) {
1305                 // <length>{2}
1306                 if (!second->isLength())
1307                     return;
1308                 width = first->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
1309                 height = second->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
1310             } else {
1311                 // <page-size> <orientation>
1312                 // The value order is guaranteed. See CSSParser::parseSizeParameter.
1313                 if (!getPageSizeFromName(first, second, width, height))
1314                     return;
1315             }
1316             pageSizeType = PAGE_SIZE_RESOLVED;
1317             break;
1318         }
1319         case 1: {
1320             // <length> | auto | <page-size> | [ portrait | landscape]
1321             if (!inspector.first()->isPrimitiveValue())
1322                 return;
1323             CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(inspector.first());
1324             if (primitiveValue->isLength()) {
1325                 // <length>
1326                 pageSizeType = PAGE_SIZE_RESOLVED;
1327                 width = height = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
1328             } else {
1329                 switch (primitiveValue->getIdent()) {
1330                 case 0:
1331                     return;
1332                 case CSSValueAuto:
1333                     pageSizeType = PAGE_SIZE_AUTO;
1334                     break;
1335                 case CSSValuePortrait:
1336                     pageSizeType = PAGE_SIZE_AUTO_PORTRAIT;
1337                     break;
1338                 case CSSValueLandscape:
1339                     pageSizeType = PAGE_SIZE_AUTO_LANDSCAPE;
1340                     break;
1341                 default:
1342                     // <page-size>
1343                     pageSizeType = PAGE_SIZE_RESOLVED;
1344                     if (!getPageSizeFromName(primitiveValue, 0, width, height))
1345                         return;
1346                 }
1347             }
1348             break;
1349         }
1350         default:
1351             return;
1352         }
1353         styleResolver->style()->setPageSizeType(pageSizeType);
1354         styleResolver->style()->setPageSize(LengthSize(width, height));
1355     }
1356     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1357 };
1358
1359 class ApplyPropertyTextEmphasisStyle {
1360 public:
1361     static void applyInheritValue(StyleResolver* styleResolver)
1362     {
1363         styleResolver->style()->setTextEmphasisFill(styleResolver->parentStyle()->textEmphasisFill());
1364         styleResolver->style()->setTextEmphasisMark(styleResolver->parentStyle()->textEmphasisMark());
1365         styleResolver->style()->setTextEmphasisCustomMark(styleResolver->parentStyle()->textEmphasisCustomMark());
1366     }
1367
1368     static void applyInitialValue(StyleResolver* styleResolver)
1369     {
1370         styleResolver->style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill());
1371         styleResolver->style()->setTextEmphasisMark(RenderStyle::initialTextEmphasisMark());
1372         styleResolver->style()->setTextEmphasisCustomMark(RenderStyle::initialTextEmphasisCustomMark());
1373     }
1374
1375     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1376     {
1377         if (value->isValueList()) {
1378             CSSValueList* list = static_cast<CSSValueList*>(value);
1379             ASSERT(list->length() == 2);
1380             if (list->length() != 2)
1381                 return;
1382             for (unsigned i = 0; i < 2; ++i) {
1383                 CSSValue* item = list->itemWithoutBoundsCheck(i);
1384                 if (!item->isPrimitiveValue())
1385                     continue;
1386
1387                 CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(item);
1388                 if (value->getIdent() == CSSValueFilled || value->getIdent() == CSSValueOpen)
1389                     styleResolver->style()->setTextEmphasisFill(*value);
1390                 else
1391                     styleResolver->style()->setTextEmphasisMark(*value);
1392             }
1393             styleResolver->style()->setTextEmphasisCustomMark(nullAtom);
1394             return;
1395         }
1396
1397         if (!value->isPrimitiveValue())
1398             return;
1399         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1400
1401         if (primitiveValue->isString()) {
1402             styleResolver->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1403             styleResolver->style()->setTextEmphasisMark(TextEmphasisMarkCustom);
1404             styleResolver->style()->setTextEmphasisCustomMark(primitiveValue->getStringValue());
1405             return;
1406         }
1407
1408         styleResolver->style()->setTextEmphasisCustomMark(nullAtom);
1409
1410         if (primitiveValue->getIdent() == CSSValueFilled || primitiveValue->getIdent() == CSSValueOpen) {
1411             styleResolver->style()->setTextEmphasisFill(*primitiveValue);
1412             styleResolver->style()->setTextEmphasisMark(TextEmphasisMarkAuto);
1413         } else {
1414             styleResolver->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1415             styleResolver->style()->setTextEmphasisMark(*primitiveValue);
1416         }
1417     }
1418
1419     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1420 };
1421
1422 template <typename T,
1423           T (Animation::*getterFunction)() const,
1424           void (Animation::*setterFunction)(T),
1425           bool (Animation::*testFunction)() const,
1426           void (Animation::*clearFunction)(),
1427           T (*initialFunction)(),
1428           void (StyleResolver::*mapFunction)(Animation*, CSSValue*),
1429           AnimationList* (RenderStyle::*animationGetterFunction)(),
1430           const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
1431 class ApplyPropertyAnimation {
1432 public:
1433     static void setValue(Animation* animation, T value) { (animation->*setterFunction)(value); }
1434     static T value(const Animation* animation) { return (animation->*getterFunction)(); }
1435     static bool test(const Animation* animation) { return (animation->*testFunction)(); }
1436     static void clear(Animation* animation) { (animation->*clearFunction)(); }
1437     static T initial() { return (*initialFunction)(); }
1438     static void map(StyleResolver* styleResolver, Animation* animation, CSSValue* value) { (styleResolver->*mapFunction)(animation, value); }
1439     static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
1440     static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
1441
1442     static void applyInheritValue(StyleResolver* styleResolver)
1443     {
1444         AnimationList* list = accessAnimations(styleResolver->style());
1445         const AnimationList* parentList = animations(styleResolver->parentStyle());
1446         size_t i = 0, parentSize = parentList ? parentList->size() : 0;
1447         for ( ; i < parentSize && test(parentList->animation(i)); ++i) {
1448             if (list->size() <= i)
1449                 list->append(Animation::create());
1450             setValue(list->animation(i), value(parentList->animation(i)));
1451             list->animation(i)->setAnimationMode(parentList->animation(i)->animationMode());
1452         }
1453
1454         /* Reset any remaining animations to not have the property set. */
1455         for ( ; i < list->size(); ++i)
1456             clear(list->animation(i));
1457     }
1458
1459     static void applyInitialValue(StyleResolver* styleResolver)
1460     {
1461         AnimationList* list = accessAnimations(styleResolver->style());
1462         if (list->isEmpty())
1463             list->append(Animation::create());
1464         setValue(list->animation(0), initial());
1465         for (size_t i = 1; i < list->size(); ++i)
1466             clear(list->animation(i));
1467     }
1468
1469     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1470     {
1471         AnimationList* list = accessAnimations(styleResolver->style());
1472         size_t childIndex = 0;
1473         if (value->isValueList()) {
1474             /* Walk each value and put it into an animation, creating new animations as needed. */
1475             for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
1476                 if (childIndex <= list->size())
1477                     list->append(Animation::create());
1478                 map(styleResolver, list->animation(childIndex), i.value());
1479                 ++childIndex;
1480             }
1481         } else {
1482             if (list->isEmpty())
1483                 list->append(Animation::create());
1484             map(styleResolver, list->animation(childIndex), value);
1485             childIndex = 1;
1486         }
1487         for ( ; childIndex < list->size(); ++childIndex) {
1488             /* Reset all remaining animations to not have the property set. */
1489             clear(list->animation(childIndex));
1490         }
1491     }
1492
1493     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1494 };
1495
1496 class ApplyPropertyOutlineStyle {
1497 public:
1498     static void applyInheritValue(StyleResolver* styleResolver)
1499     {
1500         ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInheritValue(styleResolver);
1501         ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInheritValue(styleResolver);
1502     }
1503
1504     static void applyInitialValue(StyleResolver* styleResolver)
1505     {
1506         ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInitialValue(styleResolver);
1507         ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInitialValue(styleResolver);
1508     }
1509
1510     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1511     {
1512         ApplyPropertyDefault<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyValue(styleResolver, value);
1513         ApplyPropertyDefault<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyValue(styleResolver, value);
1514     }
1515
1516     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1517 };
1518
1519 class ApplyPropertyResize {
1520 public:
1521     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1522     {
1523         if (!value->isPrimitiveValue())
1524             return;
1525
1526         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1527
1528         EResize r = RESIZE_NONE;
1529         switch (primitiveValue->getIdent()) {
1530         case 0:
1531             return;
1532         case CSSValueAuto:
1533             if (Settings* settings = styleResolver->document()->settings())
1534                 r = settings->textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE;
1535             break;
1536         default:
1537             r = *primitiveValue;
1538         }
1539         styleResolver->style()->setResize(r);
1540     }
1541
1542     static PropertyHandler createHandler()
1543     {
1544         PropertyHandler handler = ApplyPropertyDefaultBase<EResize, &RenderStyle::resize, EResize, &RenderStyle::setResize, EResize, &RenderStyle::initialResize>::createHandler();
1545         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1546     }
1547 };
1548
1549 class ApplyPropertyVerticalAlign {
1550 public:
1551     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1552     {
1553         if (!value->isPrimitiveValue())
1554             return;
1555
1556         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1557
1558         if (primitiveValue->getIdent())
1559             return styleResolver->style()->setVerticalAlign(*primitiveValue);
1560
1561         styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()));
1562     }
1563
1564     static PropertyHandler createHandler()
1565     {
1566         PropertyHandler handler = ApplyPropertyDefaultBase<EVerticalAlign, &RenderStyle::verticalAlign, EVerticalAlign, &RenderStyle::setVerticalAlign, EVerticalAlign, &RenderStyle::initialVerticalAlign>::createHandler();
1567         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1568     }
1569 };
1570
1571 class ApplyPropertyAspectRatio {
1572 public:
1573     static void applyInheritValue(StyleResolver* styleResolver)
1574     {
1575         if (!styleResolver->parentStyle()->hasAspectRatio())
1576             return;
1577         styleResolver->style()->setHasAspectRatio(true);
1578         styleResolver->style()->setAspectRatioDenominator(styleResolver->parentStyle()->aspectRatioDenominator());
1579         styleResolver->style()->setAspectRatioNumerator(styleResolver->parentStyle()->aspectRatioNumerator());
1580     }
1581
1582     static void applyInitialValue(StyleResolver* styleResolver)
1583     {
1584         styleResolver->style()->setHasAspectRatio(RenderStyle::initialHasAspectRatio());
1585         styleResolver->style()->setAspectRatioDenominator(RenderStyle::initialAspectRatioDenominator());
1586         styleResolver->style()->setAspectRatioNumerator(RenderStyle::initialAspectRatioNumerator());
1587     }
1588
1589     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1590     {
1591         if (!value->isAspectRatioValue()) {
1592             styleResolver->style()->setHasAspectRatio(false);
1593             return;
1594         }
1595         CSSAspectRatioValue* aspectRatioValue = static_cast<CSSAspectRatioValue*>(value);
1596         styleResolver->style()->setHasAspectRatio(true);
1597         styleResolver->style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue());
1598         styleResolver->style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue());
1599     }
1600
1601     static PropertyHandler createHandler()
1602     {
1603         return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1604     }
1605 };
1606
1607 class ApplyPropertyZoom {
1608 private:
1609     static void resetEffectiveZoom(StyleResolver* styleResolver)
1610     {
1611         // Reset the zoom in effect. This allows the setZoom method to accurately compute a new zoom in effect.
1612         styleResolver->setEffectiveZoom(styleResolver->parentStyle() ? styleResolver->parentStyle()->effectiveZoom() : RenderStyle::initialZoom());
1613     }
1614
1615 public:
1616     static void applyInheritValue(StyleResolver* styleResolver)
1617     {
1618         resetEffectiveZoom(styleResolver);
1619         styleResolver->setZoom(styleResolver->parentStyle()->zoom());
1620     }
1621
1622     static void applyInitialValue(StyleResolver* styleResolver)
1623     {
1624         resetEffectiveZoom(styleResolver);
1625         styleResolver->setZoom(RenderStyle::initialZoom());
1626     }
1627
1628     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1629     {
1630         ASSERT(value->isPrimitiveValue());
1631         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1632
1633         if (primitiveValue->getIdent() == CSSValueNormal) {
1634             resetEffectiveZoom(styleResolver);
1635             styleResolver->setZoom(RenderStyle::initialZoom());
1636         } else if (primitiveValue->getIdent() == CSSValueReset) {
1637             styleResolver->setEffectiveZoom(RenderStyle::initialZoom());
1638             styleResolver->setZoom(RenderStyle::initialZoom());
1639         } else if (primitiveValue->getIdent() == CSSValueDocument) {
1640             float docZoom = styleResolver->rootElementStyle() ? styleResolver->rootElementStyle()->zoom() : RenderStyle::initialZoom();
1641             styleResolver->setEffectiveZoom(docZoom);
1642             styleResolver->setZoom(docZoom);
1643         } else if (primitiveValue->isPercentage()) {
1644             resetEffectiveZoom(styleResolver);
1645             if (float percent = primitiveValue->getFloatValue())
1646                 styleResolver->setZoom(percent / 100.0f);
1647         } else if (primitiveValue->isNumber()) {
1648             resetEffectiveZoom(styleResolver);
1649             if (float number = primitiveValue->getFloatValue())
1650                 styleResolver->setZoom(number);
1651         }
1652     }
1653
1654     static PropertyHandler createHandler()
1655     {
1656         return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1657     }
1658 };
1659
1660 class ApplyPropertyDisplay {
1661 private:
1662     static inline bool isValidDisplayValue(StyleResolver* styleResolver, EDisplay displayPropertyValue)
1663     {
1664 #if ENABLE(SVG)
1665         if (styleResolver->element() && styleResolver->element()->isSVGElement() && styleResolver->style()->styleType() == NOPSEUDO)
1666             return (displayPropertyValue == INLINE || displayPropertyValue == BLOCK || displayPropertyValue == NONE);
1667 #else
1668         UNUSED_PARAM(styleResolver);
1669         UNUSED_PARAM(displayPropertyValue);
1670 #endif
1671         return true;
1672     }
1673 public:
1674     static void applyInheritValue(StyleResolver* styleResolver)
1675     {
1676         EDisplay display = styleResolver->parentStyle()->display();
1677         if (!isValidDisplayValue(styleResolver, display))
1678             return;
1679         styleResolver->style()->setDisplay(display);
1680     }
1681
1682     static void applyInitialValue(StyleResolver* styleResolver)
1683     {
1684         styleResolver->style()->setDisplay(RenderStyle::initialDisplay());
1685     }
1686
1687     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1688     {
1689         if (!value->isPrimitiveValue())
1690             return;
1691
1692         EDisplay display = *static_cast<CSSPrimitiveValue*>(value);
1693
1694         if (!isValidDisplayValue(styleResolver, display))
1695             return;
1696
1697         styleResolver->style()->setDisplay(display);
1698     }
1699
1700     static PropertyHandler createHandler()
1701     {
1702         return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1703     }
1704 };
1705
1706 class ApplyPropertyFlex {
1707 public:
1708     static void applyInheritValue(StyleResolver* styleResolver)
1709     {
1710         ApplyPropertyDefaultBase<float, &RenderStyle::positiveFlex, float, &RenderStyle::setPositiveFlex, float, &RenderStyle::initialNegativeFlex>::applyInheritValue(styleResolver);
1711         ApplyPropertyDefaultBase<float, &RenderStyle::negativeFlex, float, &RenderStyle::setNegativeFlex, float, &RenderStyle::initialPositiveFlex>::applyInheritValue(styleResolver);
1712         ApplyPropertyDefaultBase<Length, &RenderStyle::flexPreferredSize, Length, &RenderStyle::setFlexPreferredSize, Length, &RenderStyle::initialFlexPreferredSize>::applyInheritValue(styleResolver);
1713     }
1714
1715     static void applyInitialValue(StyleResolver* styleResolver)
1716     {
1717         styleResolver->style()->setPositiveFlex(RenderStyle::initialPositiveFlex());
1718         styleResolver->style()->setNegativeFlex(RenderStyle::initialNegativeFlex());
1719         styleResolver->style()->setFlexPreferredSize(RenderStyle::initialFlexPreferredSize());
1720     }
1721
1722     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1723     {
1724         if (value->isPrimitiveValue()) {
1725             CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1726             if (primitiveValue->getIdent() == CSSValueNone)
1727                 applyInitialValue(styleResolver);
1728             return;
1729         }
1730
1731         if (!value->isValueList())
1732             return;
1733         CSSValueList* valueList = static_cast<CSSValueList*>(value);
1734         if (valueList->length() != 3)
1735             return;
1736
1737         float flexValue = 0;
1738         if (!getFlexValue(valueList->itemWithoutBoundsCheck(0), flexValue))
1739             return;
1740         styleResolver->style()->setPositiveFlex(flexValue);
1741
1742         if (!getFlexValue(valueList->itemWithoutBoundsCheck(1), flexValue))
1743             return;
1744         styleResolver->style()->setNegativeFlex(flexValue);
1745
1746         ApplyPropertyLength<&RenderStyle::flexPreferredSize, &RenderStyle::setFlexPreferredSize, &RenderStyle::initialFlexPreferredSize, AutoEnabled>::applyValue(styleResolver, valueList->itemWithoutBoundsCheck(2));
1747     }
1748
1749     static PropertyHandler createHandler()
1750     {
1751         return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1752     }
1753 private:
1754     static bool getFlexValue(CSSValue* value, float& flexValue)
1755     {
1756         if (!value->isPrimitiveValue())
1757             return false;
1758         CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1759         if (!primitiveValue->isNumber())
1760             return false;
1761         flexValue = primitiveValue->getFloatValue();
1762         return true;
1763     }
1764
1765 };
1766
1767 const StyleBuilder& StyleBuilder::sharedStyleBuilder()
1768 {
1769     DEFINE_STATIC_LOCAL(StyleBuilder, styleBuilderInstance, ());
1770     return styleBuilderInstance;
1771 }
1772
1773 StyleBuilder::StyleBuilder()
1774 {
1775     for (int i = 0; i < numCSSProperties; ++i)
1776         m_propertyMap[i] = PropertyHandler();
1777
1778     // Please keep CSS property list in alphabetical order.
1779     setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &StyleResolver::mapFillAttachment>::createHandler());
1780     setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &StyleResolver::mapFillClip>::createHandler());
1781     setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler());
1782     setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &StyleResolver::mapFillImage>::createHandler());
1783     setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &StyleResolver::mapFillOrigin>::createHandler());
1784     setPropertyHandler(CSSPropertyBackgroundPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundPositionX, CSSPropertyBackgroundPositionY>::createHandler());
1785     setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &StyleResolver::mapFillXPosition>::createHandler());
1786     setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &StyleResolver::mapFillYPosition>::createHandler());
1787     setPropertyHandler(CSSPropertyBackgroundRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
1788     setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &StyleResolver::mapFillRepeatX>::createHandler());
1789     setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &StyleResolver::mapFillRepeatY>::createHandler());
1790     setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &StyleResolver::mapFillSize>::createHandler());
1791     setPropertyHandler(CSSPropertyBorder, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderStyle, CSSPropertyBorderWidth, CSSPropertyBorderColor>::createHandler());
1792     setPropertyHandler(CSSPropertyBorderBottom, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderBottomColor, CSSPropertyBorderBottomStyle, CSSPropertyBorderBottomWidth>::createHandler());
1793     setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
1794     setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
1795     setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
1796     setPropertyHandler(CSSPropertyBorderBottomStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderBottomStyle, EBorderStyle, &RenderStyle::setBorderBottomStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1797     setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1798     setPropertyHandler(CSSPropertyBorderCollapse, ApplyPropertyDefault<EBorderCollapse, &RenderStyle::borderCollapse, EBorderCollapse, &RenderStyle::setBorderCollapse, EBorderCollapse, &RenderStyle::initialBorderCollapse>::createHandler());
1799     setPropertyHandler(CSSPropertyBorderColor, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderRightColor, CSSPropertyBorderBottomColor, CSSPropertyBorderLeftColor>::createHandler());
1800     setPropertyHandler(CSSPropertyBorderImage, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderImageSource, CSSPropertyBorderImageSlice, CSSPropertyBorderImageWidth, CSSPropertyBorderImageOutset, CSSPropertyBorderImageRepeat>::createHandler());
1801     setPropertyHandler(CSSPropertyBorderImageOutset, ApplyPropertyBorderImageModifier<Image, Outset>::createHandler());
1802     setPropertyHandler(CSSPropertyBorderImageRepeat, ApplyPropertyBorderImageModifier<Image, Repeat>::createHandler());
1803     setPropertyHandler(CSSPropertyBorderImageSlice, ApplyPropertyBorderImageModifier<Image, Slice>::createHandler());
1804     setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource<CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource, &RenderStyle::initialBorderImageSource>::createHandler());
1805     setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier<Image, Width>::createHandler());
1806     setPropertyHandler(CSSPropertyBorderLeft, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderLeftColor, CSSPropertyBorderLeftStyle, CSSPropertyBorderLeftWidth>::createHandler());
1807     setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
1808     setPropertyHandler(CSSPropertyBorderLeftStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderLeftStyle, EBorderStyle, &RenderStyle::setBorderLeftStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1809     setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1810     setPropertyHandler(CSSPropertyBorderRadius, ApplyPropertyExpanding<ExpandValue, CSSPropertyBorderTopLeftRadius, CSSPropertyBorderTopRightRadius, CSSPropertyBorderBottomLeftRadius, CSSPropertyBorderBottomRightRadius>::createHandler());
1811     setPropertyHandler(CSSPropertyBorderRight, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderRightColor, CSSPropertyBorderRightStyle, CSSPropertyBorderRightWidth>::createHandler());
1812     setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
1813     setPropertyHandler(CSSPropertyBorderRightStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderRightStyle, EBorderStyle, &RenderStyle::setBorderRightStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1814     setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1815     setPropertyHandler(CSSPropertyBorderSpacing, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitBorderHorizontalSpacing, CSSPropertyWebkitBorderVerticalSpacing>::createHandler());
1816     setPropertyHandler(CSSPropertyBorderStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle>::createHandler());
1817     setPropertyHandler(CSSPropertyBorderTop, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderTopStyle, CSSPropertyBorderTopWidth>::createHandler());
1818     setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler());
1819     setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
1820     setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
1821     setPropertyHandler(CSSPropertyBorderTopStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderTopStyle, EBorderStyle, &RenderStyle::setBorderTopStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1822     setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1823     setPropertyHandler(CSSPropertyBorderWidth, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopWidth, CSSPropertyBorderRightWidth, CSSPropertyBorderBottomWidth, CSSPropertyBorderLeftWidth>::createHandler());
1824     setPropertyHandler(CSSPropertyBottom, ApplyPropertyLength<&RenderStyle::bottom, &RenderStyle::setBottom, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1825     setPropertyHandler(CSSPropertyBoxSizing, ApplyPropertyDefault<EBoxSizing, &RenderStyle::boxSizing, EBoxSizing, &RenderStyle::setBoxSizing, EBoxSizing, &RenderStyle::initialBoxSizing>::createHandler());
1826     setPropertyHandler(CSSPropertyCaptionSide, ApplyPropertyDefault<ECaptionSide, &RenderStyle::captionSide, ECaptionSide, &RenderStyle::setCaptionSide, ECaptionSide, &RenderStyle::initialCaptionSide>::createHandler());
1827     setPropertyHandler(CSSPropertyClear, ApplyPropertyDefault<EClear, &RenderStyle::clear, EClear, &RenderStyle::setClear, EClear, &RenderStyle::initialClear>::createHandler());
1828     setPropertyHandler(CSSPropertyClip, ApplyPropertyClip::createHandler());
1829     setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler());
1830     setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::createHandler());
1831     setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler());
1832     setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler());
1833     setPropertyHandler(CSSPropertyDirection, ApplyPropertyDirection<&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection>::createHandler());
1834     setPropertyHandler(CSSPropertyDisplay, ApplyPropertyDisplay::createHandler());
1835     setPropertyHandler(CSSPropertyEmptyCells, ApplyPropertyDefault<EEmptyCell, &RenderStyle::emptyCells, EEmptyCell, &RenderStyle::setEmptyCells, EEmptyCell, &RenderStyle::initialEmptyCells>::createHandler());
1836     setPropertyHandler(CSSPropertyFloat, ApplyPropertyDefault<EFloat, &RenderStyle::floating, EFloat, &RenderStyle::setFloating, EFloat, &RenderStyle::initialFloating>::createHandler());
1837     setPropertyHandler(CSSPropertyFontSize, ApplyPropertyFontSize::createHandler());
1838     setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
1839     setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
1840     setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
1841     setPropertyHandler(CSSPropertyHeight, ApplyPropertyLength<&RenderStyle::height, &RenderStyle::setHeight, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled>::createHandler());
1842     setPropertyHandler(CSSPropertyImageRendering, ApplyPropertyDefault<EImageRendering, &RenderStyle::imageRendering, EImageRendering, &RenderStyle::setImageRendering, EImageRendering, &RenderStyle::initialImageRendering>::createHandler());
1843     setPropertyHandler(CSSPropertyLeft, ApplyPropertyLength<&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1844     setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength<int, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
1845     setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeight::createHandler());
1846     setPropertyHandler(CSSPropertyListStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyListStyleType, CSSPropertyListStyleImage, CSSPropertyListStylePosition>::createHandler());
1847     setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
1848     setPropertyHandler(CSSPropertyListStylePosition, ApplyPropertyDefault<EListStylePosition, &RenderStyle::listStylePosition, EListStylePosition, &RenderStyle::setListStylePosition, EListStylePosition, &RenderStyle::initialListStylePosition>::createHandler());
1849     setPropertyHandler(CSSPropertyListStyleType, ApplyPropertyDefault<EListStyleType, &RenderStyle::listStyleType, EListStyleType, &RenderStyle::setListStyleType, EListStyleType, &RenderStyle::initialListStyleType>::createHandler());
1850     setPropertyHandler(CSSPropertyMargin, ApplyPropertyExpanding<SuppressValue, CSSPropertyMarginTop, CSSPropertyMarginRight, CSSPropertyMarginBottom, CSSPropertyMarginLeft>::createHandler());
1851     setPropertyHandler(CSSPropertyMarginBottom, ApplyPropertyLength<&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1852     setPropertyHandler(CSSPropertyMarginLeft, ApplyPropertyLength<&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1853     setPropertyHandler(CSSPropertyMarginRight, ApplyPropertyLength<&RenderStyle::marginRight, &RenderStyle::setMarginRight, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1854     setPropertyHandler(CSSPropertyMarginTop, ApplyPropertyLength<&RenderStyle::marginTop, &RenderStyle::setMarginTop, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1855     setPropertyHandler(CSSPropertyMaxHeight, ApplyPropertyLength<&RenderStyle::maxHeight, &RenderStyle::setMaxHeight, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
1856     setPropertyHandler(CSSPropertyMaxWidth, ApplyPropertyLength<&RenderStyle::maxWidth, &RenderStyle::setMaxWidth, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
1857     setPropertyHandler(CSSPropertyMinHeight, ApplyPropertyLength<&RenderStyle::minHeight, &RenderStyle::setMinHeight, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler());
1858     setPropertyHandler(CSSPropertyMinWidth, ApplyPropertyLength<&RenderStyle::minWidth, &RenderStyle::setMinWidth, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler());
1859     setPropertyHandler(CSSPropertyOrphans, ApplyPropertyDefault<short, &RenderStyle::orphans, short, &RenderStyle::setOrphans, short, &RenderStyle::initialOrphans>::createHandler());
1860     setPropertyHandler(CSSPropertyOutline, ApplyPropertyExpanding<SuppressValue, CSSPropertyOutlineWidth, CSSPropertyOutlineColor, CSSPropertyOutlineStyle>::createHandler());
1861     setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
1862     setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength<int, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset>::createHandler());
1863     setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
1864     setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialOutlineWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1865     setPropertyHandler(CSSPropertyOverflow, ApplyPropertyExpanding<ExpandValue, CSSPropertyOverflowX, CSSPropertyOverflowY>::createHandler());
1866     setPropertyHandler(CSSPropertyOverflowX, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowX, EOverflow, &RenderStyle::setOverflowX, EOverflow, &RenderStyle::initialOverflowX>::createHandler());
1867     setPropertyHandler(CSSPropertyOverflowY, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowY, EOverflow, &RenderStyle::setOverflowY, EOverflow, &RenderStyle::initialOverflowY>::createHandler());
1868     setPropertyHandler(CSSPropertyPadding, ApplyPropertyExpanding<SuppressValue, CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft>::createHandler());
1869     setPropertyHandler(CSSPropertyPaddingBottom, ApplyPropertyLength<&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding>::createHandler());
1870     setPropertyHandler(CSSPropertyPaddingLeft, ApplyPropertyLength<&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding>::createHandler());
1871     setPropertyHandler(CSSPropertyPaddingRight, ApplyPropertyLength<&RenderStyle::paddingRight, &RenderStyle::setPaddingRight, &RenderStyle::initialPadding>::createHandler());
1872     setPropertyHandler(CSSPropertyPaddingTop, ApplyPropertyLength<&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding>::createHandler());
1873     setPropertyHandler(CSSPropertyPageBreakAfter, ApplyPropertyDefault<EPageBreak, &RenderStyle::pageBreakAfter, EPageBreak, &RenderStyle::setPageBreakAfter, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
1874     setPropertyHandler(CSSPropertyPageBreakBefore, ApplyPropertyDefault<EPageBreak, &RenderStyle::pageBreakBefore, EPageBreak, &RenderStyle::setPageBreakBefore, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
1875     setPropertyHandler(CSSPropertyPageBreakInside, ApplyPropertyDefault<EPageBreak, &RenderStyle::pageBreakInside, EPageBreak, &RenderStyle::setPageBreakInside, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
1876     setPropertyHandler(CSSPropertyPosition, ApplyPropertyDefault<EPosition, &RenderStyle::position, EPosition, &RenderStyle::setPosition, EPosition, &RenderStyle::initialPosition>::createHandler());
1877     setPropertyHandler(CSSPropertyResize, ApplyPropertyResize::createHandler());
1878     setPropertyHandler(CSSPropertyRight, ApplyPropertyLength<&RenderStyle::right, &RenderStyle::setRight, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1879     setPropertyHandler(CSSPropertySize, ApplyPropertyPageSize::createHandler());
1880     setPropertyHandler(CSSPropertySpeak, ApplyPropertyDefault<ESpeak, &RenderStyle::speak, ESpeak, &RenderStyle::setSpeak, ESpeak, &RenderStyle::initialSpeak>::createHandler());
1881     setPropertyHandler(CSSPropertyTableLayout, ApplyPropertyDefault<ETableLayout, &RenderStyle::tableLayout, ETableLayout, &RenderStyle::setTableLayout, ETableLayout, &RenderStyle::initialTableLayout>::createHandler());
1882     setPropertyHandler(CSSPropertyTabSize, ApplyPropertyDefault<unsigned, &RenderStyle::tabSize, unsigned, &RenderStyle::setTabSize, unsigned, &RenderStyle::initialTabSize>::createHandler());
1883     setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
1884     setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
1885     setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
1886     setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler());
1887     setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
1888     setPropertyHandler(CSSPropertyTextTransform, ApplyPropertyDefault<ETextTransform, &RenderStyle::textTransform, ETextTransform, &RenderStyle::setTextTransform, ETextTransform, &RenderStyle::initialTextTransform>::createHandler());
1889     setPropertyHandler(CSSPropertyTop, ApplyPropertyLength<&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1890     setPropertyHandler(CSSPropertyUnicodeBidi, ApplyPropertyUnicodeBidi::createHandler());
1891     setPropertyHandler(CSSPropertyVerticalAlign, ApplyPropertyVerticalAlign::createHandler());
1892     setPropertyHandler(CSSPropertyVisibility, ApplyPropertyDefault<EVisibility, &RenderStyle::visibility, EVisibility, &RenderStyle::setVisibility, EVisibility, &RenderStyle::initialVisibility>::createHandler());
1893     setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &StyleResolver::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1894     setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &StyleResolver::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1895     setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &StyleResolver::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1896     setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &StyleResolver::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1897     setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<double, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &StyleResolver::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1898     setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &StyleResolver::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1899     setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &StyleResolver::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1900     setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &StyleResolver::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1901     setPropertyHandler(CSSPropertyWebkitAppearance, ApplyPropertyDefault<ControlPart, &RenderStyle::appearance, ControlPart, &RenderStyle::setAppearance, ControlPart, &RenderStyle::initialAppearance>::createHandler());
1902     setPropertyHandler(CSSPropertyWebkitAspectRatio, ApplyPropertyAspectRatio::createHandler());
1903     setPropertyHandler(CSSPropertyWebkitBackfaceVisibility, ApplyPropertyDefault<EBackfaceVisibility, &RenderStyle::backfaceVisibility, EBackfaceVisibility, &RenderStyle::setBackfaceVisibility, EBackfaceVisibility, &RenderStyle::initialBackfaceVisibility>::createHandler());
1904     setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
1905     setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &StyleResolver::mapFillComposite>::createHandler());
1906     setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
1907     setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
1908     setPropertyHandler(CSSPropertyWebkitBorderFit, ApplyPropertyDefault<EBorderFit, &RenderStyle::borderFit, EBorderFit, &RenderStyle::setBorderFit, EBorderFit, &RenderStyle::initialBorderFit>::createHandler());
1909     setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler());
1910     setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage<Image, CSSPropertyWebkitBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
1911     setPropertyHandler(CSSPropertyWebkitBorderRadius, CSSPropertyBorderRadius);
1912     setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing>::createHandler());
1913     setPropertyHandler(CSSPropertyWebkitBoxAlign, ApplyPropertyDefault<EBoxAlignment, &RenderStyle::boxAlign, EBoxAlignment, &RenderStyle::setBoxAlign, EBoxAlignment, &RenderStyle::initialBoxAlign>::createHandler());
1914     setPropertyHandler(CSSPropertyWebkitBoxDirection, ApplyPropertyDefault<EBoxDirection, &RenderStyle::boxDirection, EBoxDirection, &RenderStyle::setBoxDirection, EBoxDirection, &RenderStyle::initialBoxDirection>::createHandler());
1915     setPropertyHandler(CSSPropertyWebkitBoxFlex, ApplyPropertyDefault<float, &RenderStyle::boxFlex, float, &RenderStyle::setBoxFlex, float, &RenderStyle::initialBoxFlex>::createHandler());
1916     setPropertyHandler(CSSPropertyWebkitBoxFlexGroup, ApplyPropertyDefault<unsigned int, &RenderStyle::boxFlexGroup, unsigned int, &RenderStyle::setBoxFlexGroup, unsigned int, &RenderStyle::initialBoxFlexGroup>::createHandler());
1917     setPropertyHandler(CSSPropertyWebkitBoxLines, ApplyPropertyDefault<EBoxLines, &RenderStyle::boxLines, EBoxLines, &RenderStyle::setBoxLines, EBoxLines, &RenderStyle::initialBoxLines>::createHandler());
1918     setPropertyHandler(CSSPropertyWebkitBoxOrdinalGroup, ApplyPropertyDefault<unsigned int, &RenderStyle::boxOrdinalGroup, unsigned int, &RenderStyle::setBoxOrdinalGroup, unsigned int, &RenderStyle::initialBoxOrdinalGroup>::createHandler());
1919     setPropertyHandler(CSSPropertyWebkitBoxOrient, ApplyPropertyDefault<EBoxOrient, &RenderStyle::boxOrient, EBoxOrient, &RenderStyle::setBoxOrient, EBoxOrient, &RenderStyle::initialBoxOrient>::createHandler());
1920     setPropertyHandler(CSSPropertyWebkitBoxPack, ApplyPropertyDefault<EBoxPack, &RenderStyle::boxPack, EBoxPack, &RenderStyle::setBoxPack, EBoxPack, &RenderStyle::initialBoxPack>::createHandler());
1921     setPropertyHandler(CSSPropertyWebkitColorCorrection, ApplyPropertyDefault<ColorSpace, &RenderStyle::colorSpace, ColorSpace, &RenderStyle::setColorSpace, ColorSpace, &RenderStyle::initialColorSpace>::createHandler());
1922     setPropertyHandler(CSSPropertyWebkitColumnAxis, ApplyPropertyDefault<ColumnAxis, &RenderStyle::columnAxis, ColumnAxis, &RenderStyle::setColumnAxis, ColumnAxis, &RenderStyle::initialColumnAxis>::createHandler());
1923     setPropertyHandler(CSSPropertyWebkitColumnBreakAfter, ApplyPropertyDefault<EPageBreak, &RenderStyle::columnBreakAfter, EPageBreak, &RenderStyle::setColumnBreakAfter, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
1924     setPropertyHandler(CSSPropertyWebkitColumnBreakBefore, ApplyPropertyDefault<EPageBreak, &RenderStyle::columnBreakBefore, EPageBreak, &RenderStyle::setColumnBreakBefore, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
1925     setPropertyHandler(CSSPropertyWebkitColumnBreakInside, ApplyPropertyDefault<EPageBreak, &RenderStyle::columnBreakInside, EPageBreak, &RenderStyle::setColumnBreakInside, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
1926     setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
1927     setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
1928     setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
1929     setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialColumnRuleWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1930     setPropertyHandler(CSSPropertyWebkitColumns, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitColumnWidth, CSSPropertyWebkitColumnCount>::createHandler());
1931     setPropertyHandler(CSSPropertyWebkitColumnSpan, ApplyPropertyDefault<ColumnSpan, &RenderStyle::columnSpan, ColumnSpan, &RenderStyle::setColumnSpan, ColumnSpan, &RenderStyle::initialColumnSpan>::createHandler());
1932     setPropertyHandler(CSSPropertyWebkitColumnRuleStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::columnRuleStyle, EBorderStyle, &RenderStyle::setColumnRuleStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1933     setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
1934     setPropertyHandler(CSSPropertyWebkitFlex, ApplyPropertyFlex::createHandler());
1935     setPropertyHandler(CSSPropertyWebkitFlexAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexAlign, EFlexAlign, &RenderStyle::setFlexAlign, EFlexAlign, &RenderStyle::initialFlexAlign>::createHandler());
1936     setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler());
1937     setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap>::createHandler());
1938     setPropertyHandler(CSSPropertyWebkitFlexItemAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexItemAlign, EFlexAlign, &RenderStyle::setFlexItemAlign, EFlexAlign, &RenderStyle::initialFlexItemAlign>::createHandler());
1939     setPropertyHandler(CSSPropertyWebkitFlexLinePack, ApplyPropertyDefault<EFlexLinePack, &RenderStyle::flexLinePack, EFlexLinePack, &RenderStyle::setFlexLinePack, EFlexLinePack, &RenderStyle::initialFlexLinePack>::createHandler());
1940     setPropertyHandler(CSSPropertyWebkitFlexOrder, ApplyPropertyDefault<int, &RenderStyle::flexOrder, int, &RenderStyle::setFlexOrder, int, &RenderStyle::initialFlexOrder>::createHandler());
1941     setPropertyHandler(CSSPropertyWebkitFlexPack, ApplyPropertyDefault<EFlexPack, &RenderStyle::flexPack, EFlexPack, &RenderStyle::setFlexPack, EFlexPack, &RenderStyle::initialFlexPack>::createHandler());
1942     setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler());
1943 #if ENABLE(CSS_REGIONS)
1944     setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString<MapNoneToNull, &RenderStyle::regionThread, &RenderStyle::setRegionThread, &RenderStyle::initialRegionThread>::createHandler());
1945     setPropertyHandler(CSSPropertyWebkitFlowInto, ApplyPropertyString<MapNoneToNull, &RenderStyle::flowThread, &RenderStyle::setFlowThread, &RenderStyle::initialFlowThread>::createHandler());
1946 #endif
1947     setPropertyHandler(CSSPropertyWebkitFontKerning, ApplyPropertyFont<FontDescription::Kerning, &FontDescription::kerning, &FontDescription::setKerning, FontDescription::AutoKerning>::createHandler());
1948     setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
1949     setPropertyHandler(CSSPropertyWebkitFontVariantLigatures, ApplyPropertyFontVariantLigatures::createHandler());
1950     setPropertyHandler(CSSPropertyWebkitHighlight, ApplyPropertyString<MapNoneToNull, &RenderStyle::highlight, &RenderStyle::setHighlight, &RenderStyle::initialHighlight>::createHandler());
1951     setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());
1952     setPropertyHandler(CSSPropertyWebkitHyphenateLimitAfter, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitAfter, &RenderStyle::setHyphenationLimitAfter, &RenderStyle::initialHyphenationLimitAfter>::createHandler());
1953     setPropertyHandler(CSSPropertyWebkitHyphenateLimitBefore, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitBefore, &RenderStyle::setHyphenationLimitBefore, &RenderStyle::initialHyphenationLimitBefore>::createHandler());
1954     setPropertyHandler(CSSPropertyWebkitHyphenateLimitLines, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitLines, &RenderStyle::setHyphenationLimitLines, &RenderStyle::initialHyphenationLimitLines, CSSValueNoLimit>::createHandler());
1955     setPropertyHandler(CSSPropertyWebkitHyphens, ApplyPropertyDefault<Hyphens, &RenderStyle::hyphens, Hyphens, &RenderStyle::setHyphens, Hyphens, &RenderStyle::initialHyphens>::createHandler());
1956     setPropertyHandler(CSSPropertyWebkitLineAlign, ApplyPropertyDefault<LineAlign, &RenderStyle::lineAlign, LineAlign, &RenderStyle::setLineAlign, LineAlign, &RenderStyle::initialLineAlign>::createHandler());
1957     setPropertyHandler(CSSPropertyWebkitLineBreak, ApplyPropertyDefault<EKHTMLLineBreak, &RenderStyle::khtmlLineBreak, EKHTMLLineBreak, &RenderStyle::setKHTMLLineBreak, EKHTMLLineBreak, &RenderStyle::initialKHTMLLineBreak>::createHandler());
1958     setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());
1959     setPropertyHandler(CSSPropertyWebkitLineSnap, ApplyPropertyDefault<LineSnap, &RenderStyle::lineSnap, LineSnap, &RenderStyle::setLineSnap, LineSnap, &RenderStyle::initialLineSnap>::createHandler());
1960     setPropertyHandler(CSSPropertyWebkitMarginAfterCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginAfterCollapse, EMarginCollapse, &RenderStyle::setMarginAfterCollapse, EMarginCollapse, &RenderStyle::initialMarginAfterCollapse>::createHandler());
1961     setPropertyHandler(CSSPropertyWebkitMarginBeforeCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginBeforeCollapse, EMarginCollapse, &RenderStyle::setMarginBeforeCollapse, EMarginCollapse, &RenderStyle::initialMarginBeforeCollapse>::createHandler());
1962     setPropertyHandler(CSSPropertyWebkitMarginBottomCollapse, CSSPropertyWebkitMarginAfterCollapse);
1963     setPropertyHandler(CSSPropertyWebkitMarginCollapse, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse>::createHandler());
1964     setPropertyHandler(CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBeforeCollapse);
1965     setPropertyHandler(CSSPropertyWebkitMarqueeDirection, ApplyPropertyDefault<EMarqueeDirection, &RenderStyle::marqueeDirection, EMarqueeDirection, &RenderStyle::setMarqueeDirection, EMarqueeDirection, &RenderStyle::initialMarqueeDirection>::createHandler());
1966     setPropertyHandler(CSSPropertyWebkitMarqueeStyle, ApplyPropertyDefault<EMarqueeBehavior, &RenderStyle::marqueeBehavior, EMarqueeBehavior, &RenderStyle::setMarqueeBehavior, EMarqueeBehavior, &RenderStyle::initialMarqueeBehavior>::createHandler());
1967     setPropertyHandler(CSSPropertyWebkitMaskAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyWebkitMaskAttachment, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &StyleResolver::mapFillAttachment>::createHandler());
1968     setPropertyHandler(CSSPropertyWebkitMaskBoxImage, ApplyPropertyBorderImage<Mask, CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage>::createHandler());
1969     setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<Mask, Outset>::createHandler());
1970     setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<Mask, Repeat>::createHandler());
1971     setPropertyHandler(CSSPropertyWebkitMaskBoxImageSlice, ApplyPropertyBorderImageModifier<Mask, Slice>::createHandler());
1972     setPropertyHandler(CSSPropertyWebkitMaskBoxImageSource, ApplyPropertyBorderImageSource<CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource, &RenderStyle::initialMaskBoxImageSource>::createHandler());
1973     setPropertyHandler(CSSPropertyWebkitMaskBoxImageWidth, ApplyPropertyBorderImageModifier<Mask, Width>::createHandler());
1974     setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &StyleResolver::mapFillClip>::createHandler());
1975     setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &StyleResolver::mapFillComposite>::createHandler());
1976     setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &StyleResolver::mapFillImage>::createHandler());
1977     setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &StyleResolver::mapFillOrigin>::createHandler());
1978     setPropertyHandler(CSSPropertyWebkitMaskPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMaskPositionX, CSSPropertyWebkitMaskPositionY>::createHandler());
1979     setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &StyleResolver::mapFillXPosition>::createHandler());
1980     setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &StyleResolver::mapFillYPosition>::createHandler());
1981     setPropertyHandler(CSSPropertyWebkitMaskRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
1982     setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &StyleResolver::mapFillRepeatX>::createHandler());
1983     setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &StyleResolver::mapFillRepeatY>::createHandler());
1984     setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &StyleResolver::mapFillSize>::createHandler());
1985     setPropertyHandler(CSSPropertyWebkitMatchNearestMailBlockquoteColor, ApplyPropertyDefault<EMatchNearestMailBlockquoteColor, &RenderStyle::matchNearestMailBlockquoteColor, EMatchNearestMailBlockquoteColor, &RenderStyle::setMatchNearestMailBlockquoteColor, EMatchNearestMailBlockquoteColor, &RenderStyle::initialMatchNearestMailBlockquoteColor>::createHandler());
1986     setPropertyHandler(CSSPropertyWebkitNbspMode, ApplyPropertyDefault<ENBSPMode, &RenderStyle::nbspMode, ENBSPMode, &RenderStyle::setNBSPMode, ENBSPMode, &RenderStyle::initialNBSPMode>::createHandler());
1987     setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
1988     setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, ApplyPropertyLength<&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX>::createHandler());
1989     setPropertyHandler(CSSPropertyWebkitPerspectiveOriginY, ApplyPropertyLength<&RenderStyle::perspectiveOriginY, &RenderStyle::setPerspectiveOriginY, &RenderStyle::initialPerspectiveOriginY>::createHandler());
1990     setPropertyHandler(CSSPropertyWebkitPrintColorAdjust, ApplyPropertyDefault<PrintColorAdjust, &RenderStyle::printColorAdjust, PrintColorAdjust, &RenderStyle::setPrintColorAdjust, PrintColorAdjust, &RenderStyle::initialPrintColorAdjust>::createHandler());
1991 #if ENABLE(CSS_REGIONS)
1992     setPropertyHandler(CSSPropertyWebkitRegionBreakAfter, ApplyPropertyDefault<EPageBreak, &RenderStyle::regionBreakAfter, EPageBreak, &RenderStyle::setRegionBreakAfter, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
1993     setPropertyHandler(CSSPropertyWebkitRegionBreakBefore, ApplyPropertyDefault<EPageBreak, &RenderStyle::regionBreakBefore, EPageBreak, &RenderStyle::setRegionBreakBefore, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
1994     setPropertyHandler(CSSPropertyWebkitRegionBreakInside, ApplyPropertyDefault<EPageBreak, &RenderStyle::regionBreakInside, EPageBreak, &RenderStyle::setRegionBreakInside, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
1995     setPropertyHandler(CSSPropertyWebkitRegionOverflow, ApplyPropertyDefault<RegionOverflow, &RenderStyle::regionOverflow, RegionOverflow, &RenderStyle::setRegionOverflow, RegionOverflow, &RenderStyle::initialRegionOverflow>::createHandler());
1996 #endif
1997     setPropertyHandler(CSSPropertyWebkitRtlOrdering, ApplyPropertyDefault<Order, &RenderStyle::rtlOrdering, Order, &RenderStyle::setRTLOrdering, Order, &RenderStyle::initialRTLOrdering>::createHandler());
1998     setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler());
1999     setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
2000     setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler());
2001     setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
2002     setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
2003     setPropertyHandler(CSSPropertyWebkitTextOrientation, ApplyPropertyFont<TextOrientation, &FontDescription::textOrientation, &FontDescription::setTextOrientation, TextOrientationVerticalRight>::createHandler());
2004     setPropertyHandler(CSSPropertyWebkitTextSecurity, ApplyPropertyDefault<ETextSecurity, &RenderStyle::textSecurity, ETextSecurity, &RenderStyle::setTextSecurity, ETextSecurity, &RenderStyle::initialTextSecurity>::createHandler());
2005     setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
2006     setPropertyHandler(CSSPropertyWebkitTransformOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitTransformOriginX, CSSPropertyWebkitTransformOriginY, CSSPropertyWebkitTransformOriginZ>::createHandler());
2007     setPropertyHandler(CSSPropertyWebkitTransformOriginX, ApplyPropertyLength<&RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX, &RenderStyle::initialTransformOriginX>::createHandler());
2008     setPropertyHandler(CSSPropertyWebkitTransformOriginY, ApplyPropertyLength<&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY>::createHandler());
2009     setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler());
2010     setPropertyHandler(CSSPropertyWebkitTransformStyle, ApplyPropertyDefault<ETransformStyle3D, &RenderStyle::transformStyle3D, ETransformStyle3D, &RenderStyle::setTransformStyle3D, ETransformStyle3D, &RenderStyle::initialTransformStyle3D>::createHandler());
2011     setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &StyleResolver::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2012     setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &StyleResolver::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2013     setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<CSSPropertyID, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &StyleResolver::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2014     setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &StyleResolver::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2015     setPropertyHandler(CSSPropertyWebkitUserDrag, ApplyPropertyDefault<EUserDrag, &RenderStyle::userDrag, EUserDrag, &RenderStyle::setUserDrag, EUserDrag, &RenderStyle::initialUserDrag>::createHandler());
2016     setPropertyHandler(CSSPropertyWebkitUserModify, ApplyPropertyDefault<EUserModify, &RenderStyle::userModify, EUserModify, &RenderStyle::setUserModify, EUserModify, &RenderStyle::initialUserModify>::createHandler());
2017     setPropertyHandler(CSSPropertyWebkitUserSelect, ApplyPropertyDefault<EUserSelect, &RenderStyle::userSelect, EUserSelect, &RenderStyle::setUserSelect, EUserSelect, &RenderStyle::initialUserSelect>::createHandler());
2018 #if ENABLE(CSS_EXCLUSIONS)
2019     setPropertyHandler(CSSPropertyWebkitWrap, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitWrapFlow, CSSPropertyWebkitWrapMargin, CSSPropertyWebkitWrapPadding>::createHandler());
2020     setPropertyHandler(CSSPropertyWebkitWrapFlow, ApplyPropertyDefault<WrapFlow, &RenderStyle::wrapFlow, WrapFlow, &RenderStyle::setWrapFlow, WrapFlow, &RenderStyle::initialWrapFlow>::createHandler());
2021     setPropertyHandler(CSSPropertyWebkitWrapMargin, ApplyPropertyLength<&RenderStyle::wrapMargin, &RenderStyle::setWrapMargin, &RenderStyle::initialWrapMargin>::createHandler());
2022     setPropertyHandler(CSSPropertyWebkitWrapPadding, ApplyPropertyLength<&RenderStyle::wrapPadding, &RenderStyle::setWrapPadding, &RenderStyle::initialWrapPadding>::createHandler());
2023     setPropertyHandler(CSSPropertyWebkitWrapThrough, ApplyPropertyDefault<WrapThrough, &RenderStyle::wrapThrough, WrapThrough, &RenderStyle::setWrapThrough, WrapThrough, &RenderStyle::initialWrapThrough>::createHandler());
2024 #endif
2025     setPropertyHandler(CSSPropertyWhiteSpace, ApplyPropertyDefault<EWhiteSpace, &RenderStyle::whiteSpace, EWhiteSpace, &RenderStyle::setWhiteSpace, EWhiteSpace, &RenderStyle::initialWhiteSpace>::createHandler());
2026     setPropertyHandler(CSSPropertyWidows, ApplyPropertyDefault<short, &RenderStyle::widows, short, &RenderStyle::setWidows, short, &RenderStyle::initialWidows>::createHandler());
2027     setPropertyHandler(CSSPropertyWidth, ApplyPropertyLength<&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled>::createHandler());
2028     setPropertyHandler(CSSPropertyWordBreak, ApplyPropertyDefault<EWordBreak, &RenderStyle::wordBreak, EWordBreak, &RenderStyle::setWordBreak, EWordBreak, &RenderStyle::initialWordBreak>::createHandler());
2029     setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<int, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
2030     setPropertyHandler(CSSPropertyWordWrap, ApplyPropertyDefault<EWordWrap, &RenderStyle::wordWrap, EWordWrap, &RenderStyle::setWordWrap, EWordWrap, &RenderStyle::initialWordWrap>::createHandler());
2031     setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
2032     setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler());
2033 }
2034
2035
2036 }