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