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 // Check for no-op before copying anything.
519 if (*(styleResolver->parentStyle()->*layersFunction)() == *(styleResolver->style()->*layersFunction)())
522 FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
523 FillLayer* prevChild = 0;
524 const FillLayer* currParent = (styleResolver->parentStyle()->*layersFunction)();
525 while (currParent && (currParent->*testFunction)()) {
527 /* Need to make a new layer.*/
528 currChild = new FillLayer(fillLayerType);
529 prevChild->setNext(currChild);
531 (currChild->*setFunction)((currParent->*getFunction)());
532 prevChild = currChild;
533 currChild = prevChild->next();
534 currParent = currParent->next();
538 /* Reset any remaining layers to not have the property set. */
539 (currChild->*clearFunction)();
540 currChild = currChild->next();
544 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
546 // Check for (single-layer) no-op before clearing anything.
547 const FillLayer& layers = *(styleResolver->style()->*layersFunction)();
548 bool firstLayerHasValue = (layers.*testFunction)();
549 if (!layers.next() && (!firstLayerHasValue || (layers.*getFunction)() == (*initialFunction)(fillLayerType)))
552 FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
553 (currChild->*setFunction)((*initialFunction)(fillLayerType));
554 for (currChild = currChild->next(); currChild; currChild = currChild->next())
555 (currChild->*clearFunction)();
558 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
560 FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)();
561 FillLayer* prevChild = 0;
562 if (value->isValueList()
563 #if ENABLE(CSS_IMAGE_SET)
564 && !value->isImageSetValue()
567 /* Walk each value and put it into a layer, creating new layers as needed. */
568 CSSValueList* valueList = toCSSValueList(value);
569 for (unsigned int i = 0; i < valueList->length(); i++) {
571 /* Need to make a new layer to hold this value */
572 currChild = new FillLayer(fillLayerType);
573 prevChild->setNext(currChild);
575 (styleResolver->styleMap()->*mapFillFunction)(propertyId, currChild, valueList->itemWithoutBoundsCheck(i));
576 prevChild = currChild;
577 currChild = currChild->next();
580 (styleResolver->styleMap()->*mapFillFunction)(propertyId, currChild, value);
581 currChild = currChild->next();
584 /* Reset all remaining layers to not have the property set. */
585 (currChild->*clearFunction)();
586 currChild = currChild->next();
590 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
593 enum ComputeLengthNormal {NormalDisabled = 0, NormalEnabled};
594 enum ComputeLengthThickness {ThicknessDisabled = 0, ThicknessEnabled};
595 enum ComputeLengthSVGZoom {SVGZoomDisabled = 0, SVGZoomEnabled};
596 template <typename T,
597 T (RenderStyle::*getterFunction)() const,
598 void (RenderStyle::*setterFunction)(T),
599 T (*initialFunction)(),
600 ComputeLengthNormal normalEnabled = NormalDisabled,
601 ComputeLengthThickness thicknessEnabled = ThicknessDisabled,
602 ComputeLengthSVGZoom svgZoomEnabled = SVGZoomDisabled>
603 class ApplyPropertyComputeLength {
605 static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
606 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
608 // note: CSSPropertyLetter/WordSpacing right now sets to zero if it's not a primitive value for some reason...
609 if (!value->isPrimitiveValue())
612 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
614 CSSValueID ident = primitiveValue->getValueID();
616 if (normalEnabled && ident == CSSValueNormal) {
618 } else if (thicknessEnabled && ident == CSSValueThin) {
620 } else if (thicknessEnabled && ident == CSSValueMedium) {
622 } else if (thicknessEnabled && ident == CSSValueThick) {
624 } else if (ident == CSSValueInvalid) {
625 float zoom = (svgZoomEnabled && styleResolver->useSVGZoomRules()) ? 1.0f : styleResolver->style()->effectiveZoom();
627 // Any original result that was >= 1 should not be allowed to fall below 1.
628 // This keeps border lines from vanishing.
629 length = primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), zoom);
630 if (zoom < 1.0f && length < 1.0) {
631 T originalLength = primitiveValue->computeLength<T>(styleResolver->style(), styleResolver->rootElementStyle(), 1.0);
632 if (originalLength >= 1.0)
635 if (primitiveValue->isViewportPercentageLength())
636 length = styleResolver->viewportPercentageValue(*primitiveValue, length);
638 ASSERT_NOT_REACHED();
642 setValue(styleResolver->style(), length);
644 static PropertyHandler createHandler()
646 PropertyHandler handler = ApplyPropertyDefaultBase<T, getterFunction, T, setterFunction, T, initialFunction>::createHandler();
647 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
651 template <typename T, T (FontDescription::*getterFunction)() const, void (FontDescription::*setterFunction)(T), T initialValue>
652 class ApplyPropertyFont {
654 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
656 FontDescription fontDescription = styleResolver->fontDescription();
657 (fontDescription.*setterFunction)((styleResolver->parentFontDescription().*getterFunction)());
658 styleResolver->setFontDescription(fontDescription);
661 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
663 FontDescription fontDescription = styleResolver->fontDescription();
664 (fontDescription.*setterFunction)(initialValue);
665 styleResolver->setFontDescription(fontDescription);
668 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
670 if (!value->isPrimitiveValue())
672 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
673 FontDescription fontDescription = styleResolver->fontDescription();
674 (fontDescription.*setterFunction)(*primitiveValue);
675 styleResolver->setFontDescription(fontDescription);
678 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
681 class ApplyPropertyFontFamily {
683 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
685 FontDescription fontDescription = styleResolver->style()->fontDescription();
686 FontDescription parentFontDescription = styleResolver->parentStyle()->fontDescription();
688 fontDescription.setGenericFamily(parentFontDescription.genericFamily());
689 fontDescription.setFamilies(parentFontDescription.families());
690 fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont());
691 styleResolver->setFontDescription(fontDescription);
695 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
697 FontDescription fontDescription = styleResolver->style()->fontDescription();
698 FontDescription initialDesc = FontDescription();
700 // We need to adjust the size to account for the generic family change from monospace to non-monospace.
701 if (fontDescription.keywordSize() && fontDescription.useFixedDefaultSize())
702 styleResolver->setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueXxSmall + fontDescription.keywordSize() - 1, false, styleResolver->document()));
703 fontDescription.setGenericFamily(initialDesc.genericFamily());
704 if (!initialDesc.firstFamily().isEmpty())
705 fontDescription.setFamilies(initialDesc.families());
707 styleResolver->setFontDescription(fontDescription);
711 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
713 if (!value->isValueList())
716 auto& valueList = toCSSValueList(*value);
718 FontDescription fontDescription = styleResolver->style()->fontDescription();
719 // Before mapping in a new font-family property, we should reset the generic family.
720 bool oldFamilyUsedFixedDefaultSize = fontDescription.useFixedDefaultSize();
721 fontDescription.setGenericFamily(FontDescription::NoFamily);
723 Vector<AtomicString> families;
724 families.reserveInitialCapacity(valueList.length());
726 for (unsigned i = 0; i < valueList.length(); ++i) {
727 CSSValue* item = valueList.item(i);
728 if (!item->isPrimitiveValue())
730 CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item);
732 if (contentValue->isString())
733 face = contentValue->getStringValue();
734 else if (Settings* settings = styleResolver->document().settings()) {
735 switch (contentValue->getValueID()) {
736 case CSSValueWebkitBody:
737 face = settings->standardFontFamily();
741 fontDescription.setGenericFamily(FontDescription::SerifFamily);
743 case CSSValueSansSerif:
744 face = sansSerifFamily;
745 fontDescription.setGenericFamily(FontDescription::SansSerifFamily);
747 case CSSValueCursive:
748 face = cursiveFamily;
749 fontDescription.setGenericFamily(FontDescription::CursiveFamily);
751 case CSSValueFantasy:
752 face = fantasyFamily;
753 fontDescription.setGenericFamily(FontDescription::FantasyFamily);
755 case CSSValueMonospace:
756 face = monospaceFamily;
757 fontDescription.setGenericFamily(FontDescription::MonospaceFamily);
759 case CSSValueWebkitPictograph:
760 face = pictographFamily;
761 fontDescription.setGenericFamily(FontDescription::PictographFamily);
770 if (families.isEmpty())
771 fontDescription.setIsSpecifiedFont(fontDescription.genericFamily() == FontDescription::NoFamily);
772 families.uncheckedAppend(face);
775 if (families.isEmpty())
777 fontDescription.setFamilies(families);
779 if (fontDescription.keywordSize() && fontDescription.useFixedDefaultSize() != oldFamilyUsedFixedDefaultSize)
780 styleResolver->setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueXxSmall + fontDescription.keywordSize() - 1, !oldFamilyUsedFixedDefaultSize, styleResolver->document()));
782 styleResolver->setFontDescription(fontDescription);
785 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
788 class ApplyPropertyFontSize {
790 // When the CSS keyword "larger" is used, this function will attempt to match within the keyword
791 // table, and failing that, will simply multiply by 1.2.
792 static float largerFontSize(float size)
794 // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale up to
795 // the next size level.
799 // Like the previous function, but for the keyword "smaller".
800 static float smallerFontSize(float size)
802 // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale down to
803 // the next size level.
807 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
809 float size = styleResolver->parentStyle()->fontDescription().specifiedSize();
814 FontDescription fontDescription = styleResolver->style()->fontDescription();
815 fontDescription.setKeywordSize(styleResolver->parentStyle()->fontDescription().keywordSize());
816 styleResolver->setFontSize(fontDescription, size);
817 styleResolver->setFontDescription(fontDescription);
821 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
823 FontDescription fontDescription = styleResolver->style()->fontDescription();
824 float size = Style::fontSizeForKeyword(CSSValueMedium, fontDescription.useFixedDefaultSize(), styleResolver->document());
829 fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
830 styleResolver->setFontSize(fontDescription, size);
831 styleResolver->setFontDescription(fontDescription);
835 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
837 if (!value->isPrimitiveValue())
840 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
842 FontDescription fontDescription = styleResolver->style()->fontDescription();
843 fontDescription.setKeywordSize(0);
844 float parentSize = 0;
845 bool parentIsAbsoluteSize = false;
848 if (styleResolver->parentStyle()) {
849 parentSize = styleResolver->parentStyle()->fontDescription().specifiedSize();
850 parentIsAbsoluteSize = styleResolver->parentStyle()->fontDescription().isAbsoluteSize();
853 if (CSSValueID ident = primitiveValue->getValueID()) {
854 // Keywords are being used.
856 case CSSValueXxSmall:
862 case CSSValueXxLarge:
863 case CSSValueWebkitXxxLarge:
864 size = Style::fontSizeForKeyword(ident, fontDescription.useFixedDefaultSize(), styleResolver->document());
865 fontDescription.setKeywordSize(ident - CSSValueXxSmall + 1);
868 size = largerFontSize(parentSize);
870 case CSSValueSmaller:
871 size = smallerFontSize(parentSize);
877 fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize && (ident == CSSValueLarger || ident == CSSValueSmaller));
879 fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize
880 || !(primitiveValue->isPercentage() || primitiveValue->isFontRelativeLength()));
881 if (primitiveValue->isLength())
882 size = primitiveValue->computeLength<float>(styleResolver->parentStyle(), styleResolver->rootElementStyle(), 1.0, true);
883 else if (primitiveValue->isPercentage())
884 size = (primitiveValue->getFloatValue() * parentSize) / 100.0f;
885 else if (primitiveValue->isCalculatedPercentageWithLength())
886 size = primitiveValue->cssCalcValue()->toCalcValue(styleResolver->parentStyle(), styleResolver->rootElementStyle())->evaluate(parentSize);
887 else if (primitiveValue->isViewportPercentageLength())
888 size = valueForLength(primitiveValue->viewportPercentageLength(), 0, styleResolver->document().renderView());
896 // Overly large font sizes will cause crashes on some platforms (such as Windows).
897 // Cap font size here to make sure that doesn't happen.
898 size = std::min(maximumAllowedFontSize, size);
900 styleResolver->setFontSize(fontDescription, size);
901 styleResolver->setFontDescription(fontDescription);
905 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
908 class ApplyPropertyFontWeight {
910 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
912 if (!value->isPrimitiveValue())
914 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
915 FontDescription fontDescription = styleResolver->fontDescription();
916 switch (primitiveValue->getValueID()) {
917 case CSSValueInvalid:
918 ASSERT_NOT_REACHED();
921 fontDescription.setWeight(fontDescription.bolderWeight());
923 case CSSValueLighter:
924 fontDescription.setWeight(fontDescription.lighterWeight());
927 fontDescription.setWeight(*primitiveValue);
929 styleResolver->setFontDescription(fontDescription);
931 static PropertyHandler createHandler()
933 PropertyHandler handler = ApplyPropertyFont<FontWeight, &FontDescription::weight, &FontDescription::setWeight, FontWeightNormal>::createHandler();
934 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
938 class ApplyPropertyFontVariantLigatures {
940 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
942 const FontDescription& parentFontDescription = styleResolver->parentFontDescription();
943 FontDescription fontDescription = styleResolver->fontDescription();
945 fontDescription.setCommonLigaturesState(parentFontDescription.commonLigaturesState());
946 fontDescription.setDiscretionaryLigaturesState(parentFontDescription.discretionaryLigaturesState());
947 fontDescription.setHistoricalLigaturesState(parentFontDescription.historicalLigaturesState());
949 styleResolver->setFontDescription(fontDescription);
952 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
954 FontDescription fontDescription = styleResolver->fontDescription();
956 fontDescription.setCommonLigaturesState(FontDescription::NormalLigaturesState);
957 fontDescription.setDiscretionaryLigaturesState(FontDescription::NormalLigaturesState);
958 fontDescription.setHistoricalLigaturesState(FontDescription::NormalLigaturesState);
960 styleResolver->setFontDescription(fontDescription);
963 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
965 FontDescription::LigaturesState commonLigaturesState = FontDescription::NormalLigaturesState;
966 FontDescription::LigaturesState discretionaryLigaturesState = FontDescription::NormalLigaturesState;
967 FontDescription::LigaturesState historicalLigaturesState = FontDescription::NormalLigaturesState;
969 if (value->isValueList()) {
970 CSSValueList* valueList = toCSSValueList(value);
971 for (size_t i = 0; i < valueList->length(); ++i) {
972 CSSValue* item = valueList->itemWithoutBoundsCheck(i);
973 ASSERT(item->isPrimitiveValue());
974 if (item->isPrimitiveValue()) {
975 switch (toCSSPrimitiveValue(item)->getValueID()) {
976 case CSSValueNoCommonLigatures:
977 commonLigaturesState = FontDescription::DisabledLigaturesState;
979 case CSSValueCommonLigatures:
980 commonLigaturesState = FontDescription::EnabledLigaturesState;
982 case CSSValueNoDiscretionaryLigatures:
983 discretionaryLigaturesState = FontDescription::DisabledLigaturesState;
985 case CSSValueDiscretionaryLigatures:
986 discretionaryLigaturesState = FontDescription::EnabledLigaturesState;
988 case CSSValueNoHistoricalLigatures:
989 historicalLigaturesState = FontDescription::DisabledLigaturesState;
991 case CSSValueHistoricalLigatures:
992 historicalLigaturesState = FontDescription::EnabledLigaturesState;
995 ASSERT_NOT_REACHED();
1001 #if !ASSERT_DISABLED
1003 ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
1004 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNormal);
1008 FontDescription fontDescription = styleResolver->fontDescription();
1009 fontDescription.setCommonLigaturesState(commonLigaturesState);
1010 fontDescription.setDiscretionaryLigaturesState(discretionaryLigaturesState);
1011 fontDescription.setHistoricalLigaturesState(historicalLigaturesState);
1012 styleResolver->setFontDescription(fontDescription);
1015 static PropertyHandler createHandler()
1017 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1021 enum BorderImageType { BorderImage = 0, BorderMask };
1022 template <BorderImageType borderImageType,
1023 CSSPropertyID property,
1024 const NinePieceImage& (RenderStyle::*getterFunction)() const,
1025 void (RenderStyle::*setterFunction)(const NinePieceImage&)>
1026 class ApplyPropertyBorderImage {
1028 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1030 NinePieceImage image;
1031 if (borderImageType == BorderMask)
1032 image.setMaskDefaults();
1033 styleResolver->styleMap()->mapNinePieceImage(property, value, image);
1034 (styleResolver->style()->*setterFunction)(image);
1037 static PropertyHandler createHandler()
1039 PropertyHandler handler = ApplyPropertyDefaultBase<const NinePieceImage&, getterFunction, const NinePieceImage&, setterFunction, NinePieceImage, &RenderStyle::initialNinePieceImage>::createHandler();
1040 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1044 enum BorderImageModifierType { Outset, Repeat, Slice, Width };
1045 template <BorderImageType type, BorderImageModifierType modifier>
1046 class ApplyPropertyBorderImageModifier {
1048 static inline const NinePieceImage& getValue(RenderStyle* style) { return type == BorderImage ? style->borderImage() : style->maskBoxImage(); }
1049 static inline void setValue(RenderStyle* style, const NinePieceImage& value) { return type == BorderImage ? style->setBorderImage(value) : style->setMaskBoxImage(value); }
1051 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1053 NinePieceImage image(getValue(styleResolver->style()));
1056 image.copyOutsetFrom(getValue(styleResolver->parentStyle()));
1059 image.copyRepeatFrom(getValue(styleResolver->parentStyle()));
1062 image.copyImageSlicesFrom(getValue(styleResolver->parentStyle()));
1065 image.copyBorderSlicesFrom(getValue(styleResolver->parentStyle()));
1068 setValue(styleResolver->style(), image);
1071 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1073 NinePieceImage image(getValue(styleResolver->style()));
1076 image.setOutset(LengthBox(0));
1079 image.setHorizontalRule(StretchImageRule);
1080 image.setVerticalRule(StretchImageRule);
1083 // Masks have a different initial value for slices. Preserve the value of 0 for backwards compatibility.
1084 image.setImageSlices(type == BorderImage ? LengthBox(Length(100, Percent), Length(100, Percent), Length(100, Percent), Length(100, Percent)) : LengthBox());
1085 image.setFill(false);
1088 // Masks have a different initial value for widths. They use an 'auto' value rather than trying to fit to the border.
1089 image.setBorderSlices(type == BorderImage ? LengthBox(Length(1, Relative), Length(1, Relative), Length(1, Relative), Length(1, Relative)) : LengthBox());
1092 setValue(styleResolver->style(), image);
1095 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1097 NinePieceImage image(getValue(styleResolver->style()));
1100 image.setOutset(styleResolver->styleMap()->mapNinePieceImageQuad(value));
1103 styleResolver->styleMap()->mapNinePieceImageRepeat(value, image);
1106 styleResolver->styleMap()->mapNinePieceImageSlice(value, image);
1109 image.setBorderSlices(styleResolver->styleMap()->mapNinePieceImageQuad(value));
1112 setValue(styleResolver->style(), image);
1115 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1118 template <CSSPropertyID id, StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)()>
1119 class ApplyPropertyBorderImageSource {
1121 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(id, value)); }
1122 static PropertyHandler createHandler()
1124 PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
1125 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1129 enum CounterBehavior {Increment = 0, Reset};
1130 template <CounterBehavior counterBehavior>
1131 class ApplyPropertyCounter {
1133 static void emptyFunction(CSSPropertyID, StyleResolver*) { }
1134 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1136 CounterDirectiveMap& map = styleResolver->style()->accessCounterDirectives();
1137 CounterDirectiveMap& parentMap = styleResolver->parentStyle()->accessCounterDirectives();
1139 typedef CounterDirectiveMap::iterator Iterator;
1140 Iterator end = parentMap.end();
1141 for (Iterator it = parentMap.begin(); it != end; ++it) {
1142 CounterDirectives& directives = map.add(it->key, CounterDirectives()).iterator->value;
1143 if (counterBehavior == Reset) {
1144 directives.inheritReset(it->value);
1146 directives.inheritIncrement(it->value);
1150 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1152 bool setCounterIncrementToNone = counterBehavior == Increment && value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone;
1154 if (!value->isValueList() && !setCounterIncrementToNone)
1157 CounterDirectiveMap& map = styleResolver->style()->accessCounterDirectives();
1158 typedef CounterDirectiveMap::iterator Iterator;
1160 Iterator end = map.end();
1161 for (Iterator it = map.begin(); it != end; ++it)
1162 if (counterBehavior == Reset)
1163 it->value.clearReset();
1165 it->value.clearIncrement();
1167 if (setCounterIncrementToNone)
1170 CSSValueList* list = toCSSValueList(value);
1171 int length = list ? list->length() : 0;
1172 for (int i = 0; i < length; ++i) {
1173 CSSValue* currValue = list->itemWithoutBoundsCheck(i);
1174 if (!currValue->isPrimitiveValue())
1177 Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue();
1178 if (!pair || !pair->first() || !pair->second())
1181 AtomicString identifier = static_cast<CSSPrimitiveValue*>(pair->first())->getStringValue();
1182 int value = static_cast<CSSPrimitiveValue*>(pair->second())->getIntValue();
1183 CounterDirectives& directives = map.add(identifier, CounterDirectives()).iterator->value;
1184 if (counterBehavior == Reset) {
1185 directives.setResetValue(value);
1187 directives.addIncrementValue(value);
1191 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &emptyFunction, &applyValue); }
1195 class ApplyPropertyCursor {
1197 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1199 styleResolver->style()->setCursor(styleResolver->parentStyle()->cursor());
1200 styleResolver->style()->setCursorList(styleResolver->parentStyle()->cursors());
1203 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1205 styleResolver->style()->clearCursorList();
1206 styleResolver->style()->setCursor(RenderStyle::initialCursor());
1209 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1211 styleResolver->style()->clearCursorList();
1212 if (value->isValueList()) {
1213 CSSValueList* list = toCSSValueList(value);
1214 int len = list->length();
1215 styleResolver->style()->setCursor(CURSOR_AUTO);
1216 for (int i = 0; i < len; i++) {
1217 CSSValue* item = list->itemWithoutBoundsCheck(i);
1218 if (item->isCursorImageValue()) {
1219 CSSCursorImageValue* image = toCSSCursorImageValue(item);
1220 if (image->updateIfSVGCursorIsUsed(styleResolver->element())) // Elements with SVG cursors are not allowed to share style.
1221 styleResolver->style()->setUnique();
1222 styleResolver->style()->addCursor(styleResolver->styleImage(CSSPropertyCursor, image), image->hotSpot());
1223 } else if (item->isPrimitiveValue()) {
1224 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
1225 if (primitiveValue->isValueID())
1226 styleResolver->style()->setCursor(*primitiveValue);
1229 } else if (value->isPrimitiveValue()) {
1230 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1231 if (primitiveValue->isValueID() && styleResolver->style()->cursor() != ECursor(*primitiveValue))
1232 styleResolver->style()->setCursor(*primitiveValue);
1236 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1239 class ApplyPropertyTextAlign {
1241 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1243 if (!value->isPrimitiveValue())
1246 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1247 ASSERT(primitiveValue->isValueID());
1249 if (primitiveValue->getValueID() != CSSValueWebkitMatchParent)
1250 styleResolver->style()->setTextAlign(*primitiveValue);
1251 else if (styleResolver->parentStyle()->textAlign() == TASTART)
1252 styleResolver->style()->setTextAlign(styleResolver->parentStyle()->isLeftToRightDirection() ? LEFT : RIGHT);
1253 else if (styleResolver->parentStyle()->textAlign() == TAEND)
1254 styleResolver->style()->setTextAlign(styleResolver->parentStyle()->isLeftToRightDirection() ? RIGHT : LEFT);
1256 styleResolver->style()->setTextAlign(styleResolver->parentStyle()->textAlign());
1258 static PropertyHandler createHandler()
1260 PropertyHandler handler = ApplyPropertyDefaultBase<ETextAlign, &RenderStyle::textAlign, ETextAlign, &RenderStyle::setTextAlign, ETextAlign, &RenderStyle::initialTextAlign>::createHandler();
1261 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1265 class ApplyPropertyTextDecoration {
1267 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1269 TextDecoration t = RenderStyle::initialTextDecoration();
1270 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
1271 CSSValue* item = i.value();
1272 ASSERT_WITH_SECURITY_IMPLICATION(item->isPrimitiveValue());
1273 t |= *toCSSPrimitiveValue(item);
1275 styleResolver->style()->setTextDecoration(t);
1277 static PropertyHandler createHandler()
1279 PropertyHandler handler = ApplyPropertyDefaultBase<TextDecoration, &RenderStyle::textDecoration, TextDecoration, &RenderStyle::setTextDecoration, TextDecoration, &RenderStyle::initialTextDecoration>::createHandler();
1280 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1284 #if ENABLE(CSS3_TEXT_DECORATION)
1285 static TextDecorationSkip valueToDecorationSkip(CSSPrimitiveValue& primitiveValue)
1287 ASSERT(primitiveValue.isValueID());
1289 switch (primitiveValue.getValueID()) {
1291 return TextDecorationSkipNone;
1293 return TextDecorationSkipInk;
1298 ASSERT_NOT_REACHED();
1299 return TextDecorationSkipNone;
1302 class ApplyPropertyTextDecorationSkip {
1304 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1306 if (value->isPrimitiveValue()) {
1307 styleResolver->style()->setTextDecorationSkip(valueToDecorationSkip(*toCSSPrimitiveValue(value)));
1311 TextDecorationSkip skip = RenderStyle::initialTextDecorationSkip();
1312 for (CSSValueListIterator i(value); i.hasMore(); i.advance())
1313 skip |= valueToDecorationSkip(*toCSSPrimitiveValue(i.value()));
1314 styleResolver->style()->setTextDecorationSkip(skip);
1316 static PropertyHandler createHandler()
1318 PropertyHandler handler = ApplyPropertyDefaultBase<TextDecorationSkip, &RenderStyle::textDecorationSkip, TextDecorationSkip, &RenderStyle::setTextDecorationSkip, TextDecorationSkip, &RenderStyle::initialTextDecorationSkip>::createHandler();
1319 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1322 #endif // CSS3_TEXT_DECORATION
1324 class ApplyPropertyMarqueeIncrement {
1326 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1328 if (!value->isPrimitiveValue())
1331 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1332 if (primitiveValue->getValueID()) {
1333 switch (primitiveValue->getValueID()) {
1335 styleResolver->style()->setMarqueeIncrement(Length(1, Fixed)); // 1px.
1337 case CSSValueNormal:
1338 styleResolver->style()->setMarqueeIncrement(Length(6, Fixed)); // 6px. The WinIE default.
1341 styleResolver->style()->setMarqueeIncrement(Length(36, Fixed)); // 36px.
1347 Length marqueeLength = styleResolver->convertToIntLength(primitiveValue, styleResolver->style(), styleResolver->rootElementStyle());
1348 if (!marqueeLength.isUndefined())
1349 styleResolver->style()->setMarqueeIncrement(marqueeLength);
1352 static PropertyHandler createHandler()
1354 PropertyHandler handler = ApplyPropertyLength<&RenderStyle::marqueeIncrement, &RenderStyle::setMarqueeIncrement, &RenderStyle::initialMarqueeIncrement>::createHandler();
1355 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1359 class ApplyPropertyMarqueeRepetition {
1361 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1363 if (!value->isPrimitiveValue())
1366 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1367 if (primitiveValue->getValueID() == CSSValueInfinite)
1368 styleResolver->style()->setMarqueeLoopCount(-1); // -1 means repeat forever.
1369 else if (primitiveValue->isNumber())
1370 styleResolver->style()->setMarqueeLoopCount(primitiveValue->getIntValue());
1372 static PropertyHandler createHandler()
1374 PropertyHandler handler = ApplyPropertyDefault<int, &RenderStyle::marqueeLoopCount, int, &RenderStyle::setMarqueeLoopCount, int, &RenderStyle::initialMarqueeLoopCount>::createHandler();
1375 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1379 class ApplyPropertyMarqueeSpeed {
1381 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1383 if (!value->isPrimitiveValue())
1386 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1387 if (CSSValueID ident = primitiveValue->getValueID()) {
1390 styleResolver->style()->setMarqueeSpeed(500); // 500 msec.
1392 case CSSValueNormal:
1393 styleResolver->style()->setMarqueeSpeed(85); // 85msec. The WinIE default.
1396 styleResolver->style()->setMarqueeSpeed(10); // 10msec. Super fast.
1401 } else if (primitiveValue->isTime())
1402 styleResolver->style()->setMarqueeSpeed(primitiveValue->computeTime<int, CSSPrimitiveValue::Milliseconds>());
1403 else if (primitiveValue->isNumber()) // For scrollamount support.
1404 styleResolver->style()->setMarqueeSpeed(primitiveValue->getIntValue());
1406 static PropertyHandler createHandler()
1408 PropertyHandler handler = ApplyPropertyDefault<int, &RenderStyle::marqueeSpeed, int, &RenderStyle::setMarqueeSpeed, int, &RenderStyle::initialMarqueeSpeed>::createHandler();
1409 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1413 #if ENABLE(CSS3_TEXT_DECORATION)
1414 class ApplyPropertyTextUnderlinePosition {
1416 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1418 // This is true if value is 'auto' or 'alphabetic'.
1419 if (value->isPrimitiveValue()) {
1420 TextUnderlinePosition t = *toCSSPrimitiveValue(value);
1421 styleResolver->style()->setTextUnderlinePosition(t);
1426 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
1427 CSSValue* item = i.value();
1428 ASSERT_WITH_SECURITY_IMPLICATION(item->isPrimitiveValue());
1429 TextUnderlinePosition t2 = *toCSSPrimitiveValue(item);
1432 styleResolver->style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t));
1434 static PropertyHandler createHandler()
1436 PropertyHandler handler = ApplyPropertyDefaultBase<TextUnderlinePosition, &RenderStyle::textUnderlinePosition, TextUnderlinePosition, &RenderStyle::setTextUnderlinePosition, TextUnderlinePosition, &RenderStyle::initialTextUnderlinePosition>::createHandler();
1437 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1440 #endif // CSS3_TEXT_DECORATION
1442 class ApplyPropertyLineHeight {
1444 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1446 if (!value->isPrimitiveValue())
1449 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1452 if (primitiveValue->getValueID() == CSSValueNormal)
1453 lineHeight = RenderStyle::initialLineHeight();
1454 else if (primitiveValue->isLength()) {
1455 double multiplier = styleResolver->style()->effectiveZoom();
1456 if (Frame* frame = styleResolver->document().frame())
1457 multiplier *= frame->textZoomFactor();
1458 lineHeight = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), multiplier);
1459 } else if (primitiveValue->isPercentage()) {
1460 // FIXME: percentage should not be restricted to an integer here.
1461 lineHeight = Length((styleResolver->style()->computedFontSize() * primitiveValue->getIntValue()) / 100, Fixed);
1462 } else if (primitiveValue->isNumber()) {
1463 // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
1464 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
1465 } else if (primitiveValue->isViewportPercentageLength())
1466 lineHeight = primitiveValue->viewportPercentageLength();
1469 styleResolver->style()->setLineHeight(lineHeight);
1471 static PropertyHandler createHandler()
1473 PropertyHandler handler = ApplyPropertyDefaultBase<const Length&, &RenderStyle::specifiedLineHeight, Length, &RenderStyle::setLineHeight, Length, &RenderStyle::initialLineHeight>::createHandler();
1474 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1478 #if ENABLE(IOS_TEXT_AUTOSIZING)
1479 // FIXME: Share more code with class ApplyPropertyLineHeight.
1480 class ApplyPropertyLineHeightForIOSTextAutosizing {
1482 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1484 if (!value->isPrimitiveValue())
1487 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1490 if (primitiveValue->getIdent() == CSSValueNormal)
1491 lineHeight = RenderStyle::initialLineHeight();
1492 else if (primitiveValue->isLength()) {
1493 double multiplier = styleResolver->style()->effectiveZoom();
1494 if (styleResolver->style()->textSizeAdjust().isNone()) {
1495 if (Frame* frame = styleResolver->document().frame())
1496 multiplier *= frame->textZoomFactor();
1498 lineHeight = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle(), multiplier);
1499 if (styleResolver->style()->textSizeAdjust().isPercentage())
1500 lineHeight = Length(lineHeight.value() * styleResolver->style()->textSizeAdjust().multiplier(), Fixed);
1501 } else if (primitiveValue->isPercentage()) {
1502 // FIXME: percentage should not be restricted to an integer here.
1503 lineHeight = Length((styleResolver->style()->fontSize() * primitiveValue->getIntValue()) / 100, Fixed);
1504 } else if (primitiveValue->isNumber()) {
1505 // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
1506 if (styleResolver->style()->textSizeAdjust().isPercentage())
1507 lineHeight = Length(primitiveValue->getDoubleValue() * styleResolver->style()->textSizeAdjust().multiplier() * 100.0, Percent);
1509 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
1510 } else if (primitiveValue->isViewportPercentageLength())
1511 lineHeight = primitiveValue->viewportPercentageLength();
1514 styleResolver->style()->setLineHeight(lineHeight);
1515 styleResolver->style()->setSpecifiedLineHeight(lineHeight);
1518 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1520 styleResolver->style()->setLineHeight(RenderStyle::initialLineHeight());
1521 styleResolver->style()->setSpecifiedLineHeight(RenderStyle::initialSpecifiedLineHeight());
1524 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1526 styleResolver->style()->setLineHeight(styleResolver->parentStyle()->lineHeight());
1527 styleResolver->style()->setSpecifiedLineHeight(styleResolver->parentStyle()->specifiedLineHeight());
1530 static PropertyHandler createHandler()
1532 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1537 class ApplyPropertyPageSize {
1539 static Length mmLength(double mm)
1541 Ref<CSSPrimitiveValue> value(CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM));
1542 return value.get().computeLength<Length>(0, 0);
1544 static Length inchLength(double inch)
1546 Ref<CSSPrimitiveValue> value(CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN));
1547 return value.get().computeLength<Length>(0, 0);
1549 static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
1551 DEFINE_STATIC_LOCAL(Length, a5Width, (mmLength(148)));
1552 DEFINE_STATIC_LOCAL(Length, a5Height, (mmLength(210)));
1553 DEFINE_STATIC_LOCAL(Length, a4Width, (mmLength(210)));
1554 DEFINE_STATIC_LOCAL(Length, a4Height, (mmLength(297)));
1555 DEFINE_STATIC_LOCAL(Length, a3Width, (mmLength(297)));
1556 DEFINE_STATIC_LOCAL(Length, a3Height, (mmLength(420)));
1557 DEFINE_STATIC_LOCAL(Length, b5Width, (mmLength(176)));
1558 DEFINE_STATIC_LOCAL(Length, b5Height, (mmLength(250)));
1559 DEFINE_STATIC_LOCAL(Length, b4Width, (mmLength(250)));
1560 DEFINE_STATIC_LOCAL(Length, b4Height, (mmLength(353)));
1561 DEFINE_STATIC_LOCAL(Length, letterWidth, (inchLength(8.5)));
1562 DEFINE_STATIC_LOCAL(Length, letterHeight, (inchLength(11)));
1563 DEFINE_STATIC_LOCAL(Length, legalWidth, (inchLength(8.5)));
1564 DEFINE_STATIC_LOCAL(Length, legalHeight, (inchLength(14)));
1565 DEFINE_STATIC_LOCAL(Length, ledgerWidth, (inchLength(11)));
1566 DEFINE_STATIC_LOCAL(Length, ledgerHeight, (inchLength(17)));
1571 switch (pageSizeName->getValueID()) {
1592 case CSSValueLetter:
1593 width = letterWidth;
1594 height = letterHeight;
1598 height = legalHeight;
1600 case CSSValueLedger:
1601 width = ledgerWidth;
1602 height = ledgerHeight;
1608 if (pageOrientation) {
1609 switch (pageOrientation->getValueID()) {
1610 case CSSValueLandscape:
1611 std::swap(width, height);
1613 case CSSValuePortrait:
1623 static void applyInheritValue(CSSPropertyID, StyleResolver*) { }
1624 static void applyInitialValue(CSSPropertyID, StyleResolver*) { }
1625 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1627 styleResolver->style()->resetPageSizeType();
1630 PageSizeType pageSizeType = PAGE_SIZE_AUTO;
1631 CSSValueListInspector inspector(value);
1632 switch (inspector.length()) {
1634 // <length>{2} | <page-size> <orientation>
1635 if (!inspector.first()->isPrimitiveValue() || !inspector.second()->isPrimitiveValue())
1637 CSSPrimitiveValue* first = toCSSPrimitiveValue(inspector.first());
1638 CSSPrimitiveValue* second = toCSSPrimitiveValue(inspector.second());
1639 if (first->isLength()) {
1641 if (!second->isLength())
1643 width = first->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
1644 height = second->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
1646 // <page-size> <orientation>
1647 // The value order is guaranteed. See CSSParser::parseSizeParameter.
1648 if (!getPageSizeFromName(first, second, width, height))
1651 pageSizeType = PAGE_SIZE_RESOLVED;
1655 // <length> | auto | <page-size> | [ portrait | landscape]
1656 if (!inspector.first()->isPrimitiveValue())
1658 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(inspector.first());
1659 if (primitiveValue->isLength()) {
1661 pageSizeType = PAGE_SIZE_RESOLVED;
1662 width = height = primitiveValue->computeLength<Length>(styleResolver->style(), styleResolver->rootElementStyle());
1664 switch (primitiveValue->getValueID()) {
1668 pageSizeType = PAGE_SIZE_AUTO;
1670 case CSSValuePortrait:
1671 pageSizeType = PAGE_SIZE_AUTO_PORTRAIT;
1673 case CSSValueLandscape:
1674 pageSizeType = PAGE_SIZE_AUTO_LANDSCAPE;
1678 pageSizeType = PAGE_SIZE_RESOLVED;
1679 if (!getPageSizeFromName(primitiveValue, 0, width, height))
1688 styleResolver->style()->setPageSizeType(pageSizeType);
1689 styleResolver->style()->setPageSize(LengthSize(width, height));
1691 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1694 class ApplyPropertyTextEmphasisStyle {
1696 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1698 styleResolver->style()->setTextEmphasisFill(styleResolver->parentStyle()->textEmphasisFill());
1699 styleResolver->style()->setTextEmphasisMark(styleResolver->parentStyle()->textEmphasisMark());
1700 styleResolver->style()->setTextEmphasisCustomMark(styleResolver->parentStyle()->textEmphasisCustomMark());
1703 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1705 styleResolver->style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill());
1706 styleResolver->style()->setTextEmphasisMark(RenderStyle::initialTextEmphasisMark());
1707 styleResolver->style()->setTextEmphasisCustomMark(RenderStyle::initialTextEmphasisCustomMark());
1710 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1712 if (value->isValueList()) {
1713 CSSValueList* list = toCSSValueList(value);
1714 ASSERT(list->length() == 2);
1715 if (list->length() != 2)
1717 for (unsigned i = 0; i < 2; ++i) {
1718 CSSValue* item = list->itemWithoutBoundsCheck(i);
1719 if (!item->isPrimitiveValue())
1722 CSSPrimitiveValue* value = toCSSPrimitiveValue(item);
1723 if (value->getValueID() == CSSValueFilled || value->getValueID() == CSSValueOpen)
1724 styleResolver->style()->setTextEmphasisFill(*value);
1726 styleResolver->style()->setTextEmphasisMark(*value);
1728 styleResolver->style()->setTextEmphasisCustomMark(nullAtom);
1732 if (!value->isPrimitiveValue())
1734 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1736 if (primitiveValue->isString()) {
1737 styleResolver->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1738 styleResolver->style()->setTextEmphasisMark(TextEmphasisMarkCustom);
1739 styleResolver->style()->setTextEmphasisCustomMark(primitiveValue->getStringValue());
1743 styleResolver->style()->setTextEmphasisCustomMark(nullAtom);
1745 if (primitiveValue->getValueID() == CSSValueFilled || primitiveValue->getValueID() == CSSValueOpen) {
1746 styleResolver->style()->setTextEmphasisFill(*primitiveValue);
1747 styleResolver->style()->setTextEmphasisMark(TextEmphasisMarkAuto);
1749 styleResolver->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1750 styleResolver->style()->setTextEmphasisMark(*primitiveValue);
1754 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1757 template <typename T,
1758 T (Animation::*getterFunction)() const,
1759 void (Animation::*setterFunction)(T),
1760 bool (Animation::*testFunction)() const,
1761 void (Animation::*clearFunction)(),
1762 T (*initialFunction)(),
1763 void (CSSToStyleMap::*mapFunction)(Animation*, CSSValue*),
1764 AnimationList* (RenderStyle::*animationGetterFunction)(),
1765 const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
1766 class ApplyPropertyAnimation {
1768 static void setValue(Animation& animation, T value) { (animation.*setterFunction)(value); }
1769 static T value(const Animation& animation) { return (animation.*getterFunction)(); }
1770 static bool test(const Animation& animation) { return (animation.*testFunction)(); }
1771 static void clear(Animation& animation) { (animation.*clearFunction)(); }
1772 static T initial() { return (*initialFunction)(); }
1773 static void map(StyleResolver* styleResolver, Animation& animation, CSSValue* value) { (styleResolver->styleMap()->*mapFunction)(&animation, value); }
1774 static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
1775 static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
1777 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1779 AnimationList* list = accessAnimations(styleResolver->style());
1780 const AnimationList* parentList = animations(styleResolver->parentStyle());
1781 size_t i = 0, parentSize = parentList ? parentList->size() : 0;
1782 for ( ; i < parentSize && test(parentList->animation(i)); ++i) {
1783 if (list->size() <= i)
1784 list->append(Animation::create());
1785 setValue(list->animation(i), value(parentList->animation(i)));
1786 list->animation(i).setAnimationMode(parentList->animation(i).animationMode());
1789 /* Reset any remaining animations to not have the property set. */
1790 for ( ; i < list->size(); ++i)
1791 clear(list->animation(i));
1794 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
1796 AnimationList* list = accessAnimations(styleResolver->style());
1797 if (list->isEmpty())
1798 list->append(Animation::create());
1799 setValue(list->animation(0), initial());
1800 if (propertyID == CSSPropertyWebkitTransitionProperty)
1801 list->animation(0).setAnimationMode(Animation::AnimateAll);
1802 for (size_t i = 1; i < list->size(); ++i)
1803 clear(list->animation(i));
1806 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1808 AnimationList* list = accessAnimations(styleResolver->style());
1809 size_t childIndex = 0;
1810 if (value->isValueList()) {
1811 /* Walk each value and put it into an animation, creating new animations as needed. */
1812 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
1813 if (childIndex <= list->size())
1814 list->append(Animation::create());
1815 map(styleResolver, list->animation(childIndex), i.value());
1819 if (list->isEmpty())
1820 list->append(Animation::create());
1821 map(styleResolver, list->animation(childIndex), value);
1824 for ( ; childIndex < list->size(); ++childIndex) {
1825 /* Reset all remaining animations to not have the property set. */
1826 clear(list->animation(childIndex));
1830 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1833 class ApplyPropertyOutlineStyle {
1835 static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
1837 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInheritValue(propertyID, styleResolver);
1838 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInheritValue(propertyID, styleResolver);
1841 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
1843 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInitialValue(propertyID, styleResolver);
1844 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInitialValue(propertyID, styleResolver);
1847 static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
1849 ApplyPropertyDefault<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyValue(propertyID, styleResolver, value);
1850 ApplyPropertyDefault<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyValue(propertyID, styleResolver, value);
1853 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1856 class ApplyPropertyResize {
1858 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1860 if (!value->isPrimitiveValue())
1863 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1865 EResize r = RESIZE_NONE;
1866 switch (primitiveValue->getValueID()) {
1870 if (Settings* settings = styleResolver->document().settings())
1871 r = settings->textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE;
1874 r = *primitiveValue;
1876 styleResolver->style()->setResize(r);
1879 static PropertyHandler createHandler()
1881 PropertyHandler handler = ApplyPropertyDefaultBase<EResize, &RenderStyle::resize, EResize, &RenderStyle::setResize, EResize, &RenderStyle::initialResize>::createHandler();
1882 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1886 class ApplyPropertyVerticalAlign {
1888 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1890 if (!value->isPrimitiveValue())
1893 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1895 if (primitiveValue->getValueID())
1896 return styleResolver->style()->setVerticalAlign(*primitiveValue);
1898 styleResolver->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()));
1901 static PropertyHandler createHandler()
1903 PropertyHandler handler = ApplyPropertyDefaultBase<EVerticalAlign, &RenderStyle::verticalAlign, EVerticalAlign, &RenderStyle::setVerticalAlign, EVerticalAlign, &RenderStyle::initialVerticalAlign>::createHandler();
1904 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1908 class ApplyPropertyAspectRatio {
1910 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1912 if (!styleResolver->parentStyle()->hasAspectRatio())
1914 styleResolver->style()->setHasAspectRatio(true);
1915 styleResolver->style()->setAspectRatioDenominator(styleResolver->parentStyle()->aspectRatioDenominator());
1916 styleResolver->style()->setAspectRatioNumerator(styleResolver->parentStyle()->aspectRatioNumerator());
1919 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1921 styleResolver->style()->setHasAspectRatio(RenderStyle::initialHasAspectRatio());
1922 styleResolver->style()->setAspectRatioDenominator(RenderStyle::initialAspectRatioDenominator());
1923 styleResolver->style()->setAspectRatioNumerator(RenderStyle::initialAspectRatioNumerator());
1926 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1928 if (!value->isAspectRatioValue()) {
1929 styleResolver->style()->setHasAspectRatio(false);
1932 CSSAspectRatioValue* aspectRatioValue = toCSSAspectRatioValue(value);
1933 styleResolver->style()->setHasAspectRatio(true);
1934 styleResolver->style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue());
1935 styleResolver->style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue());
1938 static PropertyHandler createHandler()
1940 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1944 class ApplyPropertyZoom {
1946 static void resetEffectiveZoom(StyleResolver* styleResolver)
1948 // Reset the zoom in effect. This allows the setZoom method to accurately compute a new zoom in effect.
1949 styleResolver->setEffectiveZoom(styleResolver->parentStyle() ? styleResolver->parentStyle()->effectiveZoom() : RenderStyle::initialZoom());
1953 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1955 resetEffectiveZoom(styleResolver);
1956 styleResolver->setZoom(styleResolver->parentStyle()->zoom());
1959 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1961 resetEffectiveZoom(styleResolver);
1962 styleResolver->setZoom(RenderStyle::initialZoom());
1965 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1967 ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
1968 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
1970 if (primitiveValue->getValueID() == CSSValueNormal) {
1971 resetEffectiveZoom(styleResolver);
1972 styleResolver->setZoom(RenderStyle::initialZoom());
1973 } else if (primitiveValue->getValueID() == CSSValueReset) {
1974 styleResolver->setEffectiveZoom(RenderStyle::initialZoom());
1975 styleResolver->setZoom(RenderStyle::initialZoom());
1976 } else if (primitiveValue->getValueID() == CSSValueDocument) {
1977 float docZoom = styleResolver->rootElementStyle() ? styleResolver->rootElementStyle()->zoom() : RenderStyle::initialZoom();
1978 styleResolver->setEffectiveZoom(docZoom);
1979 styleResolver->setZoom(docZoom);
1980 } else if (primitiveValue->isPercentage()) {
1981 resetEffectiveZoom(styleResolver);
1982 if (float percent = primitiveValue->getFloatValue())
1983 styleResolver->setZoom(percent / 100.0f);
1984 } else if (primitiveValue->isNumber()) {
1985 resetEffectiveZoom(styleResolver);
1986 if (float number = primitiveValue->getFloatValue())
1987 styleResolver->setZoom(number);
1991 static PropertyHandler createHandler()
1993 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1997 class ApplyPropertyDisplay {
1999 static inline bool isValidDisplayValue(StyleResolver* styleResolver, EDisplay displayPropertyValue)
2002 if (styleResolver->element() && styleResolver->element()->isSVGElement() && styleResolver->style()->styleType() == NOPSEUDO)
2003 return (displayPropertyValue == INLINE || displayPropertyValue == BLOCK || displayPropertyValue == NONE);
2005 UNUSED_PARAM(styleResolver);
2006 UNUSED_PARAM(displayPropertyValue);
2011 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
2013 EDisplay display = styleResolver->parentStyle()->display();
2014 if (!isValidDisplayValue(styleResolver, display))
2016 styleResolver->style()->setDisplay(display);
2019 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
2021 styleResolver->style()->setDisplay(RenderStyle::initialDisplay());
2024 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
2026 if (!value->isPrimitiveValue())
2029 EDisplay display = *toCSSPrimitiveValue(value);
2031 if (!isValidDisplayValue(styleResolver, display))
2034 styleResolver->style()->setDisplay(display);
2037 static PropertyHandler createHandler()
2039 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
2043 template <ClipPathOperation* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<ClipPathOperation>), ClipPathOperation* (*initialFunction)()>
2044 class ApplyPropertyClipPath {
2046 static void setValue(RenderStyle* style, PassRefPtr<ClipPathOperation> value) { (style->*setterFunction)(value); }
2047 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
2049 if (value->isPrimitiveValue()) {
2050 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
2051 if (primitiveValue->getValueID() == CSSValueNone)
2052 setValue(styleResolver->style(), 0);
2053 else if (primitiveValue->isShape()) {
2054 setValue(styleResolver->style(), ShapeClipPathOperation::create(basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue->getShapeValue())));
2057 else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_URI) {
2058 String cssURLValue = primitiveValue->getStringValue();
2059 URL url = styleResolver->document().completeURL(cssURLValue);
2060 // FIXME: It doesn't work with forward or external SVG references (see https://bugs.webkit.org/show_bug.cgi?id=90405)
2061 setValue(styleResolver->style(), ReferenceClipPathOperation::create(cssURLValue, url.fragmentIdentifier()));
2066 static PropertyHandler createHandler()
2068 PropertyHandler handler = ApplyPropertyDefaultBase<ClipPathOperation*, getterFunction, PassRefPtr<ClipPathOperation>, setterFunction, ClipPathOperation*, initialFunction>::createHandler();
2069 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
2073 #if ENABLE(CSS_SHAPES)
2074 template <ShapeValue* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<ShapeValue>), ShapeValue* (*initialFunction)()>
2075 class ApplyPropertyShape {
2077 static void setValue(RenderStyle* style, PassRefPtr<ShapeValue> value) { (style->*setterFunction)(value); }
2078 static void applyValue(CSSPropertyID property, StyleResolver* styleResolver, CSSValue* value)
2080 if (value->isPrimitiveValue()) {
2081 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
2082 if (primitiveValue->getValueID() == CSSValueAuto)
2083 setValue(styleResolver->style(), 0);
2084 else if (primitiveValue->getValueID() == CSSValueContentBox
2085 || primitiveValue->getValueID() == CSSValueBorderBox
2086 || primitiveValue->getValueID() == CSSValuePaddingBox
2087 || primitiveValue->getValueID() == CSSValueMarginBox)
2088 setValue(styleResolver->style(), ShapeValue::createBoxValue(primitiveValue->getValueID()));
2089 else if (primitiveValue->getValueID() == CSSValueOutsideShape)
2090 setValue(styleResolver->style(), ShapeValue::createOutsideValue());
2091 else if (primitiveValue->isShape()) {
2092 RefPtr<ShapeValue> shape = ShapeValue::createShapeValue(basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue->getShapeValue()));
2093 setValue(styleResolver->style(), shape.release());
2095 } else if (value->isImageValue()) {
2096 RefPtr<ShapeValue> shape = ShapeValue::createImageValue(styleResolver->styleImage(property, value));
2097 setValue(styleResolver->style(), shape.release());
2101 static PropertyHandler createHandler()
2103 PropertyHandler handler = ApplyPropertyDefaultBase<ShapeValue*, getterFunction, PassRefPtr<ShapeValue>, setterFunction, ShapeValue*, initialFunction>::createHandler();
2104 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
2109 #if ENABLE(CSS_IMAGE_RESOLUTION)
2110 class ApplyPropertyImageResolution {
2112 static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
2114 ApplyPropertyDefaultBase<ImageResolutionSource, &RenderStyle::imageResolutionSource, ImageResolutionSource, &RenderStyle::setImageResolutionSource, ImageResolutionSource, &RenderStyle::initialImageResolutionSource>::applyInheritValue(propertyID, styleResolver);
2115 ApplyPropertyDefaultBase<ImageResolutionSnap, &RenderStyle::imageResolutionSnap, ImageResolutionSnap, &RenderStyle::setImageResolutionSnap, ImageResolutionSnap, &RenderStyle::initialImageResolutionSnap>::applyInheritValue(propertyID, styleResolver);
2116 ApplyPropertyDefaultBase<float, &RenderStyle::imageResolution, float, &RenderStyle::setImageResolution, float, &RenderStyle::initialImageResolution>::applyInheritValue(propertyID, styleResolver);
2119 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
2121 ApplyPropertyDefaultBase<ImageResolutionSource, &RenderStyle::imageResolutionSource, ImageResolutionSource, &RenderStyle::setImageResolutionSource, ImageResolutionSource, &RenderStyle::initialImageResolutionSource>::applyInitialValue(propertyID, styleResolver);
2122 ApplyPropertyDefaultBase<ImageResolutionSnap, &RenderStyle::imageResolutionSnap, ImageResolutionSnap, &RenderStyle::setImageResolutionSnap, ImageResolutionSnap, &RenderStyle::initialImageResolutionSnap>::applyInitialValue(propertyID, styleResolver);
2123 ApplyPropertyDefaultBase<float, &RenderStyle::imageResolution, float, &RenderStyle::setImageResolution, float, &RenderStyle::initialImageResolution>::applyInitialValue(propertyID, styleResolver);
2126 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
2128 if (!value->isValueList())
2130 CSSValueList* valueList = toCSSValueList(value);
2131 ImageResolutionSource source = RenderStyle::initialImageResolutionSource();
2132 ImageResolutionSnap snap = RenderStyle::initialImageResolutionSnap();
2133 double resolution = RenderStyle::initialImageResolution();
2134 for (size_t i = 0; i < valueList->length(); i++) {
2135 CSSValue* item = valueList->itemWithoutBoundsCheck(i);
2136 if (!item->isPrimitiveValue())
2138 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
2139 if (primitiveValue->getValueID() == CSSValueFromImage)
2140 source = ImageResolutionFromImage;
2141 else if (primitiveValue->getValueID() == CSSValueSnap)
2142 snap = ImageResolutionSnapPixels;
2144 resolution = primitiveValue->getDoubleValue(CSSPrimitiveValue::CSS_DPPX);
2146 styleResolver->style()->setImageResolutionSource(source);
2147 styleResolver->style()->setImageResolutionSnap(snap);
2148 styleResolver->style()->setImageResolution(resolution);
2151 static PropertyHandler createHandler()
2153 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
2158 class ApplyPropertyTextIndent {
2160 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
2162 styleResolver->style()->setTextIndent(styleResolver->parentStyle()->textIndent());
2163 #if ENABLE(CSS3_TEXT)
2164 styleResolver->style()->setTextIndentLine(styleResolver->parentStyle()->textIndentLine());
2165 styleResolver->style()->setTextIndentType(styleResolver->parentStyle()->textIndentType());
2169 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
2171 styleResolver->style()->setTextIndent(RenderStyle::initialTextIndent());
2172 #if ENABLE(CSS3_TEXT)
2173 styleResolver->style()->setTextIndentLine(RenderStyle::initialTextIndentLine());
2174 styleResolver->style()->setTextIndentType(RenderStyle::initialTextIndentType());
2178 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
2180 if (!value->isValueList())
2183 Length lengthOrPercentageValue;
2184 #if ENABLE(CSS3_TEXT)
2185 TextIndentLine textIndentLineValue = RenderStyle::initialTextIndentLine();
2186 TextIndentType textIndentTypeValue = RenderStyle::initialTextIndentType();
2188 CSSValueList* valueList = toCSSValueList(value);
2189 for (size_t i = 0; i < valueList->length(); ++i) {
2190 CSSValue* item = valueList->itemWithoutBoundsCheck(i);
2191 if (!item->isPrimitiveValue())
2194 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
2195 if (!primitiveValue->getValueID())
2196 lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
2197 #if ENABLE(CSS3_TEXT)
2198 else if (primitiveValue->getValueID() == CSSValueWebkitEachLine)
2199 textIndentLineValue = TextIndentEachLine;
2200 else if (primitiveValue->getValueID() == CSSValueWebkitHanging)
2201 textIndentTypeValue = TextIndentHanging;
2205 ASSERT(!lengthOrPercentageValue.isUndefined());
2206 styleResolver->style()->setTextIndent(lengthOrPercentageValue);
2207 #if ENABLE(CSS3_TEXT)
2208 styleResolver->style()->setTextIndentLine(textIndentLineValue);
2209 styleResolver->style()->setTextIndentType(textIndentTypeValue);
2213 static PropertyHandler createHandler()
2215 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
2219 const DeprecatedStyleBuilder& DeprecatedStyleBuilder::sharedStyleBuilder()
2221 DEFINE_STATIC_LOCAL(DeprecatedStyleBuilder, styleBuilderInstance, ());
2222 return styleBuilderInstance;
2225 DeprecatedStyleBuilder::DeprecatedStyleBuilder()
2227 for (int i = 0; i < numCSSProperties; ++i)
2228 m_propertyMap[i] = PropertyHandler();
2230 // Please keep CSS property list in alphabetical order.
2231 setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSToStyleMap::mapFillAttachment>::createHandler());
2232 setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
2233 setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler());
2234 setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
2235 setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
2236 setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
2237 setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
2238 setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
2239 setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
2240 setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
2241 setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
2242 setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
2243 setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
2244 setPropertyHandler(CSSPropertyBorderBottomStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderBottomStyle, EBorderStyle, &RenderStyle::setBorderBottomStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2245 setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2246 setPropertyHandler(CSSPropertyBorderCollapse, ApplyPropertyDefault<EBorderCollapse, &RenderStyle::borderCollapse, EBorderCollapse, &RenderStyle::setBorderCollapse, EBorderCollapse, &RenderStyle::initialBorderCollapse>::createHandler());
2247 setPropertyHandler(CSSPropertyBorderImageOutset, ApplyPropertyBorderImageModifier<BorderImage, Outset>::createHandler());
2248 setPropertyHandler(CSSPropertyBorderImageRepeat, ApplyPropertyBorderImageModifier<BorderImage, Repeat>::createHandler());
2249 setPropertyHandler(CSSPropertyBorderImageSlice, ApplyPropertyBorderImageModifier<BorderImage, Slice>::createHandler());
2250 setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource<CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource, &RenderStyle::initialBorderImageSource>::createHandler());
2251 setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier<BorderImage, Width>::createHandler());
2252 setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
2253 setPropertyHandler(CSSPropertyBorderLeftStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderLeftStyle, EBorderStyle, &RenderStyle::setBorderLeftStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2254 setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2255 setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
2256 setPropertyHandler(CSSPropertyBorderRightStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderRightStyle, EBorderStyle, &RenderStyle::setBorderRightStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2257 setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2258 setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler());
2259 setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
2260 setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
2261 setPropertyHandler(CSSPropertyBorderTopStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderTopStyle, EBorderStyle, &RenderStyle::setBorderTopStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2262 setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<unsigned, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2263 setPropertyHandler(CSSPropertyBottom, ApplyPropertyLength<&RenderStyle::bottom, &RenderStyle::setBottom, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
2264 setPropertyHandler(CSSPropertyBoxSizing, ApplyPropertyDefault<EBoxSizing, &RenderStyle::boxSizing, EBoxSizing, &RenderStyle::setBoxSizing, EBoxSizing, &RenderStyle::initialBoxSizing>::createHandler());
2265 setPropertyHandler(CSSPropertyCaptionSide, ApplyPropertyDefault<ECaptionSide, &RenderStyle::captionSide, ECaptionSide, &RenderStyle::setCaptionSide, ECaptionSide, &RenderStyle::initialCaptionSide>::createHandler());
2266 setPropertyHandler(CSSPropertyClear, ApplyPropertyDefault<EClear, &RenderStyle::clear, EClear, &RenderStyle::setClear, EClear, &RenderStyle::initialClear>::createHandler());
2267 setPropertyHandler(CSSPropertyClip, ApplyPropertyClip::createHandler());
2268 setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler());
2269 setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::createHandler());
2270 setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler());
2271 setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler());
2272 setPropertyHandler(CSSPropertyDirection, ApplyPropertyDirection<&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection>::createHandler());
2273 setPropertyHandler(CSSPropertyDisplay, ApplyPropertyDisplay::createHandler());
2274 setPropertyHandler(CSSPropertyEmptyCells, ApplyPropertyDefault<EEmptyCell, &RenderStyle::emptyCells, EEmptyCell, &RenderStyle::setEmptyCells, EEmptyCell, &RenderStyle::initialEmptyCells>::createHandler());
2275 setPropertyHandler(CSSPropertyFloat, ApplyPropertyDefault<EFloat, &RenderStyle::floating, EFloat, &RenderStyle::setFloating, EFloat, &RenderStyle::initialFloating>::createHandler());
2276 setPropertyHandler(CSSPropertyFontFamily, ApplyPropertyFontFamily::createHandler());
2277 setPropertyHandler(CSSPropertyFontSize, ApplyPropertyFontSize::createHandler());
2278 setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
2279 setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
2280 setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
2281 setPropertyHandler(CSSPropertyHeight, ApplyPropertyLength<&RenderStyle::height, &RenderStyle::setHeight, &RenderStyle::initialSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicDisabled, NoneDisabled, UndefinedDisabled>::createHandler());
2282 #if ENABLE(CSS_IMAGE_ORIENTATION)
2283 setPropertyHandler(CSSPropertyImageOrientation, ApplyPropertyDefault<ImageOrientationEnum, &RenderStyle::imageOrientation, ImageOrientationEnum, &RenderStyle::setImageOrientation, ImageOrientationEnum, &RenderStyle::initialImageOrientation>::createHandler());
2285 setPropertyHandler(CSSPropertyImageRendering, ApplyPropertyDefault<EImageRendering, &RenderStyle::imageRendering, EImageRendering, &RenderStyle::setImageRendering, EImageRendering, &RenderStyle::initialImageRendering>::createHandler());
2286 #if ENABLE(CSS_IMAGE_RESOLUTION)
2287 setPropertyHandler(CSSPropertyImageResolution, ApplyPropertyImageResolution::createHandler());
2289 setPropertyHandler(CSSPropertyLeft, ApplyPropertyLength<&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
2290 setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength<int, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
2291 #if ENABLE(IOS_TEXT_AUTOSIZING)
2292 setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeightForIOSTextAutosizing::createHandler());
2294 setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeight::createHandler());
2296 setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
2297 setPropertyHandler(CSSPropertyListStylePosition, ApplyPropertyDefault<EListStylePosition, &RenderStyle::listStylePosition, EListStylePosition, &RenderStyle::setListStylePosition, EListStylePosition, &RenderStyle::initialListStylePosition>::createHandler());
2298 setPropertyHandler(CSSPropertyListStyleType, ApplyPropertyDefault<EListStyleType, &RenderStyle::listStyleType, EListStyleType, &RenderStyle::setListStyleType, EListStyleType, &RenderStyle::initialListStyleType>::createHandler());
2299 setPropertyHandler(CSSPropertyMarginBottom, ApplyPropertyLength<&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
2300 setPropertyHandler(CSSPropertyMarginLeft, ApplyPropertyLength<&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
2301 setPropertyHandler(CSSPropertyMarginRight, ApplyPropertyLength<&RenderStyle::marginRight, &RenderStyle::setMarginRight, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
2302 setPropertyHandler(CSSPropertyMarginTop, ApplyPropertyLength<&RenderStyle::marginTop, &RenderStyle::setMarginTop, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
2303 setPropertyHandler(CSSPropertyMaxHeight, ApplyPropertyLength<&RenderStyle::maxHeight, &RenderStyle::setMaxHeight, &RenderStyle::initialMaxSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicDisabled, NoneEnabled, UndefinedEnabled>::createHandler());
2304 setPropertyHandler(CSSPropertyMaxWidth, ApplyPropertyLength<&RenderStyle::maxWidth, &RenderStyle::setMaxWidth, &RenderStyle::initialMaxSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
2305 setPropertyHandler(CSSPropertyMinHeight, ApplyPropertyLength<&RenderStyle::minHeight, &RenderStyle::setMinHeight, &RenderStyle::initialMinSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicDisabled>::createHandler());
2306 setPropertyHandler(CSSPropertyMinWidth, ApplyPropertyLength<&RenderStyle::minWidth, &RenderStyle::setMinWidth, &RenderStyle::initialMinSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicEnabled>::createHandler());
2307 setPropertyHandler(CSSPropertyObjectFit, ApplyPropertyDefault<ObjectFit, &RenderStyle::objectFit, ObjectFit, &RenderStyle::setObjectFit, ObjectFit, &RenderStyle::initialObjectFit>::createHandler());
2308 setPropertyHandler(CSSPropertyOpacity, ApplyPropertyDefault<float, &RenderStyle::opacity, float, &RenderStyle::setOpacity, float, &RenderStyle::initialOpacity>::createHandler());
2309 setPropertyHandler(CSSPropertyOrphans, ApplyPropertyAuto<short, &RenderStyle::orphans, &RenderStyle::setOrphans, &RenderStyle::hasAutoOrphans, &RenderStyle::setHasAutoOrphans>::createHandler());
2310 setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
2311 setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength<int, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset>::createHandler());
2312 setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
2313 setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialOutlineWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2314 setPropertyHandler(CSSPropertyOverflowWrap, ApplyPropertyDefault<EOverflowWrap, &RenderStyle::overflowWrap, EOverflowWrap, &RenderStyle::setOverflowWrap, EOverflowWrap, &RenderStyle::initialOverflowWrap>::createHandler());
2315 setPropertyHandler(CSSPropertyOverflowX, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowX, EOverflow, &RenderStyle::setOverflowX, EOverflow, &RenderStyle::initialOverflowX>::createHandler());
2316 setPropertyHandler(CSSPropertyOverflowY, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowY, EOverflow, &RenderStyle::setOverflowY, EOverflow, &RenderStyle::initialOverflowY>::createHandler());
2317 setPropertyHandler(CSSPropertyPaddingBottom, ApplyPropertyLength<&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding>::createHandler());
2318 setPropertyHandler(CSSPropertyPaddingLeft, ApplyPropertyLength<&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding>::createHandler());
2319 setPropertyHandler(CSSPropertyPaddingRight, ApplyPropertyLength<&RenderStyle::paddingRight, &RenderStyle::setPaddingRight, &RenderStyle::initialPadding>::createHandler());
2320 setPropertyHandler(CSSPropertyPaddingTop, ApplyPropertyLength<&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding>::createHandler());
2321 setPropertyHandler(CSSPropertyPageBreakAfter, ApplyPropertyDefault<EPageBreak, &RenderStyle::pageBreakAfter, EPageBreak, &RenderStyle::setPageBreakAfter, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2322 setPropertyHandler(CSSPropertyPageBreakBefore, ApplyPropertyDefault<EPageBreak, &RenderStyle::pageBreakBefore, EPageBreak, &RenderStyle::setPageBreakBefore, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2323 setPropertyHandler(CSSPropertyPageBreakInside, ApplyPropertyDefault<EPageBreak, &RenderStyle::pageBreakInside, EPageBreak, &RenderStyle::setPageBreakInside, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2324 setPropertyHandler(CSSPropertyPointerEvents, ApplyPropertyDefault<EPointerEvents, &RenderStyle::pointerEvents, EPointerEvents, &RenderStyle::setPointerEvents, EPointerEvents, &RenderStyle::initialPointerEvents>::createHandler());
2325 setPropertyHandler(CSSPropertyPosition, ApplyPropertyDefault<EPosition, &RenderStyle::position, EPosition, &RenderStyle::setPosition, EPosition, &RenderStyle::initialPosition>::createHandler());
2326 setPropertyHandler(CSSPropertyResize, ApplyPropertyResize::createHandler());
2327 setPropertyHandler(CSSPropertyRight, ApplyPropertyLength<&RenderStyle::right, &RenderStyle::setRight, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
2328 setPropertyHandler(CSSPropertySize, ApplyPropertyPageSize::createHandler());
2329 setPropertyHandler(CSSPropertySpeak, ApplyPropertyDefault<ESpeak, &RenderStyle::speak, ESpeak, &RenderStyle::setSpeak, ESpeak, &RenderStyle::initialSpeak>::createHandler());
2330 setPropertyHandler(CSSPropertyTableLayout, ApplyPropertyDefault<ETableLayout, &RenderStyle::tableLayout, ETableLayout, &RenderStyle::setTableLayout, ETableLayout, &RenderStyle::initialTableLayout>::createHandler());
2331 setPropertyHandler(CSSPropertyTabSize, ApplyPropertyDefault<unsigned, &RenderStyle::tabSize, unsigned, &RenderStyle::setTabSize, unsigned, &RenderStyle::initialTabSize>::createHandler());
2332 setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
2333 setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
2334 #if ENABLE(CSS3_TEXT)
2335 setPropertyHandler(CSSPropertyWebkitTextAlignLast, ApplyPropertyDefault<TextAlignLast, &RenderStyle::textAlignLast, TextAlignLast, &RenderStyle::setTextAlignLast, TextAlignLast, &RenderStyle::initialTextAlignLast>::createHandler());
2336 setPropertyHandler(CSSPropertyWebkitTextJustify, ApplyPropertyDefault<TextJustify, &RenderStyle::textJustify, TextJustify, &RenderStyle::setTextJustify, TextJustify, &RenderStyle::initialTextJustify>::createHandler());
2338 #if ENABLE(CSS3_TEXT_DECORATION)
2339 setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
2340 setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler());
2341 setPropertyHandler(CSSPropertyWebkitTextDecorationColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textDecorationColor, &RenderStyle::setTextDecorationColor, &RenderStyle::setVisitedLinkTextDecorationColor, &RenderStyle::color>::createHandler());
2342 setPropertyHandler(CSSPropertyWebkitTextDecorationSkip, ApplyPropertyTextDecorationSkip::createHandler());
2343 setPropertyHandler(CSSPropertyWebkitTextUnderlinePosition, ApplyPropertyTextUnderlinePosition::createHandler());
2345 setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyTextIndent::createHandler());
2346 setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler());
2347 setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
2348 setPropertyHandler(CSSPropertyTextTransform, ApplyPropertyDefault<ETextTransform, &RenderStyle::textTransform, ETextTransform, &RenderStyle::setTextTransform, ETextTransform, &RenderStyle::initialTextTransform>::createHandler());
2349 setPropertyHandler(CSSPropertyTop, ApplyPropertyLength<&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
2350 setPropertyHandler(CSSPropertyUnicodeBidi, ApplyPropertyDefault<EUnicodeBidi, &RenderStyle::unicodeBidi, EUnicodeBidi, &RenderStyle::setUnicodeBidi, EUnicodeBidi, &RenderStyle::initialUnicodeBidi>::createHandler());
2351 setPropertyHandler(CSSPropertyVerticalAlign, ApplyPropertyVerticalAlign::createHandler());
2352 setPropertyHandler(CSSPropertyVisibility, ApplyPropertyDefault<EVisibility, &RenderStyle::visibility, EVisibility, &RenderStyle::setVisibility, EVisibility, &RenderStyle::initialVisibility>::createHandler());
2353 setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2354 setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSToStyleMap::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2355 setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2356 setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSToStyleMap::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2357 setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<double, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSToStyleMap::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2358 setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSToStyleMap::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2359 setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSToStyleMap::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2360 setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
2361 setPropertyHandler(CSSPropertyWebkitAppearance, ApplyPropertyDefault<ControlPart, &RenderStyle::appearance, ControlPart, &RenderStyle::setAppearance, ControlPart, &RenderStyle::initialAppearance>::createHandler());
2362 setPropertyHandler(CSSPropertyWebkitAspectRatio, ApplyPropertyAspectRatio::createHandler());
2363 setPropertyHandler(CSSPropertyWebkitBackfaceVisibility, ApplyPropertyDefault<EBackfaceVisibility, &RenderStyle::backfaceVisibility, EBackfaceVisibility, &RenderStyle::setBackfaceVisibility, EBackfaceVisibility, &RenderStyle::initialBackfaceVisibility>::createHandler());
2364 setPropertyHandler(CSSPropertyWebkitBackgroundBlendMode, ApplyPropertyFillLayer<BlendMode, CSSPropertyWebkitBackgroundBlendMode, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isBlendModeSet, &FillLayer::blendMode, &FillLayer::setBlendMode, &FillLayer::clearBlendMode, &FillLayer::initialFillBlendMode, &CSSToStyleMap::mapFillBlendMode>::createHandler());
2365 setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
2366 setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
2367 setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
2368 setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
2369 #if ENABLE(CSS_COMPOSITING)
2370 setPropertyHandler(CSSPropertyWebkitBlendMode, ApplyPropertyDefault<BlendMode, &RenderStyle::blendMode, BlendMode, &RenderStyle::setBlendMode, BlendMode, &RenderStyle::initialBlendMode>::createHandler());
2372 setPropertyHandler(CSSPropertyWebkitBorderFit, ApplyPropertyDefault<EBorderFit, &RenderStyle::borderFit, EBorderFit, &RenderStyle::setBorderFit, EBorderFit, &RenderStyle::initialBorderFit>::createHandler());
2373 setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler());
2374 setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage<BorderImage, CSSPropertyWebkitBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
2375 setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing>::createHandler());
2376 setPropertyHandler(CSSPropertyWebkitBoxAlign, ApplyPropertyDefault<EBoxAlignment, &RenderStyle::boxAlign, EBoxAlignment, &RenderStyle::setBoxAlign, EBoxAlignment, &RenderStyle::initialBoxAlign>::createHandler());
2377 #if ENABLE(CSS_BOX_DECORATION_BREAK)
2378 setPropertyHandler(CSSPropertyWebkitBoxDecorationBreak, ApplyPropertyDefault<EBoxDecorationBreak, &RenderStyle::boxDecorationBreak, EBoxDecorationBreak, &RenderStyle::setBoxDecorationBreak, EBoxDecorationBreak, &RenderStyle::initialBoxDecorationBreak>::createHandler());
2380 setPropertyHandler(CSSPropertyWebkitBoxDirection, ApplyPropertyDefault<EBoxDirection, &RenderStyle::boxDirection, EBoxDirection, &RenderStyle::setBoxDirection, EBoxDirection, &RenderStyle::initialBoxDirection>::createHandler());
2381 setPropertyHandler(CSSPropertyWebkitBoxFlex, ApplyPropertyDefault<float, &RenderStyle::boxFlex, float, &RenderStyle::setBoxFlex, float, &RenderStyle::initialBoxFlex>::createHandler());
2382 setPropertyHandler(CSSPropertyWebkitBoxFlexGroup, ApplyPropertyDefault<unsigned int, &RenderStyle::boxFlexGroup, unsigned int, &RenderStyle::setBoxFlexGroup, unsigned int, &RenderStyle::initialBoxFlexGroup>::createHandler());
2383 setPropertyHandler(CSSPropertyWebkitBoxLines, ApplyPropertyDefault<EBoxLines, &RenderStyle::boxLines, EBoxLines, &RenderStyle::setBoxLines, EBoxLines, &RenderStyle::initialBoxLines>::createHandler());
2384 setPropertyHandler(CSSPropertyWebkitBoxOrdinalGroup, ApplyPropertyDefault<unsigned int, &RenderStyle::boxOrdinalGroup, unsigned int, &RenderStyle::setBoxOrdinalGroup, unsigned int, &RenderStyle::initialBoxOrdinalGroup>::createHandler());
2385 setPropertyHandler(CSSPropertyWebkitBoxOrient, ApplyPropertyDefault<EBoxOrient, &RenderStyle::boxOrient, EBoxOrient, &RenderStyle::setBoxOrient, EBoxOrient, &RenderStyle::initialBoxOrient>::createHandler());
2386 setPropertyHandler(CSSPropertyWebkitBoxPack, ApplyPropertyDefault<EBoxPack, &RenderStyle::boxPack, EBoxPack, &RenderStyle::setBoxPack, EBoxPack, &RenderStyle::initialBoxPack>::createHandler());
2387 setPropertyHandler(CSSPropertyWebkitColorCorrection, ApplyPropertyDefault<ColorSpace, &RenderStyle::colorSpace, ColorSpace, &RenderStyle::setColorSpace, ColorSpace, &RenderStyle::initialColorSpace>::createHandler());
2388 setPropertyHandler(CSSPropertyWebkitColumnAxis, ApplyPropertyDefault<ColumnAxis, &RenderStyle::columnAxis, ColumnAxis, &RenderStyle::setColumnAxis, ColumnAxis, &RenderStyle::initialColumnAxis>::createHandler());
2389 setPropertyHandler(CSSPropertyWebkitColumnBreakAfter, ApplyPropertyDefault<EPageBreak, &RenderStyle::columnBreakAfter, EPageBreak, &RenderStyle::setColumnBreakAfter, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2390 setPropertyHandler(CSSPropertyWebkitColumnBreakBefore, ApplyPropertyDefault<EPageBreak, &RenderStyle::columnBreakBefore, EPageBreak, &RenderStyle::setColumnBreakBefore, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2391 setPropertyHandler(CSSPropertyWebkitColumnBreakInside, ApplyPropertyDefault<EPageBreak, &RenderStyle::columnBreakInside, EPageBreak, &RenderStyle::setColumnBreakInside, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2392 setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
2393 setPropertyHandler(CSSPropertyWebkitColumnFill, ApplyPropertyDefault<ColumnFill, &RenderStyle::columnFill, ColumnFill, &RenderStyle::setColumnFill, ColumnFill, &RenderStyle::initialColumnFill>::createHandler());
2394 setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
2395 setPropertyHandler(CSSPropertyWebkitColumnProgression, ApplyPropertyDefault<ColumnProgression, &RenderStyle::columnProgression, ColumnProgression, &RenderStyle::setColumnProgression, ColumnProgression, &RenderStyle::initialColumnProgression>::createHandler());
2396 setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
2397 setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialColumnRuleWidth, NormalDisabled, ThicknessEnabled>::createHandler());
2398 setPropertyHandler(CSSPropertyWebkitColumnSpan, ApplyPropertyDefault<ColumnSpan, &RenderStyle::columnSpan, ColumnSpan, &RenderStyle::setColumnSpan, ColumnSpan, &RenderStyle::initialColumnSpan>::createHandler());
2399 setPropertyHandler(CSSPropertyWebkitColumnRuleStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::columnRuleStyle, EBorderStyle, &RenderStyle::setColumnRuleStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
2400 setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
2401 #if ENABLE(CURSOR_VISIBILITY)
2402 setPropertyHandler(CSSPropertyWebkitCursorVisibility, ApplyPropertyDefault<CursorVisibility, &RenderStyle::cursorVisibility, CursorVisibility, &RenderStyle::setCursorVisibility, CursorVisibility, &RenderStyle::initialCursorVisibility>::createHandler());
2404 setPropertyHandler(CSSPropertyWebkitAlignContent, ApplyPropertyDefault<EAlignContent, &RenderStyle::alignContent, EAlignContent, &RenderStyle::setAlignContent, EAlignContent, &RenderStyle::initialAlignContent>::createHandler());
2405 setPropertyHandler(CSSPropertyWebkitAlignItems, ApplyPropertyDefault<EAlignItems, &RenderStyle::alignItems, EAlignItems, &RenderStyle::setAlignItems, EAlignItems, &RenderStyle::initialAlignItems>::createHandler());
2406 setPropertyHandler(CSSPropertyWebkitAlignSelf, ApplyPropertyDefault<EAlignItems, &RenderStyle::alignSelf, EAlignItems, &RenderStyle::setAlignSelf, EAlignItems, &RenderStyle::initialAlignSelf>::createHandler());
2407 setPropertyHandler(CSSPropertyWebkitFlexBasis, ApplyPropertyLength<&RenderStyle::flexBasis, &RenderStyle::setFlexBasis, &RenderStyle::initialFlexBasis, AutoEnabled>::createHandler());
2408 setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler());
2409 setPropertyHandler(CSSPropertyWebkitFlexGrow, ApplyPropertyDefault<float, &RenderStyle::flexGrow, float, &RenderStyle::setFlexGrow, float, &RenderStyle::initialFlexGrow>::createHandler());
2410 setPropertyHandler(CSSPropertyWebkitFlexShrink, ApplyPropertyDefault<float, &RenderStyle::flexShrink, float, &RenderStyle::setFlexShrink, float, &RenderStyle::initialFlexShrink>::createHandler());
2411 setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler());
2412 setPropertyHandler(CSSPropertyWebkitGridAutoFlow, ApplyPropertyDefault<GridAutoFlow, &RenderStyle::gridAutoFlow, GridAutoFlow, &RenderStyle::setGridAutoFlow, GridAutoFlow, &RenderStyle::initialGridAutoFlow>::createHandler());
2413 setPropertyHandler(CSSPropertyWebkitJustifyContent, ApplyPropertyDefault<EJustifyContent, &RenderStyle::justifyContent, EJustifyContent, &RenderStyle::setJustifyContent, EJustifyContent, &RenderStyle::initialJustifyContent>::createHandler());
2414 setPropertyHandler(CSSPropertyWebkitOrder, ApplyPropertyDefault<int, &RenderStyle::order, int, &RenderStyle::setOrder, int, &RenderStyle::initialOrder>::createHandler());
2415 #if ENABLE(CSS_REGIONS)
2416 setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString<MapNoneToNull, &RenderStyle::regionThread, &RenderStyle::setRegionThread, &RenderStyle::initialRegionThread>::createHandler());
2417 setPropertyHandler(CSSPropertyWebkitFlowInto, ApplyPropertyString<MapNoneToNull, &RenderStyle::flowThread, &RenderStyle::setFlowThread, &RenderStyle::initialFlowThread>::createHandler());
2419 setPropertyHandler(CSSPropertyWebkitFontKerning, ApplyPropertyFont<FontDescription::Kerning, &FontDescription::kerning, &FontDescription::setKerning, FontDescription::AutoKerning>::createHandler());
2420 setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
2421 setPropertyHandler(CSSPropertyWebkitFontVariantLigatures, ApplyPropertyFontVariantLigatures::createHandler());
2422 setPropertyHandler(CSSPropertyWebkitHighlight, ApplyPropertyString<MapNoneToNull, &RenderStyle::highlight, &RenderStyle::setHighlight, &RenderStyle::initialHighlight>::createHandler());
2423 setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());
2424 setPropertyHandler(CSSPropertyWebkitHyphenateLimitAfter, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitAfter, &RenderStyle::setHyphenationLimitAfter, &RenderStyle::initialHyphenationLimitAfter>::createHandler());
2425 setPropertyHandler(CSSPropertyWebkitHyphenateLimitBefore, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitBefore, &RenderStyle::setHyphenationLimitBefore, &RenderStyle::initialHyphenationLimitBefore>::createHandler());
2426 setPropertyHandler(CSSPropertyWebkitHyphenateLimitLines, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitLines, &RenderStyle::setHyphenationLimitLines, &RenderStyle::initialHyphenationLimitLines, CSSValueNoLimit>::createHandler());
2427 setPropertyHandler(CSSPropertyWebkitHyphens, ApplyPropertyDefault<Hyphens, &RenderStyle::hyphens, Hyphens, &RenderStyle::setHyphens, Hyphens, &RenderStyle::initialHyphens>::createHandler());
2428 setPropertyHandler(CSSPropertyWebkitLineAlign, ApplyPropertyDefault<LineAlign, &RenderStyle::lineAlign, LineAlign, &RenderStyle::setLineAlign, LineAlign, &RenderStyle::initialLineAlign>::createHandler());
2429 setPropertyHandler(CSSPropertyWebkitLineBreak, ApplyPropertyDefault<LineBreak, &RenderStyle::lineBreak, LineBreak, &RenderStyle::setLineBreak, LineBreak, &RenderStyle::initialLineBreak>::createHandler());
2430 setPropertyHandler(CSSPropertyWebkitLineClamp, ApplyPropertyDefault<const LineClampValue&, &RenderStyle::lineClamp, LineClampValue, &RenderStyle::setLineClamp, LineClampValue, &RenderStyle::initialLineClamp>::createHandler());
2431 setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());
2432 setPropertyHandler(CSSPropertyWebkitLineSnap, ApplyPropertyDefault<LineSnap, &RenderStyle::lineSnap, LineSnap, &RenderStyle::setLineSnap, LineSnap, &RenderStyle::initialLineSnap>::createHandler());
2433 setPropertyHandler(CSSPropertyWebkitMarginAfterCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginAfterCollapse, EMarginCollapse, &RenderStyle::setMarginAfterCollapse, EMarginCollapse, &RenderStyle::initialMarginAfterCollapse>::createHandler());
2434 setPropertyHandler(CSSPropertyWebkitMarginBeforeCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginBeforeCollapse, EMarginCollapse, &RenderStyle::setMarginBeforeCollapse, EMarginCollapse, &RenderStyle::initialMarginBeforeCollapse>::createHandler());
2435 setPropertyHandler(CSSPropertyWebkitMarginBottomCollapse, CSSPropertyWebkitMarginAfterCollapse);
2436 setPropertyHandler(CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBeforeCollapse);
2437 setPropertyHandler(CSSPropertyWebkitMarqueeDirection, ApplyPropertyDefault<EMarqueeDirection, &RenderStyle::marqueeDirection, EMarqueeDirection, &RenderStyle::setMarqueeDirection, EMarqueeDirection, &RenderStyle::initialMarqueeDirection>::createHandler());
2438 setPropertyHandler(CSSPropertyWebkitMarqueeIncrement, ApplyPropertyMarqueeIncrement::createHandler());
2439 setPropertyHandler(CSSPropertyWebkitMarqueeRepetition, ApplyPropertyMarqueeRepetition::createHandler());
2440 setPropertyHandler(CSSPropertyWebkitMarqueeSpeed, ApplyPropertyMarqueeSpeed::createHandler());
2441 setPropertyHandler(CSSPropertyWebkitMarqueeStyle, ApplyPropertyDefault<EMarqueeBehavior, &RenderStyle::marqueeBehavior, EMarqueeBehavior, &RenderStyle::setMarqueeBehavior, EMarqueeBehavior, &RenderStyle::initialMarqueeBehavior>::createHandler());
2442 setPropertyHandler(CSSPropertyWebkitMaskBoxImage, ApplyPropertyBorderImage<BorderMask, CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage>::createHandler());
2443 setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<BorderMask, Outset>::createHandler());
2444 setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<BorderMask, Repeat>::createHandler());
2445 setPropertyHandler(CSSPropertyWebkitMaskBoxImageSlice, ApplyPropertyBorderImageModifier<BorderMask, Slice>::createHandler());
2446 setPropertyHandler(CSSPropertyWebkitMaskBoxImageSource, ApplyPropertyBorderImageSource<CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource, &RenderStyle::initialMaskBoxImageSource>::createHandler());
2447 setPropertyHandler(CSSPropertyWebkitMaskBoxImageWidth, ApplyPropertyBorderImageModifier<BorderMask, Width>::createHandler());
2448 setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
2449 setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
2450 setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
2451 setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
2452 setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
2453 setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
2454 setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
2455 setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
2456 setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
2457 setPropertyHandler(CSSPropertyWebkitMaskSourceType, ApplyPropertyFillLayer<EMaskSourceType, CSSPropertyWebkitMaskSourceType, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isMaskSourceTypeSet, &FillLayer::maskSourceType, &FillLayer::setMaskSourceType, &FillLayer::clearMaskSourceType, &FillLayer::initialMaskSourceType, &CSSToStyleMap::mapFillMaskSourceType>::createHandler());
2458 setPropertyHandler(CSSPropertyWebkitNbspMode, ApplyPropertyDefault<ENBSPMode, &RenderStyle::nbspMode, ENBSPMode, &RenderStyle::setNBSPMode, ENBSPMode, &RenderStyle::initialNBSPMode>::createHandler());
2459 setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
2460 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, ApplyPropertyLength<&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX>::createHandler());
2461 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginY, ApplyPropertyLength<&RenderStyle::perspectiveOriginY, &RenderStyle::setPerspectiveOriginY, &RenderStyle::initialPerspectiveOriginY>::createHandler());
2462 setPropertyHandler(CSSPropertyWebkitPrintColorAdjust, ApplyPropertyDefault<PrintColorAdjust, &RenderStyle::printColorAdjust, PrintColorAdjust, &RenderStyle::setPrintColorAdjust, PrintColorAdjust, &RenderStyle::initialPrintColorAdjust>::createHandler());
2463 #if ENABLE(CSS_REGIONS)
2464 setPropertyHandler(CSSPropertyWebkitRegionBreakAfter, ApplyPropertyDefault<EPageBreak, &RenderStyle::regionBreakAfter, EPageBreak, &RenderStyle::setRegionBreakAfter, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2465 setPropertyHandler(CSSPropertyWebkitRegionBreakBefore, ApplyPropertyDefault<EPageBreak, &RenderStyle::regionBreakBefore, EPageBreak, &RenderStyle::setRegionBreakBefore, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2466 setPropertyHandler(CSSPropertyWebkitRegionBreakInside, ApplyPropertyDefault<EPageBreak, &RenderStyle::regionBreakInside, EPageBreak, &RenderStyle::setRegionBreakInside, EPageBreak, &RenderStyle::initialPageBreak>::createHandler());
2467 setPropertyHandler(CSSPropertyWebkitRegionFragment, ApplyPropertyDefault<RegionFragment, &RenderStyle::regionFragment, RegionFragment, &RenderStyle::setRegionFragment, RegionFragment, &RenderStyle::initialRegionFragment>::createHandler());
2469 setPropertyHandler(CSSPropertyWebkitRtlOrdering, ApplyPropertyDefault<Order, &RenderStyle::rtlOrdering, Order, &RenderStyle::setRTLOrdering, Order, &RenderStyle::initialRTLOrdering>::createHandler());
2470 setPropertyHandler(CSSPropertyWebkitRubyPosition, ApplyPropertyDefault<RubyPosition, &RenderStyle::rubyPosition, RubyPosition, &RenderStyle::setRubyPosition, RubyPosition, &RenderStyle::initialRubyPosition>::createHandler());
2471 setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler());
2472 setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
2473 setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler());
2474 setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
2475 setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
2476 setPropertyHandler(CSSPropertyWebkitTextSecurity, ApplyPropertyDefault<ETextSecurity, &RenderStyle::textSecurity, ETextSecurity, &RenderStyle::setTextSecurity, ETextSecurity, &RenderStyle::initialTextSecurity>::createHandler());
2477 setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
2478 setPropertyHandler(CSSPropertyWebkitTransformOriginX, ApplyPropertyLength<&RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX, &RenderStyle::initialTransformOriginX>::createHandler());
2479 setPropertyHandler(CSSPropertyWebkitTransformOriginY, ApplyPropertyLength<&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY>::createHandler());
2480 setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler());
2481 setPropertyHandler(CSSPropertyWebkitTransformStyle, ApplyPropertyDefault<ETransformStyle3D, &RenderStyle::transformStyle3D, ETransformStyle3D, &RenderStyle::setTransformStyle3D, ETransformStyle3D, &RenderStyle::initialTransformStyle3D>::createHandler());
2482 setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2483 setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2484 setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<CSSPropertyID, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSToStyleMap::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2485 setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
2486 setPropertyHandler(CSSPropertyWebkitUserDrag, ApplyPropertyDefault<EUserDrag, &RenderStyle::userDrag, EUserDrag, &RenderStyle::setUserDrag, EUserDrag, &RenderStyle::initialUserDrag>::createHandler());
2487 setPropertyHandler(CSSPropertyWebkitUserModify, ApplyPropertyDefault<EUserModify, &RenderStyle::userModify, EUserModify, &RenderStyle::setUserModify, EUserModify, &RenderStyle::initialUserModify>::createHandler());
2488 setPropertyHandler(CSSPropertyWebkitUserSelect, ApplyPropertyDefault<EUserSelect, &RenderStyle::userSelect, EUserSelect, &RenderStyle::setUserSelect, EUserSelect, &RenderStyle::initialUserSelect>::createHandler());
2489 setPropertyHandler(CSSPropertyWebkitClipPath, ApplyPropertyClipPath<&RenderStyle::clipPath, &RenderStyle::setClipPath, &RenderStyle::initialClipPath>::createHandler());
2491 #if ENABLE(CSS_EXCLUSIONS)
2492 setPropertyHandler(CSSPropertyWebkitWrapFlow, ApplyPropertyDefault<WrapFlow, &RenderStyle::wrapFlow, WrapFlow, &RenderStyle::setWrapFlow, WrapFlow, &RenderStyle::initialWrapFlow>::createHandler());
2493 setPropertyHandler(CSSPropertyWebkitWrapThrough, ApplyPropertyDefault<WrapThrough, &RenderStyle::wrapThrough, WrapThrough, &RenderStyle::setWrapThrough, WrapThrough, &RenderStyle::initialWrapThrough>::createHandler());
2495 #if ENABLE(CSS_SHAPES)
2496 setPropertyHandler(CSSPropertyWebkitShapeMargin, ApplyPropertyLength<&RenderStyle::shapeMargin, &RenderStyle::setShapeMargin, &RenderStyle::initialShapeMargin>::createHandler());
2497 setPropertyHandler(CSSPropertyWebkitShapePadding, ApplyPropertyLength<&RenderStyle::shapePadding, &RenderStyle::setShapePadding, &RenderStyle::initialShapePadding>::createHandler());
2498 setPropertyHandler(CSSPropertyWebkitShapeImageThreshold, ApplyPropertyDefault<float, &RenderStyle::shapeImageThreshold, float, &RenderStyle::setShapeImageThreshold, float, &RenderStyle::initialShapeImageThreshold>::createHandler());
2499 setPropertyHandler(CSSPropertyWebkitShapeInside, ApplyPropertyShape<&RenderStyle::shapeInside, &RenderStyle::setShapeInside, &RenderStyle::initialShapeInside>::createHandler());
2500 setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyShape<&RenderStyle::shapeOutside, &RenderStyle::setShapeOutside, &RenderStyle::initialShapeOutside>::createHandler());
2502 setPropertyHandler(CSSPropertyWhiteSpace, ApplyPropertyDefault<EWhiteSpace, &RenderStyle::whiteSpace, EWhiteSpace, &RenderStyle::setWhiteSpace, EWhiteSpace, &RenderStyle::initialWhiteSpace>::createHandler());
2503 setPropertyHandler(CSSPropertyWidows, ApplyPropertyAuto<short, &RenderStyle::widows, &RenderStyle::setWidows, &RenderStyle::hasAutoWidows, &RenderStyle::setHasAutoWidows>::createHandler());
2504 setPropertyHandler(CSSPropertyWidth, ApplyPropertyLength<&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize, AutoEnabled, LegacyIntrinsicEnabled, IntrinsicEnabled, NoneDisabled, UndefinedDisabled>::createHandler());
2505 setPropertyHandler(CSSPropertyWordBreak, ApplyPropertyDefault<EWordBreak, &RenderStyle::wordBreak, EWordBreak, &RenderStyle::setWordBreak, EWordBreak, &RenderStyle::initialWordBreak>::createHandler());
2506 setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<int, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
2507 // UAs must treat 'word-wrap' as an alternate name for the 'overflow-wrap' property. So using the same handlers.
2508 setPropertyHandler(CSSPropertyWordWrap, ApplyPropertyDefault<EOverflowWrap, &RenderStyle::overflowWrap, EOverflowWrap, &RenderStyle::setOverflowWrap, EOverflowWrap, &RenderStyle::initialOverflowWrap>::createHandler());
2509 setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
2510 setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler());