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