2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
4 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
19 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #include "DeprecatedStyleBuilder.h"
30 #include "BasicShapeFunctions.h"
31 #include "BasicShapes.h"
32 #include "CSSAspectRatioValue.h"
33 #include "CSSCalculationValue.h"
34 #include "CSSCursorImageValue.h"
35 #include "CSSImageGeneratorValue.h"
36 #include "CSSImageSetValue.h"
37 #include "CSSPrimitiveValue.h"
38 #include "CSSPrimitiveValueMappings.h"
39 #include "CSSToStyleMap.h"
40 #include "CSSValueList.h"
41 #include "ClipPathOperation.h"
42 #include "CursorList.h"
45 #include "HTMLElement.h"
48 #include "RenderStyle.h"
49 #include "RenderView.h"
51 #include "StyleFontSizeFunctions.h"
52 #include "StyleResolver.h"
53 #include <wtf/StdLibExtras.h>
55 #if ENABLE(CSS_SHAPES)
56 #include "ShapeValue.h"
61 using namespace HTMLNames;
63 enum ExpandValueBehavior {SuppressValue = 0, ExpandValue};
64 template <ExpandValueBehavior expandValue, CSSPropertyID one = CSSPropertyInvalid, CSSPropertyID two = CSSPropertyInvalid, CSSPropertyID three = CSSPropertyInvalid, CSSPropertyID four = CSSPropertyInvalid, CSSPropertyID five = CSSPropertyInvalid>
65 class ApplyPropertyExpanding {
68 template <CSSPropertyID id>
69 static inline void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
71 if (id == CSSPropertyInvalid)
74 const DeprecatedStyleBuilder& table = DeprecatedStyleBuilder::sharedStyleBuilder();
75 const PropertyHandler& handler = table.propertyHandler(id);
76 if (handler.isValid())
77 handler.applyInheritValue(propertyID, styleResolver);
80 static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
82 applyInheritValue<one>(propertyID, styleResolver);
83 applyInheritValue<two>(propertyID, styleResolver);
84 applyInheritValue<three>(propertyID, styleResolver);
85 applyInheritValue<four>(propertyID, styleResolver);
86 applyInheritValue<five>(propertyID, styleResolver);
89 template <CSSPropertyID id>
90 static inline void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
92 if (id == CSSPropertyInvalid)
95 const DeprecatedStyleBuilder& table = DeprecatedStyleBuilder::sharedStyleBuilder();
96 const PropertyHandler& handler = table.propertyHandler(id);
97 if (handler.isValid())
98 handler.applyInitialValue(propertyID, styleResolver);
101 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
103 applyInitialValue<one>(propertyID, styleResolver);
104 applyInitialValue<two>(propertyID, styleResolver);
105 applyInitialValue<three>(propertyID, styleResolver);
106 applyInitialValue<four>(propertyID, styleResolver);
107 applyInitialValue<five>(propertyID, styleResolver);
110 template <CSSPropertyID id>
111 static inline void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
113 if (id == CSSPropertyInvalid)
116 const DeprecatedStyleBuilder& table = DeprecatedStyleBuilder::sharedStyleBuilder();
117 const PropertyHandler& handler = table.propertyHandler(id);
118 if (handler.isValid())
119 handler.applyValue(propertyID, styleResolver, value);
122 static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
127 applyValue<one>(propertyID, styleResolver, value);
128 applyValue<two>(propertyID, styleResolver, value);
129 applyValue<three>(propertyID, styleResolver, value);
130 applyValue<four>(propertyID, styleResolver, value);
131 applyValue<five>(propertyID, styleResolver, value);
133 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
136 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()>
137 class ApplyPropertyDefaultBase {
139 static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); }
140 static GetterType value(RenderStyle* style) { return (style->*getterFunction)(); }
141 static InitialType initial() { return (*initialFunction)(); }
142 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { setValue(styleResolver->style(), value(styleResolver->parentStyle())); }
143 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { setValue(styleResolver->style(), initial()); }
144 static void applyValue(CSSPropertyID, StyleResolver*, CSSValue*) { }
145 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
148 template <typename GetterType, GetterType (RenderStyle::*getterFunction)() const, typename SetterType, void (RenderStyle::*setterFunction)(SetterType), typename InitialType, InitialType (*initialFunction)()>
149 class ApplyPropertyDefault {
151 static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); }
152 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
154 if (is<CSSPrimitiveValue>(*value))
155 setValue(styleResolver->style(), downcast<CSSPrimitiveValue>(*value));
157 static PropertyHandler createHandler()
159 PropertyHandler handler = ApplyPropertyDefaultBase<GetterType, getterFunction, SetterType, setterFunction, InitialType, initialFunction>::createHandler();
160 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
164 template <StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)(), CSSPropertyID property>
165 class ApplyPropertyStyleImage {
167 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(property, *value)); }
168 static PropertyHandler createHandler()
170 PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
171 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
175 enum AutoValueType {Number = 0, ComputeLength};
176 template <typename T, T (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(T), bool (RenderStyle::*hasAutoFunction)() const, void (RenderStyle::*setAutoFunction)(), AutoValueType valueType = Number, int autoIdentity = CSSValueAuto>
177 class ApplyPropertyAuto {
179 static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
180 static T value(RenderStyle* style) { return (style->*getterFunction)(); }
181 static bool hasAuto(RenderStyle* style) { return (style->*hasAutoFunction)(); }
182 static void setAuto(RenderStyle* style) { (style->*setAutoFunction)(); }
184 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
186 if (hasAuto(styleResolver->parentStyle()))
187 setAuto(styleResolver->style());
189 setValue(styleResolver->style(), value(styleResolver->parentStyle()));
192 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { setAuto(styleResolver->style()); }
194 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
196 if (!is<CSSPrimitiveValue>(*value))
199 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
200 if (primitiveValue.getValueID() == autoIdentity)
201 setAuto(styleResolver->style());
202 else if (valueType == Number)
203 setValue(styleResolver->style(), primitiveValue);
204 else if (valueType == ComputeLength)
205 setValue(styleResolver->style(), primitiveValue.computeLength<T>(styleResolver->state().cssToLengthConversionData()));
208 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
211 class ApplyPropertyClip {
213 static Length convertToLength(StyleResolver* styleResolver, CSSPrimitiveValue* value)
215 return value->convertToLength<FixedIntegerConversion | PercentConversion | AutoConversion>(styleResolver->state().cssToLengthConversionData());
218 static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
220 RenderStyle* parentStyle = styleResolver->parentStyle();
221 if (!parentStyle->hasClip())
222 return applyInitialValue(propertyID, styleResolver);
223 styleResolver->style()->setClip(parentStyle->clipTop(), parentStyle->clipRight(), parentStyle->clipBottom(), parentStyle->clipLeft());
224 styleResolver->style()->setHasClip(true);
227 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
229 styleResolver->style()->setClip(Length(), Length(), Length(), Length());
230 styleResolver->style()->setHasClip(false);
233 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
235 if (!is<CSSPrimitiveValue>(*value))
238 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
240 if (Rect* rect = primitiveValue.getRectValue()) {
241 Length top = convertToLength(styleResolver, rect->top());
242 Length right = convertToLength(styleResolver, rect->right());
243 Length bottom = convertToLength(styleResolver, rect->bottom());
244 Length left = convertToLength(styleResolver, rect->left());
245 styleResolver->style()->setClip(top, right, bottom, left);
246 styleResolver->style()->setHasClip(true);
247 } else if (primitiveValue.getValueID() == CSSValueAuto) {
248 styleResolver->style()->setClip(Length(), Length(), Length(), Length());
249 styleResolver->style()->setHasClip(false);
253 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
256 enum ColorInherit {NoInheritFromParent = 0, InheritFromParent};
257 Color defaultInitialColor();
258 Color defaultInitialColor() { return Color(); }
259 template <ColorInherit inheritColorFromParent,
260 Color (RenderStyle::*getterFunction)() const,
261 void (RenderStyle::*setterFunction)(const Color&),
262 void (RenderStyle::*visitedLinkSetterFunction)(const Color&),
263 Color (RenderStyle::*defaultFunction)() const,
264 Color (*initialFunction)() = &defaultInitialColor>
265 class ApplyPropertyColor {
267 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
269 // Visited link style can never explicitly inherit from parent visited link style so no separate getters are needed.
270 Color color = (styleResolver->parentStyle()->*getterFunction)();
271 applyColorValue(styleResolver, color.isValid() ? color : (styleResolver->parentStyle()->*defaultFunction)());
274 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
276 applyColorValue(styleResolver, initialFunction());
279 static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
281 if (!is<CSSPrimitiveValue>(*value))
284 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
285 if (inheritColorFromParent && primitiveValue.getValueID() == CSSValueCurrentcolor)
286 applyInheritValue(propertyID, styleResolver);
288 if (styleResolver->applyPropertyToRegularStyle())
289 (styleResolver->style()->*setterFunction)(styleResolver->colorFromPrimitiveValue(&primitiveValue));
290 if (styleResolver->applyPropertyToVisitedLinkStyle())
291 (styleResolver->style()->*visitedLinkSetterFunction)(styleResolver->colorFromPrimitiveValue(&primitiveValue, /* forVisitedLink */ true));
295 static void applyColorValue(StyleResolver* styleResolver, const Color& color)
297 if (styleResolver->applyPropertyToRegularStyle())
298 (styleResolver->style()->*setterFunction)(color);
299 if (styleResolver->applyPropertyToVisitedLinkStyle())
300 (styleResolver->style()->*visitedLinkSetterFunction)(color);
303 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
306 template <typename T>
307 struct FillLayerAccessorTypes {
310 typedef T InitialGetter;
314 struct FillLayerAccessorTypes<StyleImage*> {
315 typedef PassRefPtr<StyleImage> Setter;
316 typedef StyleImage* Getter;
317 typedef StyleImage* InitialGetter;
321 struct FillLayerAccessorTypes<Length>
323 typedef Length Setter;
324 typedef const Length& Getter;
325 typedef Length InitialGetter;
328 template <typename T,
329 CSSPropertyID propertyId,
330 EFillLayerType fillLayerType,
331 FillLayer* (RenderStyle::*accessLayersFunction)(),
332 const FillLayer* (RenderStyle::*layersFunction)() const,
333 bool (FillLayer::*testFunction)() const,
334 typename FillLayerAccessorTypes<T>::Getter (FillLayer::*getFunction)() const,
335 void (FillLayer::*setFunction)(typename FillLayerAccessorTypes<T>::Setter),
336 void (FillLayer::*clearFunction)(),
337 typename FillLayerAccessorTypes<T>::InitialGetter (*initialFunction)(EFillLayerType),
338 void (CSSToStyleMap::*mapFillFunction)(CSSPropertyID, FillLayer*, CSSValue*)>
339 class ApplyPropertyFillLayer {
341 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
343 // Check for no-op before copying anything.
344 if (*(styleResolver->parentStyle()->*layersFunction)() == *(styleResolver->style()->*layersFunction)())
347 auto* child = (styleResolver->style()->*accessLayersFunction)();
348 FillLayer* previousChild = nullptr;
349 for (auto* parent = (styleResolver->parentStyle()->*layersFunction)(); parent && (parent->*testFunction)(); parent = parent->next()) {
351 previousChild->setNext(std::make_unique<FillLayer>(fillLayerType));
352 child = previousChild->next();
354 (child->*setFunction)((parent->*getFunction)());
355 previousChild = child;
356 child = previousChild->next();
358 for (; child; child = child->next())
359 (child->*clearFunction)();
362 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
364 // Check for (single-layer) no-op before clearing anything.
365 const FillLayer& layers = *(styleResolver->style()->*layersFunction)();
366 if (!layers.next() && (!(layers.*testFunction)() || (layers.*getFunction)() == (*initialFunction)(fillLayerType)))
369 FillLayer* child = (styleResolver->style()->*accessLayersFunction)();
370 (child->*setFunction)((*initialFunction)(fillLayerType));
371 for (child = child->next(); child; child = child->next())
372 (child->*clearFunction)();
375 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
377 FillLayer* child = (styleResolver->style()->*accessLayersFunction)();
378 FillLayer* previousChild = nullptr;
379 if (is<CSSValueList>(*value)
380 #if ENABLE(CSS_IMAGE_SET)
381 && !is<CSSImageSetValue>(*value)
384 // Walk each value and put it into a layer, creating new layers as needed.
385 CSSValueList& valueList = downcast<CSSValueList>(*value);
386 for (unsigned i = 0; i < valueList.length(); i++) {
388 previousChild->setNext(std::make_unique<FillLayer>(fillLayerType));
389 child = previousChild->next();
391 (styleResolver->styleMap()->*mapFillFunction)(propertyId, child, valueList.itemWithoutBoundsCheck(i));
392 previousChild = child;
393 child = child->next();
396 (styleResolver->styleMap()->*mapFillFunction)(propertyId, child, value);
397 child = child->next();
399 for (; child; child = child->next())
400 (child->*clearFunction)();
403 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
406 template <typename T, T (FontDescription::*getterFunction)() const, void (FontDescription::*setterFunction)(T), T initialValue>
407 class ApplyPropertyFont {
409 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
411 FontDescription fontDescription = styleResolver->fontDescription();
412 (fontDescription.*setterFunction)((styleResolver->parentFontDescription().*getterFunction)());
413 styleResolver->setFontDescription(fontDescription);
416 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
418 FontDescription fontDescription = styleResolver->fontDescription();
419 (fontDescription.*setterFunction)(initialValue);
420 styleResolver->setFontDescription(fontDescription);
423 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
425 if (!is<CSSPrimitiveValue>(*value))
427 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
428 FontDescription fontDescription = styleResolver->fontDescription();
429 (fontDescription.*setterFunction)(primitiveValue);
430 styleResolver->setFontDescription(fontDescription);
433 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
436 class ApplyPropertyFontFamily {
438 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
440 FontDescription fontDescription = styleResolver->style()->fontDescription();
441 FontDescription parentFontDescription = styleResolver->parentStyle()->fontDescription();
443 fontDescription.setGenericFamily(parentFontDescription.genericFamily());
444 fontDescription.setFamilies(parentFontDescription.families());
445 fontDescription.setIsSpecifiedFont(parentFontDescription.isSpecifiedFont());
446 styleResolver->setFontDescription(fontDescription);
450 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
452 FontDescription fontDescription = styleResolver->style()->fontDescription();
453 FontDescription initialDesc = FontDescription();
455 // We need to adjust the size to account for the generic family change from monospace to non-monospace.
456 if (fontDescription.keywordSize() && fontDescription.useFixedDefaultSize())
457 styleResolver->setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueXxSmall + fontDescription.keywordSize() - 1, false, styleResolver->document()));
458 fontDescription.setGenericFamily(initialDesc.genericFamily());
459 if (!initialDesc.firstFamily().isEmpty())
460 fontDescription.setFamilies(initialDesc.families());
462 styleResolver->setFontDescription(fontDescription);
466 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
468 if (!is<CSSValueList>(*value))
471 auto& valueList = downcast<CSSValueList>(*value);
473 FontDescription fontDescription = styleResolver->style()->fontDescription();
474 // Before mapping in a new font-family property, we should reset the generic family.
475 bool oldFamilyUsedFixedDefaultSize = fontDescription.useFixedDefaultSize();
476 fontDescription.setGenericFamily(FontDescription::NoFamily);
478 Vector<AtomicString> families;
479 families.reserveInitialCapacity(valueList.length());
481 for (unsigned i = 0; i < valueList.length(); ++i) {
482 CSSValue* item = valueList.item(i);
483 if (!is<CSSPrimitiveValue>(*item))
485 CSSPrimitiveValue& contentValue = downcast<CSSPrimitiveValue>(*item);
487 if (contentValue.isString())
488 face = contentValue.getStringValue();
489 else if (Settings* settings = styleResolver->document().settings()) {
490 switch (contentValue.getValueID()) {
491 case CSSValueWebkitBody:
492 face = settings->standardFontFamily();
496 fontDescription.setGenericFamily(FontDescription::SerifFamily);
498 case CSSValueSansSerif:
499 face = sansSerifFamily;
500 fontDescription.setGenericFamily(FontDescription::SansSerifFamily);
502 case CSSValueCursive:
503 face = cursiveFamily;
504 fontDescription.setGenericFamily(FontDescription::CursiveFamily);
506 case CSSValueFantasy:
507 face = fantasyFamily;
508 fontDescription.setGenericFamily(FontDescription::FantasyFamily);
510 case CSSValueMonospace:
511 face = monospaceFamily;
512 fontDescription.setGenericFamily(FontDescription::MonospaceFamily);
514 case CSSValueWebkitPictograph:
515 face = pictographFamily;
516 fontDescription.setGenericFamily(FontDescription::PictographFamily);
525 if (families.isEmpty())
526 fontDescription.setIsSpecifiedFont(fontDescription.genericFamily() == FontDescription::NoFamily);
527 families.uncheckedAppend(face);
530 if (families.isEmpty())
532 fontDescription.setFamilies(families);
534 if (fontDescription.keywordSize() && fontDescription.useFixedDefaultSize() != oldFamilyUsedFixedDefaultSize)
535 styleResolver->setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueXxSmall + fontDescription.keywordSize() - 1, !oldFamilyUsedFixedDefaultSize, styleResolver->document()));
537 styleResolver->setFontDescription(fontDescription);
540 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
543 class ApplyPropertyFontSize {
545 // When the CSS keyword "larger" is used, this function will attempt to match within the keyword
546 // table, and failing that, will simply multiply by 1.2.
547 static float largerFontSize(float size)
549 // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale up to
550 // the next size level.
554 // Like the previous function, but for the keyword "smaller".
555 static float smallerFontSize(float size)
557 // FIXME: Figure out where we fall in the size ranges (xx-small to xxx-large) and scale down to
558 // the next size level.
562 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
564 float size = styleResolver->parentStyle()->fontDescription().specifiedSize();
569 FontDescription fontDescription = styleResolver->style()->fontDescription();
570 fontDescription.setKeywordSize(styleResolver->parentStyle()->fontDescription().keywordSize());
571 styleResolver->setFontSize(fontDescription, size);
572 styleResolver->setFontDescription(fontDescription);
576 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
578 FontDescription fontDescription = styleResolver->style()->fontDescription();
579 float size = Style::fontSizeForKeyword(CSSValueMedium, fontDescription.useFixedDefaultSize(), styleResolver->document());
584 fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1);
585 styleResolver->setFontSize(fontDescription, size);
586 styleResolver->setFontDescription(fontDescription);
590 static float determineRubyTextSizeMultiplier(StyleResolver* styleResolver)
592 if (styleResolver->style()->rubyPosition() != RubyPositionInterCharacter)
595 Element* element = styleResolver->state().element();
596 if (element == nullptr)
599 // FIXME: This hack is to ensure tone marks are the same size as
600 // the bopomofo. This code will go away if we make a special renderer
601 // for the tone marks eventually.
602 for (const Element* currElement = element->parentElement(); currElement; currElement = currElement->parentElement()) {
603 if (currElement->hasTagName(rtTag))
609 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
611 if (!is<CSSPrimitiveValue>(*value))
614 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
616 FontDescription fontDescription = styleResolver->style()->fontDescription();
617 fontDescription.setKeywordSize(0);
618 float parentSize = 0;
619 bool parentIsAbsoluteSize = false;
622 if (styleResolver->parentStyle()) {
623 parentSize = styleResolver->parentStyle()->fontDescription().specifiedSize();
624 parentIsAbsoluteSize = styleResolver->parentStyle()->fontDescription().isAbsoluteSize();
627 if (CSSValueID ident = primitiveValue.getValueID()) {
628 // Keywords are being used.
630 case CSSValueXxSmall:
636 case CSSValueXxLarge:
637 case CSSValueWebkitXxxLarge:
638 size = Style::fontSizeForKeyword(ident, fontDescription.useFixedDefaultSize(), styleResolver->document());
639 fontDescription.setKeywordSize(ident - CSSValueXxSmall + 1);
642 size = largerFontSize(parentSize);
644 case CSSValueSmaller:
645 size = smallerFontSize(parentSize);
647 case CSSValueWebkitRubyText: {
648 float rubyTextSizeMultiplier = determineRubyTextSizeMultiplier(styleResolver);
649 size = rubyTextSizeMultiplier * parentSize;
655 fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize && (ident == CSSValueLarger || ident == CSSValueSmaller || ident == CSSValueWebkitRubyText));
657 fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize || !(primitiveValue.isPercentage() || primitiveValue.isFontRelativeLength()));
658 if (primitiveValue.isLength()) {
659 size = primitiveValue.computeLength<float>(CSSToLengthConversionData(styleResolver->parentStyle(), styleResolver->rootElementStyle(), styleResolver->document().renderView(), 1.0f, true));
660 styleResolver->state().setFontSizeHasViewportUnits(primitiveValue.isViewportPercentageLength());
661 } else if (primitiveValue.isPercentage())
662 size = (primitiveValue.getFloatValue() * parentSize) / 100.0f;
663 else if (primitiveValue.isCalculatedPercentageWithLength()) {
664 Ref<CalculationValue> calculationValue { primitiveValue.cssCalcValue()->createCalculationValue(styleResolver->state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f)) };
665 size = calculationValue->evaluate(parentSize);
673 // Overly large font sizes will cause crashes on some platforms (such as Windows).
674 // Cap font size here to make sure that doesn't happen.
675 size = std::min(maximumAllowedFontSize, size);
677 styleResolver->setFontSize(fontDescription, size);
678 styleResolver->setFontDescription(fontDescription);
682 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
685 class ApplyPropertyFontWeight {
687 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
689 if (!is<CSSPrimitiveValue>(*value))
691 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
692 FontDescription fontDescription = styleResolver->fontDescription();
693 switch (primitiveValue.getValueID()) {
694 case CSSValueInvalid:
695 ASSERT_NOT_REACHED();
698 fontDescription.setWeight(styleResolver->parentStyle()->fontDescription().weight());
699 fontDescription.setWeight(fontDescription.bolderWeight());
701 case CSSValueLighter:
702 fontDescription.setWeight(styleResolver->parentStyle()->fontDescription().weight());
703 fontDescription.setWeight(fontDescription.lighterWeight());
706 fontDescription.setWeight(primitiveValue);
708 styleResolver->setFontDescription(fontDescription);
710 static PropertyHandler createHandler()
712 PropertyHandler handler = ApplyPropertyFont<FontWeight, &FontDescription::weight, &FontDescription::setWeight, FontWeightNormal>::createHandler();
713 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
717 class ApplyPropertyFontVariantLigatures {
719 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
721 const FontDescription& parentFontDescription = styleResolver->parentFontDescription();
722 FontDescription fontDescription = styleResolver->fontDescription();
724 fontDescription.setCommonLigaturesState(parentFontDescription.commonLigaturesState());
725 fontDescription.setDiscretionaryLigaturesState(parentFontDescription.discretionaryLigaturesState());
726 fontDescription.setHistoricalLigaturesState(parentFontDescription.historicalLigaturesState());
728 styleResolver->setFontDescription(fontDescription);
731 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
733 FontDescription fontDescription = styleResolver->fontDescription();
735 fontDescription.setCommonLigaturesState(FontDescription::NormalLigaturesState);
736 fontDescription.setDiscretionaryLigaturesState(FontDescription::NormalLigaturesState);
737 fontDescription.setHistoricalLigaturesState(FontDescription::NormalLigaturesState);
739 styleResolver->setFontDescription(fontDescription);
742 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
744 FontDescription::LigaturesState commonLigaturesState = FontDescription::NormalLigaturesState;
745 FontDescription::LigaturesState discretionaryLigaturesState = FontDescription::NormalLigaturesState;
746 FontDescription::LigaturesState historicalLigaturesState = FontDescription::NormalLigaturesState;
748 if (is<CSSValueList>(*value)) {
749 CSSValueList& valueList = downcast<CSSValueList>(*value);
750 for (size_t i = 0; i < valueList.length(); ++i) {
751 CSSValue* item = valueList.itemWithoutBoundsCheck(i);
752 if (is<CSSPrimitiveValue>(*item)) {
753 switch (downcast<CSSPrimitiveValue>(*item).getValueID()) {
754 case CSSValueNoCommonLigatures:
755 commonLigaturesState = FontDescription::DisabledLigaturesState;
757 case CSSValueCommonLigatures:
758 commonLigaturesState = FontDescription::EnabledLigaturesState;
760 case CSSValueNoDiscretionaryLigatures:
761 discretionaryLigaturesState = FontDescription::DisabledLigaturesState;
763 case CSSValueDiscretionaryLigatures:
764 discretionaryLigaturesState = FontDescription::EnabledLigaturesState;
766 case CSSValueNoHistoricalLigatures:
767 historicalLigaturesState = FontDescription::DisabledLigaturesState;
769 case CSSValueHistoricalLigatures:
770 historicalLigaturesState = FontDescription::EnabledLigaturesState;
773 ASSERT_NOT_REACHED();
781 ASSERT(downcast<CSSPrimitiveValue>(*value).getValueID() == CSSValueNormal);
784 FontDescription fontDescription = styleResolver->fontDescription();
785 fontDescription.setCommonLigaturesState(commonLigaturesState);
786 fontDescription.setDiscretionaryLigaturesState(discretionaryLigaturesState);
787 fontDescription.setHistoricalLigaturesState(historicalLigaturesState);
788 styleResolver->setFontDescription(fontDescription);
791 static PropertyHandler createHandler()
793 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
797 enum CounterBehavior {Increment = 0, Reset};
798 template <CounterBehavior counterBehavior>
799 class ApplyPropertyCounter {
801 static void emptyFunction(CSSPropertyID, StyleResolver*) { }
802 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
804 CounterDirectiveMap& map = styleResolver->style()->accessCounterDirectives();
805 CounterDirectiveMap& parentMap = styleResolver->parentStyle()->accessCounterDirectives();
807 typedef CounterDirectiveMap::iterator Iterator;
808 Iterator end = parentMap.end();
809 for (Iterator it = parentMap.begin(); it != end; ++it) {
810 CounterDirectives& directives = map.add(it->key, CounterDirectives()).iterator->value;
811 if (counterBehavior == Reset) {
812 directives.inheritReset(it->value);
814 directives.inheritIncrement(it->value);
818 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
820 bool setCounterIncrementToNone = counterBehavior == Increment && is<CSSPrimitiveValue>(*value) && downcast<CSSPrimitiveValue>(*value).getValueID() == CSSValueNone;
822 if (!is<CSSValueList>(*value) && !setCounterIncrementToNone)
825 CounterDirectiveMap& map = styleResolver->style()->accessCounterDirectives();
826 typedef CounterDirectiveMap::iterator Iterator;
828 Iterator end = map.end();
829 for (Iterator it = map.begin(); it != end; ++it)
830 if (counterBehavior == Reset)
831 it->value.clearReset();
833 it->value.clearIncrement();
835 if (setCounterIncrementToNone)
838 CSSValueList& list = downcast<CSSValueList>(*value);
839 int length = list.length();
840 for (int i = 0; i < length; ++i) {
841 CSSValue* currValue = list.itemWithoutBoundsCheck(i);
842 if (!is<CSSPrimitiveValue>(*currValue))
845 Pair* pair = downcast<CSSPrimitiveValue>(*currValue).getPairValue();
846 if (!pair || !pair->first() || !pair->second())
849 AtomicString identifier = static_cast<CSSPrimitiveValue*>(pair->first())->getStringValue();
850 int value = static_cast<CSSPrimitiveValue*>(pair->second())->getIntValue();
851 CounterDirectives& directives = map.add(identifier, CounterDirectives()).iterator->value;
852 if (counterBehavior == Reset) {
853 directives.setResetValue(value);
855 directives.addIncrementValue(value);
859 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &emptyFunction, &applyValue); }
863 class ApplyPropertyCursor {
865 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
867 styleResolver->style()->setCursor(styleResolver->parentStyle()->cursor());
868 styleResolver->style()->setCursorList(styleResolver->parentStyle()->cursors());
871 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
873 styleResolver->style()->clearCursorList();
874 styleResolver->style()->setCursor(RenderStyle::initialCursor());
877 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
879 styleResolver->style()->clearCursorList();
880 if (is<CSSValueList>(*value)) {
881 CSSValueList& list = downcast<CSSValueList>(*value);
882 int length = list.length();
883 styleResolver->style()->setCursor(CursorAuto);
884 for (int i = 0; i < length; i++) {
885 CSSValue* item = list.itemWithoutBoundsCheck(i);
886 if (is<CSSCursorImageValue>(*item)) {
887 CSSCursorImageValue& image = downcast<CSSCursorImageValue>(*item);
888 if (image.updateIfSVGCursorIsUsed(styleResolver->element())) // Elements with SVG cursors are not allowed to share style.
889 styleResolver->style()->setUnique();
890 styleResolver->style()->addCursor(styleResolver->styleImage(CSSPropertyCursor, image), image.hotSpot());
891 } else if (is<CSSPrimitiveValue>(*item)) {
892 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*item);
893 if (primitiveValue.isValueID())
894 styleResolver->style()->setCursor(primitiveValue);
897 } else if (is<CSSPrimitiveValue>(*value)) {
898 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
899 if (primitiveValue.isValueID() && styleResolver->style()->cursor() != ECursor(primitiveValue))
900 styleResolver->style()->setCursor(primitiveValue);
904 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
907 static TextDecorationSkip valueToDecorationSkip(CSSPrimitiveValue& primitiveValue)
909 ASSERT(primitiveValue.isValueID());
911 switch (primitiveValue.getValueID()) {
913 return TextDecorationSkipAuto;
915 return TextDecorationSkipNone;
917 return TextDecorationSkipInk;
918 case CSSValueObjects:
919 return TextDecorationSkipObjects;
924 ASSERT_NOT_REACHED();
925 return TextDecorationSkipNone;
928 class ApplyPropertyTextDecorationSkip {
930 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
932 if (is<CSSPrimitiveValue>(*value)) {
933 styleResolver->style()->setTextDecorationSkip(valueToDecorationSkip(downcast<CSSPrimitiveValue>(*value)));
937 TextDecorationSkip skip = RenderStyle::initialTextDecorationSkip();
938 if (is<CSSValueList>(*value)) {
939 for (auto& currentValue : downcast<CSSValueList>(*value))
940 skip |= valueToDecorationSkip(downcast<CSSPrimitiveValue>(currentValue.get()));
942 styleResolver->style()->setTextDecorationSkip(skip);
944 static PropertyHandler createHandler()
946 PropertyHandler handler = ApplyPropertyDefaultBase<TextDecorationSkip, &RenderStyle::textDecorationSkip, TextDecorationSkip, &RenderStyle::setTextDecorationSkip, TextDecorationSkip, &RenderStyle::initialTextDecorationSkip>::createHandler();
947 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
951 class ApplyPropertyTextEmphasisStyle {
953 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
955 styleResolver->style()->setTextEmphasisFill(styleResolver->parentStyle()->textEmphasisFill());
956 styleResolver->style()->setTextEmphasisMark(styleResolver->parentStyle()->textEmphasisMark());
957 styleResolver->style()->setTextEmphasisCustomMark(styleResolver->parentStyle()->textEmphasisCustomMark());
960 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
962 styleResolver->style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill());
963 styleResolver->style()->setTextEmphasisMark(RenderStyle::initialTextEmphasisMark());
964 styleResolver->style()->setTextEmphasisCustomMark(RenderStyle::initialTextEmphasisCustomMark());
967 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
969 if (is<CSSValueList>(*value)) {
970 CSSValueList& list = downcast<CSSValueList>(*value);
971 ASSERT(list.length() == 2);
972 if (list.length() != 2)
974 for (unsigned i = 0; i < 2; ++i) {
975 CSSValue* item = list.itemWithoutBoundsCheck(i);
976 if (!is<CSSPrimitiveValue>(*item))
979 CSSPrimitiveValue& value = downcast<CSSPrimitiveValue>(*item);
980 if (value.getValueID() == CSSValueFilled || value.getValueID() == CSSValueOpen)
981 styleResolver->style()->setTextEmphasisFill(value);
983 styleResolver->style()->setTextEmphasisMark(value);
985 styleResolver->style()->setTextEmphasisCustomMark(nullAtom);
989 if (!is<CSSPrimitiveValue>(*value))
991 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
993 if (primitiveValue.isString()) {
994 styleResolver->style()->setTextEmphasisFill(TextEmphasisFillFilled);
995 styleResolver->style()->setTextEmphasisMark(TextEmphasisMarkCustom);
996 styleResolver->style()->setTextEmphasisCustomMark(primitiveValue.getStringValue());
1000 styleResolver->style()->setTextEmphasisCustomMark(nullAtom);
1002 if (primitiveValue.getValueID() == CSSValueFilled || primitiveValue.getValueID() == CSSValueOpen) {
1003 styleResolver->style()->setTextEmphasisFill(primitiveValue);
1004 styleResolver->style()->setTextEmphasisMark(TextEmphasisMarkAuto);
1006 styleResolver->style()->setTextEmphasisFill(TextEmphasisFillFilled);
1007 styleResolver->style()->setTextEmphasisMark(primitiveValue);
1011 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1014 template <typename T,
1015 T (Animation::*getterFunction)() const,
1016 void (Animation::*setterFunction)(T),
1017 bool (Animation::*testFunction)() const,
1018 void (Animation::*clearFunction)(),
1019 T (*initialFunction)(),
1020 void (CSSToStyleMap::*mapFunction)(Animation*, CSSValue&),
1021 AnimationList* (RenderStyle::*animationGetterFunction)(),
1022 const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
1023 class ApplyPropertyAnimation {
1025 static void setValue(Animation& animation, T value) { (animation.*setterFunction)(value); }
1026 static T value(const Animation& animation) { return (animation.*getterFunction)(); }
1027 static bool test(const Animation& animation) { return (animation.*testFunction)(); }
1028 static void clear(Animation& animation) { (animation.*clearFunction)(); }
1029 static T initial() { return (*initialFunction)(); }
1030 static void map(StyleResolver* styleResolver, Animation& animation, CSSValue& value) { (styleResolver->styleMap()->*mapFunction)(&animation, value); }
1031 static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
1032 static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
1034 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1036 AnimationList* list = accessAnimations(styleResolver->style());
1037 const AnimationList* parentList = animations(styleResolver->parentStyle());
1038 size_t i = 0, parentSize = parentList ? parentList->size() : 0;
1039 for ( ; i < parentSize && test(parentList->animation(i)); ++i) {
1040 if (list->size() <= i)
1041 list->append(Animation::create());
1042 setValue(list->animation(i), value(parentList->animation(i)));
1043 list->animation(i).setAnimationMode(parentList->animation(i).animationMode());
1046 /* Reset any remaining animations to not have the property set. */
1047 for ( ; i < list->size(); ++i)
1048 clear(list->animation(i));
1051 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
1053 AnimationList* list = accessAnimations(styleResolver->style());
1054 if (list->isEmpty())
1055 list->append(Animation::create());
1056 setValue(list->animation(0), initial());
1057 if (propertyID == CSSPropertyWebkitTransitionProperty)
1058 list->animation(0).setAnimationMode(Animation::AnimateAll);
1059 for (size_t i = 1; i < list->size(); ++i)
1060 clear(list->animation(i));
1063 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1065 AnimationList* list = accessAnimations(styleResolver->style());
1066 size_t childIndex = 0;
1067 if (is<CSSValueList>(*value)) {
1068 /* Walk each value and put it into an animation, creating new animations as needed. */
1069 for (auto& currentValue : downcast<CSSValueList>(*value)) {
1070 if (childIndex <= list->size())
1071 list->append(Animation::create());
1072 map(styleResolver, list->animation(childIndex), currentValue);
1076 if (list->isEmpty())
1077 list->append(Animation::create());
1078 map(styleResolver, list->animation(childIndex), *value);
1081 for ( ; childIndex < list->size(); ++childIndex) {
1082 /* Reset all remaining animations to not have the property set. */
1083 clear(list->animation(childIndex));
1087 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1090 class ApplyPropertyOutlineStyle {
1092 static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
1094 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInheritValue(propertyID, styleResolver);
1095 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInheritValue(propertyID, styleResolver);
1098 static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
1100 ApplyPropertyDefaultBase<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyInitialValue(propertyID, styleResolver);
1101 ApplyPropertyDefaultBase<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyInitialValue(propertyID, styleResolver);
1104 static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
1106 ApplyPropertyDefault<OutlineIsAuto, &RenderStyle::outlineStyleIsAuto, OutlineIsAuto, &RenderStyle::setOutlineStyleIsAuto, OutlineIsAuto, &RenderStyle::initialOutlineStyleIsAuto>::applyValue(propertyID, styleResolver, value);
1107 ApplyPropertyDefault<EBorderStyle, &RenderStyle::outlineStyle, EBorderStyle, &RenderStyle::setOutlineStyle, EBorderStyle, &RenderStyle::initialBorderStyle>::applyValue(propertyID, styleResolver, value);
1110 static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
1113 class ApplyPropertyAspectRatio {
1115 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1117 if (styleResolver->parentStyle()->aspectRatioType() == AspectRatioAuto)
1119 styleResolver->style()->setAspectRatioType(styleResolver->parentStyle()->aspectRatioType());
1120 styleResolver->style()->setAspectRatioDenominator(styleResolver->parentStyle()->aspectRatioDenominator());
1121 styleResolver->style()->setAspectRatioNumerator(styleResolver->parentStyle()->aspectRatioNumerator());
1124 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1126 styleResolver->style()->setAspectRatioType(RenderStyle::initialAspectRatioType());
1127 styleResolver->style()->setAspectRatioDenominator(RenderStyle::initialAspectRatioDenominator());
1128 styleResolver->style()->setAspectRatioNumerator(RenderStyle::initialAspectRatioNumerator());
1131 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1133 if (is<CSSPrimitiveValue>(*value)) {
1134 CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
1136 if (primitiveValue.getValueID() == CSSValueAuto)
1137 return styleResolver->style()->setAspectRatioType(AspectRatioAuto);
1138 if (primitiveValue.getValueID() == CSSValueFromDimensions)
1139 return styleResolver->style()->setAspectRatioType(AspectRatioFromDimensions);
1140 if (primitiveValue.getValueID() == CSSValueFromIntrinsic)
1141 return styleResolver->style()->setAspectRatioType(AspectRatioFromIntrinsic);
1144 if (!is<CSSAspectRatioValue>(*value)) {
1145 styleResolver->style()->setAspectRatioType(AspectRatioAuto);
1149 CSSAspectRatioValue& aspectRatioValue = downcast<CSSAspectRatioValue>(*value);
1150 styleResolver->style()->setAspectRatioType(AspectRatioSpecified);
1151 styleResolver->style()->setAspectRatioDenominator(aspectRatioValue.denominatorValue());
1152 styleResolver->style()->setAspectRatioNumerator(aspectRatioValue.numeratorValue());
1155 static PropertyHandler createHandler()
1157 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1161 class ApplyPropertyDisplay {
1163 static inline bool isValidDisplayValue(StyleResolver* styleResolver, EDisplay displayPropertyValue)
1165 if (styleResolver->element() && styleResolver->element()->isSVGElement() && styleResolver->style()->styleType() == NOPSEUDO)
1166 return (displayPropertyValue == INLINE || displayPropertyValue == BLOCK || displayPropertyValue == NONE);
1170 static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
1172 EDisplay display = styleResolver->parentStyle()->display();
1173 if (!isValidDisplayValue(styleResolver, display))
1175 styleResolver->style()->setDisplay(display);
1178 static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
1180 styleResolver->style()->setDisplay(RenderStyle::initialDisplay());
1183 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
1185 if (!is<CSSPrimitiveValue>(*value))
1188 EDisplay display = downcast<CSSPrimitiveValue>(*value);
1190 if (!isValidDisplayValue(styleResolver, display))
1193 styleResolver->style()->setDisplay(display);
1196 static PropertyHandler createHandler()
1198 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);
1202 const DeprecatedStyleBuilder& DeprecatedStyleBuilder::sharedStyleBuilder()
1204 static NeverDestroyed<DeprecatedStyleBuilder> styleBuilderInstance;
1205 return styleBuilderInstance;
1208 DeprecatedStyleBuilder::DeprecatedStyleBuilder()
1210 for (int i = 0; i < numCSSProperties; ++i)
1211 m_propertyMap[i] = PropertyHandler();
1213 // Please keep CSS property list in alphabetical order.
1214 setPropertyHandler(CSSPropertyBackgroundAttachment, ApplyPropertyFillLayer<EFillAttachment, CSSPropertyBackgroundAttachment, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isAttachmentSet, &FillLayer::attachment, &FillLayer::setAttachment, &FillLayer::clearAttachment, &FillLayer::initialFillAttachment, &CSSToStyleMap::mapFillAttachment>::createHandler());
1215 setPropertyHandler(CSSPropertyBackgroundBlendMode, ApplyPropertyFillLayer<BlendMode, CSSPropertyBackgroundBlendMode, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isBlendModeSet, &FillLayer::blendMode, &FillLayer::setBlendMode, &FillLayer::clearBlendMode, &FillLayer::initialFillBlendMode, &CSSToStyleMap::mapFillBlendMode>::createHandler());
1216 setPropertyHandler(CSSPropertyBackgroundClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundClip, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
1217 setPropertyHandler(CSSPropertyBackgroundColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, &RenderStyle::invalidColor>::createHandler());
1218 setPropertyHandler(CSSPropertyBackgroundImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyBackgroundImage, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
1219 setPropertyHandler(CSSPropertyBackgroundOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyBackgroundOrigin, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
1220 setPropertyHandler(CSSPropertyBackgroundPositionX, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
1221 setPropertyHandler(CSSPropertyBackgroundPositionY, ApplyPropertyFillLayer<Length, CSSPropertyBackgroundPositionY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
1222 setPropertyHandler(CSSPropertyBackgroundRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatX, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
1223 setPropertyHandler(CSSPropertyBackgroundRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyBackgroundRepeatY, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
1224 setPropertyHandler(CSSPropertyBackgroundSize, ApplyPropertyFillLayer<FillSize, CSSPropertyBackgroundSize, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
1225 setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
1226 setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
1227 setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
1228 setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler());
1229 setPropertyHandler(CSSPropertyClip, ApplyPropertyClip::createHandler());
1230 setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler());
1231 setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::createHandler());
1232 setPropertyHandler(CSSPropertyCounterReset, ApplyPropertyCounter<Reset>::createHandler());
1233 setPropertyHandler(CSSPropertyCursor, ApplyPropertyCursor::createHandler());
1234 setPropertyHandler(CSSPropertyDisplay, ApplyPropertyDisplay::createHandler());
1235 setPropertyHandler(CSSPropertyFontFamily, ApplyPropertyFontFamily::createHandler());
1236 setPropertyHandler(CSSPropertyFontSize, ApplyPropertyFontSize::createHandler());
1237 setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
1238 setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
1239 setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
1240 setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
1241 setPropertyHandler(CSSPropertyOrphans, ApplyPropertyAuto<short, &RenderStyle::orphans, &RenderStyle::setOrphans, &RenderStyle::hasAutoOrphans, &RenderStyle::setHasAutoOrphans>::createHandler());
1242 setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
1243 setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
1244 setPropertyHandler(CSSPropertyWebkitTextDecorationColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textDecorationColor, &RenderStyle::setTextDecorationColor, &RenderStyle::setVisitedLinkTextDecorationColor, &RenderStyle::color>::createHandler());
1245 setPropertyHandler(CSSPropertyWebkitTextDecorationSkip, ApplyPropertyTextDecorationSkip::createHandler());
1246 setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
1248 setPropertyHandler(CSSPropertyAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1249 setPropertyHandler(CSSPropertyAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSToStyleMap::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1250 setPropertyHandler(CSSPropertyAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1251 setPropertyHandler(CSSPropertyAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSToStyleMap::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1252 setPropertyHandler(CSSPropertyAnimationIterationCount, ApplyPropertyAnimation<double, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSToStyleMap::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1253 setPropertyHandler(CSSPropertyAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSToStyleMap::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1254 setPropertyHandler(CSSPropertyAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSToStyleMap::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1255 setPropertyHandler(CSSPropertyAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1257 setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1258 setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSToStyleMap::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1259 setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1260 setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSToStyleMap::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1261 setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<double, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSToStyleMap::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1262 setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSToStyleMap::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1263 setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSToStyleMap::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1264 setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
1265 setPropertyHandler(CSSPropertyWebkitAspectRatio, ApplyPropertyAspectRatio::createHandler());
1266 setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
1267 setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
1268 setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
1269 setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
1270 setPropertyHandler(CSSPropertyColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
1271 setPropertyHandler(CSSPropertyColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
1272 setPropertyHandler(CSSPropertyColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
1273 setPropertyHandler(CSSPropertyColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
1274 setPropertyHandler(CSSPropertyWebkitFontKerning, ApplyPropertyFont<FontDescription::Kerning, &FontDescription::kerning, &FontDescription::setKerning, FontDescription::AutoKerning>::createHandler());
1275 setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
1276 setPropertyHandler(CSSPropertyWebkitFontVariantLigatures, ApplyPropertyFontVariantLigatures::createHandler());
1277 setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
1278 setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
1279 setPropertyHandler(CSSPropertyWebkitMaskImage, ApplyPropertyFillLayer<StyleImage*, CSSPropertyWebkitMaskImage, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isImageSet, &FillLayer::image, &FillLayer::setImage, &FillLayer::clearImage, &FillLayer::initialFillImage, &CSSToStyleMap::mapFillImage>::createHandler());
1280 setPropertyHandler(CSSPropertyWebkitMaskOrigin, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskOrigin, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isOriginSet, &FillLayer::origin, &FillLayer::setOrigin, &FillLayer::clearOrigin, &FillLayer::initialFillOrigin, &CSSToStyleMap::mapFillOrigin>::createHandler());
1281 setPropertyHandler(CSSPropertyWebkitMaskPositionX, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isXPositionSet, &FillLayer::xPosition, &FillLayer::setXPosition, &FillLayer::clearXPosition, &FillLayer::initialFillXPosition, &CSSToStyleMap::mapFillXPosition>::createHandler());
1282 setPropertyHandler(CSSPropertyWebkitMaskPositionY, ApplyPropertyFillLayer<Length, CSSPropertyWebkitMaskPositionY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isYPositionSet, &FillLayer::yPosition, &FillLayer::setYPosition, &FillLayer::clearYPosition, &FillLayer::initialFillYPosition, &CSSToStyleMap::mapFillYPosition>::createHandler());
1283 setPropertyHandler(CSSPropertyWebkitMaskRepeatX, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatX, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatXSet, &FillLayer::repeatX, &FillLayer::setRepeatX, &FillLayer::clearRepeatX, &FillLayer::initialFillRepeatX, &CSSToStyleMap::mapFillRepeatX>::createHandler());
1284 setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
1285 setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
1286 setPropertyHandler(CSSPropertyWebkitMaskSourceType, ApplyPropertyFillLayer<EMaskSourceType, CSSPropertyWebkitMaskSourceType, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isMaskSourceTypeSet, &FillLayer::maskSourceType, &FillLayer::setMaskSourceType, &FillLayer::clearMaskSourceType, &FillLayer::initialMaskSourceType, &CSSToStyleMap::mapFillMaskSourceType>::createHandler());
1287 setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitPerspectiveOriginX, CSSPropertyWebkitPerspectiveOriginY>::createHandler());
1288 setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler());
1289 setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
1290 setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
1291 setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
1292 setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1293 setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1294 setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<CSSPropertyID, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSToStyleMap::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1295 setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
1296 setPropertyHandler(CSSPropertyWidows, ApplyPropertyAuto<short, &RenderStyle::widows, &RenderStyle::setWidows, &RenderStyle::hasAutoWidows, &RenderStyle::setHasAutoWidows>::createHandler());
1298 setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());