From 6bbb7fbbac94d0f511a7bd0cbd50854ab643bfb2 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 18 Sep 2012 15:53:33 +0200 Subject: Imported WebKit commit c7503cef7ecb236730d1309676ab9fc723fd061d (http://svn.webkit.org/repository/webkit/trunk@128886) New snapshot with various build fixes --- Source/WebCore/css/StyleBuilder.cpp | 240 ++++++++++++++++++------------------ 1 file changed, 121 insertions(+), 119 deletions(-) (limited to 'Source/WebCore/css/StyleBuilder.cpp') diff --git a/Source/WebCore/css/StyleBuilder.cpp b/Source/WebCore/css/StyleBuilder.cpp index ed0a15fbc..09c27b717 100644 --- a/Source/WebCore/css/StyleBuilder.cpp +++ b/Source/WebCore/css/StyleBuilder.cpp @@ -33,6 +33,7 @@ #include "CSSPrimitiveValueMappings.h" #include "CSSToStyleMap.h" #include "CSSValueList.h" +#include "ClipPathOperation.h" #include "CursorList.h" #include "Document.h" #include "Element.h" @@ -56,7 +57,7 @@ class ApplyPropertyExpanding { public: template - static inline void applyInheritValue(StyleResolver* styleResolver) + static inline void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { if (id == CSSPropertyInvalid) return; @@ -64,20 +65,20 @@ public: const StyleBuilder& table = StyleBuilder::sharedStyleBuilder(); const PropertyHandler& handler = table.propertyHandler(id); if (handler.isValid()) - handler.applyInheritValue(styleResolver); + handler.applyInheritValue(propertyID, styleResolver); } - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { - applyInheritValue(styleResolver); - applyInheritValue(styleResolver); - applyInheritValue(styleResolver); - applyInheritValue(styleResolver); - applyInheritValue(styleResolver); + applyInheritValue(propertyID, styleResolver); + applyInheritValue(propertyID, styleResolver); + applyInheritValue(propertyID, styleResolver); + applyInheritValue(propertyID, styleResolver); + applyInheritValue(propertyID, styleResolver); } template - static inline void applyInitialValue(StyleResolver* styleResolver) + static inline void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { if (id == CSSPropertyInvalid) return; @@ -85,20 +86,20 @@ public: const StyleBuilder& table = StyleBuilder::sharedStyleBuilder(); const PropertyHandler& handler = table.propertyHandler(id); if (handler.isValid()) - handler.applyInitialValue(styleResolver); + handler.applyInitialValue(propertyID, styleResolver); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { - applyInitialValue(styleResolver); - applyInitialValue(styleResolver); - applyInitialValue(styleResolver); - applyInitialValue(styleResolver); - applyInitialValue(styleResolver); + applyInitialValue(propertyID, styleResolver); + applyInitialValue(propertyID, styleResolver); + applyInitialValue(propertyID, styleResolver); + applyInitialValue(propertyID, styleResolver); + applyInitialValue(propertyID, styleResolver); } template - static inline void applyValue(StyleResolver* styleResolver, CSSValue* value) + static inline void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value) { if (id == CSSPropertyInvalid) return; @@ -106,19 +107,19 @@ public: const StyleBuilder& table = StyleBuilder::sharedStyleBuilder(); const PropertyHandler& handler = table.propertyHandler(id); if (handler.isValid()) - handler.applyValue(styleResolver, value); + handler.applyValue(propertyID, styleResolver, value); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value) { if (!expandValue) return; - applyValue(styleResolver, value); - applyValue(styleResolver, value); - applyValue(styleResolver, value); - applyValue(styleResolver, value); - applyValue(styleResolver, value); + applyValue(propertyID, styleResolver, value); + applyValue(propertyID, styleResolver, value); + applyValue(propertyID, styleResolver, value); + applyValue(propertyID, styleResolver, value); + applyValue(propertyID, styleResolver, value); } static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } }; @@ -129,9 +130,9 @@ public: static void setValue(RenderStyle* style, SetterType value) { (style->*setterFunction)(value); } static GetterType value(RenderStyle* style) { return (style->*getterFunction)(); } static InitialType initial() { return (*initialFunction)(); } - static void applyInheritValue(StyleResolver* styleResolver) { setValue(styleResolver->style(), value(styleResolver->parentStyle())); } - static void applyInitialValue(StyleResolver* styleResolver) { setValue(styleResolver->style(), initial()); } - static void applyValue(StyleResolver*, CSSValue*) { } + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { setValue(styleResolver->style(), value(styleResolver->parentStyle())); } + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { setValue(styleResolver->style(), initial()); } + static void applyValue(CSSPropertyID, StyleResolver*, CSSValue*) { } static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } }; @@ -139,7 +140,7 @@ template *setterFunction)(value); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (value->isPrimitiveValue()) setValue(styleResolver->style(), *static_cast(value)); @@ -155,7 +156,7 @@ template *setterFunction)(value); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -176,7 +177,7 @@ public: template ), StyleImage* (*initialFunction)(), CSSPropertyID property> class ApplyPropertyStyleImage { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(property, value)); } + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(property, value)); } static PropertyHandler createHandler() { PropertyHandler handler = ApplyPropertyDefaultBase, setterFunction, StyleImage*, initialFunction>::createHandler(); @@ -193,7 +194,7 @@ public: static bool hasAuto(RenderStyle* style) { return (style->*hasAutoFunction)(); } static void setAuto(RenderStyle* style) { (style->*setAutoFunction)(); } - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { if (hasAuto(styleResolver->parentStyle())) setAuto(styleResolver->style()); @@ -201,9 +202,9 @@ public: setValue(styleResolver->style(), value(styleResolver->parentStyle())); } - static void applyInitialValue(StyleResolver* styleResolver) { setAuto(styleResolver->style()); } + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { setAuto(styleResolver->style()); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -227,22 +228,22 @@ private: return value->convertToLength(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()); } public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { RenderStyle* parentStyle = styleResolver->parentStyle(); if (!parentStyle->hasClip()) - return applyInitialValue(styleResolver); + return applyInitialValue(propertyID, styleResolver); styleResolver->style()->setClip(parentStyle->clipTop(), parentStyle->clipRight(), parentStyle->clipBottom(), parentStyle->clipLeft()); styleResolver->style()->setHasClip(true); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { styleResolver->style()->setClip(Length(), Length(), Length(), Length()); styleResolver->style()->setHasClip(false); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -276,26 +277,26 @@ template class ApplyPropertyColor { public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { // Visited link style can never explicitly inherit from parent visited link style so no separate getters are needed. Color color = (styleResolver->parentStyle()->*getterFunction)(); applyColorValue(styleResolver, color.isValid() ? color : (styleResolver->parentStyle()->*defaultFunction)()); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { applyColorValue(styleResolver, initialFunction()); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; CSSPrimitiveValue* primitiveValue = static_cast(value); if (inheritColorFromParent && primitiveValue->getIdent() == CSSValueCurrentcolor) - applyInheritValue(styleResolver); + applyInheritValue(propertyID, styleResolver); else { if (styleResolver->applyPropertyToRegularStyle()) (styleResolver->style()->*setterFunction)(styleResolver->colorFromPrimitiveValue(primitiveValue)); @@ -318,9 +319,9 @@ public: template class ApplyPropertyDirection { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value) { - ApplyPropertyDefault::applyValue(styleResolver, value); + ApplyPropertyDefault::applyValue(propertyID, styleResolver, value); Element* element = styleResolver->element(); if (element && styleResolver->element() == element->document()->documentElement()) element->document()->setDirectionSetOnDocumentElement(true); @@ -349,7 +350,7 @@ template *setterFunction)(value); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -404,7 +405,7 @@ template *setterFunction)(value); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -426,7 +427,7 @@ template *setterFunction)(value); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -502,7 +503,7 @@ template class ApplyPropertyFillLayer { public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)(); FillLayer* prevChild = 0; @@ -526,7 +527,7 @@ public: } } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)(); (currChild->*setFunction)((*initialFunction)(fillLayerType)); @@ -534,7 +535,7 @@ public: (currChild->*clearFunction)(); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { FillLayer* currChild = (styleResolver->style()->*accessLayersFunction)(); FillLayer* prevChild = 0; @@ -582,7 +583,7 @@ template *setterFunction)(value); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { // note: CSSPropertyLetter/WordSpacing right now sets to zero if it's not a primitive value for some reason... if (!value->isPrimitiveValue()) @@ -629,21 +630,21 @@ public: template class ApplyPropertyFont { public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { FontDescription fontDescription = styleResolver->fontDescription(); (fontDescription.*setterFunction)((styleResolver->parentFontDescription().*getterFunction)()); styleResolver->setFontDescription(fontDescription); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { FontDescription fontDescription = styleResolver->fontDescription(); (fontDescription.*setterFunction)(initialValue); styleResolver->setFontDescription(fontDescription); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -675,7 +676,7 @@ private: return size / 1.2f; } public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { float size = styleResolver->parentStyle()->fontDescription().specifiedSize(); @@ -689,7 +690,7 @@ public: return; } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { FontDescription fontDescription = styleResolver->style()->fontDescription(); float size = styleResolver->fontSizeForKeyword(styleResolver->document(), CSSValueMedium, fontDescription.useFixedDefaultSize()); @@ -703,7 +704,7 @@ public: return; } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -778,7 +779,7 @@ public: class ApplyPropertyFontWeight { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -808,7 +809,7 @@ public: class ApplyPropertyFontVariantLigatures { public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { const FontDescription& parentFontDescription = styleResolver->parentFontDescription(); FontDescription fontDescription = styleResolver->fontDescription(); @@ -820,7 +821,7 @@ public: styleResolver->setFontDescription(fontDescription); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { FontDescription fontDescription = styleResolver->fontDescription(); @@ -831,7 +832,7 @@ public: styleResolver->setFontDescription(fontDescription); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { FontDescription::LigaturesState commonLigaturesState = FontDescription::NormalLigaturesState; FontDescription::LigaturesState discretionaryLigaturesState = FontDescription::NormalLigaturesState; @@ -897,7 +898,7 @@ template class ApplyPropertyBorderImage { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { NinePieceImage image; if (borderImageType == Mask) @@ -920,7 +921,7 @@ private: static inline const NinePieceImage& getValue(RenderStyle* style) { return type == Image ? style->borderImage() : style->maskBoxImage(); } static inline void setValue(RenderStyle* style, const NinePieceImage& value) { return type == Image ? style->setBorderImage(value) : style->setMaskBoxImage(value); } public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { NinePieceImage image(getValue(styleResolver->style())); switch (modifier) { @@ -940,7 +941,7 @@ public: setValue(styleResolver->style(), image); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { NinePieceImage image(getValue(styleResolver->style())); switch (modifier) { @@ -964,7 +965,7 @@ public: setValue(styleResolver->style(), image); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { NinePieceImage image(getValue(styleResolver->style())); switch (modifier) { @@ -990,7 +991,7 @@ public: template ), StyleImage* (*initialFunction)()> class ApplyPropertyBorderImageSource { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(id, value)); } + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(id, value)); } static PropertyHandler createHandler() { PropertyHandler handler = ApplyPropertyDefaultBase, setterFunction, StyleImage*, initialFunction>::createHandler(); @@ -1002,8 +1003,8 @@ enum CounterBehavior {Increment = 0, Reset}; template class ApplyPropertyCounter { public: - static void emptyFunction(StyleResolver*) { } - static void applyInheritValue(StyleResolver* styleResolver) + static void emptyFunction(CSSPropertyID, StyleResolver*) { } + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { CounterDirectiveMap& map = styleResolver->style()->accessCounterDirectives(); CounterDirectiveMap& parentMap = styleResolver->parentStyle()->accessCounterDirectives(); @@ -1019,7 +1020,7 @@ public: } } } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isValueList()) return; @@ -1062,19 +1063,19 @@ public: class ApplyPropertyCursor { public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { styleResolver->style()->setCursor(styleResolver->parentStyle()->cursor()); styleResolver->style()->setCursorList(styleResolver->parentStyle()->cursors()); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { styleResolver->style()->clearCursorList(); styleResolver->style()->setCursor(RenderStyle::initialCursor()); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { styleResolver->style()->clearCursorList(); if (value->isValueList()) { @@ -1106,7 +1107,7 @@ public: class ApplyPropertyTextAlign { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -1131,7 +1132,7 @@ public: class ApplyPropertyTextDecoration { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { ETextDecoration t = RenderStyle::initialTextDecoration(); for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { @@ -1150,7 +1151,7 @@ public: class ApplyPropertyLineHeight { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -1264,9 +1265,9 @@ private: return true; } public: - static void applyInheritValue(StyleResolver*) { } - static void applyInitialValue(StyleResolver*) { } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyInheritValue(CSSPropertyID, StyleResolver*) { } + static void applyInitialValue(CSSPropertyID, StyleResolver*) { } + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { styleResolver->style()->resetPageSizeType(); Length width; @@ -1337,21 +1338,21 @@ public: class ApplyPropertyTextEmphasisStyle { public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { styleResolver->style()->setTextEmphasisFill(styleResolver->parentStyle()->textEmphasisFill()); styleResolver->style()->setTextEmphasisMark(styleResolver->parentStyle()->textEmphasisMark()); styleResolver->style()->setTextEmphasisCustomMark(styleResolver->parentStyle()->textEmphasisCustomMark()); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { styleResolver->style()->setTextEmphasisFill(RenderStyle::initialTextEmphasisFill()); styleResolver->style()->setTextEmphasisMark(RenderStyle::initialTextEmphasisMark()); styleResolver->style()->setTextEmphasisCustomMark(RenderStyle::initialTextEmphasisCustomMark()); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (value->isValueList()) { CSSValueList* list = static_cast(value); @@ -1418,7 +1419,7 @@ public: static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); } static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); } - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { AnimationList* list = accessAnimations(styleResolver->style()); const AnimationList* parentList = animations(styleResolver->parentStyle()); @@ -1435,17 +1436,19 @@ public: clear(list->animation(i)); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { AnimationList* list = accessAnimations(styleResolver->style()); if (list->isEmpty()) list->append(Animation::create()); setValue(list->animation(0), initial()); + if (propertyID == CSSPropertyWebkitTransitionProperty) + list->animation(0)->setAnimationMode(Animation::AnimateAll); for (size_t i = 1; i < list->size(); ++i) clear(list->animation(i)); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { AnimationList* list = accessAnimations(styleResolver->style()); size_t childIndex = 0; @@ -1474,22 +1477,22 @@ public: class ApplyPropertyOutlineStyle { public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { - ApplyPropertyDefaultBase::applyInheritValue(styleResolver); - ApplyPropertyDefaultBase::applyInheritValue(styleResolver); + ApplyPropertyDefaultBase::applyInheritValue(propertyID, styleResolver); + ApplyPropertyDefaultBase::applyInheritValue(propertyID, styleResolver); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { - ApplyPropertyDefaultBase::applyInitialValue(styleResolver); - ApplyPropertyDefaultBase::applyInitialValue(styleResolver); + ApplyPropertyDefaultBase::applyInitialValue(propertyID, styleResolver); + ApplyPropertyDefaultBase::applyInitialValue(propertyID, styleResolver); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value) { - ApplyPropertyDefault::applyValue(styleResolver, value); - ApplyPropertyDefault::applyValue(styleResolver, value); + ApplyPropertyDefault::applyValue(propertyID, styleResolver, value); + ApplyPropertyDefault::applyValue(propertyID, styleResolver, value); } static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); } @@ -1497,7 +1500,7 @@ public: class ApplyPropertyResize { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -1527,7 +1530,7 @@ public: class ApplyPropertyVerticalAlign { public: - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -1549,7 +1552,7 @@ public: class ApplyPropertyAspectRatio { public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { if (!styleResolver->parentStyle()->hasAspectRatio()) return; @@ -1558,14 +1561,14 @@ public: styleResolver->style()->setAspectRatioNumerator(styleResolver->parentStyle()->aspectRatioNumerator()); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { styleResolver->style()->setHasAspectRatio(RenderStyle::initialHasAspectRatio()); styleResolver->style()->setAspectRatioDenominator(RenderStyle::initialAspectRatioDenominator()); styleResolver->style()->setAspectRatioNumerator(RenderStyle::initialAspectRatioNumerator()); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isAspectRatioValue()) { styleResolver->style()->setHasAspectRatio(false); @@ -1592,19 +1595,19 @@ private: } public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { resetEffectiveZoom(styleResolver); styleResolver->setZoom(styleResolver->parentStyle()->zoom()); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { resetEffectiveZoom(styleResolver); styleResolver->setZoom(RenderStyle::initialZoom()); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { ASSERT(value->isPrimitiveValue()); CSSPrimitiveValue* primitiveValue = static_cast(value); @@ -1650,7 +1653,7 @@ private: return true; } public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver) { EDisplay display = styleResolver->parentStyle()->display(); if (!isValidDisplayValue(styleResolver, display)) @@ -1658,12 +1661,12 @@ public: styleResolver->style()->setDisplay(display); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { styleResolver->style()->setDisplay(RenderStyle::initialDisplay()); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isPrimitiveValue()) return; @@ -1682,25 +1685,24 @@ public: } }; -template ), BasicShape* (*initialFunction)()> +template ), ClipPathOperation* (*initialFunction)()> class ApplyPropertyClipPath { public: - static void setValue(RenderStyle* style, PassRefPtr value) { (style->*setterFunction)(value); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void setValue(RenderStyle* style, PassRefPtr value) { (style->*setterFunction)(value); } + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (value->isPrimitiveValue()) { CSSPrimitiveValue* primitiveValue = static_cast(value); if (primitiveValue->getIdent() == CSSValueNone) setValue(styleResolver->style(), 0); else if (primitiveValue->isShape()) { - RefPtr clipPathShape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue()); - setValue(styleResolver->style(), clipPathShape.release()); + setValue(styleResolver->style(), ShapeClipPathOperation::create(basicShapeForValue(styleResolver, primitiveValue->getShapeValue()))); } } } static PropertyHandler createHandler() { - PropertyHandler handler = ApplyPropertyDefaultBase, setterFunction, BasicShape*, initialFunction>::createHandler(); + PropertyHandler handler = ApplyPropertyDefaultBase, setterFunction, ClipPathOperation*, initialFunction>::createHandler(); return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue); } }; @@ -1710,7 +1712,7 @@ template value) { (style->*setterFunction)(value); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (value->isPrimitiveValue()) { CSSPrimitiveValue* primitiveValue = static_cast(value); @@ -1733,21 +1735,21 @@ public: #if ENABLE(CSS_IMAGE_RESOLUTION) class ApplyPropertyImageResolution { public: - static void applyInheritValue(StyleResolver* styleResolver) + static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { - ApplyPropertyDefaultBase::applyInheritValue(styleResolver); - ApplyPropertyDefaultBase::applyInheritValue(styleResolver); - ApplyPropertyDefaultBase::applyInheritValue(styleResolver); + ApplyPropertyDefaultBase::applyInheritValue(propertyID, styleResolver); + ApplyPropertyDefaultBase::applyInheritValue(propertyID, styleResolver); + ApplyPropertyDefaultBase::applyInheritValue(propertyID, styleResolver); } - static void applyInitialValue(StyleResolver* styleResolver) + static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver) { - ApplyPropertyDefaultBase::applyInitialValue(styleResolver); - ApplyPropertyDefaultBase::applyInitialValue(styleResolver); - ApplyPropertyDefaultBase::applyInitialValue(styleResolver); + ApplyPropertyDefaultBase::applyInitialValue(propertyID, styleResolver); + ApplyPropertyDefaultBase::applyInitialValue(propertyID, styleResolver); + ApplyPropertyDefaultBase::applyInitialValue(propertyID, styleResolver); } - static void applyValue(StyleResolver* styleResolver, CSSValue* value) + static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { if (!value->isValueList()) return; -- cgit v1.2.1