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