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