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