2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #include "DeprecatedStyleBuilder.h"
29 #include "BasicShapeFunctions.h"
30 #include "BasicShapes.h"
31 #include "CSSAspectRatioValue.h"
32 #include "CSSCalculationValue.h"
33 #include "CSSCursorImageValue.h"
34 #include "CSSPrimitiveValue.h"
35 #include "CSSPrimitiveValueMappings.h"
36 #include "CSSToStyleMap.h"
37 #include "CSSValueList.h"
38 #include "ClipPathOperation.h"
39 #include "CursorList.h"
45 #include "RenderStyle.h"
46 #include "RenderView.h"
48 #include "StyleFontSizeFunctions.h"
49 #include "StyleResolver.h"
50 #include <wtf/StdLibExtras.h>
52 #if ENABLE(CSS_SHAPES)
53 #include "ShapeValue.h"
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 {
63 template <CSSPropertyID id>
64 static inline void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
66 if (id == CSSPropertyInvalid)
69 const DeprecatedStyleBuilder& table = DeprecatedStyleBuilder::sharedStyleBuilder();
70 const PropertyHandler& handler = table.propertyHandler(id);
71 if (handler.isValid())
72 handler.applyInheritValue(propertyID, styleResolver);
75 static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
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);
84 template <CSSPropertyID id>
85 static inline void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
87 if (id == CSSPropertyInvalid)
90 const DeprecatedStyleBuilder& table = DeprecatedStyleBuilder::sharedStyleBuilder();
91 const PropertyHandler& handler = table.propertyHandler(id);
92 if (handler.isValid())
93 handler.applyInitialValue(propertyID, styleResolver);
96 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
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);
105 template <CSSPropertyID id>
106 static inline void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
108 if (id == CSSPropertyInvalid)
111 const DeprecatedStyleBuilder& table = DeprecatedStyleBuilder::sharedStyleBuilder();
112 const PropertyHandler& handler = table.propertyHandler(id);
113 if (handler.isValid())
114 handler.applyValue(propertyID, styleResolver, value);
117 static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
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);
128 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
131 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()>
132 class ApplyPropertyDefaultBase {
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); }
143 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()>
144 class ApplyPropertyDefault {
146 static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); }
147 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
149 if (value->isPrimitiveValue())
150 setValue(styleResolver->style(), *toCSSPrimitiveValue(value));
152 static PropertyHandler createHandler()
154 PropertyHandler handler = ApplyPropertyDefaultBase<GetterType, getterFunction, SetterType, setterFunction, InitialType, initialFunction>::createHandler();
155 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
159 template <typename NumberType, NumberType (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(NumberType), NumberType (*initialFunction)(), int idMapsToMinusOne = CSSValueAuto>
160 class ApplyPropertyNumber {
162 static void setValue(RenderStyle* style, NumberType value) { (style->*setterFunction)(value); }
163 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
165 if (!value->isPrimitiveValue())
168 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
169 if (primitiveValue->getValueID() == idMapsToMinusOne)
170 setValue(styleResolver->style(), -1);
172 setValue(styleResolver->style(), primitiveValue->getValue<NumberType>(CSSPrimitiveValue::CSS_NUMBER));
174 static PropertyHandler createHandler()
176 PropertyHandler handler = ApplyPropertyDefaultBase<NumberType, getterFunction, NumberType, setterFunction, NumberType, initialFunction>::createHandler();
177 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
181 template <StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)(), CSSPropertyID property>
182 class ApplyPropertyStyleImage {
184 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(property, value)); }
185 static PropertyHandler createHandler()
187 PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
188 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
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 {
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)(); }
201 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
203 if (hasAuto(styleResolver->parentStyle()))
204 setAuto(styleResolver->style());
206 setValue(styleResolver->style(), value(styleResolver->parentStyle()));
209 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { setAuto(styleResolver->style()); }
211 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
213 if (!value->isPrimitiveValue())
216 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
217 if (primitiveValue->getValueID() == 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()));
225 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
228 class ApplyPropertyClip {
230 static Length convertToLength(StyleResolver* styleResolver, CSSPrimitiveValue* value)
232 return value->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | AutoConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
235 static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
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);
244 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
246 styleResolver->style()->setClip(Length(), Length(), Length(), Length());
247 styleResolver->style()->setHasClip(false);
250 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
252 if (!value->isPrimitiveValue())
255 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
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->getValueID() == CSSValueAuto) {
265 styleResolver->style()->setClip(Length(), Length(), Length(), Length());
266 styleResolver->style()->setHasClip(false);
270 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
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 {
284 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
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)());
291 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
293 applyColorValue(styleResolver, initialFunction());
296 static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
298 if (!value->isPrimitiveValue())
301 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
302 if (inheritColorFromParent && primitiveValue->getValueID() == CSSValueCurrentcolor)
303 applyInheritValue(propertyID, styleResolver);
305 if (styleResolver->applyPropertyToRegularStyle())
306 (styleResolver->style()->*setterFunction)(styleResolver->colorFromPrimitiveValue(primitiveValue));
307 if (styleResolver->applyPropertyToVisitedLinkStyle())
308 (styleResolver->style()->*visitedLinkSetterFunction)(styleResolver->colorFromPrimitiveValue(primitiveValue, /* forVisitedLink */ true));
312 static void applyColorValue(StyleResolver* styleResolver, const Color& color)
314 if (styleResolver->applyPropertyToRegularStyle())
315 (styleResolver->style()->*setterFunction)(color);
316 if (styleResolver->applyPropertyToVisitedLinkStyle())
317 (styleResolver->style()->*visitedLinkSetterFunction)(color);
320 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
323 template <TextDirection (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(TextDirection), TextDirection (*initialFunction)()>
324 class ApplyPropertyDirection {
326 static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
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);
334 static PropertyHandler createHandler()
336 PropertyHandler handler = ApplyPropertyDefault<TextDirection, getterFunction, TextDirection, setterFunction, TextDirection, initialFunction>::createHandler();
337 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
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 <const 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 {
356 static void setValue(RenderStyle* style, Length value) { (style->*setterFunction)(std::move(value)); }
357 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
359 if (!value->isPrimitiveValue())
362 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
363 if (noneEnabled && primitiveValue->getValueID() == CSSValueNone) {
365 setValue(styleResolver->style(), Length(Undefined));
367 setValue(styleResolver->style(), Length());
369 if (legacyIntrinsicEnabled) {
370 if (primitiveValue->getValueID() == CSSValueIntrinsic)
371 setValue(styleResolver->style(), Length(Intrinsic));
372 else if (primitiveValue->getValueID() == CSSValueMinIntrinsic)
373 setValue(styleResolver->style(), Length(MinIntrinsic));
375 if (intrinsicEnabled) {
376 if (primitiveValue->getValueID() == CSSValueWebkitMinContent)
377 setValue(styleResolver->style(), Length(MinContent));
378 else if (primitiveValue->getValueID() == CSSValueWebkitMaxContent)
379 setValue(styleResolver->style(), Length(MaxContent));
380 else if (primitiveValue->getValueID() == CSSValueWebkitFillAvailable)
381 setValue(styleResolver->style(), Length(FillAvailable));
382 else if (primitiveValue->getValueID() == CSSValueWebkitFitContent)
383 setValue(styleResolver->style(), Length(FitContent));
386 if (autoEnabled && primitiveValue->getValueID() == 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());
400 static PropertyHandler createHandler()
402 PropertyHandler handler = ApplyPropertyDefaultBase<const Length&, getterFunction, Length, setterFunction, Length, initialFunction>::createHandler();
403 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
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 {
411 static void setValue(RenderStyle* style, const AtomicString& value) { (style->*setterFunction)(value); }
412 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
414 if (!value->isPrimitiveValue())
416 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
417 if ((identBehavior == MapNoneToNull && primitiveValue->getValueID() == CSSValueNone)
418 || (identBehavior == MapAutoToNull && primitiveValue->getValueID() == CSSValueAuto))
419 setValue(styleResolver->style(), nullAtom);
421 setValue(styleResolver->style(), primitiveValue->getStringValue());
423 static PropertyHandler createHandler()
425 PropertyHandler handler = ApplyPropertyDefaultBase<const AtomicString&, getterFunction, const AtomicString&, setterFunction, const AtomicString&, initialFunction>::createHandler();
426 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
430 template <const LengthSize& (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(LengthSize), LengthSize (*initialFunction)()>
431 class ApplyPropertyBorderRadius {
433 static void setValue(RenderStyle* style, LengthSize value) { (style->*setterFunction)(std::move(value)); }
434 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
436 if (!value->isPrimitiveValue())
439 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
440 Pair* pair = primitiveValue->getPairValue();
441 if (!pair || !pair->first() || !pair->second())
446 if (pair->first()->isPercentage())
447 radiusWidth = Length(pair->first()->getDoubleValue(), Percent);
448 else if (pair->first()->isViewportPercentageLength())
449 radiusWidth = Length(styleResolver->viewportPercentageValue(*pair->first(), pair->first()->getIntValue()), Fixed);
450 else if (pair->first()->isCalculatedPercentageWithLength())
451 radiusWidth = Length((pair->first()->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom())));
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 = Length(styleResolver->viewportPercentageValue(*pair->second(), pair->second()->getIntValue()), Fixed);
458 else if (pair->second()->isCalculatedPercentageWithLength())
459 radiusHeight = Length((pair->second()->cssCalcValue()->toCalcValue(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom())));
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)
467 radiusHeight = radiusWidth; // Null out the other value.
469 radiusWidth = radiusHeight; // Null out the other value.
471 LengthSize size(radiusWidth, radiusHeight);
472 setValue(styleResolver->style(), size);
474 static PropertyHandler createHandler()
476 PropertyHandler handler = ApplyPropertyDefaultBase<const LengthSize&, getterFunction, LengthSize, setterFunction, LengthSize, initialFunction>::createHandler();
477 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
481 template <typename T>
482 struct FillLayerAccessorTypes {
485 typedef T InitialGetter;
489 struct FillLayerAccessorTypes<StyleImage*> {
490 typedef PassRefPtr<StyleImage> Setter;
491 typedef StyleImage* Getter;
492 typedef StyleImage* InitialGetter;
496 struct FillLayerAccessorTypes<Length>
498 typedef Length Setter;
499 typedef const Length& Getter;
500 typedef Length InitialGetter;
503 template <typename T,
504 CSSPropertyID propertyId,
505 EFillLayerType fillLayerType,
506 FillLayer* (RenderStyle::*accessLayersFunction)(),
507 const FillLayer* (RenderStyle::*layersFunction)() const,
508 bool (FillLayer::*testFunction)() const,
509 typename FillLayerAccessorTypes<T>::Getter (FillLayer::*getFunction)() const,
510 void (FillLayer::*setFunction)(typename FillLayerAccessorTypes<T>::Setter),
511 void (FillLayer::*clearFunction)(),
512 typename FillLayerAccessorTypes<T>::InitialGetter (*initialFunction)(EFillLayerType),
513 void (CSSToStyleMap::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)>
514 class ApplyPropertyFillLayer {
516 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
518 FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
519 FillLayer* prevChild = 0;
520 const FillLayer* currParent = (styleResolver->parentStyle()->*layersFunction)();
521 while (currParent && (currParent->*testFunction)()) {
523 /* Need to make a new layer.*/
524 currChild = new FillLayer(fillLayerType);
525 prevChild->setNext(currChild);
527 (currChild->*setFunction)((currParent->*getFunction)());
528 prevChild = currChild;
529 currChild = prevChild->next();
530 currParent = currParent->next();
534 /* Reset any remaining layers to not have the property set. */
535 (currChild->*clearFunction)();
536 currChild = currChild->next();
540 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
542 FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
543 (currChild->*setFunction)((*initialFunction)(fillLayerType));
544 for (currChild = currChild->next(); currChild; currChild = currChild->next())
545 (currChild->*clearFunction)();
548 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
550 FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
551 FillLayer* prevChild = 0;
552 if (value->isValueList()
553 #if ENABLE(CSS_IMAGE_SET)
554 && !value->isImageSetValue()
557 /* Walk each value and put it into a layer, creating new layers as needed. */
558 CSSValueList* valueList = toCSSValueList(value);
559 for (unsigned int i = 0; i < valueList->length(); i++) {
561 /* Need to make a new layer to hold this value */
562 currChild = new FillLayer(fillLayerType);
563 prevChild->setNext(currChild);
565 (styleResolver->styleMap()->*mapFillFunction)(propertyId, currChild, valueList->itemWithoutBoundsCheck(i));
566 prevChild = currChild;
567 currChild = currChild->next();
570 (styleResolver->styleMap()->*mapFillFunction)(propertyId, currChild, value);
571 currChild = currChild->next();
574 /* Reset all remaining layers to not have the property set. */
575 (currChild->*clearFunction)();
576 currChild = currChild->next();
580 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
583 enum ComputeLengthNormal {NormalDisabled = 0, NormalEnabled};
584 enum ComputeLengthThickness {ThicknessDisabled = 0, ThicknessEnabled};
585 enum ComputeLengthSVGZoom {SVGZoomDisabled = 0, SVGZoomEnabled};
586 template <typename T,
587 T (RenderStyle::*getterFunction)() const,
588 void (RenderStyle::*setterFunction)(T),
589 T (*initialFunction)(),
590 ComputeLengthNormal normalEnabled = NormalDisabled,
591 ComputeLengthThickness thicknessEnabled = ThicknessDisabled,
592 ComputeLengthSVGZoom svgZoomEnabled = SVGZoomDisabled>
593 class ApplyPropertyComputeLength {
595 static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
596 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
598 // note: CSSPropertyLetter/WordSpacing right now sets to zero if it's not a primitive value for some reason...
599 if (!value->isPrimitiveValue())
602 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
604 CSSValueID ident = primitiveValue->getValueID();
606 if (normalEnabled && ident == CSSValueNormal) {
608 } else if (thicknessEnabled && ident == CSSValueThin) {
610 } else if (thicknessEnabled && ident == CSSValueMedium) {
612 } else if (thicknessEnabled && ident == CSSValueThick) {
614 } else if (ident == CSSValueInvalid) {
615 float zoom = (svgZoomEnabled && styleResolver->useSVGZoomRules()) ? 1.0f : styleResolver->style()->effectiveZoom();
617 // Any original result that was >= 1 should not be allowed to fall below 1.
618 // This keeps border lines from vanishing.
619 length = primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), zoom);
620 if (zoom < 1.0f && length < 1.0) {
621 T originalLength = primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), 1.0);
622 if (originalLength >= 1.0)
625 if (primitiveValue->isViewportPercentageLength())
626 length = styleResolver->viewportPercentageValue(*primitiveValue, length);
628 ASSERT_NOT_REACHED();
632 setValue(styleResolver->style(), length);
634 static PropertyHandler createHandler()
636 PropertyHandler handler = ApplyPropertyDefaultBase<T, getterFunction, T, setterFunction, T, initialFunction>::createHandler();
637 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
641 template <typename T, T (FontDescription::*getterFunction)() const, void (FontDescription::*setterFunction)(T), T initialValue>
642 class ApplyPropertyFont {
644 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
646 FontDescription fontDescription = styleResolver->fontDescription();
647 (fontDescription.*setterFunction)((styleResolver->parentFontDescription().*getterFunction)());
648 styleResolver->setFontDescription(fontDescription);
651 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
653 FontDescription fontDescription = styleResolver->fontDescription();
654 (fontDescription.*setterFunction)(initialValue);
655 styleResolver->setFontDescription(fontDescription);
658 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
660 if (!value->isPrimitiveValue())
662 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
663 FontDescription fontDescription = styleResolver->fontDescription();
664 (fontDescription.*setterFunction)(*primitiveValue);
665 styleResolver->setFontDescription(fontDescription);
668 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
671 class ApplyPropertyFontFamily {
673 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
675 FontDescription fontDescription = styleResolver->style()->fontDescription();
676 FontDescription parentFontDescription = styleResolver->parentStyle()->fontDescription();
678 fontDescription.setGenericFamily(parentFontDescription.genericFamily());
679 fontDescription.setFamilies(parentFontDescription.families());
680 fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont());
681 styleResolver->setFontDescription(fontDescription);
685 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
687 FontDescription fontDescription = styleResolver->style()->fontDescription();
688 FontDescription initialDesc = FontDescription();
690 // We need to adjust the size to account for the generic family change from monospace to non-monospace.
691 if (fontDescription.keywordSize() && fontDescription.useFixedDefaultSize())
692 styleResolver->setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueXxSmall + fontDescription.keywordSize() - 1, false, styleResolver->document()));
693 fontDescription.setGenericFamily(initialDesc.genericFamily());
694 if (!initialDesc.firstFamily().isEmpty())
695 fontDescription.setFamilies(initialDesc.families());
697 styleResolver->setFontDescription(fontDescription);
701 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
703 if (!value->isValueList())
706 auto& valueList = toCSSValueList(*value);
708 FontDescription fontDescription = styleResolver->style()->fontDescription();
709 // Before mapping in a new font-family property, we should reset the generic family.
710 bool oldFamilyUsedFixedDefaultSize = fontDescription.useFixedDefaultSize();
711 fontDescription.setGenericFamily(FontDescription::NoFamily);
713 Vector<AtomicString> families;
714 families.reserveInitialCapacity(valueList.length());
716 for (unsigned i = 0; i < valueList.length(); ++i) {
717 CSSValue* item = valueList.item(i);
718 if (!item->isPrimitiveValue())
720 CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item);
722 if (contentValue->isString())
723 face = contentValue->getStringValue();
724 else if (Settings* settings = styleResolver->document().settings()) {
725 switch (contentValue->getValueID()) {
726 case CSSValueWebkitBody:
727 face = settings->standardFontFamily();
731 fontDescription.setGenericFamily(FontDescription::SerifFamily);
733 case CSSValueSansSerif:
734 face = sansSerifFamily;
735 fontDescription.setGenericFamily(FontDescription::SansSerifFamily);
737 case CSSValueCursive:
738 face = cursiveFamily;
739 fontDescription.setGenericFamily(FontDescription::CursiveFamily);
741 case CSSValueFantasy:
742 face = fantasyFamily;
743 fontDescription.setGenericFamily(FontDescription::FantasyFamily);
745 case CSSValueMonospace:
746 face = monospaceFamily;
747 fontDescription.setGenericFamily(FontDescription::MonospaceFamily);
749 case CSSValueWebkitPictograph:
750 face = pictographFamily;
751 fontDescription.setGenericFamily(FontDescription::PictographFamily);
760 if (families.isEmpty())
761 fontDescription.setIsSpecifiedFont(fontDescription.genericFamily() == FontDescription::NoFamily);
762 families.uncheckedAppend(face);
765 if (families.isEmpty())
767 fontDescription.setFamilies(families);
769 if (fontDescription.keywordSize() && fontDescription.useFixedDefaultSize() != oldFamilyUsedFixedDefaultSize)
770 styleResolver->setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueXxSmall + fontDescription.keywordSize() - 1, !oldFamilyUsedFixedDefaultSize, styleResolver->document()));
772 styleResolver->setFontDescription(fontDescription);
775 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
778 class ApplyPropertyFontSize {
780 // When the CSS keyword "larger" is used, this function will attempt to match within the keyword
781 // table, and failing that, will simply multiply by 1.2.
782 static float largerFontSize(float size)
784 // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale up to
785 // the next size level.
789 // Like the previous function, but for the keyword "smaller".
790 static float smallerFontSize(float size)
792 // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale down to
793 // the next size level.
797 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
799 float size = styleResolver->parentStyle()->fontDescription().specifiedSize();
804 FontDescription fontDescription = styleResolver->style()->fontDescription();
805 fontDescription.setKeywordSize(styleResolver->parentStyle()->fontDescription().keywordSize());
806 styleResolver->setFontSize(fontDescription, size);
807 styleResolver->setFontDescription(fontDescription);
811 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
813 FontDescription fontDescription = styleResolver->style()->fontDescription();
814 float size = Style::fontSizeForKeyword(CSSValueMedium, fontDescription.useFixedDefaultSize(), styleResolver->document());
819 fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
820 styleResolver->setFontSize(fontDescription, size);
821 styleResolver->setFontDescription(fontDescription);
825 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
827 if (!value->isPrimitiveValue())
830 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
832 FontDescription fontDescription = styleResolver->style()->fontDescription();
833 fontDescription.setKeywordSize(0);
834 float parentSize = 0;
835 bool parentIsAbsoluteSize = false;
838 if (styleResolver->parentStyle()) {
839 parentSize = styleResolver->parentStyle()->fontDescription().specifiedSize();
840 parentIsAbsoluteSize = styleResolver->parentStyle()->fontDescription().isAbsoluteSize();
843 if (CSSValueID ident = primitiveValue->getValueID()) {
844 // Keywords are being used.
846 case CSSValueXxSmall:
852 case CSSValueXxLarge:
853 case CSSValueWebkitXxxLarge:
854 size = Style::fontSizeForKeyword(ident, fontDescription.useFixedDefaultSize(), styleResolver->document());
855 fontDescription.setKeywordSize(ident - CSSValueXxSmall + 1);
858 size = largerFontSize(parentSize);
860 case CSSValueSmaller:
861 size = smallerFontSize(parentSize);
867 fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize && (ident == CSSValueLarger || ident == CSSValueSmaller));
869 fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize
870 || !(primitiveValue->isPercentage() || primitiveValue->isFontRelativeLength()));
871 if (primitiveValue->isLength())
872 size = primitiveValue->computeLength<float>(styleResolver->parentStyle(), styleResolver->rootElementStyle(), 1.0, true);
873 else if (primitiveValue->isPercentage())
874 size = (primitiveValue->getFloatValue() * parentSize) / 100.0f;
875 else if (primitiveValue->isCalculatedPercentageWithLength())
876 size = primitiveValue->cssCalcValue()->toCalcValue(styleResolver->parentStyle(), styleResolver->rootElementStyle())->evaluate(parentSize);
877 else if (primitiveValue->isViewportPercentageLength())
878 size = valueForLength(primitiveValue->viewportPercentageLength(), 0, styleResolver->document().renderView());
886 // Overly large font sizes will cause crashes on some platforms (such as Windows).
887 // Cap font size here to make sure that doesn't happen.
888 size = std::min(maximumAllowedFontSize, size);
890 styleResolver->setFontSize(fontDescription, size);
891 styleResolver->setFontDescription(fontDescription);
895 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
898 class ApplyPropertyFontWeight {
900 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
902 if (!value->isPrimitiveValue())
904 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
905 FontDescription fontDescription = styleResolver->fontDescription();
906 switch (primitiveValue->getValueID()) {
907 case CSSValueInvalid:
908 ASSERT_NOT_REACHED();
911 fontDescription.setWeight(fontDescription.bolderWeight());
913 case CSSValueLighter:
914 fontDescription.setWeight(fontDescription.lighterWeight());
917 fontDescription.setWeight(*primitiveValue);
919 styleResolver->setFontDescription(fontDescription);
921 static PropertyHandler createHandler()
923 PropertyHandler handler = ApplyPropertyFont<FontWeight, &FontDescription::weight, &FontDescription::setWeight, FontWeightNormal>::createHandler();
924 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
928 class ApplyPropertyFontVariantLigatures {
930 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
932 const FontDescription& parentFontDescription = styleResolver->parentFontDescription();
933 FontDescription fontDescription = styleResolver->fontDescription();
935 fontDescription.setCommonLigaturesState(parentFontDescription.commonLigaturesState());
936 fontDescription.setDiscretionaryLigaturesState(parentFontDescription.discretionaryLigaturesState());
937 fontDescription.setHistoricalLigaturesState(parentFontDescription.historicalLigaturesState());
939 styleResolver->setFontDescription(fontDescription);
942 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
944 FontDescription fontDescription = styleResolver->fontDescription();
946 fontDescription.setCommonLigaturesState(FontDescription::NormalLigaturesState);
947 fontDescription.setDiscretionaryLigaturesState(FontDescription::NormalLigaturesState);
948 fontDescription.setHistoricalLigaturesState(FontDescription::NormalLigaturesState);
950 styleResolver->setFontDescription(fontDescription);
953 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
955 FontDescription::LigaturesState commonLigaturesState = FontDescription::NormalLigaturesState;
956 FontDescription::LigaturesState discretionaryLigaturesState = FontDescription::NormalLigaturesState;
957 FontDescription::LigaturesState historicalLigaturesState = FontDescription::NormalLigaturesState;
959 if (value->isValueList()) {
960 CSSValueList* valueList = toCSSValueList(value);
961 for (size_t i = 0; i < valueList->length(); ++i) {
962 CSSValue* item = valueList->itemWithoutBoundsCheck(i);
963 ASSERT(item->isPrimitiveValue());
964 if (item->isPrimitiveValue()) {
965 switch (toCSSPrimitiveValue(item)->getValueID()) {
966 case CSSValueNoCommonLigatures:
967 commonLigaturesState = FontDescription::DisabledLigaturesState;
969 case CSSValueCommonLigatures:
970 commonLigaturesState = FontDescription::EnabledLigaturesState;
972 case CSSValueNoDiscretionaryLigatures:
973 discretionaryLigaturesState = FontDescription::DisabledLigaturesState;
975 case CSSValueDiscretionaryLigatures:
976 discretionaryLigaturesState = FontDescription::EnabledLigaturesState;
978 case CSSValueNoHistoricalLigatures:
979 historicalLigaturesState = FontDescription::DisabledLigaturesState;
981 case CSSValueHistoricalLigatures:
982 historicalLigaturesState = FontDescription::EnabledLigaturesState;
985 ASSERT_NOT_REACHED();
993 ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
994 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNormal);
998 FontDescription fontDescription = styleResolver->fontDescription();
999 fontDescription.setCommonLigaturesState(commonLigaturesState);
1000 fontDescription.setDiscretionaryLigaturesState(discretionaryLigaturesState);
1001 fontDescription.setHistoricalLigaturesState(historicalLigaturesState);
1002 styleResolver->setFontDescription(fontDescription);
1005 static PropertyHandler createHandler()
1007 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1011 enum BorderImageType { BorderImage = 0, BorderMask };
1012 template <BorderImageType borderImageType,
1013 CSSPropertyID property,
1014 const NinePieceImage& (RenderStyle::*getterFunction)() const,
1015 void (RenderStyle::*setterFunction)(const NinePieceImage&)>
1016 class ApplyPropertyBorderImage {
1018 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1020 NinePieceImage image;
1021 if (borderImageType == BorderMask)
1022 image.setMaskDefaults();
1023 styleResolver->styleMap()->mapNinePieceImage(property, value, image);
1024 (styleResolver->style()->*setterFunction)(image);
1027 static PropertyHandler createHandler()
1029 PropertyHandler handler = ApplyPropertyDefaultBase<const NinePieceImage&, getterFunction, const NinePieceImage&, setterFunction, NinePieceImage, &RenderStyle::initialNinePieceImage>::createHandler();
1030 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1034 enum BorderImageModifierType { Outset, Repeat, Slice, Width };
1035 template <BorderImageType type, BorderImageModifierType modifier>
1036 class ApplyPropertyBorderImageModifier {
1038 static inline const NinePieceImage& getValue(RenderStyle* style) { return type == BorderImage ? style->borderImage() : style->maskBoxImage(); }
1039 static inline void setValue(RenderStyle* style, const NinePieceImage& value) { return type == BorderImage ? style->setBorderImage(value) : style->setMaskBoxImage(value); }
1041 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1043 NinePieceImage image(getValue(styleResolver->style()));
1046 image.copyOutsetFrom(getValue(styleResolver->parentStyle()));
1049 image.copyRepeatFrom(getValue(styleResolver->parentStyle()));
1052 image.copyImageSlicesFrom(getValue(styleResolver->parentStyle()));
1055 image.copyBorderSlicesFrom(getValue(styleResolver->parentStyle()));
1058 setValue(styleResolver->style(), image);
1061 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1063 NinePieceImage image(getValue(styleResolver->style()));
1066 image.setOutset(LengthBox(0));
1069 image.setHorizontalRule(StretchImageRule);
1070 image.setVerticalRule(StretchImageRule);
1073 // Masks have a different initial value for slices. Preserve the value of 0 for backwards compatibility.
1074 image.setImageSlices(type == BorderImage ? LengthBox(Length(100, Percent), Length(100, Percent), Length(100, Percent), Length(100, Percent)) : LengthBox());
1075 image.setFill(false);
1078 // Masks have a different initial value for widths. They use an 'auto' value rather than trying to fit to the border.
1079 image.setBorderSlices(type == BorderImage ? LengthBox(Length(1, Relative), Length(1, Relative), Length(1, Relative), Length(1, Relative)) : LengthBox());
1082 setValue(styleResolver->style(), image);
1085 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1087 NinePieceImage image(getValue(styleResolver->style()));
1090 image.setOutset(styleResolver->styleMap()->mapNinePieceImageQuad(value));
1093 styleResolver->styleMap()->mapNinePieceImageRepeat(value, image);
1096 styleResolver->styleMap()->mapNinePieceImageSlice(value, image);
1099 image.setBorderSlices(styleResolver->styleMap()->mapNinePieceImageQuad(value));
1102 setValue(styleResolver->style(), image);
1105 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1108 template <CSSPropertyID id, StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)()>
1109 class ApplyPropertyBorderImageSource {
1111 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(id, value)); }
1112 static PropertyHandler createHandler()
1114 PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
1115 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1119 enum CounterBehavior {Increment = 0, Reset};
1120 template <CounterBehavior counterBehavior>
1121 class ApplyPropertyCounter {
1123 static void emptyFunction(CSSPropertyID, StyleResolver*) { }
1124 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1126 CounterDirectiveMap& map = styleResolver->style()->accessCounterDirectives();
1127 CounterDirectiveMap& parentMap = styleResolver->parentStyle()->accessCounterDirectives();
1129 typedef CounterDirectiveMap::iterator Iterator;
1130 Iterator end = parentMap.end();
1131 for (Iterator it = parentMap.begin(); it != end; ++it) {
1132 CounterDirectives& directives = map.add(it->key, CounterDirectives()).iterator->value;
1133 if (counterBehavior == Reset) {
1134 directives.inheritReset(it->value);
1136 directives.inheritIncrement(it->value);
1140 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1142 bool setCounterIncrementToNone = counterBehavior == Increment && value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone;
1144 if (!value->isValueList() && !setCounterIncrementToNone)
1147 CounterDirectiveMap& map = styleResolver->style()->accessCounterDirectives();
1148 typedef CounterDirectiveMap::iterator Iterator;
1150 Iterator end = map.end();
1151 for (Iterator it = map.begin(); it != end; ++it)
1152 if (counterBehavior == Reset)
1153 it->value.clearReset();
1155 it->value.clearIncrement();
1157 if (setCounterIncrementToNone)
1160 CSSValueList* list = toCSSValueList(value);
1161 int length = list ? list->length() : 0;
1162 for (int i = 0; i < length; ++i) {
1163 CSSValue* currValue = list->itemWithoutBoundsCheck(i);
1164 if (!currValue->isPrimitiveValue())
1167 Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue();
1168 if (!pair || !pair->first() || !pair->second())
1171 AtomicString identifier = static_cast<CSSPrimitiveValue*>(pair->first())->getStringValue();
1172 int value = static_cast<CSSPrimitiveValue*>(pair->second())->getIntValue();
1173 CounterDirectives& directives = map.add(identifier, CounterDirectives()).iterator->value;
1174 if (counterBehavior == Reset) {
1175 directives.setResetValue(value);
1177 directives.addIncrementValue(value);
1181 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &emptyFunction, &applyValue); }
1185 class ApplyPropertyCursor {
1187 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1189 styleResolver->style()->setCursor(styleResolver->parentStyle()->cursor());
1190 styleResolver->style()->setCursorList(styleResolver->parentStyle()->cursors());
1193 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1195 styleResolver->style()->clearCursorList();
1196 styleResolver->style()->setCursor(RenderStyle::initialCursor());
1199 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1201 styleResolver->style()->clearCursorList();
1202 if (value->isValueList()) {
1203 CSSValueList* list = toCSSValueList(value);
1204 int len = list->length();
1205 styleResolver->style()->setCursor(CURSOR_AUTO);
1206 for (int i = 0; i < len; i++) {
1207 CSSValue* item = list->itemWithoutBoundsCheck(i);
1208 if (item->isCursorImageValue()) {
1209 CSSCursorImageValue* image = toCSSCursorImageValue(item);
1210 if (image->updateIfSVGCursorIsUsed(styleResolver->element())) // Elements with SVG cursors are not allowed to share style.
1211 styleResolver->style()->setUnique();
1212 styleResolver->style()->addCursor(styleResolver->styleImage(CSSPropertyCursor, image), image->hotSpot());
1213 } else if (item->isPrimitiveValue()) {
1214 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
1215 if (primitiveValue->isValueID())
1216 styleResolver->style()->setCursor(*primitiveValue);
1219 } else if (value->isPrimitiveValue()) {
1220 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1221 if (primitiveValue->isValueID() && styleResolver->style()->cursor() != ECursor(*primitiveValue))
1222 styleResolver->style()->setCursor(*primitiveValue);
1226 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1229 class ApplyPropertyTextAlign {
1231 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1233 if (!value->isPrimitiveValue())
1236 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1237 ASSERT(primitiveValue->isValueID());
1239 if (primitiveValue->getValueID() != CSSValueWebkitMatchParent)
1240 styleResolver->style()->setTextAlign(*primitiveValue);
1241 else if (styleResolver->parentStyle()->textAlign() == TASTART)
1242 styleResolver->style()->setTextAlign(styleResolver->parentStyle()->isLeftToRightDirection() ? LEFT : RIGHT);
1243 else if (styleResolver->parentStyle()->textAlign() == TAEND)
1244 styleResolver->style()->setTextAlign(styleResolver->parentStyle()->isLeftToRightDirection() ? RIGHT : LEFT);
1246 styleResolver->style()->setTextAlign(styleResolver->parentStyle()->textAlign());
1248 static PropertyHandler createHandler()
1250 PropertyHandler handler = ApplyPropertyDefaultBase<ETextAlign, &RenderStyle::textAlign, ETextAlign, &RenderStyle::setTextAlign, ETextAlign, &RenderStyle::initialTextAlign>::createHandler();
1251 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1255 class ApplyPropertyTextDecoration {
1257 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1259 TextDecoration t = RenderStyle::initialTextDecoration();
1260 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
1261 CSSValue* item = i.value();
1262 ASSERT_WITH_SECURITY_IMPLICATION(item->isPrimitiveValue());
1263 t |= *toCSSPrimitiveValue(item);
1265 styleResolver->style()->setTextDecoration(t);
1267 static PropertyHandler createHandler()
1269 PropertyHandler handler = ApplyPropertyDefaultBase<TextDecoration, &RenderStyle::textDecoration, TextDecoration, &RenderStyle::setTextDecoration, TextDecoration, &RenderStyle::initialTextDecoration>::createHandler();
1270 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1274 #if ENABLE(CSS3_TEXT_DECORATION)
1275 static TextDecorationSkip valueToDecorationSkip(CSSPrimitiveValue& primitiveValue)
1277 ASSERT(primitiveValue.isValueID());
1279 switch (primitiveValue.getValueID()) {
1281 return TextDecorationSkipNone;
1283 return TextDecorationSkipInk;
1288 ASSERT_NOT_REACHED();
1289 return TextDecorationSkipNone;
1292 class ApplyPropertyTextDecorationSkip {
1294 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1296 if (value->isPrimitiveValue()) {
1297 styleResolver->style()->setTextDecorationSkip(valueToDecorationSkip(*toCSSPrimitiveValue(value)));
1301 TextDecorationSkip skip = RenderStyle::initialTextDecorationSkip();
1302 for (CSSValueListIterator i(value); i.hasMore(); i.advance())
1303 skip |= valueToDecorationSkip(*toCSSPrimitiveValue(i.value()));
1304 styleResolver->style()->setTextDecorationSkip(skip);
1306 static PropertyHandler createHandler()
1308 PropertyHandler handler = ApplyPropertyDefaultBase<TextDecorationSkip, &RenderStyle::textDecorationSkip, TextDecorationSkip, &RenderStyle::setTextDecorationSkip, TextDecorationSkip, &RenderStyle::initialTextDecorationSkip>::createHandler();
1309 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1312 #endif // CSS3_TEXT_DECORATION
1314 class ApplyPropertyMarqueeIncrement {
1316 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1318 if (!value->isPrimitiveValue())
1321 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1322 if (primitiveValue->getValueID()) {
1323 switch (primitiveValue->getValueID()) {
1325 styleResolver->style()->setMarqueeIncrement(Length(1, Fixed)); // 1px.
1327 case CSSValueNormal:
1328 styleResolver->style()->setMarqueeIncrement(Length(6, Fixed)); // 6px. The WinIE default.
1331 styleResolver->style()->setMarqueeIncrement(Length(36, Fixed)); // 36px.
1337 Length marqueeLength = styleResolver->convertToIntLength(primitiveValue, styleResolver->style(), styleResolver->rootElementStyle());
1338 if (!marqueeLength.isUndefined())
1339 styleResolver->style()->setMarqueeIncrement(marqueeLength);
1342 static PropertyHandler createHandler()
1344 PropertyHandler handler = ApplyPropertyLength<&RenderStyle::marqueeIncrement, &RenderStyle::setMarqueeIncrement, &RenderStyle::initialMarqueeIncrement>::createHandler();
1345 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1349 class ApplyPropertyMarqueeRepetition {
1351 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1353 if (!value->isPrimitiveValue())
1356 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1357 if (primitiveValue->getValueID() == CSSValueInfinite)
1358 styleResolver->style()->setMarqueeLoopCount(-1); // -1 means repeat forever.
1359 else if (primitiveValue->isNumber())
1360 styleResolver->style()->setMarqueeLoopCount(primitiveValue->getIntValue());
1362 static PropertyHandler createHandler()
1364 PropertyHandler handler = ApplyPropertyDefault<int, &RenderStyle::marqueeLoopCount, int, &RenderStyle::setMarqueeLoopCount, int, &RenderStyle::initialMarqueeLoopCount>::createHandler();
1365 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1369 class ApplyPropertyMarqueeSpeed {
1371 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1373 if (!value->isPrimitiveValue())
1376 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1377 if (CSSValueID ident = primitiveValue->getValueID()) {
1380 styleResolver->style()->setMarqueeSpeed(500); // 500 msec.
1382 case CSSValueNormal:
1383 styleResolver->style()->setMarqueeSpeed(85); // 85msec. The WinIE default.
1386 styleResolver->style()->setMarqueeSpeed(10); // 10msec. Super fast.
1391 } else if (primitiveValue->isTime())
1392 styleResolver->style()->setMarqueeSpeed(primitiveValue->computeTime<int, CSSPrimitiveValue::Milliseconds>());
1393 else if (primitiveValue->isNumber()) // For scrollamount support.
1394 styleResolver->style()->setMarqueeSpeed(primitiveValue->getIntValue());
1396 static PropertyHandler createHandler()
1398 PropertyHandler handler = ApplyPropertyDefault<int, &RenderStyle::marqueeSpeed, int, &RenderStyle::setMarqueeSpeed, int, &RenderStyle::initialMarqueeSpeed>::createHandler();
1399 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1403 #if ENABLE(CSS3_TEXT_DECORATION)
1404 class ApplyPropertyTextUnderlinePosition {
1406 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1408 // This is true if value is 'auto' or 'alphabetic'.
1409 if (value->isPrimitiveValue()) {
1410 TextUnderlinePosition t = *toCSSPrimitiveValue(value);
1411 styleResolver->style()->setTextUnderlinePosition(t);
1416 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
1417 CSSValue* item = i.value();
1418 ASSERT_WITH_SECURITY_IMPLICATION(item->isPrimitiveValue());
1419 TextUnderlinePosition t2 = *toCSSPrimitiveValue(item);
1422 styleResolver->style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t));
1424 static PropertyHandler createHandler()
1426 PropertyHandler handler = ApplyPropertyDefaultBase<TextUnderlinePosition, &RenderStyle::textUnderlinePosition, TextUnderlinePosition, &RenderStyle::setTextUnderlinePosition, TextUnderlinePosition, &RenderStyle::initialTextUnderlinePosition>::createHandler();
1427 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1430 #endif // CSS3_TEXT_DECORATION
1432 class ApplyPropertyLineHeight {
1434 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1436 if (!value->isPrimitiveValue())
1439 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1442 if (primitiveValue->getValueID() == CSSValueNormal)
1443 lineHeight = RenderStyle::initialLineHeight();
1444 else if (primitiveValue->isLength()) {
1445 double multiplier = styleResolver->style()->effectiveZoom();
1446 if (Frame* frame = styleResolver->document().frame())
1447 multiplier *= frame->textZoomFactor();
1448 lineHeight = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), multiplier);
1449 } else if (primitiveValue->isPercentage()) {
1450 // FIXME: percentage should not be restricted to an integer here.
1451 lineHeight = Length((styleResolver->style()->computedFontSize() * primitiveValue->getIntValue()) / 100, Fixed);
1452 } else if (primitiveValue->isNumber()) {
1453 // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
1454 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
1455 } else if (primitiveValue->isViewportPercentageLength())
1456 lineHeight = primitiveValue->viewportPercentageLength();
1459 styleResolver->style()->setLineHeight(lineHeight);
1461 static PropertyHandler createHandler()
1463 PropertyHandler handler = ApplyPropertyDefaultBase<const Length&, &RenderStyle::specifiedLineHeight, Length, &RenderStyle::setLineHeight, Length, &RenderStyle::initialLineHeight>::createHandler();
1464 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1468 #if ENABLE(IOS_TEXT_AUTOSIZING)
1469 // FIXME: Share more code with class ApplyPropertyLineHeight.
1470 class ApplyPropertyLineHeightForIOSTextAutosizing {
1472 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1474 if (!value->isPrimitiveValue())
1477 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1480 if (primitiveValue->getIdent() == CSSValueNormal)
1481 lineHeight = RenderStyle::initialLineHeight();
1482 else if (primitiveValue->isLength()) {
1483 double multiplier = styleResolver->style()->effectiveZoom();
1484 if (styleResolver->style()->textSizeAdjust().isNone()) {
1485 if (Frame* frame = styleResolver->document().frame())
1486 multiplier *= frame->textZoomFactor();
1488 lineHeight = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), multiplier);
1489 if (styleResolver->style()->textSizeAdjust().isPercentage())
1490 lineHeight = Length(lineHeight.value() * styleResolver->style()->textSizeAdjust().multiplier(), Fixed);
1491 } else if (primitiveValue->isPercentage()) {
1492 // FIXME: percentage should not be restricted to an integer here.
1493 lineHeight = Length((styleResolver->style()->fontSize() * primitiveValue->getIntValue()) / 100, Fixed);
1494 } else if (primitiveValue->isNumber()) {
1495 // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
1496 if (styleResolver->style()->textSizeAdjust().isPercentage())
1497 lineHeight = Length(primitiveValue->getDoubleValue() * styleResolver->style()->textSizeAdjust().multiplier() * 100.0, Percent);
1499 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
1500 } else if (primitiveValue->isViewportPercentageLength())
1501 lineHeight = primitiveValue->viewportPercentageLength();
1504 styleResolver->style()->setLineHeight(lineHeight);
1505 styleResolver->style()->setSpecifiedLineHeight(lineHeight);
1508 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1510 styleResolver->style()->setLineHeight(RenderStyle::initialLineHeight());
1511 styleResolver->style()->setSpecifiedLineHeight(RenderStyle::initialSpecifiedLineHeight());
1514 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1516 styleResolver->style()->setLineHeight(styleResolver->parentStyle()->lineHeight());
1517 styleResolver->style()->setSpecifiedLineHeight(styleResolver->parentStyle()->specifiedLineHeight());
1520 static PropertyHandler createHandler()
1522 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1527 class ApplyPropertyPageSize {
1529 static Length mmLength(double mm)
1531 Ref<CSSPrimitiveValue> value(CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM));
1532 return value.get().computeLength<Length>(0, 0);
1534 static Length inchLength(double inch)
1536 Ref<CSSPrimitiveValue> value(CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN));
1537 return value.get().computeLength<Length>(0, 0);
1539 static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
1541 DEFINE_STATIC_LOCAL(Length, a5Width, (mmLength(148)));
1542 DEFINE_STATIC_LOCAL(Length, a5Height, (mmLength(210)));
1543 DEFINE_STATIC_LOCAL(Length, a4Width, (mmLength(210)));
1544 DEFINE_STATIC_LOCAL(Length, a4Height, (mmLength(297)));
1545 DEFINE_STATIC_LOCAL(Length, a3Width, (mmLength(297)));
1546 DEFINE_STATIC_LOCAL(Length, a3Height, (mmLength(420)));
1547 DEFINE_STATIC_LOCAL(Length, b5Width, (mmLength(176)));
1548 DEFINE_STATIC_LOCAL(Length, b5Height, (mmLength(250)));
1549 DEFINE_STATIC_LOCAL(Length, b4Width, (mmLength(250)));
1550 DEFINE_STATIC_LOCAL(Length, b4Height, (mmLength(353)));
1551 DEFINE_STATIC_LOCAL(Length, letterWidth, (inchLength(8.5)));
1552 DEFINE_STATIC_LOCAL(Length, letterHeight, (inchLength(11)));
1553 DEFINE_STATIC_LOCAL(Length, legalWidth, (inchLength(8.5)));
1554 DEFINE_STATIC_LOCAL(Length, legalHeight, (inchLength(14)));
1555 DEFINE_STATIC_LOCAL(Length, ledgerWidth, (inchLength(11)));
1556 DEFINE_STATIC_LOCAL(Length, ledgerHeight, (inchLength(17)));
1561 switch (pageSizeName->getValueID()) {
1582 case CSSValueLetter:
1583 width = letterWidth;
1584 height = letterHeight;
1588 height = legalHeight;
1590 case CSSValueLedger:
1591 width = ledgerWidth;
1592 height = ledgerHeight;
1598 if (pageOrientation) {
1599 switch (pageOrientation->getValueID()) {
1600 case CSSValueLandscape:
1601 std::swap(width, height);
1603 case CSSValuePortrait:
1613 static void applyInheritValue(CSSPropertyID, StyleResolver*) { }
1614 static void applyInitialValue(CSSPropertyID, StyleResolver*) { }
1615 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1617 styleResolver->style()->resetPageSizeType();
1620 PageSizeType pageSizeType = PAGE_SIZE_AUTO;
1621 CSSValueListInspector inspector(value);
1622 switch (inspector.length()) {
1624 // <length>{2} | <page-size> <orientation>
1625 if (!inspector.first()->isPrimitiveValue() || !inspector.second()->isPrimitiveValue())
1627 CSSPrimitiveValue* first = toCSSPrimitiveValue(inspector.first());
1628 CSSPrimitiveValue* second = toCSSPrimitiveValue(inspector.second());
1629 if (first->isLength()) {
1631 if (!second->isLength())
1633 width = first->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
1634 height = second->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
1636 // <page-size> <orientation>
1637 // The value order is guaranteed. See CSSParser::parseSizeParameter.
1638 if (!getPageSizeFromName(first, second, width, height))
1641 pageSizeType = PAGE_SIZE_RESOLVED;
1645 // <length> | auto | <page-size> | [ portrait | landscape]
1646 if (!inspector.first()->isPrimitiveValue())
1648 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(inspector.first());
1649 if (primitiveValue->isLength()) {
1651 pageSizeType = PAGE_SIZE_RESOLVED;
1652 width = height = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
1654 switch (primitiveValue->getValueID()) {
1658 pageSizeType = PAGE_SIZE_AUTO;
1660 case CSSValuePortrait:
1661 pageSizeType = PAGE_SIZE_AUTO_PORTRAIT;
1663 case CSSValueLandscape:
1664 pageSizeType = PAGE_SIZE_AUTO_LANDSCAPE;
1668 pageSizeType = PAGE_SIZE_RESOLVED;
1669 if (!getPageSizeFromName(primitiveValue, 0, width, height))
1678 styleResolver->style()->setPageSizeType(pageSizeType);
1679 styleResolver->style()->setPageSize(LengthSize(width, height));
1681 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1684 class ApplyPropertyTextEmphasisStyle {
1686 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1688 styleResolver->style()->setTextEmphasisFill(styleResolver->parentStyle()->textEmphasisFill());
1689 styleResolver->style()->setTextEmphasisMark(styleResolver->parentStyle()->textEmphasisMark());
1690 styleResolver->style()->setTextEmphasisCustomMark(styleResolver->parentStyle()->textEmphasisCustomMark());
1693 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1695 styleResolver->style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill());
1696 styleResolver->style()->setTextEmphasisMark(RenderStyle::initialTextEmphasisMark());
1697 styleResolver->style()->setTextEmphasisCustomMark(RenderStyle::initialTextEmphasisCustomMark());
1700 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1702 if (value->isValueList()) {
1703 CSSValueList* list = toCSSValueList(value);
1704 ASSERT(list->length() == 2);
1705 if (list->length() != 2)
1707 for (unsigned i = 0; i < 2; ++i) {
1708 CSSValue* item = list->itemWithoutBoundsCheck(i);
1709 if (!item->isPrimitiveValue())
1712 CSSPrimitiveValue* value = toCSSPrimitiveValue(item);
1713 if (value->getValueID() == CSSValueFilled || value->getValueID() == CSSValueOpen)
1714 styleResolver->style()->setTextEmphasisFill(*value);
1716 styleResolver->style()->setTextEmphasisMark(*value);
1718 styleResolver->style()->setTextEmphasisCustomMark(nullAtom);
1722 if (!value->isPrimitiveValue())
1724 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1726 if (primitiveValue->isString()) {
1727 styleResolver->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1728 styleResolver->style()->setTextEmphasisMark(TextEmphasisMarkCustom);
1729 styleResolver->style()->setTextEmphasisCustomMark(primitiveValue->getStringValue());
1733 styleResolver->style()->setTextEmphasisCustomMark(nullAtom);
1735 if (primitiveValue->getValueID() == CSSValueFilled || primitiveValue->getValueID() == CSSValueOpen) {
1736 styleResolver->style()->setTextEmphasisFill(*primitiveValue);
1737 styleResolver->style()->setTextEmphasisMark(TextEmphasisMarkAuto);
1739 styleResolver->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1740 styleResolver->style()->setTextEmphasisMark(*primitiveValue);
1744 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1747 template <typename T,
1748 T (Animation::*getterFunction)() const,
1749 void (Animation::*setterFunction)(T),
1750 bool (Animation::*testFunction)() const,
1751 void (Animation::*clearFunction)(),
1752 T (*initialFunction)(),
1753 void (CSSToStyleMap::*mapFunction)(Animation*, CSSValue*),
1754 AnimationList* (RenderStyle::*animationGetterFunction)(),
1755 const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
1756 class ApplyPropertyAnimation {
1758 static void setValue(Animation& animation, T value) { (animation.*setterFunction)(value); }
1759 static T value(const Animation& animation) { return (animation.*getterFunction)(); }
1760 static bool test(const Animation& animation) { return (animation.*testFunction)(); }
1761 static void clear(Animation& animation) { (animation.*clearFunction)(); }
1762 static T initial() { return (*initialFunction)(); }
1763 static void map(StyleResolver* styleResolver, Animation& animation, CSSValue* value) { (styleResolver->styleMap()->*mapFunction)(&animation, value); }
1764 static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
1765 static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
1767 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1769 AnimationList* list = accessAnimations(styleResolver->style());
1770 const AnimationList* parentList = animations(styleResolver->parentStyle());
1771 size_t i = 0, parentSize = parentList ? parentList->size() : 0;
1772 for ( ; i < parentSize && test(parentList->animation(i)); ++i) {
1773 if (list->size() <= i)
1774 list->append(Animation::create());
1775 setValue(list->animation(i), value(parentList->animation(i)));
1776 list->animation(i).setAnimationMode(parentList->animation(i).animationMode());
1779 /* Reset any remaining animations to not have the property set. */
1780 for ( ; i < list->size(); ++i)
1781 clear(list->animation(i));
1784 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
1786 AnimationList* list = accessAnimations(styleResolver->style());
1787 if (list->isEmpty())
1788 list->append(Animation::create());
1789 setValue(list->animation(0), initial());
1790 if (propertyID == CSSPropertyWebkitTransitionProperty)
1791 list->animation(0).setAnimationMode(Animation::AnimateAll);
1792 for (size_t i = 1; i < list->size(); ++i)
1793 clear(list->animation(i));
1796 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1798 AnimationList* list = accessAnimations(styleResolver->style());
1799 size_t childIndex = 0;
1800 if (value->isValueList()) {
1801 /* Walk each value and put it into an animation, creating new animations as needed. */
1802 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
1803 if (childIndex <= list->size())
1804 list->append(Animation::create());
1805 map(styleResolver, list->animation(childIndex), i.value());
1809 if (list->isEmpty())
1810 list->append(Animation::create());
1811 map(styleResolver, list->animation(childIndex), value);
1814 for ( ; childIndex < list->size(); ++childIndex) {
1815 /* Reset all remaining animations to not have the property set. */
1816 clear(list->animation(childIndex));
1820 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1823 class ApplyPropertyOutlineStyle {
1825 static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
1827 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInheritValue(propertyID, styleResolver);
1828 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInheritValue(propertyID, styleResolver);
1831 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
1833 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInitialValue(propertyID, styleResolver);
1834 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInitialValue(propertyID, styleResolver);
1837 static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
1839 ApplyPropertyDefault<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyValue(propertyID, styleResolver, value);
1840 ApplyPropertyDefault<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyValue(propertyID, styleResolver, value);
1843 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1846 class ApplyPropertyResize {
1848 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1850 if (!value->isPrimitiveValue())
1853 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1855 EResize r = RESIZE_NONE;
1856 switch (primitiveValue->getValueID()) {
1860 if (Settings* settings = styleResolver->document().settings())
1861 r = settings->textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE;
1864 r = *primitiveValue;
1866 styleResolver->style()->setResize(r);
1869 static PropertyHandler createHandler()
1871 PropertyHandler handler = ApplyPropertyDefaultBase<EResize, &RenderStyle::resize, EResize, &RenderStyle::setResize, EResize, &RenderStyle::initialResize>::createHandler();
1872 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1876 class ApplyPropertyVerticalAlign {
1878 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1880 if (!value->isPrimitiveValue())
1883 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1885 if (primitiveValue->getValueID())
1886 return styleResolver->style()->setVerticalAlign(*primitiveValue);
1888 styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()));
1891 static PropertyHandler createHandler()
1893 PropertyHandler handler = ApplyPropertyDefaultBase<EVerticalAlign, &RenderStyle::verticalAlign, EVerticalAlign, &RenderStyle::setVerticalAlign, EVerticalAlign, &RenderStyle::initialVerticalAlign>::createHandler();
1894 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1898 class ApplyPropertyAspectRatio {
1900 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1902 if (!styleResolver->parentStyle()->hasAspectRatio())
1904 styleResolver->style()->setHasAspectRatio(true);
1905 styleResolver->style()->setAspectRatioDenominator(styleResolver->parentStyle()->aspectRatioDenominator());
1906 styleResolver->style()->setAspectRatioNumerator(styleResolver->parentStyle()->aspectRatioNumerator());
1909 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1911 styleResolver->style()->setHasAspectRatio(RenderStyle::initialHasAspectRatio());
1912 styleResolver->style()->setAspectRatioDenominator(RenderStyle::initialAspectRatioDenominator());
1913 styleResolver->style()->setAspectRatioNumerator(RenderStyle::initialAspectRatioNumerator());
1916 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1918 if (!value->isAspectRatioValue()) {
1919 styleResolver->style()->setHasAspectRatio(false);
1922 CSSAspectRatioValue* aspectRatioValue = toCSSAspectRatioValue(value);
1923 styleResolver->style()->setHasAspectRatio(true);
1924 styleResolver->style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue());
1925 styleResolver->style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue());
1928 static PropertyHandler createHandler()
1930 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1934 class ApplyPropertyZoom {
1936 static void resetEffectiveZoom(StyleResolver* styleResolver)
1938 // Reset the zoom in effect. This allows the setZoom method to accurately compute a new zoom in effect.
1939 styleResolver->setEffectiveZoom(styleResolver->parentStyle() ? styleResolver->parentStyle()->effectiveZoom() : RenderStyle::initialZoom());
1943 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1945 resetEffectiveZoom(styleResolver);
1946 styleResolver->setZoom(styleResolver->parentStyle()->zoom());
1949 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1951 resetEffectiveZoom(styleResolver);
1952 styleResolver->setZoom(RenderStyle::initialZoom());
1955 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1957 ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
1958 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1960 if (primitiveValue->getValueID() == CSSValueNormal) {
1961 resetEffectiveZoom(styleResolver);
1962 styleResolver->setZoom(RenderStyle::initialZoom());
1963 } else if (primitiveValue->getValueID() == CSSValueReset) {
1964 styleResolver->setEffectiveZoom(RenderStyle::initialZoom());
1965 styleResolver->setZoom(RenderStyle::initialZoom());
1966 } else if (primitiveValue->getValueID() == CSSValueDocument) {
1967 float docZoom = styleResolver->rootElementStyle() ? styleResolver->rootElementStyle()->zoom() : RenderStyle::initialZoom();
1968 styleResolver->setEffectiveZoom(docZoom);
1969 styleResolver->setZoom(docZoom);
1970 } else if (primitiveValue->isPercentage()) {
1971 resetEffectiveZoom(styleResolver);
1972 if (float percent = primitiveValue->getFloatValue())
1973 styleResolver->setZoom(percent / 100.0f);
1974 } else if (primitiveValue->isNumber()) {
1975 resetEffectiveZoom(styleResolver);
1976 if (float number = primitiveValue->getFloatValue())
1977 styleResolver->setZoom(number);
1981 static PropertyHandler createHandler()
1983 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1987 class ApplyPropertyDisplay {
1989 static inline bool isValidDisplayValue(StyleResolver* styleResolver, EDisplay displayPropertyValue)
1992 if (styleResolver->element() && styleResolver->element()->isSVGElement() && styleResolver->style()->styleType() == NOPSEUDO)
1993 return (displayPropertyValue == INLINE || displayPropertyValue == BLOCK || displayPropertyValue == NONE);
1995 UNUSED_PARAM(styleResolver);
1996 UNUSED_PARAM(displayPropertyValue);
2001 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
2003 EDisplay display = styleResolver->parentStyle()->display();
2004 if (!isValidDisplayValue(styleResolver, display))
2006 styleResolver->style()->setDisplay(display);
2009 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
2011 styleResolver->style()->setDisplay(RenderStyle::initialDisplay());
2014 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
2016 if (!value->isPrimitiveValue())
2019 EDisplay display = *toCSSPrimitiveValue(value);
2021 if (!isValidDisplayValue(styleResolver, display))
2024 styleResolver->style()->setDisplay(display);
2027 static PropertyHandler createHandler()
2029 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
2033 template <ClipPathOperation* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<ClipPathOperation>), ClipPathOperation* (*initialFunction)()>
2034 class ApplyPropertyClipPath {
2036 static void setValue(RenderStyle* style, PassRefPtr<ClipPathOperation> value) { (style->*setterFunction)(value); }
2037 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
2039 if (value->isPrimitiveValue()) {
2040 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
2041 if (primitiveValue->getValueID() == CSSValueNone)
2042 setValue(styleResolver->style(), 0);
2043 else if (primitiveValue->isShape()) {
2044 setValue(styleResolver->style(), ShapeClipPathOperation::create(basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue->getShapeValue())));
2047 else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_URI) {
2048 String cssURLValue = primitiveValue->getStringValue();
2049 URL url = styleResolver->document().completeURL(cssURLValue);
2050 // FIXME: It doesn't work with forward or external SVG references (see https://bugs.webkit.org/show_bug.cgi?id=90405)
2051 setValue(styleResolver->style(), ReferenceClipPathOperation::create(cssURLValue, url.fragmentIdentifier()));
2056 static PropertyHandler createHandler()
2058 PropertyHandler handler = ApplyPropertyDefaultBase<ClipPathOperation*, getterFunction, PassRefPtr<ClipPathOperation>, setterFunction, ClipPathOperation*, initialFunction>::createHandler();
2059 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
2063 #if ENABLE(CSS_SHAPES)
2064 template <ShapeValue* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<ShapeValue>), ShapeValue* (*initialFunction)()>
2065 class ApplyPropertyShape {
2067 static void setValue(RenderStyle* style, PassRefPtr<ShapeValue> value) { (style->*setterFunction)(value); }
2068 static void applyValue(CSSPropertyID property, StyleResolver* styleResolver, CSSValue* value)
2070 if (value->isPrimitiveValue()) {
2071 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
2072 if (primitiveValue->getValueID() == CSSValueAuto)
2073 setValue(styleResolver->style(), 0);
2074 else if (primitiveValue->getValueID() == CSSValueContentBox
2075 || primitiveValue->getValueID() == CSSValueBorderBox
2076 || primitiveValue->getValueID() == CSSValuePaddingBox
2077 || primitiveValue->getValueID() == CSSValueMarginBox)
2078 setValue(styleResolver->style(), ShapeValue::createBoxValue(primitiveValue->getValueID()));
2079 else if (primitiveValue->getValueID() == CSSValueOutsideShape)
2080 setValue(styleResolver->style(), ShapeValue::createOutsideValue());
2081 else if (primitiveValue->isShape()) {
2082 RefPtr<ShapeValue> shape = ShapeValue::createShapeValue(basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue->getShapeValue()));
2083 setValue(styleResolver->style(), shape.release());
2085 } else if (value->isImageValue()) {
2086 RefPtr<ShapeValue> shape = ShapeValue::createImageValue(styleResolver->styleImage(property, value));
2087 setValue(styleResolver->style(), shape.release());
2091 static PropertyHandler createHandler()
2093 PropertyHandler handler = ApplyPropertyDefaultBase<ShapeValue*, getterFunction, PassRefPtr<ShapeValue>, setterFunction, ShapeValue*, initialFunction>::createHandler();
2094 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
2099 #if ENABLE(CSS_IMAGE_RESOLUTION)
2100 class ApplyPropertyImageResolution {
2102 static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
2104 ApplyPropertyDefaultBase<ImageResolutionSource, &RenderStyle::imageResolutionSource, ImageResolutionSource, &RenderStyle::setImageResolutionSource, ImageResolutionSource, &RenderStyle::initialImageResolutionSource>::applyInheritValue(propertyID, styleResolver);
2105 ApplyPropertyDefaultBase<ImageResolutionSnap, &RenderStyle::imageResolutionSnap, ImageResolutionSnap, &RenderStyle::setImageResolutionSnap, ImageResolutionSnap, &RenderStyle::initialImageResolutionSnap>::applyInheritValue(propertyID, styleResolver);
2106 ApplyPropertyDefaultBase<float, &RenderStyle::imageResolution, float, &RenderStyle::setImageResolution, float, &RenderStyle::initialImageResolution>::applyInheritValue(propertyID, styleResolver);
2109 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
2111 ApplyPropertyDefaultBase<ImageResolutionSource, &RenderStyle::imageResolutionSource, ImageResolutionSource, &RenderStyle::setImageResolutionSource, ImageResolutionSource, &RenderStyle::initialImageResolutionSource>::applyInitialValue(propertyID, styleResolver);
2112 ApplyPropertyDefaultBase<ImageResolutionSnap, &RenderStyle::imageResolutionSnap, ImageResolutionSnap, &RenderStyle::setImageResolutionSnap, ImageResolutionSnap, &RenderStyle::initialImageResolutionSnap>::applyInitialValue(propertyID, styleResolver);
2113 ApplyPropertyDefaultBase<float, &RenderStyle::imageResolution, float, &RenderStyle::setImageResolution, float, &RenderStyle::initialImageResolution>::applyInitialValue(propertyID, styleResolver);
2116 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
2118 if (!value->isValueList())
2120 CSSValueList* valueList = toCSSValueList(value);
2121 ImageResolutionSource source = RenderStyle::initialImageResolutionSource();
2122 ImageResolutionSnap snap = RenderStyle::initialImageResolutionSnap();
2123 double resolution = RenderStyle::initialImageResolution();
2124 for (size_t i = 0; i < valueList->length(); i++) {
2125 CSSValue* item = valueList->itemWithoutBoundsCheck(i);
2126 if (!item->isPrimitiveValue())
2128 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
2129 if (primitiveValue->getValueID() == CSSValueFromImage)
2130 source = ImageResolutionFromImage;
2131 else if (primitiveValue->getValueID() == CSSValueSnap)
2132 snap = ImageResolutionSnapPixels;
2134 resolution = primitiveValue->getDoubleValue(CSSPrimitiveValue::CSS_DPPX);
2136 styleResolver->style()->setImageResolutionSource(source);
2137 styleResolver->style()->setImageResolutionSnap(snap);
2138 styleResolver->style()->setImageResolution(resolution);
2141 static PropertyHandler createHandler()
2143 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
2148 class ApplyPropertyTextIndent {
2150 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
2152 styleResolver->style()->setTextIndent(styleResolver->parentStyle()->textIndent());
2153 #if ENABLE(CSS3_TEXT)
2154 styleResolver->style()->setTextIndentLine(styleResolver->parentStyle()->textIndentLine());
2155 styleResolver->style()->setTextIndentType(styleResolver->parentStyle()->textIndentType());
2159 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
2161 styleResolver->style()->setTextIndent(RenderStyle::initialTextIndent());
2162 #if ENABLE(CSS3_TEXT)
2163 styleResolver->style()->setTextIndentLine(RenderStyle::initialTextIndentLine());
2164 styleResolver->style()->setTextIndentType(RenderStyle::initialTextIndentType());
2168 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
2170 if (!value->isValueList())
2173 Length lengthOrPercentageValue;
2174 #if ENABLE(CSS3_TEXT)
2175 TextIndentLine textIndentLineValue = RenderStyle::initialTextIndentLine();
2176 TextIndentType textIndentTypeValue = RenderStyle::initialTextIndentType();
2178 CSSValueList* valueList = toCSSValueList(value);
2179 for (size_t i = 0; i < valueList->length(); ++i) {
2180 CSSValue* item = valueList->itemWithoutBoundsCheck(i);
2181 if (!item->isPrimitiveValue())
2184 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
2185 if (!primitiveValue->getValueID())
2186 lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
2187 #if ENABLE(CSS3_TEXT)
2188 else if (primitiveValue->getValueID() == CSSValueWebkitEachLine)
2189 textIndentLineValue = TextIndentEachLine;
2190 else if (primitiveValue->getValueID() == CSSValueWebkitHanging)
2191 textIndentTypeValue = TextIndentHanging;
2195 ASSERT(!lengthOrPercentageValue.isUndefined());
2196 styleResolver->style()->setTextIndent(lengthOrPercentageValue);
2197 #if ENABLE(CSS3_TEXT)
2198 styleResolver->style()->setTextIndentLine(textIndentLineValue);
2199 styleResolver->style()->setTextIndentType(textIndentTypeValue);
2203 static PropertyHandler createHandler()
2205 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
2209 const DeprecatedStyleBuilder& DeprecatedStyleBuilder::sharedStyleBuilder()
2211 DEFINE_STATIC_LOCAL(DeprecatedStyleBuilder, styleBuilderInstance, ());
2212 return styleBuilderInstance;
2215 DeprecatedStyleBuilder::DeprecatedStyleBuilder()
2217 for (int i = 0; i < numCSSProperties; ++i)
2218 m_propertyMap[i] = PropertyHandler();
2220 // Please keep CSS property list in alphabetical order.
2221 setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSToStyleMap::mapFillAttachment>::createHandler());
2222 setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
2223 setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler());
2224 setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
2225 setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
2226 setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
2227 setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
2228 setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
2229 setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
2230 setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
2231 setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
2232 setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
2233 setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
2234 setPropertyHandler(CSSPropertyBorderBottomStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderBottomStyle, EBorderStyle, &RenderStyle::setBorderBottomStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2235 setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2236 setPropertyHandler(CSSPropertyBorderCollapse, ApplyPropertyDefault<EBorderCollapse, &RenderStyle::borderCollapse, EBorderCollapse, &RenderStyle::setBorderCollapse, EBorderCollapse, &RenderStyle::initialBorderCollapse>::createHandler());
2237 setPropertyHandler(CSSPropertyBorderImageOutset, ApplyPropertyBorderImageModifier<BorderImage, Outset>::createHandler());
2238 setPropertyHandler(CSSPropertyBorderImageRepeat, ApplyPropertyBorderImageModifier<BorderImage, Repeat>::createHandler());
2239 setPropertyHandler(CSSPropertyBorderImageSlice, ApplyPropertyBorderImageModifier<BorderImage, Slice>::createHandler());
2240 setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource<CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource, &RenderStyle::initialBorderImageSource>::createHandler());
2241 setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier<BorderImage, Width>::createHandler());
2242 setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
2243 setPropertyHandler(CSSPropertyBorderLeftStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderLeftStyle, EBorderStyle, &RenderStyle::setBorderLeftStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2244 setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2245 setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
2246 setPropertyHandler(CSSPropertyBorderRightStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderRightStyle, EBorderStyle, &RenderStyle::setBorderRightStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2247 setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2248 setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler());
2249 setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
2250 setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
2251 setPropertyHandler(CSSPropertyBorderTopStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderTopStyle, EBorderStyle, &RenderStyle::setBorderTopStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2252 setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2253 setPropertyHandler(CSSPropertyBottom, ApplyPropertyLength<&RenderStyle::bottom, &RenderStyle::setBottom, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
2254 setPropertyHandler(CSSPropertyBoxSizing, ApplyPropertyDefault<EBoxSizing, &RenderStyle::boxSizing, EBoxSizing, &RenderStyle::setBoxSizing, EBoxSizing, &RenderStyle::initialBoxSizing>::createHandler());
2255 setPropertyHandler(CSSPropertyCaptionSide, ApplyPropertyDefault<ECaptionSide, &RenderStyle::captionSide, ECaptionSide, &RenderStyle::setCaptionSide, ECaptionSide, &RenderStyle::initialCaptionSide>::createHandler());
2256 setPropertyHandler(CSSPropertyClear, ApplyPropertyDefault<EClear, &RenderStyle::clear, EClear, &RenderStyle::setClear, EClear, &RenderStyle::initialClear>::createHandler());
2257 setPropertyHandler(CSSPropertyClip, ApplyPropertyClip::createHandler());
2258 setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler());
2259 setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::createHandler());
2260 setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler());
2261 setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler());
2262 setPropertyHandler(CSSPropertyDirection, ApplyPropertyDirection<&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection>::createHandler());
2263 setPropertyHandler(CSSPropertyDisplay, ApplyPropertyDisplay::createHandler());
2264 setPropertyHandler(CSSPropertyEmptyCells, ApplyPropertyDefault<EEmptyCell, &RenderStyle::emptyCells, EEmptyCell, &RenderStyle::setEmptyCells, EEmptyCell, &RenderStyle::initialEmptyCells>::createHandler());
2265 setPropertyHandler(CSSPropertyFloat, ApplyPropertyDefault<EFloat, &RenderStyle::floating, EFloat, &RenderStyle::setFloating, EFloat, &RenderStyle::initialFloating>::createHandler());
2266 setPropertyHandler(CSSPropertyFontFamily, ApplyPropertyFontFamily::createHandler());
2267 setPropertyHandler(CSSPropertyFontSize, ApplyPropertyFontSize::createHandler());
2268 setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
2269 setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
2270 setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
2271 setPropertyHandler(CSSPropertyHeight, ApplyPropertyLength<&RenderStyle::height, &RenderStyle::setHeight, &RenderStyle::initialSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicDisabled, NoneDisabled, UndefinedDisabled>::createHandler());
2272 #if ENABLE(CSS_IMAGE_ORIENTATION)
2273 setPropertyHandler(CSSPropertyImageOrientation, ApplyPropertyDefault<ImageOrientationEnum, &RenderStyle::imageOrientation, ImageOrientationEnum, &RenderStyle::setImageOrientation, ImageOrientationEnum, &RenderStyle::initialImageOrientation>::createHandler());
2275 setPropertyHandler(CSSPropertyImageRendering, ApplyPropertyDefault<EImageRendering, &RenderStyle::imageRendering, EImageRendering, &RenderStyle::setImageRendering, EImageRendering, &RenderStyle::initialImageRendering>::createHandler());
2276 #if ENABLE(CSS_IMAGE_RESOLUTION)
2277 setPropertyHandler(CSSPropertyImageResolution, ApplyPropertyImageResolution::createHandler());
2279 setPropertyHandler(CSSPropertyLeft, ApplyPropertyLength<&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
2280 setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength<int, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
2281 #if ENABLE(IOS_TEXT_AUTOSIZING)
2282 setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeightForIOSTextAutosizing::createHandler());
2284 setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeight::createHandler());
2286 setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
2287 setPropertyHandler(CSSPropertyListStylePosition, ApplyPropertyDefault<EListStylePosition, &RenderStyle::listStylePosition, EListStylePosition, &RenderStyle::setListStylePosition, EListStylePosition, &RenderStyle::initialListStylePosition>::createHandler());
2288 setPropertyHandler(CSSPropertyListStyleType, ApplyPropertyDefault<EListStyleType, &RenderStyle::listStyleType, EListStyleType, &RenderStyle::setListStyleType, EListStyleType, &RenderStyle::initialListStyleType>::createHandler());
2289 setPropertyHandler(CSSPropertyMarginBottom, ApplyPropertyLength<&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
2290 setPropertyHandler(CSSPropertyMarginLeft, ApplyPropertyLength<&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
2291 setPropertyHandler(CSSPropertyMarginRight, ApplyPropertyLength<&RenderStyle::marginRight, &RenderStyle::setMarginRight, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
2292 setPropertyHandler(CSSPropertyMarginTop, ApplyPropertyLength<&RenderStyle::marginTop, &RenderStyle::setMarginTop, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
2293 setPropertyHandler(CSSPropertyMaxHeight, ApplyPropertyLength<&RenderStyle::maxHeight, &RenderStyle::setMaxHeight, &RenderStyle::initialMaxSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicDisabled, NoneEnabled, UndefinedEnabled>::createHandler());
2294 setPropertyHandler(CSSPropertyMaxWidth, ApplyPropertyLength<&RenderStyle::maxWidth, &RenderStyle::setMaxWidth, &RenderStyle::initialMaxSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
2295 setPropertyHandler(CSSPropertyMinHeight, ApplyPropertyLength<&RenderStyle::minHeight, &RenderStyle::setMinHeight, &RenderStyle::initialMinSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicDisabled>::createHandler());
2296 setPropertyHandler(CSSPropertyMinWidth, ApplyPropertyLength<&RenderStyle::minWidth, &RenderStyle::setMinWidth, &RenderStyle::initialMinSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicEnabled>::createHandler());
2297 setPropertyHandler(CSSPropertyObjectFit, ApplyPropertyDefault<ObjectFit, &RenderStyle::objectFit, ObjectFit, &RenderStyle::setObjectFit, ObjectFit, &RenderStyle::initialObjectFit>::createHandler());
2298 setPropertyHandler(CSSPropertyOpacity, ApplyPropertyDefault<float, &RenderStyle::opacity, float, &RenderStyle::setOpacity, float, &RenderStyle::initialOpacity>::createHandler());
2299 setPropertyHandler(CSSPropertyOrphans, ApplyPropertyAuto<short, &RenderStyle::orphans, &RenderStyle::setOrphans, &RenderStyle::hasAutoOrphans, &RenderStyle::setHasAutoOrphans>::createHandler());
2300 setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
2301 setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength<int, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset>::createHandler());
2302 setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
2303 setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialOutlineWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2304 setPropertyHandler(CSSPropertyOverflowWrap, ApplyPropertyDefault<EOverflowWrap, &RenderStyle::overflowWrap, EOverflowWrap, &RenderStyle::setOverflowWrap, EOverflowWrap, &RenderStyle::initialOverflowWrap>::createHandler());
2305 setPropertyHandler(CSSPropertyOverflowX, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowX, EOverflow, &RenderStyle::setOverflowX, EOverflow, &RenderStyle::initialOverflowX>::createHandler());
2306 setPropertyHandler(CSSPropertyOverflowY, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowY, EOverflow, &RenderStyle::setOverflowY, EOverflow, &RenderStyle::initialOverflowY>::createHandler());
2307 setPropertyHandler(CSSPropertyPaddingBottom, ApplyPropertyLength<&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding>::createHandler());
2308 setPropertyHandler(CSSPropertyPaddingLeft, ApplyPropertyLength<&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding>::createHandler());
2309 setPropertyHandler(CSSPropertyPaddingRight, ApplyPropertyLength<&RenderStyle::paddingRight, &RenderStyle::setPaddingRight, &RenderStyle::initialPadding>::createHandler());
2310 setPropertyHandler(CSSPropertyPaddingTop, ApplyPropertyLength<&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding>::createHandler());
2311 setPropertyHandler(CSSPropertyPageBreakAfter, ApplyPropertyDefault<EPageBreak, &RenderStyle::pageBreakAfter, EPageBreak, &RenderStyle::setPageBreakAfter, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2312 setPropertyHandler(CSSPropertyPageBreakBefore, ApplyPropertyDefault<EPageBreak, &RenderStyle::pageBreakBefore, EPageBreak, &RenderStyle::setPageBreakBefore, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2313 setPropertyHandler(CSSPropertyPageBreakInside, ApplyPropertyDefault<EPageBreak, &RenderStyle::pageBreakInside, EPageBreak, &RenderStyle::setPageBreakInside, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2314 setPropertyHandler(CSSPropertyPointerEvents, ApplyPropertyDefault<EPointerEvents, &RenderStyle::pointerEvents, EPointerEvents, &RenderStyle::setPointerEvents, EPointerEvents, &RenderStyle::initialPointerEvents>::createHandler());
2315 setPropertyHandler(CSSPropertyPosition, ApplyPropertyDefault<EPosition, &RenderStyle::position, EPosition, &RenderStyle::setPosition, EPosition, &RenderStyle::initialPosition>::createHandler());
2316 setPropertyHandler(CSSPropertyResize, ApplyPropertyResize::createHandler());
2317 setPropertyHandler(CSSPropertyRight, ApplyPropertyLength<&RenderStyle::right, &RenderStyle::setRight, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
2318 setPropertyHandler(CSSPropertySize, ApplyPropertyPageSize::createHandler());
2319 setPropertyHandler(CSSPropertySpeak, ApplyPropertyDefault<ESpeak, &RenderStyle::speak, ESpeak, &RenderStyle::setSpeak, ESpeak, &RenderStyle::initialSpeak>::createHandler());
2320 setPropertyHandler(CSSPropertyTableLayout, ApplyPropertyDefault<ETableLayout, &RenderStyle::tableLayout, ETableLayout, &RenderStyle::setTableLayout, ETableLayout, &RenderStyle::initialTableLayout>::createHandler());
2321 setPropertyHandler(CSSPropertyTabSize, ApplyPropertyDefault<unsigned, &RenderStyle::tabSize, unsigned, &RenderStyle::setTabSize, unsigned, &RenderStyle::initialTabSize>::createHandler());
2322 setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
2323 setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
2324 #if ENABLE(CSS3_TEXT)
2325 setPropertyHandler(CSSPropertyWebkitTextAlignLast, ApplyPropertyDefault<TextAlignLast, &RenderStyle::textAlignLast, TextAlignLast, &RenderStyle::setTextAlignLast, TextAlignLast, &RenderStyle::initialTextAlignLast>::createHandler());
2326 setPropertyHandler(CSSPropertyWebkitTextJustify, ApplyPropertyDefault<TextJustify, &RenderStyle::textJustify, TextJustify, &RenderStyle::setTextJustify, TextJustify, &RenderStyle::initialTextJustify>::createHandler());
2328 #if ENABLE(CSS3_TEXT_DECORATION)
2329 setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
2330 setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler());
2331 setPropertyHandler(CSSPropertyWebkitTextDecorationColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textDecorationColor, &RenderStyle::setTextDecorationColor, &RenderStyle::setVisitedLinkTextDecorationColor, &RenderStyle::color>::createHandler());
2332 setPropertyHandler(CSSPropertyWebkitTextDecorationSkip, ApplyPropertyTextDecorationSkip::createHandler());
2333 setPropertyHandler(CSSPropertyWebkitTextUnderlinePosition, ApplyPropertyTextUnderlinePosition::createHandler());
2335 setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyTextIndent::createHandler());
2336 setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler());
2337 setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
2338 setPropertyHandler(CSSPropertyTextTransform, ApplyPropertyDefault<ETextTransform, &RenderStyle::textTransform, ETextTransform, &RenderStyle::setTextTransform, ETextTransform, &RenderStyle::initialTextTransform>::createHandler());
2339 setPropertyHandler(CSSPropertyTop, ApplyPropertyLength<&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
2340 setPropertyHandler(CSSPropertyUnicodeBidi, ApplyPropertyDefault<EUnicodeBidi, &RenderStyle::unicodeBidi, EUnicodeBidi, &RenderStyle::setUnicodeBidi, EUnicodeBidi, &RenderStyle::initialUnicodeBidi>::createHandler());
2341 setPropertyHandler(CSSPropertyVerticalAlign, ApplyPropertyVerticalAlign::createHandler());
2342 setPropertyHandler(CSSPropertyVisibility, ApplyPropertyDefault<EVisibility, &RenderStyle::visibility, EVisibility, &RenderStyle::setVisibility, EVisibility, &RenderStyle::initialVisibility>::createHandler());
2343 setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2344 setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSToStyleMap::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2345 setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2346 setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSToStyleMap::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2347 setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<double, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSToStyleMap::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2348 setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSToStyleMap::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2349 setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSToStyleMap::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2350 setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2351 setPropertyHandler(CSSPropertyWebkitAppearance, ApplyPropertyDefault<ControlPart, &RenderStyle::appearance, ControlPart, &RenderStyle::setAppearance, ControlPart, &RenderStyle::initialAppearance>::createHandler());
2352 setPropertyHandler(CSSPropertyWebkitAspectRatio, ApplyPropertyAspectRatio::createHandler());
2353 setPropertyHandler(CSSPropertyWebkitBackfaceVisibility, ApplyPropertyDefault<EBackfaceVisibility, &RenderStyle::backfaceVisibility, EBackfaceVisibility, &RenderStyle::setBackfaceVisibility, EBackfaceVisibility, &RenderStyle::initialBackfaceVisibility>::createHandler());
2354 setPropertyHandler(CSSPropertyWebkitBackgroundBlendMode, ApplyPropertyFillLayer<BlendMode, CSSPropertyWebkitBackgroundBlendMode, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isBlendModeSet, &FillLayer::blendMode, &FillLayer::setBlendMode, &FillLayer::clearBlendMode, &FillLayer::initialFillBlendMode, &CSSToStyleMap::mapFillBlendMode>::createHandler());
2355 setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
2356 setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
2357 setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
2358 setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
2359 #if ENABLE(CSS_COMPOSITING)
2360 setPropertyHandler(CSSPropertyWebkitBlendMode, ApplyPropertyDefault<BlendMode, &RenderStyle::blendMode, BlendMode, &RenderStyle::setBlendMode, BlendMode, &RenderStyle::initialBlendMode>::createHandler());
2362 setPropertyHandler(CSSPropertyWebkitBorderFit, ApplyPropertyDefault<EBorderFit, &RenderStyle::borderFit, EBorderFit, &RenderStyle::setBorderFit, EBorderFit, &RenderStyle::initialBorderFit>::createHandler());
2363 setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler());
2364 setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage<BorderImage, CSSPropertyWebkitBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
2365 setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing>::createHandler());
2366 setPropertyHandler(CSSPropertyWebkitBoxAlign, ApplyPropertyDefault<EBoxAlignment, &RenderStyle::boxAlign, EBoxAlignment, &RenderStyle::setBoxAlign, EBoxAlignment, &RenderStyle::initialBoxAlign>::createHandler());
2367 #if ENABLE(CSS_BOX_DECORATION_BREAK)
2368 setPropertyHandler(CSSPropertyWebkitBoxDecorationBreak, ApplyPropertyDefault<EBoxDecorationBreak, &RenderStyle::boxDecorationBreak, EBoxDecorationBreak, &RenderStyle::setBoxDecorationBreak, EBoxDecorationBreak, &RenderStyle::initialBoxDecorationBreak>::createHandler());
2370 setPropertyHandler(CSSPropertyWebkitBoxDirection, ApplyPropertyDefault<EBoxDirection, &RenderStyle::boxDirection, EBoxDirection, &RenderStyle::setBoxDirection, EBoxDirection, &RenderStyle::initialBoxDirection>::createHandler());
2371 setPropertyHandler(CSSPropertyWebkitBoxFlex, ApplyPropertyDefault<float, &RenderStyle::boxFlex, float, &RenderStyle::setBoxFlex, float, &RenderStyle::initialBoxFlex>::createHandler());
2372 setPropertyHandler(CSSPropertyWebkitBoxFlexGroup, ApplyPropertyDefault<unsigned int, &RenderStyle::boxFlexGroup, unsigned int, &RenderStyle::setBoxFlexGroup, unsigned int, &RenderStyle::initialBoxFlexGroup>::createHandler());
2373 setPropertyHandler(CSSPropertyWebkitBoxLines, ApplyPropertyDefault<EBoxLines, &RenderStyle::boxLines, EBoxLines, &RenderStyle::setBoxLines, EBoxLines, &RenderStyle::initialBoxLines>::createHandler());
2374 setPropertyHandler(CSSPropertyWebkitBoxOrdinalGroup, ApplyPropertyDefault<unsigned int, &RenderStyle::boxOrdinalGroup, unsigned int, &RenderStyle::setBoxOrdinalGroup, unsigned int, &RenderStyle::initialBoxOrdinalGroup>::createHandler());
2375 setPropertyHandler(CSSPropertyWebkitBoxOrient, ApplyPropertyDefault<EBoxOrient, &RenderStyle::boxOrient, EBoxOrient, &RenderStyle::setBoxOrient, EBoxOrient, &RenderStyle::initialBoxOrient>::createHandler());
2376 setPropertyHandler(CSSPropertyWebkitBoxPack, ApplyPropertyDefault<EBoxPack, &RenderStyle::boxPack, EBoxPack, &RenderStyle::setBoxPack, EBoxPack, &RenderStyle::initialBoxPack>::createHandler());
2377 setPropertyHandler(CSSPropertyWebkitColorCorrection, ApplyPropertyDefault<ColorSpace, &RenderStyle::colorSpace, ColorSpace, &RenderStyle::setColorSpace, ColorSpace, &RenderStyle::initialColorSpace>::createHandler());
2378 setPropertyHandler(CSSPropertyWebkitColumnAxis, ApplyPropertyDefault<ColumnAxis, &RenderStyle::columnAxis, ColumnAxis, &RenderStyle::setColumnAxis, ColumnAxis, &RenderStyle::initialColumnAxis>::createHandler());
2379 setPropertyHandler(CSSPropertyWebkitColumnBreakAfter, ApplyPropertyDefault<EPageBreak, &RenderStyle::columnBreakAfter, EPageBreak, &RenderStyle::setColumnBreakAfter, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2380 setPropertyHandler(CSSPropertyWebkitColumnBreakBefore, ApplyPropertyDefault<EPageBreak, &RenderStyle::columnBreakBefore, EPageBreak, &RenderStyle::setColumnBreakBefore, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2381 setPropertyHandler(CSSPropertyWebkitColumnBreakInside, ApplyPropertyDefault<EPageBreak, &RenderStyle::columnBreakInside, EPageBreak, &RenderStyle::setColumnBreakInside, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2382 setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
2383 setPropertyHandler(CSSPropertyWebkitColumnFill, ApplyPropertyDefault<ColumnFill, &RenderStyle::columnFill, ColumnFill, &RenderStyle::setColumnFill, ColumnFill, &RenderStyle::initialColumnFill>::createHandler());
2384 setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
2385 setPropertyHandler(CSSPropertyWebkitColumnProgression, ApplyPropertyDefault<ColumnProgression, &RenderStyle::columnProgression, ColumnProgression, &RenderStyle::setColumnProgression, ColumnProgression, &RenderStyle::initialColumnProgression>::createHandler());
2386 setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
2387 setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialColumnRuleWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2388 setPropertyHandler(CSSPropertyWebkitColumnSpan, ApplyPropertyDefault<ColumnSpan, &RenderStyle::columnSpan, ColumnSpan, &RenderStyle::setColumnSpan, ColumnSpan, &RenderStyle::initialColumnSpan>::createHandler());
2389 setPropertyHandler(CSSPropertyWebkitColumnRuleStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::columnRuleStyle, EBorderStyle, &RenderStyle::setColumnRuleStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2390 setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
2391 #if ENABLE(CURSOR_VISIBILITY)
2392 setPropertyHandler(CSSPropertyWebkitCursorVisibility, ApplyPropertyDefault<CursorVisibility, &RenderStyle::cursorVisibility, CursorVisibility, &RenderStyle::setCursorVisibility, CursorVisibility, &RenderStyle::initialCursorVisibility>::createHandler());
2394 setPropertyHandler(CSSPropertyWebkitAlignContent, ApplyPropertyDefault<EAlignContent, &RenderStyle::alignContent, EAlignContent, &RenderStyle::setAlignContent, EAlignContent, &RenderStyle::initialAlignContent>::createHandler());
2395 setPropertyHandler(CSSPropertyWebkitAlignItems, ApplyPropertyDefault<EAlignItems, &RenderStyle::alignItems, EAlignItems, &RenderStyle::setAlignItems, EAlignItems, &RenderStyle::initialAlignItems>::createHandler());
2396 setPropertyHandler(CSSPropertyWebkitAlignSelf, ApplyPropertyDefault<EAlignItems, &RenderStyle::alignSelf, EAlignItems, &RenderStyle::setAlignSelf, EAlignItems, &RenderStyle::initialAlignSelf>::createHandler());
2397 setPropertyHandler(CSSPropertyWebkitFlexBasis, ApplyPropertyLength<&RenderStyle::flexBasis, &RenderStyle::setFlexBasis, &RenderStyle::initialFlexBasis, AutoEnabled>::createHandler());
2398 setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler());
2399 setPropertyHandler(CSSPropertyWebkitFlexGrow, ApplyPropertyDefault<float, &RenderStyle::flexGrow, float, &RenderStyle::setFlexGrow, float, &RenderStyle::initialFlexGrow>::createHandler());
2400 setPropertyHandler(CSSPropertyWebkitFlexShrink, ApplyPropertyDefault<float, &RenderStyle::flexShrink, float, &RenderStyle::setFlexShrink, float, &RenderStyle::initialFlexShrink>::createHandler());
2401 setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler());
2402 setPropertyHandler(CSSPropertyWebkitGridAutoFlow, ApplyPropertyDefault<GridAutoFlow, &RenderStyle::gridAutoFlow, GridAutoFlow, &RenderStyle::setGridAutoFlow, GridAutoFlow, &RenderStyle::initialGridAutoFlow>::createHandler());
2403 setPropertyHandler(CSSPropertyWebkitJustifyContent, ApplyPropertyDefault<EJustifyContent, &RenderStyle::justifyContent, EJustifyContent, &RenderStyle::setJustifyContent, EJustifyContent, &RenderStyle::initialJustifyContent>::createHandler());
2404 setPropertyHandler(CSSPropertyWebkitOrder, ApplyPropertyDefault<int, &RenderStyle::order, int, &RenderStyle::setOrder, int, &RenderStyle::initialOrder>::createHandler());
2405 #if ENABLE(CSS_REGIONS)
2406 setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString<MapNoneToNull, &RenderStyle::regionThread, &RenderStyle::setRegionThread, &RenderStyle::initialRegionThread>::createHandler());
2407 setPropertyHandler(CSSPropertyWebkitFlowInto, ApplyPropertyString<MapNoneToNull, &RenderStyle::flowThread, &RenderStyle::setFlowThread, &RenderStyle::initialFlowThread>::createHandler());
2409 setPropertyHandler(CSSPropertyWebkitFontKerning, ApplyPropertyFont<FontDescription::Kerning, &FontDescription::kerning, &FontDescription::setKerning, FontDescription::AutoKerning>::createHandler());
2410 setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
2411 setPropertyHandler(CSSPropertyWebkitFontVariantLigatures, ApplyPropertyFontVariantLigatures::createHandler());
2412 setPropertyHandler(CSSPropertyWebkitHighlight, ApplyPropertyString<MapNoneToNull, &RenderStyle::highlight, &RenderStyle::setHighlight, &RenderStyle::initialHighlight>::createHandler());
2413 setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());
2414 setPropertyHandler(CSSPropertyWebkitHyphenateLimitAfter, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitAfter, &RenderStyle::setHyphenationLimitAfter, &RenderStyle::initialHyphenationLimitAfter>::createHandler());
2415 setPropertyHandler(CSSPropertyWebkitHyphenateLimitBefore, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitBefore, &RenderStyle::setHyphenationLimitBefore, &RenderStyle::initialHyphenationLimitBefore>::createHandler());
2416 setPropertyHandler(CSSPropertyWebkitHyphenateLimitLines, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitLines, &RenderStyle::setHyphenationLimitLines, &RenderStyle::initialHyphenationLimitLines, CSSValueNoLimit>::createHandler());
2417 setPropertyHandler(CSSPropertyWebkitHyphens, ApplyPropertyDefault<Hyphens, &RenderStyle::hyphens, Hyphens, &RenderStyle::setHyphens, Hyphens, &RenderStyle::initialHyphens>::createHandler());
2418 setPropertyHandler(CSSPropertyWebkitLineAlign, ApplyPropertyDefault<LineAlign, &RenderStyle::lineAlign, LineAlign, &RenderStyle::setLineAlign, LineAlign, &RenderStyle::initialLineAlign>::createHandler());
2419 setPropertyHandler(CSSPropertyWebkitLineBreak, ApplyPropertyDefault<LineBreak, &RenderStyle::lineBreak, LineBreak, &RenderStyle::setLineBreak, LineBreak, &RenderStyle::initialLineBreak>::createHandler());
2420 setPropertyHandler(CSSPropertyWebkitLineClamp, ApplyPropertyDefault<const LineClampValue&, &RenderStyle::lineClamp, LineClampValue, &RenderStyle::setLineClamp, LineClampValue, &RenderStyle::initialLineClamp>::createHandler());
2421 setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());
2422 setPropertyHandler(CSSPropertyWebkitLineSnap, ApplyPropertyDefault<LineSnap, &RenderStyle::lineSnap, LineSnap, &RenderStyle::setLineSnap, LineSnap, &RenderStyle::initialLineSnap>::createHandler());
2423 setPropertyHandler(CSSPropertyWebkitMarginAfterCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginAfterCollapse, EMarginCollapse, &RenderStyle::setMarginAfterCollapse, EMarginCollapse, &RenderStyle::initialMarginAfterCollapse>::createHandler());
2424 setPropertyHandler(CSSPropertyWebkitMarginBeforeCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginBeforeCollapse, EMarginCollapse, &RenderStyle::setMarginBeforeCollapse, EMarginCollapse, &RenderStyle::initialMarginBeforeCollapse>::createHandler());
2425 setPropertyHandler(CSSPropertyWebkitMarginBottomCollapse, CSSPropertyWebkitMarginAfterCollapse);
2426 setPropertyHandler(CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBeforeCollapse);
2427 setPropertyHandler(CSSPropertyWebkitMarqueeDirection, ApplyPropertyDefault<EMarqueeDirection, &RenderStyle::marqueeDirection, EMarqueeDirection, &RenderStyle::setMarqueeDirection, EMarqueeDirection, &RenderStyle::initialMarqueeDirection>::createHandler());
2428 setPropertyHandler(CSSPropertyWebkitMarqueeIncrement, ApplyPropertyMarqueeIncrement::createHandler());
2429 setPropertyHandler(CSSPropertyWebkitMarqueeRepetition, ApplyPropertyMarqueeRepetition::createHandler());
2430 setPropertyHandler(CSSPropertyWebkitMarqueeSpeed, ApplyPropertyMarqueeSpeed::createHandler());
2431 setPropertyHandler(CSSPropertyWebkitMarqueeStyle, ApplyPropertyDefault<EMarqueeBehavior, &RenderStyle::marqueeBehavior, EMarqueeBehavior, &RenderStyle::setMarqueeBehavior, EMarqueeBehavior, &RenderStyle::initialMarqueeBehavior>::createHandler());
2432 setPropertyHandler(CSSPropertyWebkitMaskBoxImage, ApplyPropertyBorderImage<BorderMask, CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage>::createHandler());
2433 setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<BorderMask, Outset>::createHandler());
2434 setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<BorderMask, Repeat>::createHandler());
2435 setPropertyHandler(CSSPropertyWebkitMaskBoxImageSlice, ApplyPropertyBorderImageModifier<BorderMask, Slice>::createHandler());
2436 setPropertyHandler(CSSPropertyWebkitMaskBoxImageSource, ApplyPropertyBorderImageSource<CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource, &RenderStyle::initialMaskBoxImageSource>::createHandler());
2437 setPropertyHandler(CSSPropertyWebkitMaskBoxImageWidth, ApplyPropertyBorderImageModifier<BorderMask, Width>::createHandler());
2438 setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
2439 setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
2440 setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
2441 setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
2442 setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
2443 setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
2444 setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
2445 setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
2446 setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
2447 setPropertyHandler(CSSPropertyWebkitMaskSourceType, ApplyPropertyFillLayer<EMaskSourceType, CSSPropertyWebkitMaskSourceType, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isMaskSourceTypeSet, &FillLayer::maskSourceType, &FillLayer::setMaskSourceType, &FillLayer::clearMaskSourceType, &FillLayer::initialMaskSourceType, &CSSToStyleMap::mapFillMaskSourceType>::createHandler());
2448 setPropertyHandler(CSSPropertyWebkitNbspMode, ApplyPropertyDefault<ENBSPMode, &RenderStyle::nbspMode, ENBSPMode, &RenderStyle::setNBSPMode, ENBSPMode, &RenderStyle::initialNBSPMode>::createHandler());
2449 setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
2450 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, ApplyPropertyLength<&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX>::createHandler());
2451 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginY, ApplyPropertyLength<&RenderStyle::perspectiveOriginY, &RenderStyle::setPerspectiveOriginY, &RenderStyle::initialPerspectiveOriginY>::createHandler());
2452 setPropertyHandler(CSSPropertyWebkitPrintColorAdjust, ApplyPropertyDefault<PrintColorAdjust, &RenderStyle::printColorAdjust, PrintColorAdjust, &RenderStyle::setPrintColorAdjust, PrintColorAdjust, &RenderStyle::initialPrintColorAdjust>::createHandler());
2453 #if ENABLE(CSS_REGIONS)
2454 setPropertyHandler(CSSPropertyWebkitRegionBreakAfter, ApplyPropertyDefault<EPageBreak, &RenderStyle::regionBreakAfter, EPageBreak, &RenderStyle::setRegionBreakAfter, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2455 setPropertyHandler(CSSPropertyWebkitRegionBreakBefore, ApplyPropertyDefault<EPageBreak, &RenderStyle::regionBreakBefore, EPageBreak, &RenderStyle::setRegionBreakBefore, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2456 setPropertyHandler(CSSPropertyWebkitRegionBreakInside, ApplyPropertyDefault<EPageBreak, &RenderStyle::regionBreakInside, EPageBreak, &RenderStyle::setRegionBreakInside, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2457 setPropertyHandler(CSSPropertyWebkitRegionFragment, ApplyPropertyDefault<RegionFragment, &RenderStyle::regionFragment, RegionFragment, &RenderStyle::setRegionFragment, RegionFragment, &RenderStyle::initialRegionFragment>::createHandler());
2459 setPropertyHandler(CSSPropertyWebkitRtlOrdering, ApplyPropertyDefault<Order, &RenderStyle::rtlOrdering, Order, &RenderStyle::setRTLOrdering, Order, &RenderStyle::initialRTLOrdering>::createHandler());
2460 setPropertyHandler(CSSPropertyWebkitRubyPosition, ApplyPropertyDefault<RubyPosition, &RenderStyle::rubyPosition, RubyPosition, &RenderStyle::setRubyPosition, RubyPosition, &RenderStyle::initialRubyPosition>::createHandler());
2461 setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler());
2462 setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
2463 setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler());
2464 setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
2465 setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
2466 setPropertyHandler(CSSPropertyWebkitTextSecurity, ApplyPropertyDefault<ETextSecurity, &RenderStyle::textSecurity, ETextSecurity, &RenderStyle::setTextSecurity, ETextSecurity, &RenderStyle::initialTextSecurity>::createHandler());
2467 setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
2468 setPropertyHandler(CSSPropertyWebkitTransformOriginX, ApplyPropertyLength<&RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX, &RenderStyle::initialTransformOriginX>::createHandler());
2469 setPropertyHandler(CSSPropertyWebkitTransformOriginY, ApplyPropertyLength<&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY>::createHandler());
2470 setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler());
2471 setPropertyHandler(CSSPropertyWebkitTransformStyle, ApplyPropertyDefault<ETransformStyle3D, &RenderStyle::transformStyle3D, ETransformStyle3D, &RenderStyle::setTransformStyle3D, ETransformStyle3D, &RenderStyle::initialTransformStyle3D>::createHandler());
2472 setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2473 setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2474 setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<CSSPropertyID, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSToStyleMap::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2475 setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2476 setPropertyHandler(CSSPropertyWebkitUserDrag, ApplyPropertyDefault<EUserDrag, &RenderStyle::userDrag, EUserDrag, &RenderStyle::setUserDrag, EUserDrag, &RenderStyle::initialUserDrag>::createHandler());
2477 setPropertyHandler(CSSPropertyWebkitUserModify, ApplyPropertyDefault<EUserModify, &RenderStyle::userModify, EUserModify, &RenderStyle::setUserModify, EUserModify, &RenderStyle::initialUserModify>::createHandler());
2478 setPropertyHandler(CSSPropertyWebkitUserSelect, ApplyPropertyDefault<EUserSelect, &RenderStyle::userSelect, EUserSelect, &RenderStyle::setUserSelect, EUserSelect, &RenderStyle::initialUserSelect>::createHandler());
2479 setPropertyHandler(CSSPropertyWebkitClipPath, ApplyPropertyClipPath<&RenderStyle::clipPath, &RenderStyle::setClipPath, &RenderStyle::initialClipPath>::createHandler());
2481 #if ENABLE(CSS_EXCLUSIONS)
2482 setPropertyHandler(CSSPropertyWebkitWrapFlow, ApplyPropertyDefault<WrapFlow, &RenderStyle::wrapFlow, WrapFlow, &RenderStyle::setWrapFlow, WrapFlow, &RenderStyle::initialWrapFlow>::createHandler());
2483 setPropertyHandler(CSSPropertyWebkitWrapThrough, ApplyPropertyDefault<WrapThrough, &RenderStyle::wrapThrough, WrapThrough, &RenderStyle::setWrapThrough, WrapThrough, &RenderStyle::initialWrapThrough>::createHandler());
2485 #if ENABLE(CSS_SHAPES)
2486 setPropertyHandler(CSSPropertyWebkitShapeMargin, ApplyPropertyLength<&RenderStyle::shapeMargin, &RenderStyle::setShapeMargin, &RenderStyle::initialShapeMargin>::createHandler());
2487 setPropertyHandler(CSSPropertyWebkitShapePadding, ApplyPropertyLength<&RenderStyle::shapePadding, &RenderStyle::setShapePadding, &RenderStyle::initialShapePadding>::createHandler());
2488 setPropertyHandler(CSSPropertyWebkitShapeImageThreshold, ApplyPropertyDefault<float, &RenderStyle::shapeImageThreshold, float, &RenderStyle::setShapeImageThreshold, float, &RenderStyle::initialShapeImageThreshold>::createHandler());
2489 setPropertyHandler(CSSPropertyWebkitShapeInside, ApplyPropertyShape<&RenderStyle::shapeInside, &RenderStyle::setShapeInside, &RenderStyle::initialShapeInside>::createHandler());
2490 setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyShape<&RenderStyle::shapeOutside, &RenderStyle::setShapeOutside, &RenderStyle::initialShapeOutside>::createHandler());
2492 setPropertyHandler(CSSPropertyWhiteSpace, ApplyPropertyDefault<EWhiteSpace, &RenderStyle::whiteSpace, EWhiteSpace, &RenderStyle::setWhiteSpace, EWhiteSpace, &RenderStyle::initialWhiteSpace>::createHandler());
2493 setPropertyHandler(CSSPropertyWidows, ApplyPropertyAuto<short, &RenderStyle::widows, &RenderStyle::setWidows, &RenderStyle::hasAutoWidows, &RenderStyle::setHasAutoWidows>::createHandler());
2494 setPropertyHandler(CSSPropertyWidth, ApplyPropertyLength<&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicEnabled, NoneDisabled, UndefinedDisabled>::createHandler());
2495 setPropertyHandler(CSSPropertyWordBreak, ApplyPropertyDefault<EWordBreak, &RenderStyle::wordBreak, EWordBreak, &RenderStyle::setWordBreak, EWordBreak, &RenderStyle::initialWordBreak>::createHandler());
2496 setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<int, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
2497 // UAs must treat 'word-wrap' as an alternate name for the 'overflow-wrap' property. So using the same handlers.
2498 setPropertyHandler(CSSPropertyWordWrap, ApplyPropertyDefault<EOverflowWrap, &RenderStyle::overflowWrap, EOverflowWrap, &RenderStyle::setOverflowWrap, EOverflowWrap, &RenderStyle::initialOverflowWrap>::createHandler());
2499 setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
2500 setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler());