Title: [175405] trunk/Source/WebCore
Revision
175405
Author
[email protected]
Date
2014-10-30 19:37:40 -0700 (Thu, 30 Oct 2014)

Log Message

Move border-image-source / -webkit-mask-box-image-source to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138209

Reviewed by Andreas Kling.

Move border-image-source / -webkit-mask-box-image-source CSS properties
from DeprecatedStyleBuilder to the new StyleBuilder so that they are
now generated from CSSPropertyNames.in.

No new tests, no behavior change.

* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyBorderImageSource::applyValue): Deleted.
(WebCore::ApplyPropertyBorderImageSource::createHandler): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertBorderImageSource):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (175404 => 175405)


--- trunk/Source/WebCore/ChangeLog	2014-10-31 01:16:24 UTC (rev 175404)
+++ trunk/Source/WebCore/ChangeLog	2014-10-31 02:37:40 UTC (rev 175405)
@@ -1,3 +1,24 @@
+2014-10-30  Chris Dumez  <[email protected]>
+
+        Move border-image-source / -webkit-mask-box-image-source to the new StyleBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=138209
+
+        Reviewed by Andreas Kling.
+
+        Move border-image-source / -webkit-mask-box-image-source CSS properties
+        from DeprecatedStyleBuilder to the new StyleBuilder so that they are
+        now generated from CSSPropertyNames.in.
+
+        No new tests, no behavior change.
+
+        * css/CSSPropertyNames.in:
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
+        (WebCore::ApplyPropertyBorderImageSource::applyValue): Deleted.
+        (WebCore::ApplyPropertyBorderImageSource::createHandler): Deleted.
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertBorderImageSource):
+
 2014-10-30  Jer Noble  <[email protected]>
 
         [EME] Add Setting for accessing storage location for MediaKeys data

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (175404 => 175405)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2014-10-31 01:16:24 UTC (rev 175404)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2014-10-31 02:37:40 UTC (rev 175405)
@@ -113,7 +113,7 @@
 border-image-outset
 border-image-repeat
 border-image-slice
-border-image-source
+border-image-source [NewStyleBuilder, Converter=BorderImageSource<CSSPropertyBorderImageSource>]
 border-image-width
 border-left
 border-left-color
@@ -411,7 +411,7 @@
 -webkit-mask-box-image-outset
 -webkit-mask-box-image-repeat
 -webkit-mask-box-image-slice
--webkit-mask-box-image-source
+-webkit-mask-box-image-source [NewStyleBuilder, Converter=BorderImageSource<CSSPropertyWebkitMaskBoxImageSource>]
 -webkit-mask-box-image-width
 -webkit-mask-clip
 -webkit-mask-composite

Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (175404 => 175405)


--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp	2014-10-31 01:16:24 UTC (rev 175404)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp	2014-10-31 02:37:40 UTC (rev 175405)
@@ -976,17 +976,6 @@
     static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
 };
 
-template <CSSPropertyID id, StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)()>
-class ApplyPropertyBorderImageSource {
-public:
-    static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) { (styleResolver->style()->*setterFunction)(styleResolver->styleImage(id, value)); }
-    static PropertyHandler createHandler()
-    {
-        PropertyHandler handler = ApplyPropertyDefaultBase<StyleImage*, getterFunction, PassRefPtr<StyleImage>, setterFunction, StyleImage*, initialFunction>::createHandler();
-        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
-    }
-};
-
 enum CounterBehavior {Increment = 0, Reset};
 template <CounterBehavior counterBehavior>
 class ApplyPropertyCounter {
@@ -2193,7 +2182,6 @@
     setPropertyHandler(CSSPropertyBorderImageOutset, ApplyPropertyBorderImageModifier<BorderImage, Outset>::createHandler());
     setPropertyHandler(CSSPropertyBorderImageRepeat, ApplyPropertyBorderImageModifier<BorderImage, Repeat>::createHandler());
     setPropertyHandler(CSSPropertyBorderImageSlice, ApplyPropertyBorderImageModifier<BorderImage, Slice>::createHandler());
-    setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource<CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource, &RenderStyle::initialBorderImageSource>::createHandler());
     setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier<BorderImage, Width>::createHandler());
     setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
     setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
@@ -2263,7 +2251,6 @@
     setPropertyHandler(CSSPropertyWebkitMaskBoxImageOutset, ApplyPropertyBorderImageModifier<BorderMask, Outset>::createHandler());
     setPropertyHandler(CSSPropertyWebkitMaskBoxImageRepeat, ApplyPropertyBorderImageModifier<BorderMask, Repeat>::createHandler());
     setPropertyHandler(CSSPropertyWebkitMaskBoxImageSlice, ApplyPropertyBorderImageModifier<BorderMask, Slice>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitMaskBoxImageSource, ApplyPropertyBorderImageSource<CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource, &RenderStyle::initialMaskBoxImageSource>::createHandler());
     setPropertyHandler(CSSPropertyWebkitMaskBoxImageWidth, ApplyPropertyBorderImageModifier<BorderMask, Width>::createHandler());
     setPropertyHandler(CSSPropertyWebkitMaskClip, ApplyPropertyFillLayer<EFillBox, CSSPropertyWebkitMaskClip, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isClipSet, &FillLayer::clip, &FillLayer::setClip, &FillLayer::clearClip, &FillLayer::initialFillClip, &CSSToStyleMap::mapFillClip>::createHandler());
     setPropertyHandler(CSSPropertyWebkitMaskComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitMaskComposite, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());

Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (175404 => 175405)


--- trunk/Source/WebCore/css/StyleBuilderConverter.h	2014-10-31 01:16:24 UTC (rev 175404)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h	2014-10-31 02:37:40 UTC (rev 175405)
@@ -49,6 +49,7 @@
     template <typename T> static T convertNumber(StyleResolver&, CSSValue&);
     template <CSSPropertyID property> static NinePieceImage convertBorderImage(StyleResolver&, CSSValue&);
     template <CSSPropertyID property> static NinePieceImage convertBorderMask(StyleResolver&, CSSValue&);
+    template <CSSPropertyID property> static PassRefPtr<StyleImage> convertBorderImageSource(StyleResolver&, CSSValue&);
 
 private:
     static Length convertToRadiusLength(CSSToLengthConversionData&, CSSPrimitiveValue&);
@@ -224,6 +225,12 @@
     return image;
 }
 
+template <CSSPropertyID property>
+inline PassRefPtr<StyleImage> StyleBuilderConverter::convertBorderImageSource(StyleResolver& styleResolver, CSSValue& value)
+{
+    return styleResolver.styleImage(property, &value);
+}
+
 } // namespace WebCore
 
 #endif // StyleBuilderConverter_h
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to