2 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #include "CSSStyleApplyProperty.h"
28 #include "CSSAspectRatioValue.h"
29 #include "CSSCursorImageValue.h"
30 #include "CSSFlexValue.h"
31 #include "CSSPrimitiveValueMappings.h"
32 #include "CSSStyleSelector.h"
33 #include "CSSValueList.h"
34 #include "CursorList.h"
38 #include "RenderObject.h"
39 #include "RenderStyle.h"
41 #include <wtf/StdLibExtras.h>
42 #include <wtf/UnusedParam.h>
48 enum ExpandValueBehavior {SuppressValue = 0, ExpandValue};
49 template <ExpandValueBehavior expandValue, CSSPropertyID one = CSSPropertyInvalid, CSSPropertyID two = CSSPropertyInvalid, CSSPropertyID three = CSSPropertyInvalid, CSSPropertyID four = CSSPropertyInvalid>
50 class ApplyPropertyExpanding {
53 template <CSSPropertyID id>
54 static inline void applyInheritValue(CSSStyleSelector* selector)
56 if (id == CSSPropertyInvalid)
59 const CSSStyleApplyProperty& table = CSSStyleApplyProperty::sharedCSSStyleApplyProperty();
60 const PropertyHandler& handler = table.propertyHandler(id);
61 if (handler.isValid())
62 handler.applyInheritValue(selector);
65 static void applyInheritValue(CSSStyleSelector* selector)
67 applyInheritValue<one>(selector);
68 applyInheritValue<two>(selector);
69 applyInheritValue<three>(selector);
70 applyInheritValue<four>(selector);
73 template <CSSPropertyID id>
74 static inline void applyInitialValue(CSSStyleSelector* selector)
76 if (id == CSSPropertyInvalid)
79 const CSSStyleApplyProperty& table = CSSStyleApplyProperty::sharedCSSStyleApplyProperty();
80 const PropertyHandler& handler = table.propertyHandler(id);
81 if (handler.isValid())
82 handler.applyInitialValue(selector);
85 static void applyInitialValue(CSSStyleSelector* selector)
87 applyInitialValue<one>(selector);
88 applyInitialValue<two>(selector);
89 applyInitialValue<three>(selector);
90 applyInitialValue<four>(selector);
93 template <CSSPropertyID id>
94 static inline void applyValue(CSSStyleSelector* selector, CSSValue* value)
96 if (id == CSSPropertyInvalid)
99 const CSSStyleApplyProperty& table = CSSStyleApplyProperty::sharedCSSStyleApplyProperty();
100 const PropertyHandler& handler = table.propertyHandler(id);
101 if (handler.isValid())
102 handler.applyValue(selector, value);
105 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
110 applyValue<one>(selector, value);
111 applyValue<two>(selector, value);
112 applyValue<three>(selector, value);
113 applyValue<four>(selector, value);
115 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
118 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()>
119 class ApplyPropertyDefaultBase {
121 static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); }
122 static GetterType value(RenderStyle* style) { return (style->*getterFunction)(); }
123 static InitialType initial() { return (*initialFunction)(); }
124 static void applyInheritValue(CSSStyleSelector* selector) { setValue(selector->style(), value(selector->parentStyle())); }
125 static void applyInitialValue(CSSStyleSelector* selector) { setValue(selector->style(), initial()); }
126 static void applyValue(CSSStyleSelector*, CSSValue*) { }
127 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
130 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()>
131 class ApplyPropertyDefault {
133 static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); }
134 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
136 if (value->isPrimitiveValue())
137 setValue(selector->style(), *static_cast<CSSPrimitiveValue*>(value));
139 static PropertyHandler createHandler()
141 PropertyHandler handler = ApplyPropertyDefaultBase<GetterType, getterFunction, SetterType, setterFunction, InitialType, initialFunction>::createHandler();
142 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
146 template <typename NumberType, NumberType (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(NumberType), NumberType (*initialFunction)(), int idMapsToMinusOne = CSSValueAuto>
147 class ApplyPropertyNumber {
149 static void setValue(RenderStyle* style, NumberType value) { (style->*setterFunction)(value); }
150 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
152 if (!value->isPrimitiveValue())
155 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
156 if (primitiveValue->getIdent() == idMapsToMinusOne)
157 setValue(selector->style(), -1);
159 setValue(selector->style(), primitiveValue->getValue<NumberType>(CSSPrimitiveValue::CSS_NUMBER));
161 static PropertyHandler createHandler()
163 PropertyHandler handler = ApplyPropertyDefaultBase<NumberType, getterFunction, NumberType, setterFunction, NumberType, initialFunction>::createHandler();
164 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
168 template <StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)(), CSSPropertyID property>
169 class ApplyPropertyStyleImage {
171 static void applyValue(CSSStyleSelector* selector, CSSValue* value) { (selector->style()->*setterFunction)(selector->styleImage(property, value)); }
172 static PropertyHandler createHandler()
174 PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
175 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
179 enum AutoValueType {Number = 0, ComputeLength};
180 template <typename T, T (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(T), bool (RenderStyle::*hasAutoFunction)() const, void (RenderStyle::*setAutoFunction)(), AutoValueType valueType = Number, int autoIdentity = CSSValueAuto>
181 class ApplyPropertyAuto {
183 static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
184 static T value(RenderStyle* style) { return (style->*getterFunction)(); }
185 static bool hasAuto(RenderStyle* style) { return (style->*hasAutoFunction)(); }
186 static void setAuto(RenderStyle* style) { (style->*setAutoFunction)(); }
188 static void applyInheritValue(CSSStyleSelector* selector)
190 if (hasAuto(selector->parentStyle()))
191 setAuto(selector->style());
193 setValue(selector->style(), value(selector->parentStyle()));
196 static void applyInitialValue(CSSStyleSelector* selector) { setAuto(selector->style()); }
198 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
200 if (!value->isPrimitiveValue())
203 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
204 if (primitiveValue->getIdent() == autoIdentity)
205 setAuto(selector->style());
206 else if (valueType == Number)
207 setValue(selector->style(), *primitiveValue);
208 else if (valueType == ComputeLength)
209 setValue(selector->style(), primitiveValue->computeLength<T>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()));
212 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
215 enum ColorInherit {NoInheritFromParent = 0, InheritFromParent};
216 Color defaultInitialColor();
217 Color defaultInitialColor() { return Color(); }
218 template <ColorInherit inheritColorFromParent,
219 const Color& (RenderStyle::*getterFunction)() const,
220 void (RenderStyle::*setterFunction)(const Color&),
221 void (RenderStyle::*visitedLinkSetterFunction)(const Color&),
222 const Color& (RenderStyle::*defaultFunction)() const,
223 Color (*initialFunction)() = &defaultInitialColor>
224 class ApplyPropertyColor {
226 static void applyInheritValue(CSSStyleSelector* selector)
228 // Visited link style can never explicitly inherit from parent visited link style so no separate getters are needed.
229 const Color& color = (selector->parentStyle()->*getterFunction)();
230 applyColorValue(selector, color.isValid() ? color : (selector->parentStyle()->*defaultFunction)());
233 static void applyInitialValue(CSSStyleSelector* selector)
235 applyColorValue(selector, initialFunction());
238 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
240 if (!value->isPrimitiveValue())
243 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
244 if (inheritColorFromParent && primitiveValue->getIdent() == CSSValueCurrentcolor)
245 applyInheritValue(selector);
247 if (selector->applyPropertyToRegularStyle())
248 (selector->style()->*setterFunction)(selector->colorFromPrimitiveValue(primitiveValue));
249 if (selector->applyPropertyToVisitedLinkStyle())
250 (selector->style()->*visitedLinkSetterFunction)(selector->colorFromPrimitiveValue(primitiveValue, /* forVisitedLink */ true));
254 static void applyColorValue(CSSStyleSelector* selector, const Color& color)
256 if (selector->applyPropertyToRegularStyle())
257 (selector->style()->*setterFunction)(color);
258 if (selector->applyPropertyToVisitedLinkStyle())
259 (selector->style()->*visitedLinkSetterFunction)(color);
262 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
265 template <TextDirection (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(TextDirection), TextDirection (*initialFunction)()>
266 class ApplyPropertyDirection {
268 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
270 ApplyPropertyDefault<TextDirection, getterFunction, TextDirection, setterFunction, TextDirection, initialFunction>::applyValue(selector, value);
271 Element* element = selector->element();
272 if (element && selector->element() == element->document()->documentElement())
273 element->document()->setDirectionSetOnDocumentElement(true);
276 static PropertyHandler createHandler()
278 PropertyHandler handler = ApplyPropertyDefault<TextDirection, getterFunction, TextDirection, setterFunction, TextDirection, initialFunction>::createHandler();
279 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
283 enum LengthAuto { AutoDisabled = 0, AutoEnabled };
284 enum LengthIntrinsic { IntrinsicDisabled = 0, IntrinsicEnabled };
285 enum LengthMinIntrinsic { MinIntrinsicDisabled = 0, MinIntrinsicEnabled };
286 enum LengthNone { NoneDisabled = 0, NoneEnabled };
287 enum LengthUndefined { UndefinedDisabled = 0, UndefinedEnabled };
288 enum LengthFlexDirection { FlexDirectionDisabled = 0, FlexWidth, FlexHeight };
289 template <Length (RenderStyle::*getterFunction)() const,
290 void (RenderStyle::*setterFunction)(Length),
291 Length (*initialFunction)(),
292 LengthAuto autoEnabled = AutoDisabled,
293 LengthIntrinsic intrinsicEnabled = IntrinsicDisabled,
294 LengthMinIntrinsic minIntrinsicEnabled = MinIntrinsicDisabled,
295 LengthNone noneEnabled = NoneDisabled,
296 LengthUndefined noneUndefined = UndefinedDisabled,
297 LengthFlexDirection flexDirection = FlexDirectionDisabled>
298 class ApplyPropertyLength {
300 static void setValue(RenderStyle* style, Length value) { (style->*setterFunction)(value); }
301 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
303 if (!value->isPrimitiveValue()) {
304 if (!flexDirection || !value->isFlexValue())
307 CSSFlexValue* flexValue = static_cast<CSSFlexValue*>(value);
308 value = flexValue->preferredSize();
310 if (flexDirection == FlexWidth) {
311 selector->style()->setFlexboxWidthPositiveFlex(flexValue->positiveFlex());
312 selector->style()->setFlexboxWidthNegativeFlex(flexValue->negativeFlex());
313 } else if (flexDirection == FlexHeight) {
314 selector->style()->setFlexboxHeightPositiveFlex(flexValue->positiveFlex());
315 selector->style()->setFlexboxHeightNegativeFlex(flexValue->negativeFlex());
319 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
320 if (noneEnabled && primitiveValue->getIdent() == CSSValueNone)
322 setValue(selector->style(), Length(Undefined));
324 setValue(selector->style(), Length());
325 else if (intrinsicEnabled && primitiveValue->getIdent() == CSSValueIntrinsic)
326 setValue(selector->style(), Length(Intrinsic));
327 else if (minIntrinsicEnabled && primitiveValue->getIdent() == CSSValueMinIntrinsic)
328 setValue(selector->style(), Length(MinIntrinsic));
329 else if (autoEnabled && primitiveValue->getIdent() == CSSValueAuto)
330 setValue(selector->style(), Length());
332 int type = primitiveValue->primitiveType();
333 if (CSSPrimitiveValue::isUnitTypeLength(type)) {
334 Length length = primitiveValue->computeLength<Length>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());
335 length.setQuirk(primitiveValue->isQuirkValue());
336 setValue(selector->style(), length);
337 } else if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
338 setValue(selector->style(), Length(primitiveValue->getDoubleValue(), Percent));
342 static PropertyHandler createHandler()
344 PropertyHandler handler = ApplyPropertyDefaultBase<Length, getterFunction, Length, setterFunction, Length, initialFunction>::createHandler();
345 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
349 enum StringIdentBehavior { NothingMapsToNull = 0, MapNoneToNull, MapAutoToNull };
350 template <StringIdentBehavior identBehavior, const AtomicString& (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(const AtomicString&), const AtomicString& (*initialFunction)()>
351 class ApplyPropertyString {
353 static void setValue(RenderStyle* style, const AtomicString& value) { (style->*setterFunction)(value); }
354 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
356 if (!value->isPrimitiveValue())
358 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
359 if ((identBehavior == MapNoneToNull && primitiveValue->getIdent() == CSSValueNone)
360 || (identBehavior == MapAutoToNull && primitiveValue->getIdent() == CSSValueAuto))
361 setValue(selector->style(), nullAtom);
363 setValue(selector->style(), primitiveValue->getStringValue());
365 static PropertyHandler createHandler()
367 PropertyHandler handler = ApplyPropertyDefaultBase<const AtomicString&, getterFunction, const AtomicString&, setterFunction, const AtomicString&, initialFunction>::createHandler();
368 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
372 template <LengthSize (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(LengthSize), LengthSize (*initialFunction)()>
373 class ApplyPropertyBorderRadius {
375 static void setValue(RenderStyle* style, LengthSize value) { (style->*setterFunction)(value); }
376 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
378 if (!value->isPrimitiveValue())
381 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
382 Pair* pair = primitiveValue->getPairValue();
383 if (!pair || !pair->first() || !pair->second())
388 if (pair->first()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE)
389 radiusWidth = Length(pair->first()->getDoubleValue(), Percent);
391 radiusWidth = Length(max(intMinForLength, min(intMaxForLength, pair->first()->computeLength<int>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()))), Fixed);
392 if (pair->second()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE)
393 radiusHeight = Length(pair->second()->getDoubleValue(), Percent);
395 radiusHeight = Length(max(intMinForLength, min(intMaxForLength, pair->second()->computeLength<int>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()))), Fixed);
396 int width = radiusWidth.value();
397 int height = radiusHeight.value();
398 if (width < 0 || height < 0)
401 radiusHeight = radiusWidth; // Null out the other value.
403 radiusWidth = radiusHeight; // Null out the other value.
405 LengthSize size(radiusWidth, radiusHeight);
406 setValue(selector->style(), size);
408 static PropertyHandler createHandler()
410 PropertyHandler handler = ApplyPropertyDefaultBase<LengthSize, getterFunction, LengthSize, setterFunction, LengthSize, initialFunction>::createHandler();
411 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
415 template <typename T>
416 struct FillLayerAccessorTypes {
422 struct FillLayerAccessorTypes<StyleImage*> {
423 typedef PassRefPtr<StyleImage> Setter;
424 typedef StyleImage* Getter;
427 template <typename T,
428 CSSPropertyID propertyId,
429 EFillLayerType fillLayerType,
430 FillLayer* (RenderStyle::*accessLayersFunction)(),
431 const FillLayer* (RenderStyle::*layersFunction)() const,
432 bool (FillLayer::*testFunction)() const,
433 typename FillLayerAccessorTypes<T>::Getter (FillLayer::*getFunction)() const,
434 void (FillLayer::*setFunction)(typename FillLayerAccessorTypes<T>::Setter),
435 void (FillLayer::*clearFunction)(),
436 typename FillLayerAccessorTypes<T>::Getter (*initialFunction)(EFillLayerType),
437 void (CSSStyleSelector::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)>
438 class ApplyPropertyFillLayer {
440 static void applyInheritValue(CSSStyleSelector* selector)
442 FillLayer* currChild = (selector->style()->*accessLayersFunction)();
443 FillLayer* prevChild = 0;
444 const FillLayer* currParent = (selector->parentStyle()->*layersFunction)();
445 while (currParent && (currParent->*testFunction)()) {
447 /* Need to make a new layer.*/
448 currChild = new FillLayer(fillLayerType);
449 prevChild->setNext(currChild);
451 (currChild->*setFunction)((currParent->*getFunction)());
452 prevChild = currChild;
453 currChild = prevChild->next();
454 currParent = currParent->next();
458 /* Reset any remaining layers to not have the property set. */
459 (currChild->*clearFunction)();
460 currChild = currChild->next();
464 static void applyInitialValue(CSSStyleSelector* selector)
466 FillLayer* currChild = (selector->style()->*accessLayersFunction)();
467 (currChild->*setFunction)((*initialFunction)(fillLayerType));
468 for (currChild = currChild->next(); currChild; currChild = currChild->next())
469 (currChild->*clearFunction)();
472 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
474 FillLayer* currChild = (selector->style()->*accessLayersFunction)();
475 FillLayer* prevChild = 0;
476 if (value->isValueList()) {
477 /* Walk each value and put it into a layer, creating new layers as needed. */
478 CSSValueList* valueList = static_cast<CSSValueList*>(value);
479 for (unsigned int i = 0; i < valueList->length(); i++) {
481 /* Need to make a new layer to hold this value */
482 currChild = new FillLayer(fillLayerType);
483 prevChild->setNext(currChild);
485 (selector->*mapFillFunction)(propertyId, currChild, valueList->itemWithoutBoundsCheck(i));
486 prevChild = currChild;
487 currChild = currChild->next();
490 (selector->*mapFillFunction)(propertyId, currChild, value);
491 currChild = currChild->next();
494 /* Reset all remaining layers to not have the property set. */
495 (currChild->*clearFunction)();
496 currChild = currChild->next();
500 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
503 enum ComputeLengthNormal {NormalDisabled = 0, NormalEnabled};
504 enum ComputeLengthThickness {ThicknessDisabled = 0, ThicknessEnabled};
505 enum ComputeLengthSVGZoom {SVGZoomDisabled = 0, SVGZoomEnabled};
506 template <typename T,
507 T (RenderStyle::*getterFunction)() const,
508 void (RenderStyle::*setterFunction)(T),
509 T (*initialFunction)(),
510 ComputeLengthNormal normalEnabled = NormalDisabled,
511 ComputeLengthThickness thicknessEnabled = ThicknessDisabled,
512 ComputeLengthSVGZoom svgZoomEnabled = SVGZoomDisabled>
513 class ApplyPropertyComputeLength {
515 static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
516 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
518 // note: CSSPropertyLetter/WordSpacing right now sets to zero if it's not a primitive value for some reason...
519 if (!value->isPrimitiveValue())
522 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
524 int ident = primitiveValue->getIdent();
526 if (normalEnabled && ident == CSSValueNormal) {
528 } else if (thicknessEnabled && ident == CSSValueThin) {
530 } else if (thicknessEnabled && ident == CSSValueMedium) {
532 } else if (thicknessEnabled && ident == CSSValueThick) {
534 } else if (ident == CSSValueInvalid) {
535 float zoom = (svgZoomEnabled && selector->useSVGZoomRules()) ? 1.0f : selector->style()->effectiveZoom();
536 length = primitiveValue->computeLength<T>(selector->style(), selector->rootElementStyle(), zoom);
538 ASSERT_NOT_REACHED();
542 setValue(selector->style(), length);
544 static PropertyHandler createHandler()
546 PropertyHandler handler = ApplyPropertyDefaultBase<T, getterFunction, T, setterFunction, T, initialFunction>::createHandler();
547 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
551 template <typename T, T (FontDescription::*getterFunction)() const, void (FontDescription::*setterFunction)(T), T initialValue>
552 class ApplyPropertyFont {
554 static void applyInheritValue(CSSStyleSelector* selector)
556 FontDescription fontDescription = selector->fontDescription();
557 (fontDescription.*setterFunction)((selector->parentFontDescription().*getterFunction)());
558 selector->setFontDescription(fontDescription);
561 static void applyInitialValue(CSSStyleSelector* selector)
563 FontDescription fontDescription = selector->fontDescription();
564 (fontDescription.*setterFunction)(initialValue);
565 selector->setFontDescription(fontDescription);
568 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
570 if (!value->isPrimitiveValue())
572 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
573 FontDescription fontDescription = selector->fontDescription();
574 (fontDescription.*setterFunction)(*primitiveValue);
575 selector->setFontDescription(fontDescription);
578 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
581 class ApplyPropertyFontSize {
583 // When the CSS keyword "larger" is used, this function will attempt to match within the keyword
584 // table, and failing that, will simply multiply by 1.2.
585 static float largerFontSize(float size)
587 // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale up to
588 // the next size level.
592 // Like the previous function, but for the keyword "smaller".
593 static float smallerFontSize(float size)
595 // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale down to
596 // the next size level.
600 static void applyInheritValue(CSSStyleSelector* selector)
602 float size = selector->parentStyle()->fontDescription().specifiedSize();
607 FontDescription fontDescription = selector->style()->fontDescription();
608 fontDescription.setKeywordSize(selector->parentStyle()->fontDescription().keywordSize());
609 selector->setFontSize(fontDescription, size);
610 selector->setFontDescription(fontDescription);
614 static void applyInitialValue(CSSStyleSelector* selector)
616 FontDescription fontDescription = selector->style()->fontDescription();
617 float size = selector->fontSizeForKeyword(selector->document(), CSSValueMedium, fontDescription.useFixedDefaultSize());
622 fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
623 selector->setFontSize(fontDescription, size);
624 selector->setFontDescription(fontDescription);
628 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
630 if (!value->isPrimitiveValue())
633 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
635 FontDescription fontDescription = selector->style()->fontDescription();
636 fontDescription.setKeywordSize(0);
637 float parentSize = 0;
638 bool parentIsAbsoluteSize = false;
641 if (selector->hasParentNode()) {
642 parentSize = selector->parentStyle()->fontDescription().specifiedSize();
643 parentIsAbsoluteSize = selector->parentStyle()->fontDescription().isAbsoluteSize();
646 if (int ident = primitiveValue->getIdent()) {
647 // Keywords are being used.
649 case CSSValueXxSmall:
655 case CSSValueXxLarge:
656 case CSSValueWebkitXxxLarge:
657 size = selector->fontSizeForKeyword(selector->document(), ident, fontDescription.useFixedDefaultSize());
658 fontDescription.setKeywordSize(ident - CSSValueXxSmall + 1);
661 size = largerFontSize(parentSize);
663 case CSSValueSmaller:
664 size = smallerFontSize(parentSize);
670 fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize && (ident == CSSValueLarger || ident == CSSValueSmaller));
672 int type = primitiveValue->primitiveType();
673 fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize
674 || (type != CSSPrimitiveValue::CSS_PERCENTAGE
675 && type != CSSPrimitiveValue::CSS_EMS
676 && type != CSSPrimitiveValue::CSS_EXS
677 && type != CSSPrimitiveValue::CSS_REMS));
678 if (primitiveValue->isLength())
679 size = primitiveValue->computeLength<float>(selector->parentStyle(), selector->rootElementStyle(), 1.0, true);
680 else if (primitiveValue->isPercentage())
681 size = (primitiveValue->getFloatValue() * parentSize) / 100.0f;
689 selector->setFontSize(fontDescription, size);
690 selector->setFontDescription(fontDescription);
694 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
697 class ApplyPropertyFontWeight {
699 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
701 if (!value->isPrimitiveValue())
703 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
704 FontDescription fontDescription = selector->fontDescription();
705 switch (primitiveValue->getIdent()) {
706 case CSSValueInvalid:
707 ASSERT_NOT_REACHED();
710 fontDescription.setWeight(fontDescription.bolderWeight());
712 case CSSValueLighter:
713 fontDescription.setWeight(fontDescription.lighterWeight());
716 fontDescription.setWeight(*primitiveValue);
718 selector->setFontDescription(fontDescription);
720 static PropertyHandler createHandler()
722 PropertyHandler handler = ApplyPropertyFont<FontWeight, &FontDescription::weight, &FontDescription::setWeight, FontWeightNormal>::createHandler();
723 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
727 enum BorderImageType { Image = 0, Mask };
728 template <BorderImageType borderImageType,
729 CSSPropertyID property,
730 const NinePieceImage& (RenderStyle::*getterFunction)() const,
731 void (RenderStyle::*setterFunction)(const NinePieceImage&)>
732 class ApplyPropertyBorderImage {
734 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
736 NinePieceImage image;
737 if (borderImageType == Mask)
738 image.setMaskDefaults();
739 selector->mapNinePieceImage(property, value, image);
740 (selector->style()->*setterFunction)(image);
743 static PropertyHandler createHandler()
745 PropertyHandler handler = ApplyPropertyDefaultBase<const NinePieceImage&, getterFunction, const NinePieceImage&, setterFunction, NinePieceImage, &RenderStyle::initialNinePieceImage>::createHandler();
746 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
750 enum BorderImageModifierType { Outset, Repeat, Slice, Width };
751 template <BorderImageType type, BorderImageModifierType modifier>
752 class ApplyPropertyBorderImageModifier {
754 static inline const NinePieceImage& getValue(RenderStyle* style) { return type == Image ? style->borderImage() : style->maskBoxImage(); }
755 static inline void setValue(RenderStyle* style, const NinePieceImage& value) { return type == Image ? style->setBorderImage(value) : style->setMaskBoxImage(value); }
757 static void applyInheritValue(CSSStyleSelector* selector)
759 NinePieceImage image(getValue(selector->style()));
762 image.copyOutsetFrom(getValue(selector->parentStyle()));
765 image.copyRepeatFrom(getValue(selector->parentStyle()));
768 image.copyImageSlicesFrom(getValue(selector->parentStyle()));
771 image.copyBorderSlicesFrom(getValue(selector->parentStyle()));
774 setValue(selector->style(), image);
777 static void applyInitialValue(CSSStyleSelector* selector)
779 NinePieceImage image(getValue(selector->style()));
782 image.setOutset(LengthBox());
785 image.setHorizontalRule(StretchImageRule);
786 image.setVerticalRule(StretchImageRule);
789 // Masks have a different initial value for slices. Preserve the value of 0 for backwards compatibility.
790 image.setImageSlices(type == Image ? LengthBox(Length(100, Percent), Length(100, Percent), Length(100, Percent), Length(100, Percent)) : LengthBox());
791 image.setFill(false);
794 // Masks have a different initial value for widths. They use an 'auto' value rather than trying to fit to the border.
795 image.setBorderSlices(type == Image ? LengthBox(Length(1, Relative), Length(1, Relative), Length(1, Relative), Length(1, Relative)) : LengthBox());
798 setValue(selector->style(), image);
801 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
803 NinePieceImage image(getValue(selector->style()));
806 image.setOutset(selector->mapNinePieceImageQuad(value));
809 selector->mapNinePieceImageRepeat(value, image);
812 selector->mapNinePieceImageSlice(value, image);
815 image.setBorderSlices(selector->mapNinePieceImageQuad(value));
818 setValue(selector->style(), image);
821 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
824 template <CSSPropertyID id, StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)()>
825 class ApplyPropertyBorderImageSource {
827 static void applyValue(CSSStyleSelector* selector, CSSValue* value) { (selector->style()->*setterFunction)(selector->styleImage(id, value)); }
828 static PropertyHandler createHandler()
830 PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
831 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
835 enum CounterBehavior {Increment = 0, Reset};
836 template <CounterBehavior counterBehavior>
837 class ApplyPropertyCounter {
839 static void emptyFunction(CSSStyleSelector*) { }
840 static void applyInheritValue(CSSStyleSelector* selector)
842 CounterDirectiveMap& map = selector->style()->accessCounterDirectives();
843 CounterDirectiveMap& parentMap = selector->parentStyle()->accessCounterDirectives();
845 typedef CounterDirectiveMap::iterator Iterator;
846 Iterator end = parentMap.end();
847 for (Iterator it = parentMap.begin(); it != end; ++it) {
848 CounterDirectives& directives = map.add(it->first, CounterDirectives()).first->second;
849 if (counterBehavior == Reset) {
850 directives.m_reset = it->second.m_reset;
851 directives.m_resetValue = it->second.m_resetValue;
853 // Inheriting a counter-increment means taking the parent's current value for the counter
854 // and adding it to itself.
855 directives.m_increment = it->second.m_increment;
856 directives.m_incrementValue = 0;
857 if (directives.m_increment) {
858 float incrementValue = directives.m_incrementValue;
859 directives.m_incrementValue = clampToInteger(incrementValue + it->second.m_incrementValue);
861 directives.m_increment = true;
862 directives.m_incrementValue = it->second.m_incrementValue;
867 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
869 if (!value->isValueList())
872 CSSValueList* list = static_cast<CSSValueList*>(value);
874 CounterDirectiveMap& map = selector->style()->accessCounterDirectives();
875 typedef CounterDirectiveMap::iterator Iterator;
877 Iterator end = map.end();
878 for (Iterator it = map.begin(); it != end; ++it)
879 if (counterBehavior == Reset)
880 it->second.m_reset = false;
882 it->second.m_increment = false;
884 int length = list ? list->length() : 0;
885 for (int i = 0; i < length; ++i) {
886 CSSValue* currValue = list->itemWithoutBoundsCheck(i);
887 if (!currValue->isPrimitiveValue())
890 Pair* pair = static_cast<CSSPrimitiveValue*>(currValue)->getPairValue();
891 if (!pair || !pair->first() || !pair->second())
894 AtomicString identifier = static_cast<CSSPrimitiveValue*>(pair->first())->getStringValue();
895 int value = static_cast<CSSPrimitiveValue*>(pair->second())->getIntValue();
896 CounterDirectives& directives = map.add(identifier.impl(), CounterDirectives()).first->second;
897 if (counterBehavior == Reset) {
898 directives.m_reset = true;
899 directives.m_resetValue = value;
901 if (directives.m_increment) {
902 float incrementValue = directives.m_incrementValue;
903 directives.m_incrementValue = clampToInteger(incrementValue + value);
905 directives.m_increment = true;
906 directives.m_incrementValue = value;
912 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &emptyFunction, &applyValue); }
916 class ApplyPropertyCursor {
918 static void applyInheritValue(CSSStyleSelector* selector)
920 selector->style()->setCursor(selector->parentStyle()->cursor());
921 selector->style()->setCursorList(selector->parentStyle()->cursors());
924 static void applyInitialValue(CSSStyleSelector* selector)
926 selector->style()->clearCursorList();
927 selector->style()->setCursor(RenderStyle::initialCursor());
930 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
932 selector->style()->clearCursorList();
933 if (value->isValueList()) {
934 CSSValueList* list = static_cast<CSSValueList*>(value);
935 int len = list->length();
936 selector->style()->setCursor(CURSOR_AUTO);
937 for (int i = 0; i < len; i++) {
938 CSSValue* item = list->itemWithoutBoundsCheck(i);
939 if (!item->isPrimitiveValue())
941 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
942 int type = primitiveValue->primitiveType();
943 if (type == CSSPrimitiveValue::CSS_URI) {
944 if (primitiveValue->isCursorImageValue()) {
945 CSSCursorImageValue* image = static_cast<CSSCursorImageValue*>(primitiveValue);
946 if (image->updateIfSVGCursorIsUsed(selector->element())) // Elements with SVG cursors are not allowed to share style.
947 selector->style()->setUnique();
948 selector->style()->addCursor(selector->cachedOrPendingFromValue(CSSPropertyCursor, image), image->hotSpot());
950 } else if (type == CSSPrimitiveValue::CSS_IDENT)
951 selector->style()->setCursor(*primitiveValue);
953 } else if (value->isPrimitiveValue()) {
954 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
955 int type = primitiveValue->primitiveType();
956 if (type == CSSPrimitiveValue::CSS_IDENT && selector->style()->cursor() != ECursor(*primitiveValue))
957 selector->style()->setCursor(*primitiveValue);
961 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
964 class ApplyPropertyTextAlign {
966 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
968 if (!value->isPrimitiveValue())
971 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
973 if (primitiveValue->getIdent() != CSSValueWebkitMatchParent)
974 selector->style()->setTextAlign(*primitiveValue);
975 else if (selector->parentStyle()->textAlign() == TASTART)
976 selector->style()->setTextAlign(selector->parentStyle()->isLeftToRightDirection() ? LEFT : RIGHT);
977 else if (selector->parentStyle()->textAlign() == TAEND)
978 selector->style()->setTextAlign(selector->parentStyle()->isLeftToRightDirection() ? RIGHT : LEFT);
980 selector->style()->setTextAlign(selector->parentStyle()->textAlign());
982 static PropertyHandler createHandler()
984 PropertyHandler handler = ApplyPropertyDefaultBase<ETextAlign, &RenderStyle::textAlign, ETextAlign, &RenderStyle::setTextAlign, ETextAlign, &RenderStyle::initialTextAlign>::createHandler();
985 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
989 class ApplyPropertyTextDecoration {
991 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
993 ETextDecoration t = RenderStyle::initialTextDecoration();
994 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
995 CSSValue* item = i.value();
996 ASSERT(item->isPrimitiveValue());
997 t |= *static_cast<CSSPrimitiveValue*>(item);
999 selector->style()->setTextDecoration(t);
1001 static PropertyHandler createHandler()
1003 PropertyHandler handler = ApplyPropertyDefaultBase<ETextDecoration, &RenderStyle::textDecoration, ETextDecoration, &RenderStyle::setTextDecoration, ETextDecoration, &RenderStyle::initialTextDecoration>::createHandler();
1004 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1008 class ApplyPropertyLineHeight {
1010 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1012 if (!value->isPrimitiveValue())
1015 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1018 if (primitiveValue->getIdent() == CSSValueNormal)
1019 lineHeight = Length(-100.0, Percent);
1020 else if (primitiveValue->isLength()) {
1021 double multiplier = selector->style()->effectiveZoom();
1022 if (selector->style()->textSizeAdjust()) {
1023 if (Frame* frame = selector->document()->frame())
1024 multiplier *= frame->textZoomFactor();
1026 lineHeight = primitiveValue->computeLength<Length>(selector->style(), selector->rootElementStyle(), multiplier);
1027 } else if (primitiveValue->isPercentage()) {
1028 // FIXME: percentage should not be restricted to an integer here.
1029 lineHeight = Length((selector->style()->fontSize() * primitiveValue->getIntValue()) / 100, Fixed);
1030 } else if (primitiveValue->isNumber()) {
1031 // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
1032 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
1035 selector->style()->setLineHeight(lineHeight);
1037 static PropertyHandler createHandler()
1039 PropertyHandler handler = ApplyPropertyDefaultBase<Length, &RenderStyle::lineHeight, Length, &RenderStyle::setLineHeight, Length, &RenderStyle::initialLineHeight>::createHandler();
1040 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1044 class ApplyPropertyPageSize {
1046 static Length mmLength(double mm) { return CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM)->computeLength<Length>(0, 0); }
1047 static Length inchLength(double inch) { return CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN)->computeLength<Length>(0, 0); }
1048 static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
1050 static const Length a5Width = mmLength(148), a5Height = mmLength(210);
1051 static const Length a4Width = mmLength(210), a4Height = mmLength(297);
1052 static const Length a3Width = mmLength(297), a3Height = mmLength(420);
1053 static const Length b5Width = mmLength(176), b5Height = mmLength(250);
1054 static const Length b4Width = mmLength(250), b4Height = mmLength(353);
1055 static const Length letterWidth = inchLength(8.5), letterHeight = inchLength(11);
1056 static const Length legalWidth = inchLength(8.5), legalHeight = inchLength(14);
1057 static const Length ledgerWidth = inchLength(11), ledgerHeight = inchLength(17);
1062 switch (pageSizeName->getIdent()) {
1083 case CSSValueLetter:
1084 width = letterWidth;
1085 height = letterHeight;
1089 height = legalHeight;
1091 case CSSValueLedger:
1092 width = ledgerWidth;
1093 height = ledgerHeight;
1099 if (pageOrientation) {
1100 switch (pageOrientation->getIdent()) {
1101 case CSSValueLandscape:
1102 std::swap(width, height);
1104 case CSSValuePortrait:
1114 static void applyInheritValue(CSSStyleSelector*) { }
1115 static void applyInitialValue(CSSStyleSelector*) { }
1116 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1118 selector->style()->resetPageSizeType();
1121 PageSizeType pageSizeType = PAGE_SIZE_AUTO;
1122 CSSValueListInspector inspector(value);
1123 switch (inspector.length()) {
1125 // <length>{2} | <page-size> <orientation>
1126 if (!inspector.first()->isPrimitiveValue() || !inspector.second()->isPrimitiveValue())
1128 CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(inspector.first());
1129 CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(inspector.second());
1130 if (first->isLength()) {
1132 if (!second->isLength())
1134 width = first->computeLength<Length>(selector->style(), selector->rootElementStyle());
1135 height = second->computeLength<Length>(selector->style(), selector->rootElementStyle());
1137 // <page-size> <orientation>
1138 // The value order is guaranteed. See CSSParser::parseSizeParameter.
1139 if (!getPageSizeFromName(first, second, width, height))
1142 pageSizeType = PAGE_SIZE_RESOLVED;
1146 // <length> | auto | <page-size> | [ portrait | landscape]
1147 if (!inspector.first()->isPrimitiveValue())
1149 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(inspector.first());
1150 if (primitiveValue->isLength()) {
1152 pageSizeType = PAGE_SIZE_RESOLVED;
1153 width = height = primitiveValue->computeLength<Length>(selector->style(), selector->rootElementStyle());
1155 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_IDENT)
1157 switch (primitiveValue->getIdent()) {
1159 pageSizeType = PAGE_SIZE_AUTO;
1161 case CSSValuePortrait:
1162 pageSizeType = PAGE_SIZE_AUTO_PORTRAIT;
1164 case CSSValueLandscape:
1165 pageSizeType = PAGE_SIZE_AUTO_LANDSCAPE;
1169 pageSizeType = PAGE_SIZE_RESOLVED;
1170 if (!getPageSizeFromName(primitiveValue, 0, width, height))
1179 selector->style()->setPageSizeType(pageSizeType);
1180 selector->style()->setPageSize(LengthSize(width, height));
1182 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1185 class ApplyPropertyTextEmphasisStyle {
1187 static void applyInheritValue(CSSStyleSelector* selector)
1189 selector->style()->setTextEmphasisFill(selector->parentStyle()->textEmphasisFill());
1190 selector->style()->setTextEmphasisMark(selector->parentStyle()->textEmphasisMark());
1191 selector->style()->setTextEmphasisCustomMark(selector->parentStyle()->textEmphasisCustomMark());
1194 static void applyInitialValue(CSSStyleSelector* selector)
1196 selector->style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill());
1197 selector->style()->setTextEmphasisMark(RenderStyle::initialTextEmphasisMark());
1198 selector->style()->setTextEmphasisCustomMark(RenderStyle::initialTextEmphasisCustomMark());
1201 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1203 if (value->isValueList()) {
1204 CSSValueList* list = static_cast<CSSValueList*>(value);
1205 ASSERT(list->length() == 2);
1206 if (list->length() != 2)
1208 for (unsigned i = 0; i < 2; ++i) {
1209 CSSValue* item = list->itemWithoutBoundsCheck(i);
1210 if (!item->isPrimitiveValue())
1213 CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(item);
1214 if (value->getIdent() == CSSValueFilled || value->getIdent() == CSSValueOpen)
1215 selector->style()->setTextEmphasisFill(*value);
1217 selector->style()->setTextEmphasisMark(*value);
1219 selector->style()->setTextEmphasisCustomMark(nullAtom);
1223 if (!value->isPrimitiveValue())
1225 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1227 if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_STRING) {
1228 selector->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1229 selector->style()->setTextEmphasisMark(TextEmphasisMarkCustom);
1230 selector->style()->setTextEmphasisCustomMark(primitiveValue->getStringValue());
1234 selector->style()->setTextEmphasisCustomMark(nullAtom);
1236 if (primitiveValue->getIdent() == CSSValueFilled || primitiveValue->getIdent() == CSSValueOpen) {
1237 selector->style()->setTextEmphasisFill(*primitiveValue);
1238 selector->style()->setTextEmphasisMark(TextEmphasisMarkAuto);
1240 selector->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1241 selector->style()->setTextEmphasisMark(*primitiveValue);
1245 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1248 template <typename T,
1249 T (Animation::*getterFunction)() const,
1250 void (Animation::*setterFunction)(T),
1251 bool (Animation::*testFunction)() const,
1252 void (Animation::*clearFunction)(),
1253 T (*initialFunction)(),
1254 void (CSSStyleSelector::*mapFunction)(Animation*, CSSValue*),
1255 AnimationList* (RenderStyle::*animationGetterFunction)(),
1256 const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
1257 class ApplyPropertyAnimation {
1259 static void setValue(Animation* animation, T value) { (animation->*setterFunction)(value); }
1260 static T value(const Animation* animation) { return (animation->*getterFunction)(); }
1261 static bool test(const Animation* animation) { return (animation->*testFunction)(); }
1262 static void clear(Animation* animation) { (animation->*clearFunction)(); }
1263 static T initial() { return (*initialFunction)(); }
1264 static void map(CSSStyleSelector* selector, Animation* animation, CSSValue* value) { (selector->*mapFunction)(animation, value); }
1265 static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
1266 static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
1268 static void applyInheritValue(CSSStyleSelector* selector)
1270 AnimationList* list = accessAnimations(selector->style());
1271 const AnimationList* parentList = animations(selector->parentStyle());
1272 size_t i = 0, parentSize = parentList ? parentList->size() : 0;
1273 for ( ; i < parentSize && test(parentList->animation(i)); ++i) {
1274 if (list->size() <= i)
1275 list->append(Animation::create());
1276 setValue(list->animation(i), value(parentList->animation(i)));
1279 /* Reset any remaining animations to not have the property set. */
1280 for ( ; i < list->size(); ++i)
1281 clear(list->animation(i));
1284 static void applyInitialValue(CSSStyleSelector* selector)
1286 AnimationList* list = accessAnimations(selector->style());
1287 if (list->isEmpty())
1288 list->append(Animation::create());
1289 setValue(list->animation(0), initial());
1290 for (size_t i = 1; i < list->size(); ++i)
1291 clear(list->animation(i));
1294 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1296 AnimationList* list = accessAnimations(selector->style());
1297 size_t childIndex = 0;
1298 if (value->isValueList()) {
1299 /* Walk each value and put it into an animation, creating new animations as needed. */
1300 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
1301 if (childIndex <= list->size())
1302 list->append(Animation::create());
1303 map(selector, list->animation(childIndex), i.value());
1307 if (list->isEmpty())
1308 list->append(Animation::create());
1309 map(selector, list->animation(childIndex), value);
1312 for ( ; childIndex < list->size(); ++childIndex) {
1313 /* Reset all remaining animations to not have the property set. */
1314 clear(list->animation(childIndex));
1318 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1321 class ApplyPropertyOutlineStyle {
1323 static void applyInheritValue(CSSStyleSelector* selector)
1325 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInheritValue(selector);
1326 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInheritValue(selector);
1329 static void applyInitialValue(CSSStyleSelector* selector)
1331 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInitialValue(selector);
1332 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInitialValue(selector);
1335 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1337 ApplyPropertyDefault<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyValue(selector, value);
1338 ApplyPropertyDefault<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyValue(selector, value);
1341 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1344 class ApplyPropertyResize {
1346 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1348 if (!value->isPrimitiveValue())
1351 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1353 EResize r = RESIZE_NONE;
1354 switch (primitiveValue->getIdent()) {
1358 if (Settings* settings = selector->document()->settings())
1359 r = settings->textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE;
1362 r = *primitiveValue;
1364 selector->style()->setResize(r);
1367 static PropertyHandler createHandler()
1369 PropertyHandler handler = ApplyPropertyDefaultBase<EResize, &RenderStyle::resize, EResize, &RenderStyle::setResize, EResize, &RenderStyle::initialResize>::createHandler();
1370 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1374 class ApplyPropertyVerticalAlign {
1376 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1378 if (!value->isPrimitiveValue())
1381 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1383 if (primitiveValue->getIdent())
1384 return selector->style()->setVerticalAlign(*primitiveValue);
1387 if (primitiveValue->isLength())
1388 length = primitiveValue->computeLength<Length>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());
1389 else if (primitiveValue->isPercentage())
1390 length = Length(primitiveValue->getDoubleValue(), Percent);
1392 selector->style()->setVerticalAlignLength(length);
1395 static PropertyHandler createHandler()
1397 PropertyHandler handler = ApplyPropertyDefaultBase<EVerticalAlign, &RenderStyle::verticalAlign, EVerticalAlign, &RenderStyle::setVerticalAlign, EVerticalAlign, &RenderStyle::initialVerticalAlign>::createHandler();
1398 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1402 class ApplyPropertyAspectRatio {
1404 static void applyInheritValue(CSSStyleSelector* selector)
1406 if (!selector->parentStyle()->hasAspectRatio())
1408 selector->style()->setHasAspectRatio(true);
1409 selector->style()->setAspectRatioDenominator(selector->parentStyle()->aspectRatioDenominator());
1410 selector->style()->setAspectRatioNumerator(selector->parentStyle()->aspectRatioNumerator());
1413 static void applyInitialValue(CSSStyleSelector* selector)
1415 selector->style()->setHasAspectRatio(RenderStyle::initialHasAspectRatio());
1416 selector->style()->setAspectRatioDenominator(RenderStyle::initialAspectRatioDenominator());
1417 selector->style()->setAspectRatioNumerator(RenderStyle::initialAspectRatioNumerator());
1420 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1422 if (!value->isAspectRatioValue()) {
1423 selector->style()->setHasAspectRatio(false);
1426 CSSAspectRatioValue* aspectRatioValue = static_cast<CSSAspectRatioValue*>(value);
1427 selector->style()->setHasAspectRatio(true);
1428 selector->style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue());
1429 selector->style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue());
1432 static PropertyHandler createHandler()
1434 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1438 class ApplyPropertyZoom {
1440 static void resetEffectiveZoom(CSSStyleSelector* selector)
1442 // Reset the zoom in effect. This allows the setZoom method to accurately compute a new zoom in effect.
1443 selector->setEffectiveZoom(selector->parentStyle() ? selector->parentStyle()->effectiveZoom() : RenderStyle::initialZoom());
1447 static void applyInheritValue(CSSStyleSelector* selector)
1449 resetEffectiveZoom(selector);
1450 selector->setZoom(selector->parentStyle()->zoom());
1453 static void applyInitialValue(CSSStyleSelector* selector)
1455 resetEffectiveZoom(selector);
1456 selector->setZoom(RenderStyle::initialZoom());
1459 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1461 ASSERT(value->isPrimitiveValue());
1462 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1464 if (primitiveValue->getIdent() == CSSValueNormal) {
1465 resetEffectiveZoom(selector);
1466 selector->setZoom(RenderStyle::initialZoom());
1467 } else if (primitiveValue->getIdent() == CSSValueReset) {
1468 selector->setEffectiveZoom(RenderStyle::initialZoom());
1469 selector->setZoom(RenderStyle::initialZoom());
1470 } else if (primitiveValue->getIdent() == CSSValueDocument) {
1471 float docZoom = selector->document()->renderer()->style()->zoom();
1472 selector->setEffectiveZoom(docZoom);
1473 selector->setZoom(docZoom);
1474 } else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) {
1475 resetEffectiveZoom(selector);
1476 if (float percent = primitiveValue->getFloatValue())
1477 selector->setZoom(percent / 100.0f);
1478 } else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_NUMBER) {
1479 resetEffectiveZoom(selector);
1480 if (float number = primitiveValue->getFloatValue())
1481 selector->setZoom(number);
1485 static PropertyHandler createHandler()
1487 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1491 class ApplyPropertyDisplay {
1493 static inline bool isValidDisplayValue(CSSStyleSelector* selector, EDisplay displayPropertyValue)
1496 if (selector->element() && selector->element()->isSVGElement() && selector->style()->styleType() == NOPSEUDO)
1497 return (displayPropertyValue == INLINE || displayPropertyValue == BLOCK || displayPropertyValue == NONE);
1502 static void applyInheritValue(CSSStyleSelector* selector)
1504 EDisplay display = selector->parentStyle()->display();
1505 if (!isValidDisplayValue(selector, display))
1507 selector->style()->setDisplay(display);
1510 static void applyInitialValue(CSSStyleSelector* selector)
1512 selector->style()->setDisplay(RenderStyle::initialDisplay());
1515 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1517 if (!value->isPrimitiveValue())
1520 EDisplay display = *static_cast<CSSPrimitiveValue*>(value);
1522 if (!isValidDisplayValue(selector, display))
1525 selector->style()->setDisplay(display);
1528 static PropertyHandler createHandler()
1530 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1534 const CSSStyleApplyProperty& CSSStyleApplyProperty::sharedCSSStyleApplyProperty()
1536 DEFINE_STATIC_LOCAL(CSSStyleApplyProperty, cssStyleApplyPropertyInstance, ());
1537 return cssStyleApplyPropertyInstance;
1540 CSSStyleApplyProperty::CSSStyleApplyProperty()
1542 for (int i = 0; i < numCSSProperties; ++i)
1543 m_propertyMap[i] = PropertyHandler();
1545 setPropertyHandler(CSSPropertyWebkitAspectRatio, ApplyPropertyAspectRatio::createHandler());
1547 setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler());
1548 setPropertyHandler(CSSPropertyDirection, ApplyPropertyDirection<&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection>::createHandler());
1550 setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1551 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment>::createHandler());
1552 setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1553 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip>::createHandler());
1554 setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
1555 setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1556 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite>::createHandler());
1558 setPropertyHandler(CSSPropertyDisplay, ApplyPropertyDisplay::createHandler());
1560 setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1561 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage>::createHandler());
1563 setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1564 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin>::createHandler());
1565 setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
1567 setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1568 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition>::createHandler());
1569 setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1570 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition>::createHandler());
1571 setPropertyHandler(CSSPropertyBackgroundPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundPositionX, CSSPropertyBackgroundPositionY>::createHandler());
1573 setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1574 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX>::createHandler());
1575 setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1576 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY>::createHandler());
1577 setPropertyHandler(CSSPropertyBackgroundRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
1579 setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1580 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize>::createHandler());
1581 setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
1583 setPropertyHandler(CSSPropertyWebkitMaskAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyWebkitMaskAttachment, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1584 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment>::createHandler());
1585 setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1586 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip>::createHandler());
1587 setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1588 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite>::createHandler());
1590 setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1591 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage>::createHandler());
1593 setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1594 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin>::createHandler());
1595 setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1596 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize>::createHandler());
1598 setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1599 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition>::createHandler());
1600 setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1601 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition>::createHandler());
1602 setPropertyHandler(CSSPropertyWebkitMaskPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMaskPositionX, CSSPropertyWebkitMaskPositionY>::createHandler());
1604 setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1605 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX>::createHandler());
1606 setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1607 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY>::createHandler());
1608 setPropertyHandler(CSSPropertyWebkitMaskRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
1610 setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler());
1611 setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
1612 setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
1613 setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
1614 setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler());
1616 setPropertyHandler(CSSPropertyBorderTopStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderTopStyle, EBorderStyle, &RenderStyle::setBorderTopStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1617 setPropertyHandler(CSSPropertyBorderRightStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderRightStyle, EBorderStyle, &RenderStyle::setBorderRightStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1618 setPropertyHandler(CSSPropertyBorderBottomStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderBottomStyle, EBorderStyle, &RenderStyle::setBorderBottomStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1619 setPropertyHandler(CSSPropertyBorderLeftStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderLeftStyle, EBorderStyle, &RenderStyle::setBorderLeftStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1621 setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1622 setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1623 setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1624 setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1625 setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1626 setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1628 setPropertyHandler(CSSPropertyBorderTop, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderTopStyle, CSSPropertyBorderTopWidth>::createHandler());
1629 setPropertyHandler(CSSPropertyBorderRight, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderRightColor, CSSPropertyBorderRightStyle, CSSPropertyBorderRightWidth>::createHandler());
1630 setPropertyHandler(CSSPropertyBorderBottom, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderBottomColor, CSSPropertyBorderBottomStyle, CSSPropertyBorderBottomWidth>::createHandler());
1631 setPropertyHandler(CSSPropertyBorderLeft, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderLeftColor, CSSPropertyBorderLeftStyle, CSSPropertyBorderLeftWidth>::createHandler());
1633 setPropertyHandler(CSSPropertyBorderStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle>::createHandler());
1634 setPropertyHandler(CSSPropertyBorderWidth, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopWidth, CSSPropertyBorderRightWidth, CSSPropertyBorderBottomWidth, CSSPropertyBorderLeftWidth>::createHandler());
1635 setPropertyHandler(CSSPropertyBorderColor, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderRightColor, CSSPropertyBorderBottomColor, CSSPropertyBorderLeftColor>::createHandler());
1636 setPropertyHandler(CSSPropertyBorder, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderStyle, CSSPropertyBorderWidth, CSSPropertyBorderColor>::createHandler());
1638 setPropertyHandler(CSSPropertyBorderImage, ApplyPropertyBorderImage<Image, CSSPropertyBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
1639 setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage<Image, CSSPropertyWebkitBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
1640 setPropertyHandler(CSSPropertyWebkitMaskBoxImage, ApplyPropertyBorderImage<Mask, CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage>::createHandler());
1642 setPropertyHandler(CSSPropertyBorderImageOutset, ApplyPropertyBorderImageModifier<Image, Outset>::createHandler());
1643 setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<Mask, Outset>::createHandler());
1644 setPropertyHandler(CSSPropertyBorderImageRepeat, ApplyPropertyBorderImageModifier<Image, Repeat>::createHandler());
1645 setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<Mask, Repeat>::createHandler());
1646 setPropertyHandler(CSSPropertyBorderImageSlice, ApplyPropertyBorderImageModifier<Image, Slice>::createHandler());
1647 setPropertyHandler(CSSPropertyWebkitMaskBoxImageSlice, ApplyPropertyBorderImageModifier<Mask, Slice>::createHandler());
1648 setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier<Image, Width>::createHandler());
1649 setPropertyHandler(CSSPropertyWebkitMaskBoxImageWidth, ApplyPropertyBorderImageModifier<Mask, Width>::createHandler());
1651 setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource<CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource, &RenderStyle::initialBorderImageSource>::createHandler());
1652 setPropertyHandler(CSSPropertyWebkitMaskBoxImageSource, ApplyPropertyBorderImageSource<CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource, &RenderStyle::initialMaskBoxImageSource>::createHandler());
1654 setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
1655 setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
1656 setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
1657 setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
1658 setPropertyHandler(CSSPropertyBorderRadius, ApplyPropertyExpanding<ExpandValue, CSSPropertyBorderTopLeftRadius, CSSPropertyBorderTopRightRadius, CSSPropertyBorderBottomLeftRadius, CSSPropertyBorderBottomRightRadius>::createHandler());
1659 setPropertyHandler(CSSPropertyWebkitBorderRadius, CSSPropertyBorderRadius);
1661 setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler());
1662 setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing>::createHandler());
1663 setPropertyHandler(CSSPropertyBorderSpacing, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitBorderHorizontalSpacing, CSSPropertyWebkitBorderVerticalSpacing>::createHandler());
1665 setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength<int, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
1666 setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<int, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
1668 setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler());
1670 setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::createHandler());
1671 setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler());
1673 setPropertyHandler(CSSPropertyWebkitFlexOrder, ApplyPropertyDefault<int, &RenderStyle::flexOrder, int, &RenderStyle::setFlexOrder, int, &RenderStyle::initialFlexOrder>::createHandler());
1674 setPropertyHandler(CSSPropertyWebkitFlexPack, ApplyPropertyDefault<EFlexPack, &RenderStyle::flexPack, EFlexPack, &RenderStyle::setFlexPack, EFlexPack, &RenderStyle::initialFlexPack>::createHandler());
1675 setPropertyHandler(CSSPropertyWebkitFlexItemAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexItemAlign, EFlexAlign, &RenderStyle::setFlexItemAlign, EFlexAlign, &RenderStyle::initialFlexItemAlign>::createHandler());
1676 setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler());
1677 setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler());
1678 setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap>::createHandler());
1680 setPropertyHandler(CSSPropertyFontSize, ApplyPropertyFontSize::createHandler());
1681 setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
1682 setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
1683 setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
1684 setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
1685 setPropertyHandler(CSSPropertyWebkitTextOrientation, ApplyPropertyFont<TextOrientation, &FontDescription::textOrientation, &FontDescription::setTextOrientation, TextOrientationVerticalRight>::createHandler());
1686 setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
1688 setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
1689 setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
1691 setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
1692 setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
1693 setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength<int, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset>::createHandler());
1695 setPropertyHandler(CSSPropertyOutline, ApplyPropertyExpanding<SuppressValue, CSSPropertyOutlineWidth, CSSPropertyOutlineColor, CSSPropertyOutlineStyle>::createHandler());
1697 setPropertyHandler(CSSPropertyOverflowX, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowX, EOverflow, &RenderStyle::setOverflowX, EOverflow, &RenderStyle::initialOverflowX>::createHandler());
1698 setPropertyHandler(CSSPropertyOverflowY, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowY, EOverflow, &RenderStyle::setOverflowY, EOverflow, &RenderStyle::initialOverflowY>::createHandler());
1699 setPropertyHandler(CSSPropertyOverflow, ApplyPropertyExpanding<ExpandValue, CSSPropertyOverflowX, CSSPropertyOverflowY>::createHandler());
1701 setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
1702 setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
1703 setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
1704 setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
1706 setPropertyHandler(CSSPropertyTop, ApplyPropertyLength<&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1707 setPropertyHandler(CSSPropertyRight, ApplyPropertyLength<&RenderStyle::right, &RenderStyle::setRight, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1708 setPropertyHandler(CSSPropertyBottom, ApplyPropertyLength<&RenderStyle::bottom, &RenderStyle::setBottom, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1709 setPropertyHandler(CSSPropertyLeft, ApplyPropertyLength<&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1711 setPropertyHandler(CSSPropertyWidth, ApplyPropertyLength<&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexWidth>::createHandler());
1712 setPropertyHandler(CSSPropertyHeight, ApplyPropertyLength<&RenderStyle::height, &RenderStyle::setHeight, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexHeight>::createHandler());
1714 setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
1716 setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeight::createHandler());
1718 setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
1719 setPropertyHandler(CSSPropertyListStylePosition, ApplyPropertyDefault<EListStylePosition, &RenderStyle::listStylePosition, EListStylePosition, &RenderStyle::setListStylePosition, EListStylePosition, &RenderStyle::initialListStylePosition>::createHandler());
1720 setPropertyHandler(CSSPropertyListStyleType, ApplyPropertyDefault<EListStyleType, &RenderStyle::listStyleType, EListStyleType, &RenderStyle::setListStyleType, EListStyleType, &RenderStyle::initialListStyleType>::createHandler());
1721 setPropertyHandler(CSSPropertyListStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyListStyleType, CSSPropertyListStyleImage, CSSPropertyListStylePosition>::createHandler());
1723 setPropertyHandler(CSSPropertyMaxHeight, ApplyPropertyLength<&RenderStyle::maxHeight, &RenderStyle::setMaxHeight, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
1724 setPropertyHandler(CSSPropertyMaxWidth, ApplyPropertyLength<&RenderStyle::maxWidth, &RenderStyle::setMaxWidth, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
1725 setPropertyHandler(CSSPropertyMinHeight, ApplyPropertyLength<&RenderStyle::minHeight, &RenderStyle::setMinHeight, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler());
1726 setPropertyHandler(CSSPropertyMinWidth, ApplyPropertyLength<&RenderStyle::minWidth, &RenderStyle::setMinWidth, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler());
1728 setPropertyHandler(CSSPropertyMarginTop, ApplyPropertyLength<&RenderStyle::marginTop, &RenderStyle::setMarginTop, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1729 setPropertyHandler(CSSPropertyMarginRight, ApplyPropertyLength<&RenderStyle::marginRight, &RenderStyle::setMarginRight, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1730 setPropertyHandler(CSSPropertyMarginBottom, ApplyPropertyLength<&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1731 setPropertyHandler(CSSPropertyMarginLeft, ApplyPropertyLength<&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1732 setPropertyHandler(CSSPropertyMargin, ApplyPropertyExpanding<SuppressValue, CSSPropertyMarginTop, CSSPropertyMarginRight, CSSPropertyMarginBottom, CSSPropertyMarginLeft>::createHandler());
1734 setPropertyHandler(CSSPropertyWebkitMarginBeforeCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginBeforeCollapse, EMarginCollapse, &RenderStyle::setMarginBeforeCollapse, EMarginCollapse, &RenderStyle::initialMarginBeforeCollapse>::createHandler());
1735 setPropertyHandler(CSSPropertyWebkitMarginAfterCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginAfterCollapse, EMarginCollapse, &RenderStyle::setMarginAfterCollapse, EMarginCollapse, &RenderStyle::initialMarginAfterCollapse>::createHandler());
1736 setPropertyHandler(CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBeforeCollapse);
1737 setPropertyHandler(CSSPropertyWebkitMarginBottomCollapse, CSSPropertyWebkitMarginAfterCollapse);
1738 setPropertyHandler(CSSPropertyWebkitMarginCollapse, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse>::createHandler());
1740 setPropertyHandler(CSSPropertyPaddingTop, ApplyPropertyLength<&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding>::createHandler());
1741 setPropertyHandler(CSSPropertyPaddingRight, ApplyPropertyLength<&RenderStyle::paddingRight, &RenderStyle::setPaddingRight, &RenderStyle::initialPadding>::createHandler());
1742 setPropertyHandler(CSSPropertyPaddingBottom, ApplyPropertyLength<&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding>::createHandler());
1743 setPropertyHandler(CSSPropertyPaddingLeft, ApplyPropertyLength<&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding>::createHandler());
1744 setPropertyHandler(CSSPropertyPadding, ApplyPropertyExpanding<SuppressValue, CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft>::createHandler());
1746 setPropertyHandler(CSSPropertyResize, ApplyPropertyResize::createHandler());
1748 setPropertyHandler(CSSPropertyVerticalAlign, ApplyPropertyVerticalAlign::createHandler());
1750 setPropertyHandler(CSSPropertySize, ApplyPropertyPageSize::createHandler());
1752 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, ApplyPropertyLength<&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX>::createHandler());
1753 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginY, ApplyPropertyLength<&RenderStyle::perspectiveOriginY, &RenderStyle::setPerspectiveOriginY, &RenderStyle::initialPerspectiveOriginY>::createHandler());
1754 setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
1755 setPropertyHandler(CSSPropertyWebkitTransformOriginX, ApplyPropertyLength<&RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX, &RenderStyle::initialTransformOriginX>::createHandler());
1756 setPropertyHandler(CSSPropertyWebkitTransformOriginY, ApplyPropertyLength<&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY>::createHandler());
1757 setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler());
1758 setPropertyHandler(CSSPropertyWebkitTransformOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitTransformOriginX, CSSPropertyWebkitTransformOriginY, CSSPropertyWebkitTransformOriginZ>::createHandler());
1760 setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1761 setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSStyleSelector::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1762 setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1763 setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSStyleSelector::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1764 setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<int, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSStyleSelector::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1765 setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSStyleSelector::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1766 setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSStyleSelector::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1767 setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1769 setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1770 setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1771 setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<int, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSStyleSelector::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1772 setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1774 setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
1775 setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
1776 setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
1777 setPropertyHandler(CSSPropertyWebkitColumns, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitColumnWidth, CSSPropertyWebkitColumnCount>::createHandler());
1779 setPropertyHandler(CSSPropertyWebkitFlowInto, ApplyPropertyString<MapAutoToNull, &RenderStyle::flowThread, &RenderStyle::setFlowThread, &RenderStyle::initialFlowThread>::createHandler());
1780 setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString<MapNoneToNull, &RenderStyle::regionThread, &RenderStyle::setRegionThread, &RenderStyle::initialRegionThread>::createHandler());
1782 setPropertyHandler(CSSPropertyWebkitHighlight, ApplyPropertyString<MapNoneToNull, &RenderStyle::highlight, &RenderStyle::setHighlight, &RenderStyle::initialHighlight>::createHandler());
1783 setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());
1785 setPropertyHandler(CSSPropertyWebkitHyphenateLimitAfter, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitAfter, &RenderStyle::setHyphenationLimitAfter, &RenderStyle::initialHyphenationLimitAfter>::createHandler());
1786 setPropertyHandler(CSSPropertyWebkitHyphenateLimitBefore, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitBefore, &RenderStyle::setHyphenationLimitBefore, &RenderStyle::initialHyphenationLimitBefore>::createHandler());
1787 setPropertyHandler(CSSPropertyWebkitHyphenateLimitLines, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitLines, &RenderStyle::setHyphenationLimitLines, &RenderStyle::initialHyphenationLimitLines, CSSValueNoLimit>::createHandler());
1789 setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());
1790 setPropertyHandler(CSSPropertyWebkitLineGridSnap, ApplyPropertyDefault<LineGridSnap, &RenderStyle::lineGridSnap, LineGridSnap, &RenderStyle::setLineGridSnap, LineGridSnap, &RenderStyle::initialLineGridSnap>::createHandler());
1792 setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler());
1793 setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler());
1794 setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
1796 setPropertyHandler(CSSPropertyWebkitWrapMargin, ApplyPropertyLength<&RenderStyle::wrapMargin, &RenderStyle::setWrapMargin, &RenderStyle::initialWrapMargin>::createHandler());
1797 setPropertyHandler(CSSPropertyWebkitWrapPadding, ApplyPropertyLength<&RenderStyle::wrapPadding, &RenderStyle::setWrapPadding, &RenderStyle::initialWrapPadding>::createHandler());
1798 setPropertyHandler(CSSPropertyWebkitWrapFlow, ApplyPropertyDefault<WrapFlow, &RenderStyle::wrapFlow, WrapFlow, &RenderStyle::setWrapFlow, WrapFlow, &RenderStyle::initialWrapFlow>::createHandler());
1799 setPropertyHandler(CSSPropertyWebkitWrapThrough, ApplyPropertyDefault<WrapThrough, &RenderStyle::wrapThrough, WrapThrough, &RenderStyle::setWrapThrough, WrapThrough, &RenderStyle::initialWrapThrough>::createHandler());
1800 setPropertyHandler(CSSPropertyWebkitWrap, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitWrapFlow, CSSPropertyWebkitWrapMargin, CSSPropertyWebkitWrapPadding>::createHandler());
1802 setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
1803 setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler());