~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebCore/css/StyleBuilder.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

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