Title: [175391] trunk/Source/WebCore
Revision
175391
Author
[email protected]
Date
2014-10-30 16:08:20 -0700 (Thu, 30 Oct 2014)

Log Message

Clean up virtual functions in css/
https://bugs.webkit.org/show_bug.cgi?id=138230

Reviewed by Benjamin Poulain.

Clean up virtual functions in css/ by:
- Making virtual functions final when possible
- Making classes final when possible
- Using 'override' when appropriate
- Explicitly marking functions / destructors as virtual when they are
  inherently virtual
- Making isXXX() virtual functions private on XXX classes to avoid
  unnecessary type checks

No new tests, no behavior change.

* WebCore.exp.in:
* css/CSSBasicShapes.h:
* css/CSSCharsetRule.h:
* css/CSSComputedStyleDeclaration.h:
* css/CSSCrossfadeValue.h:
* css/CSSFilterImageValue.h:
* css/CSSFontFaceLoadEvent.h:
* css/CSSFontFaceRule.h:
* css/CSSFontFaceSource.h:
* css/CSSImportRule.h:
* css/CSSMediaRule.h:
* css/CSSPageRule.h:
* css/CSSRuleList.h:
(WebCore::StaticCSSRuleList::ref): Deleted.
(WebCore::StaticCSSRuleList::styleSheet): Deleted.
(WebCore::StaticCSSRuleList::length): Deleted.
(WebCore::StaticCSSRuleList::item): Deleted.
(WebCore::LiveCSSRuleList::ref): Deleted.
(WebCore::LiveCSSRuleList::deref): Deleted.
(WebCore::LiveCSSRuleList::length): Deleted.
(WebCore::LiveCSSRuleList::item): Deleted.
(WebCore::LiveCSSRuleList::styleSheet): Deleted.
* css/CSSStyleRule.h:
* css/CSSSupportsRule.h:
* css/CSSUnknownRule.h:
* css/FontLoader.h:
* css/PropertySetCSSStyleDeclaration.h:
(WebCore::PropertySetCSSStyleDeclaration::parentElement):
* css/WebKitCSSKeyframeRule.h:
* css/WebKitCSSViewportRule.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (175390 => 175391)


--- trunk/Source/WebCore/ChangeLog	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/ChangeLog	2014-10-30 23:08:20 UTC (rev 175391)
@@ -1,3 +1,52 @@
+2014-10-30  Chris Dumez  <[email protected]>
+
+        Clean up virtual functions in css/
+        https://bugs.webkit.org/show_bug.cgi?id=138230
+
+        Reviewed by Benjamin Poulain.
+
+        Clean up virtual functions in css/ by:
+        - Making virtual functions final when possible
+        - Making classes final when possible
+        - Using 'override' when appropriate
+        - Explicitly marking functions / destructors as virtual when they are
+          inherently virtual
+        - Making isXXX() virtual functions private on XXX classes to avoid
+          unnecessary type checks
+
+        No new tests, no behavior change.
+
+        * WebCore.exp.in:
+        * css/CSSBasicShapes.h:
+        * css/CSSCharsetRule.h:
+        * css/CSSComputedStyleDeclaration.h:
+        * css/CSSCrossfadeValue.h:
+        * css/CSSFilterImageValue.h:
+        * css/CSSFontFaceLoadEvent.h:
+        * css/CSSFontFaceRule.h:
+        * css/CSSFontFaceSource.h:
+        * css/CSSImportRule.h:
+        * css/CSSMediaRule.h:
+        * css/CSSPageRule.h:
+        * css/CSSRuleList.h:
+        (WebCore::StaticCSSRuleList::ref): Deleted.
+        (WebCore::StaticCSSRuleList::styleSheet): Deleted.
+        (WebCore::StaticCSSRuleList::length): Deleted.
+        (WebCore::StaticCSSRuleList::item): Deleted.
+        (WebCore::LiveCSSRuleList::ref): Deleted.
+        (WebCore::LiveCSSRuleList::deref): Deleted.
+        (WebCore::LiveCSSRuleList::length): Deleted.
+        (WebCore::LiveCSSRuleList::item): Deleted.
+        (WebCore::LiveCSSRuleList::styleSheet): Deleted.
+        * css/CSSStyleRule.h:
+        * css/CSSSupportsRule.h:
+        * css/CSSUnknownRule.h:
+        * css/FontLoader.h:
+        * css/PropertySetCSSStyleDeclaration.h:
+        (WebCore::PropertySetCSSStyleDeclaration::parentElement):
+        * css/WebKitCSSKeyframeRule.h:
+        * css/WebKitCSSViewportRule.h:
+
 2014-10-30  Tim Horton  <[email protected]>
 
         Long spins under rangeExpandedAroundPosition on Yahoo Mail

Modified: trunk/Source/WebCore/WebCore.exp.in (175390 => 175391)


--- trunk/Source/WebCore/WebCore.exp.in	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-10-30 23:08:20 UTC (rev 175391)
@@ -1062,6 +1062,8 @@
 __ZN7WebCore27AuthenticationChallengeBase7compareERKNS_23AuthenticationChallengeES3_
 __ZN7WebCore27AuthenticationChallengeBase7nullifyEv
 __ZN7WebCore27AuthenticationChallengeBaseC2Ev
+__ZN7WebCore27CSSComputedStyleDeclaration3refEv
+__ZN7WebCore27CSSComputedStyleDeclaration5derefEv
 __ZN7WebCore27CSSComputedStyleDeclarationC1EN3WTF10PassRefPtrINS_4NodeEEEbRKNS1_6StringE
 __ZN7WebCore27DeviceOrientationClientMock14setOrientationEN3WTF10PassRefPtrINS_21DeviceOrientationDataEEE
 __ZN7WebCore27DeviceOrientationClientMockC1Ev

Modified: trunk/Source/WebCore/css/CSSBasicShapes.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSBasicShapes.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSBasicShapes.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -63,7 +63,7 @@
     RefPtr<CSSPrimitiveValue> m_referenceBox;
 };
 
-class CSSBasicShapeInset : public CSSBasicShape {
+class CSSBasicShapeInset final : public CSSBasicShape {
 public:
     static PassRefPtr<CSSBasicShapeInset> create() { return adoptRef(new CSSBasicShapeInset); }
 
@@ -110,13 +110,14 @@
     void setBottomRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomRightRadius = radius; }
     void setBottomLeftRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomLeftRadius = radius; }
 
-    virtual Type type() const override { return CSSBasicShapeInsetType; }
     virtual String cssText() const override;
     virtual bool equals(const CSSBasicShape&) const override;
 
 private:
     CSSBasicShapeInset() { }
 
+    virtual Type type() const override { return CSSBasicShapeInsetType; }
+
     RefPtr<CSSPrimitiveValue> m_top;
     RefPtr<CSSPrimitiveValue> m_right;
     RefPtr<CSSPrimitiveValue> m_bottom;
@@ -128,11 +129,10 @@
     RefPtr<CSSPrimitiveValue> m_bottomLeftRadius;
 };
 
-class CSSBasicShapeCircle : public CSSBasicShape {
+class CSSBasicShapeCircle final : public CSSBasicShape {
 public:
     static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBasicShapeCircle); }
 
-    virtual Type type() const override { return CSSBasicShapeCircleType; }
     virtual String cssText() const override;
     virtual bool equals(const CSSBasicShape&) const override;
 
@@ -147,12 +147,14 @@
 private:
     CSSBasicShapeCircle() { }
 
+    virtual Type type() const override { return CSSBasicShapeCircleType; }
+
     RefPtr<CSSPrimitiveValue> m_centerX;
     RefPtr<CSSPrimitiveValue> m_centerY;
     RefPtr<CSSPrimitiveValue> m_radius;
 };
 
-class CSSBasicShapeEllipse : public CSSBasicShape {
+class CSSBasicShapeEllipse final : public CSSBasicShape {
 public:
     static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBasicShapeEllipse); }
 
@@ -166,20 +168,21 @@
     void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
     void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; }
 
-    virtual Type type() const override { return CSSBasicShapeEllipseType; }
     virtual String cssText() const override;
     virtual bool equals(const CSSBasicShape&) const override;
 
 private:
     CSSBasicShapeEllipse() { }
 
+    virtual Type type() const override { return CSSBasicShapeEllipseType; }
+
     RefPtr<CSSPrimitiveValue> m_centerX;
     RefPtr<CSSPrimitiveValue> m_centerY;
     RefPtr<CSSPrimitiveValue> m_radiusX;
     RefPtr<CSSPrimitiveValue> m_radiusY;
 };
 
-class CSSBasicShapePolygon : public CSSBasicShape {
+class CSSBasicShapePolygon final : public CSSBasicShape {
 public:
     static PassRefPtr<CSSBasicShapePolygon> create() { return adoptRef(new CSSBasicShapePolygon); }
 
@@ -196,7 +199,6 @@
     void setWindRule(WindRule w) { m_windRule = w; }
     WindRule windRule() const { return m_windRule; }
 
-    virtual Type type() const override { return CSSBasicShapePolygonType; }
     virtual String cssText() const override;
     virtual bool equals(const CSSBasicShape&) const override;
 
@@ -206,6 +208,8 @@
     {
     }
 
+    virtual Type type() const override { return CSSBasicShapePolygonType; }
+
     Vector<RefPtr<CSSPrimitiveValue>> m_values;
     WindRule m_windRule;
 };

Modified: trunk/Source/WebCore/css/CSSCharsetRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSCharsetRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSCharsetRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -35,7 +35,6 @@
 
     virtual ~CSSCharsetRule() { }
 
-    virtual CSSRule::Type type() const override { return CHARSET_RULE; }
     virtual String cssText() const override;
     virtual void reattach(StyleRuleBase&) override { }
 
@@ -43,6 +42,8 @@
     void setEncoding(const String& encoding, ExceptionCode&) { m_encoding = encoding; }
 
 private:
+    virtual CSSRule::Type type() const override { return CHARSET_RULE; }
+
     CSSCharsetRule(CSSStyleSheet* parent, const String& encoding);
 
     String m_encoding;

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -83,7 +83,7 @@
     bool m_allowVisitedStyle;
 };
 
-class CSSComputedStyleDeclaration : public CSSStyleDeclaration {
+class CSSComputedStyleDeclaration final : public CSSStyleDeclaration {
 public:
     static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoElementName = String())
     {

Modified: trunk/Source/WebCore/css/CSSCrossfadeValue.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSCrossfadeValue.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSCrossfadeValue.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -80,7 +80,7 @@
     {
     }
 
-    class CrossfadeSubimageObserverProxy : public CachedImageClient {
+    class CrossfadeSubimageObserverProxy final : public CachedImageClient {
     public:
         CrossfadeSubimageObserverProxy(CSSCrossfadeValue* ownerValue)
             : m_ownerValue(ownerValue)
@@ -89,7 +89,7 @@
         }
 
         virtual ~CrossfadeSubimageObserverProxy() { }
-        virtual void imageChanged(CachedImage*, const IntRect* = 0) override;
+        virtual void imageChanged(CachedImage*, const IntRect* = nullptr) override;
         void setReady(bool ready) { m_ready = ready; }
     private:
         CSSCrossfadeValue* m_ownerValue;

Modified: trunk/Source/WebCore/css/CSSFilterImageValue.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSFilterImageValue.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSFilterImageValue.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -88,7 +88,7 @@
     {
     }
 
-    class FilterSubimageObserverProxy : public CachedImageClient {
+    class FilterSubimageObserverProxy final : public CachedImageClient {
     public:
         FilterSubimageObserverProxy(CSSFilterImageValue* ownerValue)
             : m_ownerValue(ownerValue)
@@ -97,7 +97,7 @@
         }
 
         virtual ~FilterSubimageObserverProxy() { }
-        virtual void imageChanged(CachedImage*, const IntRect* = 0) override;
+        virtual void imageChanged(CachedImage*, const IntRect* = nullptr) override;
         void setReady(bool ready) { m_ready = ready; }
     private:
         CSSFilterImageValue* m_ownerValue;

Modified: trunk/Source/WebCore/css/CSSFontFaceLoadEvent.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSFontFaceLoadEvent.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSFontFaceLoadEvent.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -48,7 +48,7 @@
     RefPtr<DOMError> error;
 };
 
-class CSSFontFaceLoadEvent : public Event {
+class CSSFontFaceLoadEvent final : public Event {
 public:
     static PassRefPtr<CSSFontFaceLoadEvent> create()
     {
@@ -75,7 +75,7 @@
     CSSFontFaceRule* fontface() const { return m_fontface.get(); }
     DOMError* error() const { return m_error.get(); }
 
-    virtual EventInterface eventInterface() const;
+    virtual EventInterface eventInterface() const override;
 
 private:
     CSSFontFaceLoadEvent();

Modified: trunk/Source/WebCore/css/CSSFontFaceRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSFontFaceRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSFontFaceRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -36,7 +36,6 @@
 
     virtual ~CSSFontFaceRule();
 
-    virtual CSSRule::Type type() const override { return FONT_FACE_RULE; }
     virtual String cssText() const override;
     virtual void reattach(StyleRuleBase&) override;
 
@@ -45,6 +44,8 @@
 private:
     CSSFontFaceRule(StyleRuleFontFace&, CSSStyleSheet* parent);
 
+    virtual CSSRule::Type type() const override { return FONT_FACE_RULE; }
+
     Ref<StyleRuleFontFace> m_fontFaceRule;
     RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };

Modified: trunk/Source/WebCore/css/CSSFontFaceSource.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSFontFaceSource.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -44,9 +44,9 @@
 class SVGFontFaceElement;
 #endif
 
-class CSSFontFaceSource : public CachedFontClient {
+class CSSFontFaceSource final : public CachedFontClient {
 public:
-    CSSFontFaceSource(const String&, CachedFont* = 0);
+    CSSFontFaceSource(const String&, CachedFont* = nullptr);
     virtual ~CSSFontFaceSource();
 
     bool isLoaded() const;
@@ -56,7 +56,7 @@
 
     void setFontFace(CSSFontFace* face) { m_face = face; }
 
-    virtual void fontLoaded(CachedFont*);
+    virtual void fontLoaded(CachedFont*) override;
 
     PassRefPtr<SimpleFontData> getFontData(const FontDescription&, bool syntheticBold, bool syntheticItalic, CSSFontSelector*);
 

Modified: trunk/Source/WebCore/css/CSSImportRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSImportRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSImportRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -37,7 +37,6 @@
     
     virtual ~CSSImportRule();
 
-    virtual CSSRule::Type type() const override { return IMPORT_RULE; }
     virtual String cssText() const override;
     virtual void reattach(StyleRuleBase&) override;
 
@@ -48,6 +47,8 @@
 private:
     CSSImportRule(StyleRuleImport&, CSSStyleSheet*);
 
+    virtual CSSRule::Type type() const override { return IMPORT_RULE; }
+
     Ref<StyleRuleImport> m_importRule;
     mutable RefPtr<MediaList> m_mediaCSSOMWrapper;
     mutable RefPtr<CSSStyleSheet> m_styleSheetCSSOMWrapper;

Modified: trunk/Source/WebCore/css/CSSMediaRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSMediaRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSMediaRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -36,7 +36,6 @@
 
     virtual ~CSSMediaRule();
 
-    virtual CSSRule::Type type() const override { return MEDIA_RULE; }
     virtual void reattach(StyleRuleBase&) override;
     virtual String cssText() const override;
 
@@ -45,6 +44,8 @@
 private:
     CSSMediaRule(StyleRuleMedia&, CSSStyleSheet*);
 
+    virtual CSSRule::Type type() const override { return MEDIA_RULE; }
+
     MediaQuerySet* mediaQueries() const;
     
     mutable RefPtr<MediaList> m_mediaCSSOMWrapper;

Modified: trunk/Source/WebCore/css/CSSPageRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSPageRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSPageRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -37,7 +37,6 @@
 
     virtual ~CSSPageRule();
 
-    virtual CSSRule::Type type() const override { return PAGE_RULE; }
     virtual String cssText() const override;
     virtual void reattach(StyleRuleBase&) override;
 
@@ -48,7 +47,9 @@
 
 private:
     CSSPageRule(StyleRulePage&, CSSStyleSheet*);
-    
+
+    virtual CSSRule::Type type() const override { return PAGE_RULE; }
+
     Ref<StyleRulePage> m_pageRule;
     mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };

Modified: trunk/Source/WebCore/css/CSSRuleList.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSRuleList.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSRuleList.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -50,23 +50,23 @@
     CSSRuleList();
 };
 
-class StaticCSSRuleList : public CSSRuleList {
+class StaticCSSRuleList final : public CSSRuleList {
 public:
     static PassRefPtr<StaticCSSRuleList> create() { return adoptRef(new StaticCSSRuleList()); }
 
-    virtual void ref() { ++m_refCount; }
-    virtual void deref();
+    virtual void ref() override { ++m_refCount; }
+    virtual void deref() override;
 
     Vector<RefPtr<CSSRule>>& rules() { return m_rules; }
     
-    virtual CSSStyleSheet* styleSheet() const { return 0; }
+    virtual CSSStyleSheet* styleSheet() const override { return nullptr; }
 
 private:    
     StaticCSSRuleList();
     ~StaticCSSRuleList();
 
-    virtual unsigned length() const { return m_rules.size(); }
-    virtual CSSRule* item(unsigned index) const { return index < m_rules.size() ? m_rules[index].get() : 0; }
+    virtual unsigned length() const override { return m_rules.size(); }
+    virtual CSSRule* item(unsigned index) const override { return index < m_rules.size() ? m_rules[index].get() : nullptr; }
 
     Vector<RefPtr<CSSRule>> m_rules;
     unsigned m_refCount;
@@ -74,17 +74,17 @@
 
 // The rule owns the live list.
 template <class Rule>
-class LiveCSSRuleList : public CSSRuleList {
+class LiveCSSRuleList final : public CSSRuleList {
 public:
     LiveCSSRuleList(Rule* rule) : m_rule(rule) { }
     
-    virtual void ref() { m_rule->ref(); }
-    virtual void deref() { m_rule->deref(); }
+    virtual void ref() override { m_rule->ref(); }
+    virtual void deref() override { m_rule->deref(); }
 
 private:
-    virtual unsigned length() const { return m_rule->length(); }
-    virtual CSSRule* item(unsigned index) const  { return m_rule->item(index); }
-    virtual CSSStyleSheet* styleSheet() const { return m_rule->parentStyleSheet(); }
+    virtual unsigned length() const override { return m_rule->length(); }
+    virtual CSSRule* item(unsigned index) const override { return m_rule->item(index); }
+    virtual CSSStyleSheet* styleSheet() const override { return m_rule->parentStyleSheet(); }
     
     Rule* m_rule;
 };

Modified: trunk/Source/WebCore/css/CSSStyleRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSStyleRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSStyleRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -36,7 +36,6 @@
 
     virtual ~CSSStyleRule();
 
-    virtual CSSRule::Type type() const { return STYLE_RULE; }
     virtual String cssText() const override;
     virtual void reattach(StyleRuleBase&) override;
 
@@ -51,6 +50,8 @@
 private:
     CSSStyleRule(StyleRule&, CSSStyleSheet*);
 
+    virtual CSSRule::Type type() const override { return STYLE_RULE; }
+
     String generateSelectorText() const;
 
     Ref<StyleRule> m_styleRule;

Modified: trunk/Source/WebCore/css/CSSSupportsRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSSupportsRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSSupportsRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -45,13 +45,14 @@
 
     virtual ~CSSSupportsRule() { }
 
-    virtual CSSRule::Type type() const override { return SUPPORTS_RULE; }
     virtual String cssText() const override;
 
     String conditionText() const;
 
 private:
     CSSSupportsRule(StyleRuleSupports&, CSSStyleSheet*);
+
+    virtual CSSRule::Type type() const override { return SUPPORTS_RULE; }
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/css/CSSUnknownRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/CSSUnknownRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/CSSUnknownRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -28,12 +28,18 @@
 
 class CSSUnknownRule final : public CSSRule {
 public:
-    CSSUnknownRule() : CSSRule(0) { }
+    CSSUnknownRule()
+        : CSSRule(nullptr)
+    {
+    }
+
     virtual ~CSSUnknownRule() { }
 
-    virtual CSSRule::Type type() const override { return UNKNOWN_RULE; }
     virtual String cssText() const override { return String(); }
     virtual void reattach(StyleRuleBase&) override { }
+
+private:
+    virtual CSSRule::Type type() const override { return UNKNOWN_RULE; }
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/css/FontLoader.h (175390 => 175391)


--- trunk/Source/WebCore/css/FontLoader.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/FontLoader.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -48,7 +48,7 @@
 class LoadFontCallback;
 class ScriptExecutionContext;
 
-class FontLoader : public RefCounted<FontLoader>, public ActiveDOMObject, public EventTarget {
+class FontLoader final : public RefCounted<FontLoader>, public ActiveDOMObject, public EventTarget {
 public:
     static PassRefPtr<FontLoader> create(Document* document)
     {
@@ -70,8 +70,8 @@
 
     bool loading() const { return m_numLoadingFromCSS > 0 || m_numLoadingFromJS > 0; }
 
-    virtual ScriptExecutionContext* scriptExecutionContext() const;
-    virtual EventTargetInterface eventTargetInterface() const;
+    virtual ScriptExecutionContext* scriptExecutionContext() const override;
+    virtual EventTargetInterface eventTargetInterface() const override;
 
     using RefCounted<FontLoader>::ref;
     using RefCounted<FontLoader>::deref;

Modified: trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.h (175390 => 175391)


--- trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -44,7 +44,7 @@
 public:
     PropertySetCSSStyleDeclaration(MutableStyleProperties* propertySet) : m_propertySet(propertySet) { }
     
-    virtual StyledElement* parentElement() const { return 0; }
+    virtual StyledElement* parentElement() const { return nullptr; }
     virtual void clearParentElement() { ASSERT_NOT_REACHED(); }
     StyleSheetContents* contextStyleSheet() const;
     
@@ -52,23 +52,23 @@
     virtual void deref() override;
 
 private:
-    virtual CSSRule* parentRule() const override { return 0; };
-    virtual unsigned length() const override;
-    virtual String item(unsigned index) const override;
-    virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName) override;
-    virtual String getPropertyValue(const String& propertyName) override;
-    virtual String getPropertyPriority(const String& propertyName) override;
-    virtual String getPropertyShorthand(const String& propertyName) override;
-    virtual bool isPropertyImplicit(const String& propertyName) override;
-    virtual void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&) override;
-    virtual String removeProperty(const String& propertyName, ExceptionCode&) override;
-    virtual String cssText() const override;
-    virtual void setCssText(const String&, ExceptionCode&) override;
-    virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) override;
-    virtual String getPropertyValueInternal(CSSPropertyID) override;
-    virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&) override;
+    virtual CSSRule* parentRule() const override { return nullptr; }
+    virtual unsigned length() const override final;
+    virtual String item(unsigned index) const override final;
+    virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName) override final;
+    virtual String getPropertyValue(const String& propertyName) override final;
+    virtual String getPropertyPriority(const String& propertyName) override final;
+    virtual String getPropertyShorthand(const String& propertyName) override final;
+    virtual bool isPropertyImplicit(const String& propertyName) override final;
+    virtual void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&) override final;
+    virtual String removeProperty(const String& propertyName, ExceptionCode&) override final;
+    virtual String cssText() const override final;
+    virtual void setCssText(const String&, ExceptionCode&) override final;
+    virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) override final;
+    virtual String getPropertyValueInternal(CSSPropertyID) override final;
+    virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&) override final;
     
-    virtual PassRef<MutableStyleProperties> copyProperties() const override;
+    virtual PassRef<MutableStyleProperties> copyProperties() const override final;
 
     CSSValue* cloneAndCacheForCSSOM(CSSValue*);
     
@@ -81,7 +81,7 @@
     std::unique_ptr<HashMap<CSSValue*, RefPtr<CSSValue>>> m_cssomCSSValueClones;
 };
 
-class StyleRuleCSSStyleDeclaration : public PropertySetCSSStyleDeclaration
+class StyleRuleCSSStyleDeclaration final : public PropertySetCSSStyleDeclaration
 {
 public:
     static PassRefPtr<StyleRuleCSSStyleDeclaration> create(MutableStyleProperties& propertySet, CSSRule& parentRule)
@@ -111,7 +111,7 @@
     CSSRule* m_parentRule;
 };
 
-class InlineCSSStyleDeclaration : public PropertySetCSSStyleDeclaration
+class InlineCSSStyleDeclaration final : public PropertySetCSSStyleDeclaration
 {
 public:
     InlineCSSStyleDeclaration(MutableStyleProperties* propertySet, StyledElement* parentElement)

Modified: trunk/Source/WebCore/css/WebKitCSSKeyframeRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/WebKitCSSKeyframeRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/WebKitCSSKeyframeRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -69,7 +69,6 @@
 public:
     virtual ~WebKitCSSKeyframeRule();
 
-    virtual CSSRule::Type type() const override { return WEBKIT_KEYFRAME_RULE; }
     virtual String cssText() const override { return m_keyframe->cssText(); }
     virtual void reattach(StyleRuleBase&) override;
 
@@ -81,6 +80,8 @@
 private:
     WebKitCSSKeyframeRule(StyleKeyframe&, WebKitCSSKeyframesRule* parent);
 
+    virtual CSSRule::Type type() const override { return WEBKIT_KEYFRAME_RULE; }
+
     Ref<StyleKeyframe> m_keyframe;
     mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
     

Modified: trunk/Source/WebCore/css/WebKitCSSViewportRule.h (175390 => 175391)


--- trunk/Source/WebCore/css/WebKitCSSViewportRule.h	2014-10-30 23:03:26 UTC (rev 175390)
+++ trunk/Source/WebCore/css/WebKitCSSViewportRule.h	2014-10-30 23:08:20 UTC (rev 175391)
@@ -47,9 +47,8 @@
     {
         return adoptRef(new WebKitCSSViewportRule(viewportRule, sheet));
     }
-    ~WebKitCSSViewportRule();
+    virtual ~WebKitCSSViewportRule();
 
-    virtual CSSRule::Type type() const override { return WEBKIT_VIEWPORT_RULE; }
     virtual String cssText() const override;
     virtual void reattach(StyleRuleBase&) override;
 
@@ -58,6 +57,8 @@
 private:
     WebKitCSSViewportRule(StyleRuleViewport&, CSSStyleSheet*);
 
+    virtual CSSRule::Type type() const override { return WEBKIT_VIEWPORT_RULE; }
+
     Ref<StyleRuleViewport> m_viewportRule;
     mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to