Title: [102311] trunk/Source/WebCore
Revision
102311
Author
[email protected]
Date
2011-12-07 21:08:32 -0800 (Wed, 07 Dec 2011)

Log Message

Implement border image source properties in CSSStyleApplyProperty.
https://bugs.webkit.org/show_bug.cgi?id=73981

Reviewed by Andreas Kling.

No new tests / refactoring only.

* css/CSSStyleApplyProperty.cpp:
(WebCore::ApplyPropertyBorderImageSource::applyValue):
(WebCore::ApplyPropertyBorderImageSource::createHandler):
(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (102310 => 102311)


--- trunk/Source/WebCore/ChangeLog	2011-12-08 04:58:00 UTC (rev 102310)
+++ trunk/Source/WebCore/ChangeLog	2011-12-08 05:08:32 UTC (rev 102311)
@@ -1,3 +1,19 @@
+2011-12-07  Luke Macpherson   <[email protected]>
+
+        Implement border image source properties in CSSStyleApplyProperty.
+        https://bugs.webkit.org/show_bug.cgi?id=73981
+
+        Reviewed by Andreas Kling.
+
+        No new tests / refactoring only.
+
+        * css/CSSStyleApplyProperty.cpp:
+        (WebCore::ApplyPropertyBorderImageSource::applyValue):
+        (WebCore::ApplyPropertyBorderImageSource::createHandler):
+        (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty):
+
 2011-12-07  Noel Gordon  <[email protected]>
 
         WebPImageDecoder should not do a full image decode if progressive decoding is active

Modified: trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp (102310 => 102311)


--- trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2011-12-08 04:58:00 UTC (rev 102310)
+++ trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2011-12-08 05:08:32 UTC (rev 102311)
@@ -704,6 +704,17 @@
     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(CSSStyleSelector* selector, CSSValue* value) { (selector->style()->*setterFunction)(selector->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 {
@@ -1362,6 +1373,9 @@
     setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier<Image, Width>::createHandler());
     setPropertyHandler(CSSPropertyWebkitMaskBoxImageWidth, ApplyPropertyBorderImageModifier<Mask, Width>::createHandler());
 
+    setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource<CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource, &RenderStyle::initialBorderImageSource>::createHandler());
+    setPropertyHandler(CSSPropertyWebkitMaskBoxImageSource, ApplyPropertyBorderImageSource<CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource, &RenderStyle::initialMaskBoxImageSource>::createHandler());
+
     setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
     setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
     setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (102310 => 102311)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-12-08 04:58:00 UTC (rev 102310)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-12-08 05:08:32 UTC (rev 102311)
@@ -2708,18 +2708,6 @@
         HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(whiteSpace, WhiteSpace)
         return;
 // uri || inherit
-    case CSSPropertyBorderImageSource:
-    {
-        HANDLE_INHERIT_AND_INITIAL(borderImageSource, BorderImageSource)
-        m_style->setBorderImageSource(styleImage(CSSPropertyBorderImageSource, value));
-        return;
-    }
-    case CSSPropertyWebkitMaskBoxImageSource:
-    {
-        HANDLE_INHERIT_AND_INITIAL(maskBoxImageSource, MaskBoxImageSource)
-        m_style->setMaskBoxImageSource(styleImage(CSSPropertyWebkitMaskBoxImageSource, value));
-        return;
-    }
     case CSSPropertyWordBreak:
         HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(wordBreak, WordBreak)
         return;
@@ -3869,6 +3857,8 @@
     case CSSPropertyWebkitMaskBoxImageSlice:
     case CSSPropertyBorderImageWidth:
     case CSSPropertyWebkitMaskBoxImageWidth:
+    case CSSPropertyBorderImageSource:
+    case CSSPropertyWebkitMaskBoxImageSource:
     case CSSPropertyBorderTop:
     case CSSPropertyBorderRight:
     case CSSPropertyBorderBottom:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to