CSSValue: Devirtualize cssText().
authorandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Nov 2011 15:29:58 +0000 (15:29 +0000)
committerandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Nov 2011 15:29:58 +0000 (15:29 +0000)
<http://webkit.org/b/71813>

Reviewed by Antti Koivisto.

Rename all subclass implementations to customCssText() and add
a CSSValue::cssText() that defers to the appropriate subclass
based on the type info.

The rename is both for clarity, and to ensure that calling
cssText() will always end up in the correct method.

* css/CSSAspectRatioValue.cpp:
(WebCore::CSSAspectRatioValue::customCssText):
* css/CSSAspectRatioValue.h:
* css/CSSBorderImageSliceValue.cpp:
(WebCore::CSSBorderImageSliceValue::customCssText):
* css/CSSBorderImageSliceValue.h:
* css/CSSBorderImageValue.cpp:
(WebCore::CSSBorderImageValue::customCssText):
* css/CSSBorderImageValue.h:
* css/CSSCanvasValue.cpp:
(WebCore::CSSCanvasValue::customCssText):
* css/CSSCanvasValue.h:
* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::customCssText):
* css/CSSCrossfadeValue.h:
* css/CSSFlexValue.cpp:
(WebCore::CSSFlexValue::customCssText):
* css/CSSFlexValue.h:
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::customCssText):
* css/CSSFontFaceSrcValue.h:
* css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::customCssText):
* css/CSSFunctionValue.h:
* css/CSSGradientValue.cpp:
(WebCore::CSSLinearGradientValue::customCssText):
(WebCore::CSSRadialGradientValue::customCssText):
* css/CSSGradientValue.h:
* css/CSSInheritedValue.cpp:
(WebCore::CSSInheritedValue::customCssText):
* css/CSSInheritedValue.h:
* css/CSSInitialValue.cpp:
(WebCore::CSSInitialValue::customCssText):
* css/CSSInitialValue.h:
* css/CSSLineBoxContainValue.cpp:
(WebCore::CSSLineBoxContainValue::customCssText):
* css/CSSLineBoxContainValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::customCssText):
* css/CSSPrimitiveValue.h:
* css/CSSReflectValue.cpp:
(WebCore::CSSReflectValue::customCssText):
* css/CSSReflectValue.h:
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSLinearTimingFunctionValue::customCssText):
(WebCore::CSSCubicBezierTimingFunctionValue::customCssText):
(WebCore::CSSStepsTimingFunctionValue::customCssText):
* css/CSSTimingFunctionValue.h:
(WebCore::CSSLinearTimingFunctionValue::CSSLinearTimingFunctionValue):
* css/CSSUnicodeRangeValue.cpp:
(WebCore::CSSUnicodeRangeValue::customCssText):
* css/CSSUnicodeRangeValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::cssText):
* css/CSSValue.h:
* css/CSSValueList.cpp:
(WebCore::CSSValueList::customCssText):
* css/CSSValueList.h:
* css/FontFamilyValue.cpp:
(WebCore::FontFamilyValue::customCssText):
* css/FontFamilyValue.h:
* css/FontFeatureValue.cpp:
(WebCore::FontFeatureValue::customCssText):
* css/FontFeatureValue.h:
* css/FontValue.cpp:
(WebCore::FontValue::customCssText):
* css/FontValue.h:
* css/ShadowValue.cpp:
(WebCore::ShadowValue::customCssText):
* css/ShadowValue.h:
* css/WebKitCSSFilterValue.cpp:
(WebCore::WebKitCSSFilterValue::customCssText):
* css/WebKitCSSFilterValue.h:
* css/WebKitCSSTransformValue.cpp:
(WebCore::WebKitCSSTransformValue::customCssText):
* css/WebKitCSSTransformValue.h:
* svg/SVGColor.cpp:
(WebCore::SVGColor::customCssText):
* svg/SVGColor.h:
* svg/SVGPaint.cpp:
(WebCore::SVGPaint::customCssText):
* svg/SVGPaint.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99567 268f45cc-cd09-0410-ab3c-d52691b4dbfc

53 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSAspectRatioValue.cpp
Source/WebCore/css/CSSAspectRatioValue.h
Source/WebCore/css/CSSBorderImageSliceValue.cpp
Source/WebCore/css/CSSBorderImageSliceValue.h
Source/WebCore/css/CSSBorderImageValue.cpp
Source/WebCore/css/CSSBorderImageValue.h
Source/WebCore/css/CSSCanvasValue.cpp
Source/WebCore/css/CSSCanvasValue.h
Source/WebCore/css/CSSCrossfadeValue.cpp
Source/WebCore/css/CSSCrossfadeValue.h
Source/WebCore/css/CSSFlexValue.cpp
Source/WebCore/css/CSSFlexValue.h
Source/WebCore/css/CSSFontFaceSrcValue.cpp
Source/WebCore/css/CSSFontFaceSrcValue.h
Source/WebCore/css/CSSFunctionValue.cpp
Source/WebCore/css/CSSFunctionValue.h
Source/WebCore/css/CSSGradientValue.cpp
Source/WebCore/css/CSSGradientValue.h
Source/WebCore/css/CSSInheritedValue.cpp
Source/WebCore/css/CSSInheritedValue.h
Source/WebCore/css/CSSInitialValue.cpp
Source/WebCore/css/CSSInitialValue.h
Source/WebCore/css/CSSLineBoxContainValue.cpp
Source/WebCore/css/CSSLineBoxContainValue.h
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSReflectValue.cpp
Source/WebCore/css/CSSReflectValue.h
Source/WebCore/css/CSSTimingFunctionValue.cpp
Source/WebCore/css/CSSTimingFunctionValue.h
Source/WebCore/css/CSSUnicodeRangeValue.cpp
Source/WebCore/css/CSSUnicodeRangeValue.h
Source/WebCore/css/CSSValue.cpp
Source/WebCore/css/CSSValue.h
Source/WebCore/css/CSSValueList.cpp
Source/WebCore/css/CSSValueList.h
Source/WebCore/css/FontFamilyValue.cpp
Source/WebCore/css/FontFamilyValue.h
Source/WebCore/css/FontFeatureValue.cpp
Source/WebCore/css/FontFeatureValue.h
Source/WebCore/css/FontValue.cpp
Source/WebCore/css/FontValue.h
Source/WebCore/css/ShadowValue.cpp
Source/WebCore/css/ShadowValue.h
Source/WebCore/css/WebKitCSSFilterValue.cpp
Source/WebCore/css/WebKitCSSFilterValue.h
Source/WebCore/css/WebKitCSSTransformValue.cpp
Source/WebCore/css/WebKitCSSTransformValue.h
Source/WebCore/svg/SVGColor.cpp
Source/WebCore/svg/SVGColor.h
Source/WebCore/svg/SVGPaint.cpp
Source/WebCore/svg/SVGPaint.h

index ec926d8edca0d908c68348f6a841eb0fbcee05e8..b94e9252e26e92666038775c1a179b7b2a8f7dbc 100644 (file)
@@ -1,3 +1,100 @@
+2011-11-08  Andreas Kling  <kling@webkit.org>
+
+        CSSValue: Devirtualize cssText().
+        <http://webkit.org/b/71813>
+
+        Reviewed by Antti Koivisto.
+
+        Rename all subclass implementations to customCssText() and add
+        a CSSValue::cssText() that defers to the appropriate subclass
+        based on the type info.
+
+        The rename is both for clarity, and to ensure that calling
+        cssText() will always end up in the correct method.
+
+        * css/CSSAspectRatioValue.cpp:
+        (WebCore::CSSAspectRatioValue::customCssText):
+        * css/CSSAspectRatioValue.h:
+        * css/CSSBorderImageSliceValue.cpp:
+        (WebCore::CSSBorderImageSliceValue::customCssText):
+        * css/CSSBorderImageSliceValue.h:
+        * css/CSSBorderImageValue.cpp:
+        (WebCore::CSSBorderImageValue::customCssText):
+        * css/CSSBorderImageValue.h:
+        * css/CSSCanvasValue.cpp:
+        (WebCore::CSSCanvasValue::customCssText):
+        * css/CSSCanvasValue.h:
+        * css/CSSCrossfadeValue.cpp:
+        (WebCore::CSSCrossfadeValue::customCssText):
+        * css/CSSCrossfadeValue.h:
+        * css/CSSFlexValue.cpp:
+        (WebCore::CSSFlexValue::customCssText):
+        * css/CSSFlexValue.h:
+        * css/CSSFontFaceSrcValue.cpp:
+        (WebCore::CSSFontFaceSrcValue::customCssText):
+        * css/CSSFontFaceSrcValue.h:
+        * css/CSSFunctionValue.cpp:
+        (WebCore::CSSFunctionValue::customCssText):
+        * css/CSSFunctionValue.h:
+        * css/CSSGradientValue.cpp:
+        (WebCore::CSSLinearGradientValue::customCssText):
+        (WebCore::CSSRadialGradientValue::customCssText):
+        * css/CSSGradientValue.h:
+        * css/CSSInheritedValue.cpp:
+        (WebCore::CSSInheritedValue::customCssText):
+        * css/CSSInheritedValue.h:
+        * css/CSSInitialValue.cpp:
+        (WebCore::CSSInitialValue::customCssText):
+        * css/CSSInitialValue.h:
+        * css/CSSLineBoxContainValue.cpp:
+        (WebCore::CSSLineBoxContainValue::customCssText):
+        * css/CSSLineBoxContainValue.h:
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::customCssText):
+        * css/CSSPrimitiveValue.h:
+        * css/CSSReflectValue.cpp:
+        (WebCore::CSSReflectValue::customCssText):
+        * css/CSSReflectValue.h:
+        * css/CSSTimingFunctionValue.cpp:
+        (WebCore::CSSLinearTimingFunctionValue::customCssText):
+        (WebCore::CSSCubicBezierTimingFunctionValue::customCssText):
+        (WebCore::CSSStepsTimingFunctionValue::customCssText):
+        * css/CSSTimingFunctionValue.h:
+        (WebCore::CSSLinearTimingFunctionValue::CSSLinearTimingFunctionValue):
+        * css/CSSUnicodeRangeValue.cpp:
+        (WebCore::CSSUnicodeRangeValue::customCssText):
+        * css/CSSUnicodeRangeValue.h:
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::cssText):
+        * css/CSSValue.h:
+        * css/CSSValueList.cpp:
+        (WebCore::CSSValueList::customCssText):
+        * css/CSSValueList.h:
+        * css/FontFamilyValue.cpp:
+        (WebCore::FontFamilyValue::customCssText):
+        * css/FontFamilyValue.h:
+        * css/FontFeatureValue.cpp:
+        (WebCore::FontFeatureValue::customCssText):
+        * css/FontFeatureValue.h:
+        * css/FontValue.cpp:
+        (WebCore::FontValue::customCssText):
+        * css/FontValue.h:
+        * css/ShadowValue.cpp:
+        (WebCore::ShadowValue::customCssText):
+        * css/ShadowValue.h:
+        * css/WebKitCSSFilterValue.cpp:
+        (WebCore::WebKitCSSFilterValue::customCssText):
+        * css/WebKitCSSFilterValue.h:
+        * css/WebKitCSSTransformValue.cpp:
+        (WebCore::WebKitCSSTransformValue::customCssText):
+        * css/WebKitCSSTransformValue.h:
+        * svg/SVGColor.cpp:
+        (WebCore::SVGColor::customCssText):
+        * svg/SVGColor.h:
+        * svg/SVGPaint.cpp:
+        (WebCore::SVGPaint::customCssText):
+        * svg/SVGPaint.h:
+
 2011-11-08  Gavin Peters  <gavinp@chromium.org>
 
         Fix width of m_type in CachedResource
index 6d8f9b105f77ce530c223e11b3436cb3b6ce69f2..713a136cc4d02706a815cb60967377da8911b094 100644 (file)
@@ -37,7 +37,7 @@ CSSAspectRatioValue::~CSSAspectRatioValue()
 {
 }
 
-String CSSAspectRatioValue::cssText() const
+String CSSAspectRatioValue::customCssText() const
 {
     StringBuilder result;
     result.append(String::number(m_numeratorValue));
index 37bec9da75f296857bb21464da7570580787428d..5ea14043e0cf8abd59be5db4a3ad96890badc41f 100644 (file)
@@ -43,7 +43,7 @@ public:
 
     virtual ~CSSAspectRatioValue();
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     float numeratorValue() const { return m_numeratorValue; }
     float denominatorValue() const { return m_denominatorValue; }
index 3bdcbdbb349d4ec5e45f7f51e18d00dd316e5c2b..b543e032865b0898ed19f63791ac0c581519e703 100644 (file)
@@ -42,7 +42,7 @@ CSSBorderImageSliceValue::~CSSBorderImageSliceValue()
 {
 }
 
-String CSSBorderImageSliceValue::cssText() const
+String CSSBorderImageSliceValue::customCssText() const
 {
     // Dump the slices first.
     String text = m_slices->cssText();
index b7f1f031be4ef340a5ff7fac7b9e5043bc93a445..af120ac71c43301353ef2d9a6e59463f39bbf85d 100644 (file)
@@ -42,7 +42,7 @@ public:
     }
     virtual ~CSSBorderImageSliceValue();
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     Quad* slices() { return m_slices ? m_slices->getQuadValue() : 0; }
 
index 7c0a34bc663b3257639ea04768607ddd41df0ccb..8ff6bc80b3967dda133d1164671019aaa5bc8eae 100644 (file)
@@ -41,7 +41,7 @@ CSSBorderImageValue::~CSSBorderImageValue()
 {
 }
 
-String CSSBorderImageValue::cssText() const
+String CSSBorderImageValue::customCssText() const
 {
     // Image first.
     String text;
index d165fe0bb9617c35aea767bba95f4bb950b1f0de..1b80d6ba54ca332893499c5965511cdbedc54bc1 100644 (file)
@@ -38,7 +38,7 @@ public:
     }
     virtual ~CSSBorderImageValue();
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     CSSValue* imageValue() const { return m_image.get(); }
 
index 056a5fd220ff34756016668ea35e9087e569251e..783ceef82b50f885e37059e75de156dedf27d161 100644 (file)
@@ -37,7 +37,7 @@ CSSCanvasValue::~CSSCanvasValue()
         m_element->removeObserver(&m_canvasObserver);
 }
 
-String CSSCanvasValue::cssText() const
+String CSSCanvasValue::customCssText() const
 {
     String result = "-webkit-canvas(";
     result += m_name  + ")";
index 4f6fef5ea8c0e2fd401998ba17d4e16d12a01329..430da0fb618d08fe5959ed18002123c7886de43e 100644 (file)
@@ -38,7 +38,7 @@ public:
     static PassRefPtr<CSSCanvasValue> create() { return adoptRef(new CSSCanvasValue); }
     virtual ~CSSCanvasValue();
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     virtual PassRefPtr<Image> image(RenderObject*, const IntSize&);
     virtual bool isFixedSize() const { return true; }
index ee7392c82a401db116ec9919dd0768cf1d2f0644..14c250cca127561b3334fc74ecec4e00944facdd 100644 (file)
@@ -33,7 +33,7 @@ CSSCrossfadeValue::~CSSCrossfadeValue()
 
 }
 
-String CSSCrossfadeValue::cssText() const
+String CSSCrossfadeValue::customCssText() const
 {
     String result = "-webkit-cross-fade(";
     result += m_fromImage->cssText() + ", ";
index 403182eb5be76a81602d40023700772736beda6b..90fc27856451fed627519a1e3d5fd9c1d0999ef3 100644 (file)
@@ -40,7 +40,7 @@ public:
     static PassRefPtr<CSSCrossfadeValue> create(PassRefPtr<CSSImageValue> fromImage, PassRefPtr<CSSImageValue> toImage) { return adoptRef(new CSSCrossfadeValue(fromImage, toImage)); }
     virtual ~CSSCrossfadeValue();
 
-    virtual String cssText() const OVERRIDE;
+    String customCssText() const;
 
     virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) OVERRIDE;
     virtual bool isFixedSize() const OVERRIDE { return false; }
index 28f3be9fc46d299db35e734bc58b1b1146d13328..6bd312cf5236a5f187b5f790861f312cf4bbbfc8 100644 (file)
@@ -39,7 +39,7 @@ CSSFlexValue::~CSSFlexValue()
 {
 }
 
-String CSSFlexValue::cssText() const
+String CSSFlexValue::customCssText() const
 {
     StringBuilder result;
     result.append("-webkit-flex(");
index c2662ee3d31be9147c0da640b614b0d04df81e0e..99099d9404681d1bbda4a08633f307d28156b373 100644 (file)
@@ -45,7 +45,7 @@ public:
 
     virtual ~CSSFlexValue();
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     float positiveFlex() { return m_positiveFlex; }
     float negativeFlex() { return m_negativeFlex; }
index 5b4c3115443cd842ffcb7cf9fcaa960fc957c1fb..0567ff402c8c930e40f8c07f3cef6421dcaacdcf 100644 (file)
@@ -60,7 +60,7 @@ bool CSSFontFaceSrcValue::isSupportedFormat() const
            ;
 }
 
-String CSSFontFaceSrcValue::cssText() const
+String CSSFontFaceSrcValue::customCssText() const
 {
     String result;
     if (isLocal())
index 60eb27f5b05c468ffd0fa315f762ca918c770117..f036978f421a2d6cb0ceb2786bbb384847cf7cb0 100644 (file)
@@ -62,7 +62,7 @@ public:
     void setSVGFontFaceElement(SVGFontFaceElement* element) { m_svgFontFaceElement = element; }
 #endif
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*);
 
index 493cbb2ed47f568716cd8b19315cf4b090f85c5a..c31ab0a3643b23aa41b588a820f6ea89ce6f9390 100644 (file)
@@ -44,7 +44,7 @@ CSSFunctionValue::~CSSFunctionValue()
 {
 }
 
-String CSSFunctionValue::cssText() const
+String CSSFunctionValue::customCssText() const
 {
     String result = m_name; // Includes the '('
     if (m_args)
index 0a187a9476fd17254031b257af6048471b0cc86d..4505093bbd714c45ac1df8c164b415847daffc43 100644 (file)
@@ -42,7 +42,7 @@ public:
 
     virtual ~CSSFunctionValue();
 
-    virtual String cssText() const;
+    String customCssText() const;
 
 private:
     explicit CSSFunctionValue(CSSParserFunction*);
index 356543124519b9282009745443c7f6efe4a59be5..feb01f44885617f8761e51ccb9fb008dae034050 100644 (file)
@@ -437,7 +437,7 @@ bool CSSGradientValue::isCacheable() const
     return true;
 }
 
-String CSSLinearGradientValue::cssText() const
+String CSSLinearGradientValue::customCssText() const
 {
     String result;
     if (m_deprecatedType) {
@@ -579,7 +579,7 @@ PassRefPtr<Gradient> CSSLinearGradientValue::createGradient(RenderObject* render
     return gradient.release();
 }
 
-String CSSRadialGradientValue::cssText() const
+String CSSRadialGradientValue::customCssText() const
 {
     String result;
 
index e7f6b57ad21034450e9648b2b0bc913a943d7856..59c078806a97f80e5dc9261a1bf6d0aebce8272f 100644 (file)
@@ -106,7 +106,7 @@ public:
 
     void setAngle(PassRefPtr<CSSPrimitiveValue> val) { m_angle = val; }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     // Create the gradient for a given size.
     PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
@@ -127,7 +127,7 @@ public:
         return adoptRef(new CSSRadialGradientValue(repeat, deprecatedType));
     }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     void setFirstRadius(PassRefPtr<CSSPrimitiveValue> val) { m_firstRadius = val; }
     void setSecondRadius(PassRefPtr<CSSPrimitiveValue> val) { m_secondRadius = val; }
index a2de18a511a5cf217bc1ad2e26cdf8e01f17e375..8c4be6d4bc700c2b06b1035f72583c75ad891732 100644 (file)
@@ -25,7 +25,7 @@
 
 namespace WebCore {
 
-String CSSInheritedValue::cssText() const
+String CSSInheritedValue::customCssText() const
 {
     return "inherit";
 }
index faeaa7e30ea9999d915d32422dfb83c852f1a2fc..5aa906367717304668b1342bb6d17badb167d0e9 100644 (file)
@@ -33,7 +33,7 @@ public:
         return adoptRef(new CSSInheritedValue);
     }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
 private:
     CSSInheritedValue()
index 6c8cf36bfd536a3cf1e15256df2cc7ed7f4b1546..8de3f3182c5c1eede3acd92010d07e9be819b232 100644 (file)
@@ -25,7 +25,7 @@
 
 namespace WebCore {
 
-String CSSInitialValue::cssText() const
+String CSSInitialValue::customCssText() const
 {
     return "initial";
 }
index 05f0d511ab0f8f01fad8d8f34c819ce8da29a268..81dca8ec19123d49a525171ee2f529cdde05346c 100644 (file)
@@ -39,7 +39,7 @@ public:
         return explicitValue;
     }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
 private:
     CSSInitialValue(bool implicit)
index 0f7a1c467a4add0f13d7cc7e4d547979f7d8f9a2..53132eb190f5ea29cc734d0dd5c27945cbfe1bdc 100644 (file)
@@ -37,7 +37,7 @@ CSSLineBoxContainValue::CSSLineBoxContainValue(unsigned value)
 {
 }
 
-String CSSLineBoxContainValue::cssText() const
+String CSSLineBoxContainValue::customCssText() const
 {
     String text("");
 
index be99b0b65cb6a5a25498999d3236e88e1d4beb23..ddc0c60f3c2465afe2372dc3f440dc7140ec527b 100644 (file)
@@ -46,7 +46,7 @@ public:
         return adoptRef(new CSSLineBoxContainValue(value));
     }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     LineBoxContain value() const { return m_value; }
 
index 0027ba598bd7f7f7ae47fa0a1fa83c29ed6d8b72..6d96d21ceef7cf7da9348993c4b1926239397025 100644 (file)
@@ -708,7 +708,7 @@ static String formatNumber(double number)
     return String::adopt(buffer);
 }
 
-String CSSPrimitiveValue::cssText() const
+String CSSPrimitiveValue::customCssText() const
 {
     // FIXME: return the original value instead of a generated one (e.g. color
     // name if it was specified) - check what spec says about this
index 9f1b176368272a50b54190a7595febc024cde558..180de6d935fd221a6a48e06305c3326354af0202 100644 (file)
@@ -207,7 +207,7 @@ public:
     int getIdent() const;
     template<typename T> inline operator T() const; // Defined in CSSPrimitiveValueMappings.h
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     bool isQuirkValue() { return m_isQuirkValue; }
 
index ddc3cefc8dacaefc2d57c6485f7713bbdfefcdc0..911d110b9b5136316cb462f29fa2bb428e2efa8c 100644 (file)
@@ -33,7 +33,7 @@ using namespace std;
 
 namespace WebCore {
 
-String CSSReflectValue::cssText() const
+String CSSReflectValue::customCssText() const
 {
     String result;
     switch (m_direction) {
index c38b6947964b782ba663f40d6b5003dcd27bbfa6..5b03efe899af047a635f4802ed389ce44b33bf7b 100644 (file)
@@ -47,7 +47,7 @@ public:
     CSSPrimitiveValue* offset() const { return m_offset.get(); }
     CSSValue* mask() const { return m_mask.get(); }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*);
 
index d29c2df759dff276649f1b6c9dc5171a85bc228f..dcf7bb29b546c684bd96c7cf6aa1768de4ea1010 100644 (file)
 
 namespace WebCore {
 
-String CSSLinearTimingFunctionValue::cssText() const
+String CSSLinearTimingFunctionValue::customCssText() const
 {
     return "linear";
 }
 
-String CSSCubicBezierTimingFunctionValue::cssText() const
+String CSSCubicBezierTimingFunctionValue::customCssText() const
 {
     String text("cubic-bezier(");
     text += String::number(m_x1);
@@ -49,7 +49,7 @@ String CSSCubicBezierTimingFunctionValue::cssText() const
     return text;
 }
 
-String CSSStepsTimingFunctionValue::cssText() const
+String CSSStepsTimingFunctionValue::customCssText() const
 {
     String text("steps(");
     text += String::number(m_steps);
index 0bf98a82f3483b191f36ad7b3761bb53d1b61065..9958a8c21ea94bb4735eca200d5940dd6a046bfb 100644 (file)
@@ -33,8 +33,6 @@ namespace WebCore {
 
 class CSSTimingFunctionValue : public CSSValue {
 public:
-    virtual String cssText() const = 0;
-
     bool isLinearTimingFunctionValue() const { return classType() == LinearTimingFunctionClass; }
     bool isCubicBezierTimingFunctionValue() const { return classType() == CubicBezierTimingFunctionClass; }
     bool isStepsTimingFunctionValue() const { return classType() == StepsTimingFunctionClass; }
@@ -53,13 +51,13 @@ public:
         return adoptRef(new CSSLinearTimingFunctionValue);
     }
 
+    String customCssText() const;
+
 private:
     CSSLinearTimingFunctionValue()
         : CSSTimingFunctionValue(LinearTimingFunctionClass)
     {
     }
-
-    virtual String cssText() const;
 };
 
 class CSSCubicBezierTimingFunctionValue : public CSSTimingFunctionValue {
@@ -69,6 +67,8 @@ public:
         return adoptRef(new CSSCubicBezierTimingFunctionValue(x1, y1, x2, y2));
     }
 
+    String customCssText() const;
+
     double x1() const { return m_x1; }
     double y1() const { return m_y1; }
     double x2() const { return m_x2; }
@@ -84,8 +84,6 @@ private:
     {
     }
 
-    virtual String cssText() const;
-
     double m_x1;
     double m_y1;
     double m_x2;
@@ -102,6 +100,8 @@ public:
     int numberOfSteps() const { return m_steps; }
     bool stepAtStart() const { return m_stepAtStart; }
 
+    String customCssText() const;
+
 private:
     CSSStepsTimingFunctionValue(int steps, bool stepAtStart)
         : CSSTimingFunctionValue(StepsTimingFunctionClass)
@@ -110,8 +110,6 @@ private:
     {
     }
 
-    virtual String cssText() const;
-
     int m_steps;
     bool m_stepAtStart;
 };
index f7b877952db586d9873a06708fc2fb2a2f22d36f..a1a2b822e2c44b900839d4e310719dd6ea29724f 100644 (file)
@@ -34,7 +34,7 @@ CSSUnicodeRangeValue::~CSSUnicodeRangeValue()
 {
 }
 
-String CSSUnicodeRangeValue::cssText() const
+String CSSUnicodeRangeValue::customCssText() const
 {
     String result;
     // FIXME: Implement.
index 458bf1acd0e888b0fbdad6099d2ce2109847c6d7..a8b4a38562f1329eb9bdaaec7b04d1027ab40db3 100644 (file)
@@ -44,7 +44,7 @@ public:
     UChar32 from() const { return m_from; }
     UChar32 to() const { return m_to; }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
 private:
     CSSUnicodeRangeValue(UChar32 from, UChar32 to)
index 47a72870ce7443e2d1041bfebebcf15bed17037f..ea94e1e6e0e67e46affd25a71f0dabfddcec940b 100644 (file)
 #include "config.h"
 #include "CSSValue.h"
 
+#include "CSSAspectRatioValue.h"
 #include "CSSBorderImageValue.h"
+#include "CSSBorderImageSliceValue.h"
+#include "CSSCanvasValue.h"
+#include "CSSCrossfadeValue.h"
+#include "CSSCursorImageValue.h"
+#include "CSSFlexValue.h"
 #include "CSSFontFaceSrcValue.h"
+#include "CSSFunctionValue.h"
+#include "CSSGradientValue.h"
+#include "CSSImageGeneratorValue.h"
+#include "CSSImageValue.h"
+#include "CSSInheritedValue.h"
+#include "CSSInitialValue.h"
+#include "CSSLineBoxContainValue.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSReflectValue.h"
+#include "CSSTimingFunctionValue.h"
+#include "CSSUnicodeRangeValue.h"
 #include "CSSValueList.h"
+#include "FontValue.h"
+#include "FontFamilyValue.h"
+#include "FontFeatureValue.h"
+#include "ShadowValue.h"
+#include "SVGColor.h"
+#include "SVGPaint.h"
+#include "WebKitCSSFilterValue.h"
+#include "WebKitCSSTransformValue.h"
 
 namespace WebCore {
 
@@ -62,4 +85,79 @@ void CSSValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const CSSStyleSh
         static_cast<CSSReflectValue*>(this)->addSubresourceStyleURLs(urls, styleSheet);
 }
 
+String CSSValue::cssText() const
+{
+    switch (classType()) {
+    case AspectRatioClass:
+        return static_cast<const CSSAspectRatioValue*>(this)->customCssText();
+    case BorderImageClass:
+        return static_cast<const CSSBorderImageValue*>(this)->customCssText();
+    case BorderImageSliceClass:
+        return static_cast<const CSSBorderImageSliceValue*>(this)->customCssText();
+    case CanvasClass:
+        return static_cast<const CSSCanvasValue*>(this)->customCssText();
+    case CursorImageClass:
+        return static_cast<const CSSCursorImageValue*>(this)->customCssText();
+    case FontClass:
+        return static_cast<const FontValue*>(this)->customCssText();
+    case FontFaceSrcClass:
+        return static_cast<const CSSFontFaceSrcValue*>(this)->customCssText();
+    case FontFamilyClass:
+        return static_cast<const FontFamilyValue*>(this)->customCssText();
+    case FontFeatureClass:
+        return static_cast<const FontFeatureValue*>(this)->customCssText();
+    case FunctionClass:
+        return static_cast<const CSSFunctionValue*>(this)->customCssText();
+    case LinearGradientClass:
+        return static_cast<const CSSLinearGradientValue*>(this)->customCssText();
+    case RadialGradientClass:
+        return static_cast<const CSSRadialGradientValue*>(this)->customCssText();
+    case CrossfadeClass:
+        return static_cast<const CSSCrossfadeValue*>(this)->customCssText();
+    case ImageClass:
+        return static_cast<const CSSImageValue*>(this)->customCssText();
+    case InheritedClass:
+        return static_cast<const CSSInheritedValue*>(this)->customCssText();
+    case InitialClass:
+    case ImplicitInitialClass:
+        return static_cast<const CSSInitialValue*>(this)->customCssText();
+    case PrimitiveClass:
+        return static_cast<const CSSPrimitiveValue*>(this)->customCssText();
+    case ReflectClass:
+        return static_cast<const CSSReflectValue*>(this)->customCssText();
+    case ShadowClass:
+        return static_cast<const ShadowValue*>(this)->customCssText();
+    case LinearTimingFunctionClass:
+        return static_cast<const CSSLinearTimingFunctionValue*>(this)->customCssText();
+    case CubicBezierTimingFunctionClass:
+        return static_cast<const CSSCubicBezierTimingFunctionValue*>(this)->customCssText();
+    case StepsTimingFunctionClass:
+        return static_cast<const CSSStepsTimingFunctionValue*>(this)->customCssText();
+    case UnicodeRangeClass:
+        return static_cast<const CSSUnicodeRangeValue*>(this)->customCssText();
+    case ValueListClass:
+        return static_cast<const CSSValueList*>(this)->customCssText();
+    case WebKitCSSTransformClass:
+        return static_cast<const WebKitCSSTransformValue*>(this)->customCssText();
+    case LineBoxContainClass:
+        return static_cast<const CSSLineBoxContainValue*>(this)->customCssText();
+#if ENABLE(CSS3_FLEXBOX)
+    case FlexClass:
+        return static_cast<const CSSFlexValue*>(this)->customCssText();
+#endif
+#if ENABLE(CSS_FILTERS)
+    case WebKitCSSFilterClass:
+        return static_cast<const WebKitCSSFilterValue*>(this)->customCssText();
+#endif
+#if ENABLE(SVG)
+    case SVGColorClass:
+        return static_cast<const SVGColor*>(this)->customCssText();
+    case SVGPaintClass:
+        return static_cast<const SVGPaint*>(this)->customCssText();
+#endif
+    }
+    ASSERT_NOT_REACHED();
+    return String();
+}
+
 }
index 9a6ab227095f3322477c2e6636897b7a014a22e1..26530d11b9b14e008d4de73ca83a1385dda4eeec 100644 (file)
@@ -46,7 +46,7 @@ public:
 
     Type cssValueType() const;
 
-    virtual String cssText() const = 0;
+    String cssText() const;
     void setCssText(const String&, ExceptionCode&) { } // FIXME: Not implemented.
 
     bool isMutableValue() const { return m_isMutable; }
index 7aa3ac2d7c487b17aa200be22e60051e62e4c1ab..7a288b61b1dbda3e69201d019237d71df2596e62 100644 (file)
@@ -98,7 +98,7 @@ PassRefPtr<CSSValueList> CSSValueList::copy()
     return newList;
 }
 
-String CSSValueList::cssText() const
+String CSSValueList::customCssText() const
 {
     String result = "";
 
index 916225fe8033b95ca136684c41587dfe546894e1..22abf3b2554a42be149eead63b0f8eb71690c450 100644 (file)
@@ -56,7 +56,7 @@ public:
     bool hasValue(CSSValue*) const;
     PassRefPtr<CSSValueList> copy();
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*);
 
index 5d83fb15340f92514142e8585956ee965e60c0a4..665895d3a8321a61077960109ebe895c6112e1e6 100644 (file)
@@ -64,7 +64,7 @@ void FontFamilyValue::appendSpaceSeparated(const UChar* characters, unsigned len
     m_familyName.append(characters, length);
 }
 
-String FontFamilyValue::cssText() const
+String FontFamilyValue::customCssText() const
 {
     return quoteCSSStringIfNeeded(m_familyName);
 }
index 087d22a67ed936c5c2d648292c2afab8b8061a61..b2fbaa29b8f046085e028504b186a16c8726a6cb 100644 (file)
@@ -37,7 +37,7 @@ public:
 
     const String& familyName() const { return m_familyName; }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
 private:
     FontFamilyValue(const String& familyName);
index 33f30f79f26f56e90a6de8702d2fbfbd8d0ef1a4..62c396068598af91580f55e5a94a868aa51bf32c 100644 (file)
@@ -39,7 +39,7 @@ FontFeatureValue::FontFeatureValue(const String& tag, int value)
 {
 }
 
-String FontFeatureValue::cssText() const
+String FontFeatureValue::customCssText() const
 {
     StringBuilder builder;
     builder.append("'");
index 30b0dfbf06087d5eb06d8b6462668c2398cfc61c..7d5e036c08a618395855672750a61e547ad5c5eb 100644 (file)
@@ -40,7 +40,7 @@ public:
 
     const String& tag() const { return m_tag; }
     int value() const { return m_value; }
-    virtual String cssText() const;
+    String customCssText() const;
 
 private:
     FontFeatureValue(const String&, int);
index 6b092b3d7a39a54d41cabb691e96ffdc30717304..00e7fbee4144cce14aa77276d951cf5969330775 100644 (file)
@@ -26,7 +26,7 @@
 
 namespace WebCore {
 
-String FontValue::cssText() const
+String FontValue::customCssText() const
 {
     // font variant weight size / line-height family
 
index c966a07a8e6a0cfa30b663b4aa9d6335454837d7..5f8336921055c398b152c7cb0357cbc7e77ed93a 100644 (file)
@@ -37,7 +37,7 @@ public:
         return adoptRef(new FontValue);
     }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     RefPtr<CSSPrimitiveValue> style;
     RefPtr<CSSPrimitiveValue> variant;
index 25ac5159fbe377e414b16ecb9a5f378a0d8da805..14c7cda8c570bcbd7fb756fb5ef9b9baf9013bb4 100644 (file)
@@ -42,7 +42,7 @@ ShadowValue::ShadowValue(PassRefPtr<CSSPrimitiveValue> _x,
 {
 }
 
-String ShadowValue::cssText() const
+String ShadowValue::customCssText() const
 {
     String text("");
 
index a88a0e784f2cb133f7a3c4fafd22ea39356d4c1d..21547a5711ee3ee8f54b5cd9f5fa8b6596f4293f 100644 (file)
@@ -42,7 +42,7 @@ public:
         return adoptRef(new ShadowValue(x, y, blur, spread, style, color));
     }
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     RefPtr<CSSPrimitiveValue> x;
     RefPtr<CSSPrimitiveValue> y;
index 105005e6f539f649bd5592a28f48f3adcffdf0c7..71ec327b0936408d2e61a0ed7eaaf70f96e0b487 100644 (file)
@@ -44,7 +44,7 @@ WebKitCSSFilterValue::~WebKitCSSFilterValue()
 {
 }
 
-String WebKitCSSFilterValue::cssText() const
+String WebKitCSSFilterValue::customCssText() const
 {
     String result;
     switch (m_type) {
@@ -85,7 +85,7 @@ String WebKitCSSFilterValue::cssText() const
         break;
     }
 
-    return result + CSSValueList::cssText() + ")";
+    return result + CSSValueList::customCssText() + ")";
 }
 
 }
index 48f1a7c8f0792d44424e1269ac4b04ee267ce4bf..cfb4c8bd3dd5899895a9c5c3b1922f0be93bb576 100644 (file)
@@ -59,7 +59,7 @@ public:
 
     virtual ~WebKitCSSFilterValue();
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     FilterOperationType operationType() const { return m_type; }
 
index a56a9d13e624894cf084df677afc749ee9c18847..6e0cdd57022e50a0f1f5344fdcdc9ddcba242d05 100644 (file)
@@ -42,7 +42,7 @@ WebKitCSSTransformValue::~WebKitCSSTransformValue()
 {
 }
 
-String WebKitCSSTransformValue::cssText() const
+String WebKitCSSTransformValue::customCssText() const
 {
     String result;
     switch (m_type) {
@@ -113,7 +113,7 @@ String WebKitCSSTransformValue::cssText() const
             break;
     }
 
-    result += CSSValueList::cssText();
+    result += CSSValueList::customCssText();
 
     result += ")";
     return result;
index d7cd4cc77f74b51032a9c6f92bf767973cd03363..8a5e6d86353c278b75ebfcb1488bd95546440506 100644 (file)
@@ -67,7 +67,7 @@ public:
 
     virtual ~WebKitCSSTransformValue();
 
-    virtual String cssText() const;
+    String customCssText() const;
 
     TransformOperationType operationType() const { return m_type; }
 
index 016337e1563f56674a5196ef1d80db6da7039e2a..109350639cb0c4952cb1b9681e65c0d0f85514cb 100644 (file)
@@ -136,7 +136,7 @@ void SVGColor::setColor(unsigned short colorType, const String& rgbColor, const
         setRGBColor(rgbColor, ec);
 }
 
-String SVGColor::cssText() const
+String SVGColor::customCssText() const
 {
     switch (m_colorType) {
     case SVG_COLORTYPE_UNKNOWN:
index daed83d8656b675828d1bbe32104108b47574ce3..8ef3e3a54428e759a66c8959fc4ecc8933bf5b64 100644 (file)
@@ -69,12 +69,13 @@ public:
     void setRGBColorICCColor(const String& rgbColor, const String& iccColor, ExceptionCode&);
     void setColor(unsigned short colorType, const String& rgbColor, const String& iccColor, ExceptionCode&);
 
+    String customCssText() const;
+
 protected:
     friend class CSSComputedStyleDeclaration;
 
     SVGColor(ClassType, const SVGColorType&);
     virtual ~SVGColor() { }
-    virtual String cssText() const;
 
     void setColor(const Color& color) { m_color = color; }
     void setColorType(const SVGColorType& type) { m_colorType = type; }
index 863ce6ae89b3cf397968187d73f33b0b8f08d556..e6ea2536644cf08ece69d122e31c139926154ec5 100644 (file)
@@ -123,14 +123,14 @@ void SVGPaint::setPaint(unsigned short paintType, const String& uri, const Strin
     setNeedsStyleRecalc();
 }
 
-String SVGPaint::cssText() const
+String SVGPaint::customCssText() const
 {
     switch (m_paintType) {
     case SVG_PAINTTYPE_UNKNOWN:
     case SVG_PAINTTYPE_RGBCOLOR:
     case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR:
     case SVG_PAINTTYPE_CURRENTCOLOR:
-        return SVGColor::cssText();
+        return SVGColor::customCssText();
     case SVG_PAINTTYPE_NONE:
         return "none";
     case SVG_PAINTTYPE_URI_NONE:
@@ -138,7 +138,7 @@ String SVGPaint::cssText() const
     case SVG_PAINTTYPE_URI_CURRENTCOLOR:
     case SVG_PAINTTYPE_URI_RGBCOLOR:
     case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: {
-        String color = SVGColor::cssText();
+        String color = SVGColor::customCssText();
         if (color.isEmpty())
             return m_uri;
         return m_uri + ' ' + color;
index 620784d0efae0b22dc9feb85fa4558155596489e..88c5f393a73211541de640905fa99c554b483592 100644 (file)
@@ -93,6 +93,8 @@ public:
 
     bool matchesTargetURI(const String& referenceId);
 
+    String customCssText() const;
+
 private:
     friend class CSSComputedStyleDeclaration;
 
@@ -106,8 +108,6 @@ private:
 private:
     SVGPaint(const SVGPaintType&, const String& uri = String());
 
-    virtual String cssText() const;
-
     SVGPaintType m_paintType;
     String m_uri;
 };