Changeset 175381 in webkit
- Timestamp:
- Oct 30, 2014, 2:30:19 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
css/CSSPropertyNames.in (modified) (2 diffs)
-
css/DeprecatedStyleBuilder.cpp (modified) (3 diffs)
-
css/StyleBuilderConverter.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r175380 r175381 1 2014-10-30 Chris Dumez <cdumez@apple.com> 2 3 Move -webkit-border-image / -webkit-mask-box-image to the new StyleBuilder 4 https://bugs.webkit.org/show_bug.cgi?id=138207 5 6 Reviewed by Andreas Kling. 7 8 Move -webkit-border-image / -webkit-mask-box-image CSS properties to 9 the new StyleBuilder so that they are now generated from 10 CSSPropertyNames.in. 11 12 No new tests, no behavior change. 13 14 * css/CSSPropertyNames.in: 15 * css/DeprecatedStyleBuilder.cpp: 16 (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): 17 (WebCore::ApplyPropertyBorderImage::applyValue): Deleted. 18 (WebCore::ApplyPropertyBorderImage::createHandler): Deleted. 19 * css/StyleBuilderConverter.h: 20 (WebCore::StyleBuilderConverter::convertBorderImage): 21 (WebCore::StyleBuilderConverter::convertBorderMask): 22 1 23 2014-10-30 Chris Dumez <cdumez@apple.com> 2 24 -
trunk/Source/WebCore/css/CSSPropertyNames.in
r175267 r175381 289 289 -webkit-border-fit [NewStyleBuilder] 290 290 -webkit-border-horizontal-spacing [Inherited, NewStyleBuilder, NameForMethods=HorizontalBorderSpacing, Converter=ComputedLength<short>] 291 -webkit-border-image 291 -webkit-border-image [NewStyleBuilder, Initial=initialNinePieceImage, Converter=BorderImage<CSSPropertyWebkitBorderImage>] 292 292 // -webkit-border-radius differs from border-radius only in the interpretation of 293 293 // a value consisting of two lengths: "-webkit-border-radius: l1 l2;" is equivalent … … 408 408 -webkit-marquee-style [NewStyleBuilder, TypeName=EMarqueeBehavior, NameForMethods=MarqueeBehavior] 409 409 -webkit-mask 410 -webkit-mask-box-image 410 -webkit-mask-box-image [NewStyleBuilder, Initial=initialNinePieceImage, Converter=BorderMask<CSSPropertyWebkitMaskBoxImage>] 411 411 -webkit-mask-box-image-outset 412 412 -webkit-mask-box-image-repeat -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r175267 r175381 903 903 904 904 enum BorderImageType { BorderImage = 0, BorderMask }; 905 template <BorderImageType borderImageType,906 CSSPropertyID property,907 const NinePieceImage& (RenderStyle::*getterFunction)() const,908 void (RenderStyle::*setterFunction)(const NinePieceImage&)>909 class ApplyPropertyBorderImage {910 public:911 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)912 {913 NinePieceImage image;914 if (borderImageType == BorderMask)915 image.setMaskDefaults();916 styleResolver->styleMap()->mapNinePieceImage(property, value, image);917 (styleResolver->style()->*setterFunction)(image);918 }919 920 static PropertyHandler createHandler()921 {922 PropertyHandler handler = ApplyPropertyDefaultBase<const NinePieceImage&, getterFunction, const NinePieceImage&, setterFunction, NinePieceImage, &RenderStyle::initialNinePieceImage>::createHandler();923 return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);924 }925 };926 927 905 enum BorderImageModifierType { Outset, Repeat, Slice, Width }; 928 906 template <BorderImageType type, BorderImageModifierType modifier> … … 2267 2245 setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin); 2268 2246 setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize); 2269 setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage<BorderImage, CSSPropertyWebkitBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());2270 2247 setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler()); 2271 2248 setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler()); … … 2284 2261 setPropertyHandler(CSSPropertyWebkitMarqueeRepetition, ApplyPropertyMarqueeRepetition::createHandler()); 2285 2262 setPropertyHandler(CSSPropertyWebkitMarqueeSpeed, ApplyPropertyMarqueeSpeed::createHandler()); 2286 setPropertyHandler(CSSPropertyWebkitMaskBoxImage, ApplyPropertyBorderImage<BorderMask, CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage>::createHandler());2287 2263 setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<BorderMask, Outset>::createHandler()); 2288 2264 setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<BorderMask, Repeat>::createHandler()); -
trunk/Source/WebCore/css/StyleBuilderConverter.h
r175267 r175381 48 48 static TextDecoration convertTextDecoration(StyleResolver&, CSSValue&); 49 49 template <typename T> static T convertNumber(StyleResolver&, CSSValue&); 50 template <CSSPropertyID property> static NinePieceImage convertBorderImage(StyleResolver&, CSSValue&); 51 template <CSSPropertyID property> static NinePieceImage convertBorderMask(StyleResolver&, CSSValue&); 50 52 51 53 private: … … 207 209 } 208 210 211 template <CSSPropertyID property> 212 inline NinePieceImage StyleBuilderConverter::convertBorderImage(StyleResolver& styleResolver, CSSValue& value) 213 { 214 NinePieceImage image; 215 styleResolver.styleMap()->mapNinePieceImage(property, &value, image); 216 return image; 217 } 218 219 template <CSSPropertyID property> 220 inline NinePieceImage StyleBuilderConverter::convertBorderMask(StyleResolver& styleResolver, CSSValue& value) 221 { 222 NinePieceImage image = convertBorderImage<property>(styleResolver, value); 223 image.setMaskDefaults(); 224 return image; 225 } 226 209 227 } // namespace WebCore 210 228
Note:
See TracChangeset
for help on using the changeset viewer.