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 class ApplyPropertyFontVariantLigatures {
729 static void applyInheritValue(CSSStyleSelector* selector)
731 const FontDescription& parentFontDescription = selector->parentFontDescription();
732 FontDescription fontDescription = selector->fontDescription();
734 fontDescription.setCommonLigaturesState(parentFontDescription.commonLigaturesState());
735 fontDescription.setDiscretionaryLigaturesState(parentFontDescription.discretionaryLigaturesState());
736 fontDescription.setHistoricalLigaturesState(parentFontDescription.historicalLigaturesState());
738 selector->setFontDescription(fontDescription);
741 static void applyInitialValue(CSSStyleSelector* selector)
743 FontDescription fontDescription = selector->fontDescription();
745 fontDescription.setCommonLigaturesState(FontDescription::NormalLigaturesState);
746 fontDescription.setDiscretionaryLigaturesState(FontDescription::NormalLigaturesState);
747 fontDescription.setHistoricalLigaturesState(FontDescription::NormalLigaturesState);
749 selector->setFontDescription(fontDescription);
752 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
754 FontDescription::LigaturesState commonLigaturesState = FontDescription::NormalLigaturesState;
755 FontDescription::LigaturesState discretionaryLigaturesState = FontDescription::NormalLigaturesState;
756 FontDescription::LigaturesState historicalLigaturesState = FontDescription::NormalLigaturesState;
758 if (value->isValueList()) {
759 CSSValueList* valueList = static_cast<CSSValueList*>(value);
760 for (size_t i = 0; i < valueList->length(); ++i) {
761 CSSValue* item = valueList->itemWithoutBoundsCheck(i);
762 ASSERT(item->isPrimitiveValue());
763 if (item->isPrimitiveValue()) {
764 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
765 switch (primitiveValue->getIdent()) {
766 case CSSValueNoCommonLigatures:
767 commonLigaturesState = FontDescription::DisabledLigaturesState;
769 case CSSValueCommonLigatures:
770 commonLigaturesState = FontDescription::EnabledLigaturesState;
772 case CSSValueNoDiscretionaryLigatures:
773 discretionaryLigaturesState = FontDescription::DisabledLigaturesState;
775 case CSSValueDiscretionaryLigatures:
776 discretionaryLigaturesState = FontDescription::EnabledLigaturesState;
778 case CSSValueNoHistoricalLigatures:
779 historicalLigaturesState = FontDescription::DisabledLigaturesState;
781 case CSSValueHistoricalLigatures:
782 historicalLigaturesState = FontDescription::EnabledLigaturesState;
785 ASSERT_NOT_REACHED();
793 ASSERT(value->isPrimitiveValue());
794 ASSERT(static_cast<CSSPrimitiveValue*>(value)->getIdent() == CSSValueNormal);
798 FontDescription fontDescription = selector->fontDescription();
799 fontDescription.setCommonLigaturesState(commonLigaturesState);
800 fontDescription.setDiscretionaryLigaturesState(discretionaryLigaturesState);
801 fontDescription.setHistoricalLigaturesState(historicalLigaturesState);
802 selector->setFontDescription(fontDescription);
805 static PropertyHandler createHandler()
807 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
811 enum BorderImageType { Image = 0, Mask };
812 template <BorderImageType borderImageType,
813 CSSPropertyID property,
814 const NinePieceImage& (RenderStyle::*getterFunction)() const,
815 void (RenderStyle::*setterFunction)(const NinePieceImage&)>
816 class ApplyPropertyBorderImage {
818 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
820 NinePieceImage image;
821 if (borderImageType == Mask)
822 image.setMaskDefaults();
823 selector->mapNinePieceImage(property, value, image);
824 (selector->style()->*setterFunction)(image);
827 static PropertyHandler createHandler()
829 PropertyHandler handler = ApplyPropertyDefaultBase<const NinePieceImage&, getterFunction, const NinePieceImage&, setterFunction, NinePieceImage, &RenderStyle::initialNinePieceImage>::createHandler();
830 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
834 enum BorderImageModifierType { Outset, Repeat, Slice, Width };
835 template <BorderImageType type, BorderImageModifierType modifier>
836 class ApplyPropertyBorderImageModifier {
838 static inline const NinePieceImage& getValue(RenderStyle* style) { return type == Image ? style->borderImage() : style->maskBoxImage(); }
839 static inline void setValue(RenderStyle* style, const NinePieceImage& value) { return type == Image ? style->setBorderImage(value) : style->setMaskBoxImage(value); }
841 static void applyInheritValue(CSSStyleSelector* selector)
843 NinePieceImage image(getValue(selector->style()));
846 image.copyOutsetFrom(getValue(selector->parentStyle()));
849 image.copyRepeatFrom(getValue(selector->parentStyle()));
852 image.copyImageSlicesFrom(getValue(selector->parentStyle()));
855 image.copyBorderSlicesFrom(getValue(selector->parentStyle()));
858 setValue(selector->style(), image);
861 static void applyInitialValue(CSSStyleSelector* selector)
863 NinePieceImage image(getValue(selector->style()));
866 image.setOutset(LengthBox());
869 image.setHorizontalRule(StretchImageRule);
870 image.setVerticalRule(StretchImageRule);
873 // Masks have a different initial value for slices. Preserve the value of 0 for backwards compatibility.
874 image.setImageSlices(type == Image ? LengthBox(Length(100, Percent), Length(100, Percent), Length(100, Percent), Length(100, Percent)) : LengthBox());
875 image.setFill(false);
878 // Masks have a different initial value for widths. They use an 'auto' value rather than trying to fit to the border.
879 image.setBorderSlices(type == Image ? LengthBox(Length(1, Relative), Length(1, Relative), Length(1, Relative), Length(1, Relative)) : LengthBox());
882 setValue(selector->style(), image);
885 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
887 NinePieceImage image(getValue(selector->style()));
890 image.setOutset(selector->mapNinePieceImageQuad(value));
893 selector->mapNinePieceImageRepeat(value, image);
896 selector->mapNinePieceImageSlice(value, image);
899 image.setBorderSlices(selector->mapNinePieceImageQuad(value));
902 setValue(selector->style(), image);
905 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
908 template <CSSPropertyID id, StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)()>
909 class ApplyPropertyBorderImageSource {
911 static void applyValue(CSSStyleSelector* selector, CSSValue* value) { (selector->style()->*setterFunction)(selector->styleImage(id, value)); }
912 static PropertyHandler createHandler()
914 PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
915 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
919 enum CounterBehavior {Increment = 0, Reset};
920 template <CounterBehavior counterBehavior>
921 class ApplyPropertyCounter {
923 static void emptyFunction(CSSStyleSelector*) { }
924 static void applyInheritValue(CSSStyleSelector* selector)
926 CounterDirectiveMap& map = selector->style()->accessCounterDirectives();
927 CounterDirectiveMap& parentMap = selector->parentStyle()->accessCounterDirectives();
929 typedef CounterDirectiveMap::iterator Iterator;
930 Iterator end = parentMap.end();
931 for (Iterator it = parentMap.begin(); it != end; ++it) {
932 CounterDirectives& directives = map.add(it->first, CounterDirectives()).first->second;
933 if (counterBehavior == Reset) {
934 directives.m_reset = it->second.m_reset;
935 directives.m_resetValue = it->second.m_resetValue;
937 // Inheriting a counter-increment means taking the parent's current value for the counter
938 // and adding it to itself.
939 directives.m_increment = it->second.m_increment;
940 directives.m_incrementValue = 0;
941 if (directives.m_increment) {
942 float incrementValue = directives.m_incrementValue;
943 directives.m_incrementValue = clampToInteger(incrementValue + it->second.m_incrementValue);
945 directives.m_increment = true;
946 directives.m_incrementValue = it->second.m_incrementValue;
951 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
953 if (!value->isValueList())
956 CSSValueList* list = static_cast<CSSValueList*>(value);
958 CounterDirectiveMap& map = selector->style()->accessCounterDirectives();
959 typedef CounterDirectiveMap::iterator Iterator;
961 Iterator end = map.end();
962 for (Iterator it = map.begin(); it != end; ++it)
963 if (counterBehavior == Reset)
964 it->second.m_reset = false;
966 it->second.m_increment = false;
968 int length = list ? list->length() : 0;
969 for (int i = 0; i < length; ++i) {
970 CSSValue* currValue = list->itemWithoutBoundsCheck(i);
971 if (!currValue->isPrimitiveValue())
974 Pair* pair = static_cast<CSSPrimitiveValue*>(currValue)->getPairValue();
975 if (!pair || !pair->first() || !pair->second())
978 AtomicString identifier = static_cast<CSSPrimitiveValue*>(pair->first())->getStringValue();
979 int value = static_cast<CSSPrimitiveValue*>(pair->second())->getIntValue();
980 CounterDirectives& directives = map.add(identifier.impl(), CounterDirectives()).first->second;
981 if (counterBehavior == Reset) {
982 directives.m_reset = true;
983 directives.m_resetValue = value;
985 if (directives.m_increment) {
986 float incrementValue = directives.m_incrementValue;
987 directives.m_incrementValue = clampToInteger(incrementValue + value);
989 directives.m_increment = true;
990 directives.m_incrementValue = value;
996 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &emptyFunction, &applyValue); }
1000 class ApplyPropertyCursor {
1002 static void applyInheritValue(CSSStyleSelector* selector)
1004 selector->style()->setCursor(selector->parentStyle()->cursor());
1005 selector->style()->setCursorList(selector->parentStyle()->cursors());
1008 static void applyInitialValue(CSSStyleSelector* selector)
1010 selector->style()->clearCursorList();
1011 selector->style()->setCursor(RenderStyle::initialCursor());
1014 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1016 selector->style()->clearCursorList();
1017 if (value->isValueList()) {
1018 CSSValueList* list = static_cast<CSSValueList*>(value);
1019 int len = list->length();
1020 selector->style()->setCursor(CURSOR_AUTO);
1021 for (int i = 0; i < len; i++) {
1022 CSSValue* item = list->itemWithoutBoundsCheck(i);
1023 if (!item->isPrimitiveValue())
1025 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
1026 int type = primitiveValue->primitiveType();
1027 if (type == CSSPrimitiveValue::CSS_URI) {
1028 if (primitiveValue->isCursorImageValue()) {
1029 CSSCursorImageValue* image = static_cast<CSSCursorImageValue*>(primitiveValue);
1030 if (image->updateIfSVGCursorIsUsed(selector->element())) // Elements with SVG cursors are not allowed to share style.
1031 selector->style()->setUnique();
1032 selector->style()->addCursor(selector->cachedOrPendingFromValue(CSSPropertyCursor, image), image->hotSpot());
1034 } else if (type == CSSPrimitiveValue::CSS_IDENT)
1035 selector->style()->setCursor(*primitiveValue);
1037 } else if (value->isPrimitiveValue()) {
1038 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1039 int type = primitiveValue->primitiveType();
1040 if (type == CSSPrimitiveValue::CSS_IDENT && selector->style()->cursor() != ECursor(*primitiveValue))
1041 selector->style()->setCursor(*primitiveValue);
1045 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1048 class ApplyPropertyTextAlign {
1050 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1052 if (!value->isPrimitiveValue())
1055 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1057 if (primitiveValue->getIdent() != CSSValueWebkitMatchParent)
1058 selector->style()->setTextAlign(*primitiveValue);
1059 else if (selector->parentStyle()->textAlign() == TASTART)
1060 selector->style()->setTextAlign(selector->parentStyle()->isLeftToRightDirection() ? LEFT : RIGHT);
1061 else if (selector->parentStyle()->textAlign() == TAEND)
1062 selector->style()->setTextAlign(selector->parentStyle()->isLeftToRightDirection() ? RIGHT : LEFT);
1064 selector->style()->setTextAlign(selector->parentStyle()->textAlign());
1066 static PropertyHandler createHandler()
1068 PropertyHandler handler = ApplyPropertyDefaultBase<ETextAlign, &RenderStyle::textAlign, ETextAlign, &RenderStyle::setTextAlign, ETextAlign, &RenderStyle::initialTextAlign>::createHandler();
1069 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1073 class ApplyPropertyTextDecoration {
1075 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1077 ETextDecoration t = RenderStyle::initialTextDecoration();
1078 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
1079 CSSValue* item = i.value();
1080 ASSERT(item->isPrimitiveValue());
1081 t |= *static_cast<CSSPrimitiveValue*>(item);
1083 selector->style()->setTextDecoration(t);
1085 static PropertyHandler createHandler()
1087 PropertyHandler handler = ApplyPropertyDefaultBase<ETextDecoration, &RenderStyle::textDecoration, ETextDecoration, &RenderStyle::setTextDecoration, ETextDecoration, &RenderStyle::initialTextDecoration>::createHandler();
1088 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1092 class ApplyPropertyLineHeight {
1094 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1096 if (!value->isPrimitiveValue())
1099 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1102 if (primitiveValue->getIdent() == CSSValueNormal)
1103 lineHeight = Length(-100.0, Percent);
1104 else if (primitiveValue->isLength()) {
1105 double multiplier = selector->style()->effectiveZoom();
1106 if (selector->style()->textSizeAdjust()) {
1107 if (Frame* frame = selector->document()->frame())
1108 multiplier *= frame->textZoomFactor();
1110 lineHeight = primitiveValue->computeLength<Length>(selector->style(), selector->rootElementStyle(), multiplier);
1111 } else if (primitiveValue->isPercentage()) {
1112 // FIXME: percentage should not be restricted to an integer here.
1113 lineHeight = Length((selector->style()->fontSize() * primitiveValue->getIntValue()) / 100, Fixed);
1114 } else if (primitiveValue->isNumber()) {
1115 // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
1116 lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
1119 selector->style()->setLineHeight(lineHeight);
1121 static PropertyHandler createHandler()
1123 PropertyHandler handler = ApplyPropertyDefaultBase<Length, &RenderStyle::lineHeight, Length, &RenderStyle::setLineHeight, Length, &RenderStyle::initialLineHeight>::createHandler();
1124 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1128 class ApplyPropertyPageSize {
1130 static Length mmLength(double mm) { return CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM)->computeLength<Length>(0, 0); }
1131 static Length inchLength(double inch) { return CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN)->computeLength<Length>(0, 0); }
1132 static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
1134 static const Length a5Width = mmLength(148), a5Height = mmLength(210);
1135 static const Length a4Width = mmLength(210), a4Height = mmLength(297);
1136 static const Length a3Width = mmLength(297), a3Height = mmLength(420);
1137 static const Length b5Width = mmLength(176), b5Height = mmLength(250);
1138 static const Length b4Width = mmLength(250), b4Height = mmLength(353);
1139 static const Length letterWidth = inchLength(8.5), letterHeight = inchLength(11);
1140 static const Length legalWidth = inchLength(8.5), legalHeight = inchLength(14);
1141 static const Length ledgerWidth = inchLength(11), ledgerHeight = inchLength(17);
1146 switch (pageSizeName->getIdent()) {
1167 case CSSValueLetter:
1168 width = letterWidth;
1169 height = letterHeight;
1173 height = legalHeight;
1175 case CSSValueLedger:
1176 width = ledgerWidth;
1177 height = ledgerHeight;
1183 if (pageOrientation) {
1184 switch (pageOrientation->getIdent()) {
1185 case CSSValueLandscape:
1186 std::swap(width, height);
1188 case CSSValuePortrait:
1198 static void applyInheritValue(CSSStyleSelector*) { }
1199 static void applyInitialValue(CSSStyleSelector*) { }
1200 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1202 selector->style()->resetPageSizeType();
1205 PageSizeType pageSizeType = PAGE_SIZE_AUTO;
1206 CSSValueListInspector inspector(value);
1207 switch (inspector.length()) {
1209 // <length>{2} | <page-size> <orientation>
1210 if (!inspector.first()->isPrimitiveValue() || !inspector.second()->isPrimitiveValue())
1212 CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(inspector.first());
1213 CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(inspector.second());
1214 if (first->isLength()) {
1216 if (!second->isLength())
1218 width = first->computeLength<Length>(selector->style(), selector->rootElementStyle());
1219 height = second->computeLength<Length>(selector->style(), selector->rootElementStyle());
1221 // <page-size> <orientation>
1222 // The value order is guaranteed. See CSSParser::parseSizeParameter.
1223 if (!getPageSizeFromName(first, second, width, height))
1226 pageSizeType = PAGE_SIZE_RESOLVED;
1230 // <length> | auto | <page-size> | [ portrait | landscape]
1231 if (!inspector.first()->isPrimitiveValue())
1233 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(inspector.first());
1234 if (primitiveValue->isLength()) {
1236 pageSizeType = PAGE_SIZE_RESOLVED;
1237 width = height = primitiveValue->computeLength<Length>(selector->style(), selector->rootElementStyle());
1239 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_IDENT)
1241 switch (primitiveValue->getIdent()) {
1243 pageSizeType = PAGE_SIZE_AUTO;
1245 case CSSValuePortrait:
1246 pageSizeType = PAGE_SIZE_AUTO_PORTRAIT;
1248 case CSSValueLandscape:
1249 pageSizeType = PAGE_SIZE_AUTO_LANDSCAPE;
1253 pageSizeType = PAGE_SIZE_RESOLVED;
1254 if (!getPageSizeFromName(primitiveValue, 0, width, height))
1263 selector->style()->setPageSizeType(pageSizeType);
1264 selector->style()->setPageSize(LengthSize(width, height));
1266 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1269 class ApplyPropertyTextEmphasisStyle {
1271 static void applyInheritValue(CSSStyleSelector* selector)
1273 selector->style()->setTextEmphasisFill(selector->parentStyle()->textEmphasisFill());
1274 selector->style()->setTextEmphasisMark(selector->parentStyle()->textEmphasisMark());
1275 selector->style()->setTextEmphasisCustomMark(selector->parentStyle()->textEmphasisCustomMark());
1278 static void applyInitialValue(CSSStyleSelector* selector)
1280 selector->style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill());
1281 selector->style()->setTextEmphasisMark(RenderStyle::initialTextEmphasisMark());
1282 selector->style()->setTextEmphasisCustomMark(RenderStyle::initialTextEmphasisCustomMark());
1285 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1287 if (value->isValueList()) {
1288 CSSValueList* list = static_cast<CSSValueList*>(value);
1289 ASSERT(list->length() == 2);
1290 if (list->length() != 2)
1292 for (unsigned i = 0; i < 2; ++i) {
1293 CSSValue* item = list->itemWithoutBoundsCheck(i);
1294 if (!item->isPrimitiveValue())
1297 CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(item);
1298 if (value->getIdent() == CSSValueFilled || value->getIdent() == CSSValueOpen)
1299 selector->style()->setTextEmphasisFill(*value);
1301 selector->style()->setTextEmphasisMark(*value);
1303 selector->style()->setTextEmphasisCustomMark(nullAtom);
1307 if (!value->isPrimitiveValue())
1309 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1311 if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_STRING) {
1312 selector->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1313 selector->style()->setTextEmphasisMark(TextEmphasisMarkCustom);
1314 selector->style()->setTextEmphasisCustomMark(primitiveValue->getStringValue());
1318 selector->style()->setTextEmphasisCustomMark(nullAtom);
1320 if (primitiveValue->getIdent() == CSSValueFilled || primitiveValue->getIdent() == CSSValueOpen) {
1321 selector->style()->setTextEmphasisFill(*primitiveValue);
1322 selector->style()->setTextEmphasisMark(TextEmphasisMarkAuto);
1324 selector->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1325 selector->style()->setTextEmphasisMark(*primitiveValue);
1329 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1332 template <typename T,
1333 T (Animation::*getterFunction)() const,
1334 void (Animation::*setterFunction)(T),
1335 bool (Animation::*testFunction)() const,
1336 void (Animation::*clearFunction)(),
1337 T (*initialFunction)(),
1338 void (CSSStyleSelector::*mapFunction)(Animation*, CSSValue*),
1339 AnimationList* (RenderStyle::*animationGetterFunction)(),
1340 const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
1341 class ApplyPropertyAnimation {
1343 static void setValue(Animation* animation, T value) { (animation->*setterFunction)(value); }
1344 static T value(const Animation* animation) { return (animation->*getterFunction)(); }
1345 static bool test(const Animation* animation) { return (animation->*testFunction)(); }
1346 static void clear(Animation* animation) { (animation->*clearFunction)(); }
1347 static T initial() { return (*initialFunction)(); }
1348 static void map(CSSStyleSelector* selector, Animation* animation, CSSValue* value) { (selector->*mapFunction)(animation, value); }
1349 static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
1350 static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
1352 static void applyInheritValue(CSSStyleSelector* selector)
1354 AnimationList* list = accessAnimations(selector->style());
1355 const AnimationList* parentList = animations(selector->parentStyle());
1356 size_t i = 0, parentSize = parentList ? parentList->size() : 0;
1357 for ( ; i < parentSize && test(parentList->animation(i)); ++i) {
1358 if (list->size() <= i)
1359 list->append(Animation::create());
1360 setValue(list->animation(i), value(parentList->animation(i)));
1363 /* Reset any remaining animations to not have the property set. */
1364 for ( ; i < list->size(); ++i)
1365 clear(list->animation(i));
1368 static void applyInitialValue(CSSStyleSelector* selector)
1370 AnimationList* list = accessAnimations(selector->style());
1371 if (list->isEmpty())
1372 list->append(Animation::create());
1373 setValue(list->animation(0), initial());
1374 for (size_t i = 1; i < list->size(); ++i)
1375 clear(list->animation(i));
1378 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1380 AnimationList* list = accessAnimations(selector->style());
1381 size_t childIndex = 0;
1382 if (value->isValueList()) {
1383 /* Walk each value and put it into an animation, creating new animations as needed. */
1384 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
1385 if (childIndex <= list->size())
1386 list->append(Animation::create());
1387 map(selector, list->animation(childIndex), i.value());
1391 if (list->isEmpty())
1392 list->append(Animation::create());
1393 map(selector, list->animation(childIndex), value);
1396 for ( ; childIndex < list->size(); ++childIndex) {
1397 /* Reset all remaining animations to not have the property set. */
1398 clear(list->animation(childIndex));
1402 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1405 class ApplyPropertyOutlineStyle {
1407 static void applyInheritValue(CSSStyleSelector* selector)
1409 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInheritValue(selector);
1410 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInheritValue(selector);
1413 static void applyInitialValue(CSSStyleSelector* selector)
1415 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInitialValue(selector);
1416 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInitialValue(selector);
1419 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1421 ApplyPropertyDefault<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyValue(selector, value);
1422 ApplyPropertyDefault<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyValue(selector, value);
1425 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1428 class ApplyPropertyResize {
1430 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1432 if (!value->isPrimitiveValue())
1435 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1437 EResize r = RESIZE_NONE;
1438 switch (primitiveValue->getIdent()) {
1442 if (Settings* settings = selector->document()->settings())
1443 r = settings->textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE;
1446 r = *primitiveValue;
1448 selector->style()->setResize(r);
1451 static PropertyHandler createHandler()
1453 PropertyHandler handler = ApplyPropertyDefaultBase<EResize, &RenderStyle::resize, EResize, &RenderStyle::setResize, EResize, &RenderStyle::initialResize>::createHandler();
1454 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1458 class ApplyPropertyVerticalAlign {
1460 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1462 if (!value->isPrimitiveValue())
1465 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1467 if (primitiveValue->getIdent())
1468 return selector->style()->setVerticalAlign(*primitiveValue);
1471 if (primitiveValue->isLength())
1472 length = primitiveValue->computeLength<Length>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());
1473 else if (primitiveValue->isPercentage())
1474 length = Length(primitiveValue->getDoubleValue(), Percent);
1476 selector->style()->setVerticalAlignLength(length);
1479 static PropertyHandler createHandler()
1481 PropertyHandler handler = ApplyPropertyDefaultBase<EVerticalAlign, &RenderStyle::verticalAlign, EVerticalAlign, &RenderStyle::setVerticalAlign, EVerticalAlign, &RenderStyle::initialVerticalAlign>::createHandler();
1482 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1486 class ApplyPropertyAspectRatio {
1488 static void applyInheritValue(CSSStyleSelector* selector)
1490 if (!selector->parentStyle()->hasAspectRatio())
1492 selector->style()->setHasAspectRatio(true);
1493 selector->style()->setAspectRatioDenominator(selector->parentStyle()->aspectRatioDenominator());
1494 selector->style()->setAspectRatioNumerator(selector->parentStyle()->aspectRatioNumerator());
1497 static void applyInitialValue(CSSStyleSelector* selector)
1499 selector->style()->setHasAspectRatio(RenderStyle::initialHasAspectRatio());
1500 selector->style()->setAspectRatioDenominator(RenderStyle::initialAspectRatioDenominator());
1501 selector->style()->setAspectRatioNumerator(RenderStyle::initialAspectRatioNumerator());
1504 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1506 if (!value->isAspectRatioValue()) {
1507 selector->style()->setHasAspectRatio(false);
1510 CSSAspectRatioValue* aspectRatioValue = static_cast<CSSAspectRatioValue*>(value);
1511 selector->style()->setHasAspectRatio(true);
1512 selector->style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue());
1513 selector->style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue());
1516 static PropertyHandler createHandler()
1518 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1522 class ApplyPropertyZoom {
1524 static void resetEffectiveZoom(CSSStyleSelector* selector)
1526 // Reset the zoom in effect. This allows the setZoom method to accurately compute a new zoom in effect.
1527 selector->setEffectiveZoom(selector->parentStyle() ? selector->parentStyle()->effectiveZoom() : RenderStyle::initialZoom());
1531 static void applyInheritValue(CSSStyleSelector* selector)
1533 resetEffectiveZoom(selector);
1534 selector->setZoom(selector->parentStyle()->zoom());
1537 static void applyInitialValue(CSSStyleSelector* selector)
1539 resetEffectiveZoom(selector);
1540 selector->setZoom(RenderStyle::initialZoom());
1543 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1545 ASSERT(value->isPrimitiveValue());
1546 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
1548 if (primitiveValue->getIdent() == CSSValueNormal) {
1549 resetEffectiveZoom(selector);
1550 selector->setZoom(RenderStyle::initialZoom());
1551 } else if (primitiveValue->getIdent() == CSSValueReset) {
1552 selector->setEffectiveZoom(RenderStyle::initialZoom());
1553 selector->setZoom(RenderStyle::initialZoom());
1554 } else if (primitiveValue->getIdent() == CSSValueDocument) {
1555 float docZoom = selector->document()->renderer()->style()->zoom();
1556 selector->setEffectiveZoom(docZoom);
1557 selector->setZoom(docZoom);
1558 } else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) {
1559 resetEffectiveZoom(selector);
1560 if (float percent = primitiveValue->getFloatValue())
1561 selector->setZoom(percent / 100.0f);
1562 } else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_NUMBER) {
1563 resetEffectiveZoom(selector);
1564 if (float number = primitiveValue->getFloatValue())
1565 selector->setZoom(number);
1569 static PropertyHandler createHandler()
1571 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1575 class ApplyPropertyDisplay {
1577 static inline bool isValidDisplayValue(CSSStyleSelector* selector, EDisplay displayPropertyValue)
1580 if (selector->element() && selector->element()->isSVGElement() && selector->style()->styleType() == NOPSEUDO)
1581 return (displayPropertyValue == INLINE || displayPropertyValue == BLOCK || displayPropertyValue == NONE);
1586 static void applyInheritValue(CSSStyleSelector* selector)
1588 EDisplay display = selector->parentStyle()->display();
1589 if (!isValidDisplayValue(selector, display))
1591 selector->style()->setDisplay(display);
1594 static void applyInitialValue(CSSStyleSelector* selector)
1596 selector->style()->setDisplay(RenderStyle::initialDisplay());
1599 static void applyValue(CSSStyleSelector* selector, CSSValue* value)
1601 if (!value->isPrimitiveValue())
1604 EDisplay display = *static_cast<CSSPrimitiveValue*>(value);
1606 if (!isValidDisplayValue(selector, display))
1609 selector->style()->setDisplay(display);
1612 static PropertyHandler createHandler()
1614 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1618 const CSSStyleApplyProperty& CSSStyleApplyProperty::sharedCSSStyleApplyProperty()
1620 DEFINE_STATIC_LOCAL(CSSStyleApplyProperty, cssStyleApplyPropertyInstance, ());
1621 return cssStyleApplyPropertyInstance;
1624 CSSStyleApplyProperty::CSSStyleApplyProperty()
1626 for (int i = 0; i < numCSSProperties; ++i)
1627 m_propertyMap[i] = PropertyHandler();
1629 setPropertyHandler(CSSPropertyWebkitAspectRatio, ApplyPropertyAspectRatio::createHandler());
1631 setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler());
1632 setPropertyHandler(CSSPropertyDirection, ApplyPropertyDirection<&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection>::createHandler());
1634 setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1635 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment>::createHandler());
1636 setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1637 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip>::createHandler());
1638 setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
1639 setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1640 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite>::createHandler());
1642 setPropertyHandler(CSSPropertyDisplay, ApplyPropertyDisplay::createHandler());
1644 setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1645 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage>::createHandler());
1647 setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1648 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin>::createHandler());
1649 setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
1651 setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1652 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition>::createHandler());
1653 setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1654 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition>::createHandler());
1655 setPropertyHandler(CSSPropertyBackgroundPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundPositionX, CSSPropertyBackgroundPositionY>::createHandler());
1657 setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1658 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX>::createHandler());
1659 setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1660 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY>::createHandler());
1661 setPropertyHandler(CSSPropertyBackgroundRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
1663 setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers,
1664 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize>::createHandler());
1665 setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
1667 setPropertyHandler(CSSPropertyWebkitMaskAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyWebkitMaskAttachment, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1668 &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSStyleSelector::mapFillAttachment>::createHandler());
1669 setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1670 &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSStyleSelector::mapFillClip>::createHandler());
1671 setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1672 &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSStyleSelector::mapFillComposite>::createHandler());
1674 setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1675 &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSStyleSelector::mapFillImage>::createHandler());
1677 setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1678 &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSStyleSelector::mapFillOrigin>::createHandler());
1679 setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1680 &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSStyleSelector::mapFillSize>::createHandler());
1682 setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1683 &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSStyleSelector::mapFillXPosition>::createHandler());
1684 setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1685 &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSStyleSelector::mapFillYPosition>::createHandler());
1686 setPropertyHandler(CSSPropertyWebkitMaskPosition, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMaskPositionX, CSSPropertyWebkitMaskPositionY>::createHandler());
1688 setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1689 &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSStyleSelector::mapFillRepeatX>::createHandler());
1690 setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers,
1691 &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSStyleSelector::mapFillRepeatY>::createHandler());
1692 setPropertyHandler(CSSPropertyWebkitMaskRepeat, ApplyPropertyExpanding<SuppressValue, CSSPropertyBackgroundRepeatX, CSSPropertyBackgroundRepeatY>::createHandler());
1694 setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler());
1695 setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
1696 setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
1697 setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
1698 setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler());
1700 setPropertyHandler(CSSPropertyBorderTopStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderTopStyle, EBorderStyle, &RenderStyle::setBorderTopStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1701 setPropertyHandler(CSSPropertyBorderRightStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderRightStyle, EBorderStyle, &RenderStyle::setBorderRightStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1702 setPropertyHandler(CSSPropertyBorderBottomStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderBottomStyle, EBorderStyle, &RenderStyle::setBorderBottomStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1703 setPropertyHandler(CSSPropertyBorderLeftStyle, ApplyPropertyDefault<EBorderStyle, &RenderStyle::borderLeftStyle, EBorderStyle, &RenderStyle::setBorderLeftStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::createHandler());
1705 setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1706 setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1707 setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1708 setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1709 setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1710 setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
1712 setPropertyHandler(CSSPropertyBorderTop, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderTopStyle, CSSPropertyBorderTopWidth>::createHandler());
1713 setPropertyHandler(CSSPropertyBorderRight, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderRightColor, CSSPropertyBorderRightStyle, CSSPropertyBorderRightWidth>::createHandler());
1714 setPropertyHandler(CSSPropertyBorderBottom, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderBottomColor, CSSPropertyBorderBottomStyle, CSSPropertyBorderBottomWidth>::createHandler());
1715 setPropertyHandler(CSSPropertyBorderLeft, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderLeftColor, CSSPropertyBorderLeftStyle, CSSPropertyBorderLeftWidth>::createHandler());
1717 setPropertyHandler(CSSPropertyBorderStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopStyle, CSSPropertyBorderRightStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle>::createHandler());
1718 setPropertyHandler(CSSPropertyBorderWidth, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopWidth, CSSPropertyBorderRightWidth, CSSPropertyBorderBottomWidth, CSSPropertyBorderLeftWidth>::createHandler());
1719 setPropertyHandler(CSSPropertyBorderColor, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderTopColor, CSSPropertyBorderRightColor, CSSPropertyBorderBottomColor, CSSPropertyBorderLeftColor>::createHandler());
1720 setPropertyHandler(CSSPropertyBorder, ApplyPropertyExpanding<SuppressValue, CSSPropertyBorderStyle, CSSPropertyBorderWidth, CSSPropertyBorderColor>::createHandler());
1722 setPropertyHandler(CSSPropertyBorderImage, ApplyPropertyBorderImage<Image, CSSPropertyBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
1723 setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage<Image, CSSPropertyWebkitBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
1724 setPropertyHandler(CSSPropertyWebkitMaskBoxImage, ApplyPropertyBorderImage<Mask, CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage>::createHandler());
1726 setPropertyHandler(CSSPropertyBorderImageOutset, ApplyPropertyBorderImageModifier<Image, Outset>::createHandler());
1727 setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<Mask, Outset>::createHandler());
1728 setPropertyHandler(CSSPropertyBorderImageRepeat, ApplyPropertyBorderImageModifier<Image, Repeat>::createHandler());
1729 setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<Mask, Repeat>::createHandler());
1730 setPropertyHandler(CSSPropertyBorderImageSlice, ApplyPropertyBorderImageModifier<Image, Slice>::createHandler());
1731 setPropertyHandler(CSSPropertyWebkitMaskBoxImageSlice, ApplyPropertyBorderImageModifier<Mask, Slice>::createHandler());
1732 setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier<Image, Width>::createHandler());
1733 setPropertyHandler(CSSPropertyWebkitMaskBoxImageWidth, ApplyPropertyBorderImageModifier<Mask, Width>::createHandler());
1735 setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource<CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource, &RenderStyle::initialBorderImageSource>::createHandler());
1736 setPropertyHandler(CSSPropertyWebkitMaskBoxImageSource, ApplyPropertyBorderImageSource<CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource, &RenderStyle::initialMaskBoxImageSource>::createHandler());
1738 setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
1739 setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
1740 setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
1741 setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
1742 setPropertyHandler(CSSPropertyBorderRadius, ApplyPropertyExpanding<ExpandValue, CSSPropertyBorderTopLeftRadius, CSSPropertyBorderTopRightRadius, CSSPropertyBorderBottomLeftRadius, CSSPropertyBorderBottomRightRadius>::createHandler());
1743 setPropertyHandler(CSSPropertyWebkitBorderRadius, CSSPropertyBorderRadius);
1745 setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler());
1746 setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing>::createHandler());
1747 setPropertyHandler(CSSPropertyBorderSpacing, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitBorderHorizontalSpacing, CSSPropertyWebkitBorderVerticalSpacing>::createHandler());
1749 setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength<int, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
1750 setPropertyHandler(CSSPropertyWordSpacing, ApplyPropertyComputeLength<int, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing, &RenderStyle::initialLetterWordSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::createHandler());
1752 setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler());
1754 setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::createHandler());
1755 setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler());
1757 setPropertyHandler(CSSPropertyWebkitFlexOrder, ApplyPropertyDefault<int, &RenderStyle::flexOrder, int, &RenderStyle::setFlexOrder, int, &RenderStyle::initialFlexOrder>::createHandler());
1758 setPropertyHandler(CSSPropertyWebkitFlexPack, ApplyPropertyDefault<EFlexPack, &RenderStyle::flexPack, EFlexPack, &RenderStyle::setFlexPack, EFlexPack, &RenderStyle::initialFlexPack>::createHandler());
1759 setPropertyHandler(CSSPropertyWebkitFlexItemAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexItemAlign, EFlexAlign, &RenderStyle::setFlexItemAlign, EFlexAlign, &RenderStyle::initialFlexItemAlign>::createHandler());
1760 setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler());
1761 setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler());
1762 setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap>::createHandler());
1764 setPropertyHandler(CSSPropertyFontSize, ApplyPropertyFontSize::createHandler());
1765 setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
1766 setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
1767 setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
1768 setPropertyHandler(CSSPropertyWebkitFontKerning, ApplyPropertyFont<FontDescription::Kerning, &FontDescription::kerning, &FontDescription::setKerning, FontDescription::AutoKerning>::createHandler());
1769 setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
1770 setPropertyHandler(CSSPropertyWebkitTextOrientation, ApplyPropertyFont<TextOrientation, &FontDescription::textOrientation, &FontDescription::setTextOrientation, TextOrientationVerticalRight>::createHandler());
1771 setPropertyHandler(CSSPropertyWebkitFontVariantLigatures, ApplyPropertyFontVariantLigatures::createHandler());
1772 setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
1774 setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
1775 setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
1777 setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
1778 setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
1779 setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength<int, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset>::createHandler());
1781 setPropertyHandler(CSSPropertyOutline, ApplyPropertyExpanding<SuppressValue, CSSPropertyOutlineWidth, CSSPropertyOutlineColor, CSSPropertyOutlineStyle>::createHandler());
1783 setPropertyHandler(CSSPropertyOverflowX, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowX, EOverflow, &RenderStyle::setOverflowX, EOverflow, &RenderStyle::initialOverflowX>::createHandler());
1784 setPropertyHandler(CSSPropertyOverflowY, ApplyPropertyDefault<EOverflow, &RenderStyle::overflowY, EOverflow, &RenderStyle::setOverflowY, EOverflow, &RenderStyle::initialOverflowY>::createHandler());
1785 setPropertyHandler(CSSPropertyOverflow, ApplyPropertyExpanding<ExpandValue, CSSPropertyOverflowX, CSSPropertyOverflowY>::createHandler());
1787 setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
1788 setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
1789 setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
1790 setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
1792 setPropertyHandler(CSSPropertyTop, ApplyPropertyLength<&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1793 setPropertyHandler(CSSPropertyRight, ApplyPropertyLength<&RenderStyle::right, &RenderStyle::setRight, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1794 setPropertyHandler(CSSPropertyBottom, ApplyPropertyLength<&RenderStyle::bottom, &RenderStyle::setBottom, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1795 setPropertyHandler(CSSPropertyLeft, ApplyPropertyLength<&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset, AutoEnabled>::createHandler());
1797 setPropertyHandler(CSSPropertyWidth, ApplyPropertyLength<&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexWidth>::createHandler());
1798 setPropertyHandler(CSSPropertyHeight, ApplyPropertyLength<&RenderStyle::height, &RenderStyle::setHeight, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexHeight>::createHandler());
1800 setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
1802 setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeight::createHandler());
1804 setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
1805 setPropertyHandler(CSSPropertyListStylePosition, ApplyPropertyDefault<EListStylePosition, &RenderStyle::listStylePosition, EListStylePosition, &RenderStyle::setListStylePosition, EListStylePosition, &RenderStyle::initialListStylePosition>::createHandler());
1806 setPropertyHandler(CSSPropertyListStyleType, ApplyPropertyDefault<EListStyleType, &RenderStyle::listStyleType, EListStyleType, &RenderStyle::setListStyleType, EListStyleType, &RenderStyle::initialListStyleType>::createHandler());
1807 setPropertyHandler(CSSPropertyListStyle, ApplyPropertyExpanding<SuppressValue, CSSPropertyListStyleType, CSSPropertyListStyleImage, CSSPropertyListStylePosition>::createHandler());
1809 setPropertyHandler(CSSPropertyMaxHeight, ApplyPropertyLength<&RenderStyle::maxHeight, &RenderStyle::setMaxHeight, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
1810 setPropertyHandler(CSSPropertyMaxWidth, ApplyPropertyLength<&RenderStyle::maxWidth, &RenderStyle::setMaxWidth, &RenderStyle::initialMaxSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneEnabled, UndefinedEnabled>::createHandler());
1811 setPropertyHandler(CSSPropertyMinHeight, ApplyPropertyLength<&RenderStyle::minHeight, &RenderStyle::setMinHeight, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler());
1812 setPropertyHandler(CSSPropertyMinWidth, ApplyPropertyLength<&RenderStyle::minWidth, &RenderStyle::setMinWidth, &RenderStyle::initialMinSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled>::createHandler());
1814 setPropertyHandler(CSSPropertyMarginTop, ApplyPropertyLength<&RenderStyle::marginTop, &RenderStyle::setMarginTop, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1815 setPropertyHandler(CSSPropertyMarginRight, ApplyPropertyLength<&RenderStyle::marginRight, &RenderStyle::setMarginRight, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1816 setPropertyHandler(CSSPropertyMarginBottom, ApplyPropertyLength<&RenderStyle::marginBottom, &RenderStyle::setMarginBottom, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1817 setPropertyHandler(CSSPropertyMarginLeft, ApplyPropertyLength<&RenderStyle::marginLeft, &RenderStyle::setMarginLeft, &RenderStyle::initialMargin, AutoEnabled>::createHandler());
1818 setPropertyHandler(CSSPropertyMargin, ApplyPropertyExpanding<SuppressValue, CSSPropertyMarginTop, CSSPropertyMarginRight, CSSPropertyMarginBottom, CSSPropertyMarginLeft>::createHandler());
1820 setPropertyHandler(CSSPropertyWebkitMarginBeforeCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginBeforeCollapse, EMarginCollapse, &RenderStyle::setMarginBeforeCollapse, EMarginCollapse, &RenderStyle::initialMarginBeforeCollapse>::createHandler());
1821 setPropertyHandler(CSSPropertyWebkitMarginAfterCollapse, ApplyPropertyDefault<EMarginCollapse, &RenderStyle::marginAfterCollapse, EMarginCollapse, &RenderStyle::setMarginAfterCollapse, EMarginCollapse, &RenderStyle::initialMarginAfterCollapse>::createHandler());
1822 setPropertyHandler(CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBeforeCollapse);
1823 setPropertyHandler(CSSPropertyWebkitMarginBottomCollapse, CSSPropertyWebkitMarginAfterCollapse);
1824 setPropertyHandler(CSSPropertyWebkitMarginCollapse, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse>::createHandler());
1826 setPropertyHandler(CSSPropertyPaddingTop, ApplyPropertyLength<&RenderStyle::paddingTop, &RenderStyle::setPaddingTop, &RenderStyle::initialPadding>::createHandler());
1827 setPropertyHandler(CSSPropertyPaddingRight, ApplyPropertyLength<&RenderStyle::paddingRight, &RenderStyle::setPaddingRight, &RenderStyle::initialPadding>::createHandler());
1828 setPropertyHandler(CSSPropertyPaddingBottom, ApplyPropertyLength<&RenderStyle::paddingBottom, &RenderStyle::setPaddingBottom, &RenderStyle::initialPadding>::createHandler());
1829 setPropertyHandler(CSSPropertyPaddingLeft, ApplyPropertyLength<&RenderStyle::paddingLeft, &RenderStyle::setPaddingLeft, &RenderStyle::initialPadding>::createHandler());
1830 setPropertyHandler(CSSPropertyPadding, ApplyPropertyExpanding<SuppressValue, CSSPropertyPaddingTop, CSSPropertyPaddingRight, CSSPropertyPaddingBottom, CSSPropertyPaddingLeft>::createHandler());
1832 setPropertyHandler(CSSPropertyResize, ApplyPropertyResize::createHandler());
1834 setPropertyHandler(CSSPropertyVerticalAlign, ApplyPropertyVerticalAlign::createHandler());
1836 setPropertyHandler(CSSPropertySize, ApplyPropertyPageSize::createHandler());
1838 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginX, ApplyPropertyLength<&RenderStyle::perspectiveOriginX, &RenderStyle::setPerspectiveOriginX, &RenderStyle::initialPerspectiveOriginX>::createHandler());
1839 setPropertyHandler(CSSPropertyWebkitPerspectiveOriginY, ApplyPropertyLength<&RenderStyle::perspectiveOriginY, &RenderStyle::setPerspectiveOriginY, &RenderStyle::initialPerspectiveOriginY>::createHandler());
1840 setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
1841 setPropertyHandler(CSSPropertyWebkitTransformOriginX, ApplyPropertyLength<&RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX, &RenderStyle::initialTransformOriginX>::createHandler());
1842 setPropertyHandler(CSSPropertyWebkitTransformOriginY, ApplyPropertyLength<&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY>::createHandler());
1843 setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler());
1844 setPropertyHandler(CSSPropertyWebkitTransformOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitTransformOriginX, CSSPropertyWebkitTransformOriginY, CSSPropertyWebkitTransformOriginZ>::createHandler());
1846 setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1847 setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSStyleSelector::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1848 setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1849 setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSStyleSelector::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1850 setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<int, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSStyleSelector::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1851 setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSStyleSelector::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1852 setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSStyleSelector::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1853 setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1855 setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSStyleSelector::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1856 setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSStyleSelector::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1857 setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<int, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSStyleSelector::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1858 setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSStyleSelector::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1860 setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
1861 setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
1862 setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
1863 setPropertyHandler(CSSPropertyWebkitColumns, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitColumnWidth, CSSPropertyWebkitColumnCount>::createHandler());
1865 setPropertyHandler(CSSPropertyWebkitFlowInto, ApplyPropertyString<MapAutoToNull, &RenderStyle::flowThread, &RenderStyle::setFlowThread, &RenderStyle::initialFlowThread>::createHandler());
1866 setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString<MapNoneToNull, &RenderStyle::regionThread, &RenderStyle::setRegionThread, &RenderStyle::initialRegionThread>::createHandler());
1868 setPropertyHandler(CSSPropertyWebkitHighlight, ApplyPropertyString<MapNoneToNull, &RenderStyle::highlight, &RenderStyle::setHighlight, &RenderStyle::initialHighlight>::createHandler());
1869 setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());
1871 setPropertyHandler(CSSPropertyWebkitHyphenateLimitAfter, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitAfter, &RenderStyle::setHyphenationLimitAfter, &RenderStyle::initialHyphenationLimitAfter>::createHandler());
1872 setPropertyHandler(CSSPropertyWebkitHyphenateLimitBefore, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitBefore, &RenderStyle::setHyphenationLimitBefore, &RenderStyle::initialHyphenationLimitBefore>::createHandler());
1873 setPropertyHandler(CSSPropertyWebkitHyphenateLimitLines, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitLines, &RenderStyle::setHyphenationLimitLines, &RenderStyle::initialHyphenationLimitLines, CSSValueNoLimit>::createHandler());
1875 setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());
1876 setPropertyHandler(CSSPropertyWebkitLineGridSnap, ApplyPropertyDefault<LineGridSnap, &RenderStyle::lineGridSnap, LineGridSnap, &RenderStyle::setLineGridSnap, LineGridSnap, &RenderStyle::initialLineGridSnap>::createHandler());
1878 setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler());
1879 setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler());
1880 setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
1882 setPropertyHandler(CSSPropertyWebkitWrapMargin, ApplyPropertyLength<&RenderStyle::wrapMargin, &RenderStyle::setWrapMargin, &RenderStyle::initialWrapMargin>::createHandler());
1883 setPropertyHandler(CSSPropertyWebkitWrapPadding, ApplyPropertyLength<&RenderStyle::wrapPadding, &RenderStyle::setWrapPadding, &RenderStyle::initialWrapPadding>::createHandler());
1884 setPropertyHandler(CSSPropertyWebkitWrapFlow, ApplyPropertyDefault<WrapFlow, &RenderStyle::wrapFlow, WrapFlow, &RenderStyle::setWrapFlow, WrapFlow, &RenderStyle::initialWrapFlow>::createHandler());
1885 setPropertyHandler(CSSPropertyWebkitWrapThrough, ApplyPropertyDefault<WrapThrough, &RenderStyle::wrapThrough, WrapThrough, &RenderStyle::setWrapThrough, WrapThrough, &RenderStyle::initialWrapThrough>::createHandler());
1886 setPropertyHandler(CSSPropertyWebkitWrap, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitWrapFlow, CSSPropertyWebkitWrapMargin, CSSPropertyWebkitWrapPadding>::createHandler());
1888 setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
1889 setPropertyHandler(CSSPropertyZoom, ApplyPropertyZoom::createHandler());