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