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