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