Kill StyleBase.
authorandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 14:13:14 +0000 (14:13 +0000)
committerandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 14:13:14 +0000 (14:13 +0000)
commit3b5f9ef6853045b7cf267da2cc41d470c668a045
treefac39bd4d60d8b5d81f547bc9945835347553376
parent12cdb8cd0c6f6a324ae9ad877d14ad60f2fba58b
Kill StyleBase.
https://bugs.webkit.org/show_bug.cgi?id=71218

Reviewed by Antti Koivisto.

Remove the StyleBase class and make all subclasses stand alone. CSSRule and StyleSheet
now inherit from RefCounted<T> instead, and XSLImportRule doesn't even need that,
so StyleBase is replaced by nothing.

* css/StyleBase.cpp:
* css/StyleBase.h:

    Removed.

* css/CSSRule.cpp:
* css/CSSRule.h:
(WebCore::CSSRule::~CSSRule):
(WebCore::CSSRule::useStrictParsing):
(WebCore::CSSRule::setParentStyleSheet):
(WebCore::CSSRule::setParentRule):
(WebCore::CSSRule::parentStyleSheet):
(WebCore::CSSRule::parentRule):
(WebCore::CSSRule::baseURL):
(WebCore::CSSRule::CSSRule):

    CSSRule now inherits directly from RefCounted, and has either a CSSRule or a
    CSSStyleSheet as its parent. Made these getters/setters inline since they are
    trivial now.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:

    Purge StyleBase.* from the build systems.

* bindings/js/JSDOMBinding.h:
(WebCore::root):

    New root() functions for CSSRule and StyleSheet.

* bindings/js/JSNodeCustom.h:

    Remove StyleBase.h include.

* css/CSSStyleSheet.h:
(WebCore::CSSStyleSheet::parentStyleSheet):

    Added CSS-specific parentStyleSheet() so we don't have to cast it to a
    CSSStyleSheet* at the call sites.

* css/StyleSheet.cpp:
(WebCore::StyleSheet::StyleSheet):
(WebCore::StyleSheet::parentStyleSheet):
(WebCore::StyleSheet::baseURL):
* css/StyleSheet.h:
(WebCore::StyleSheet::parentRule):
(WebCore::StyleSheet::setParentRule):
(WebCore::StyleSheet::isCSSStyleSheet):
(WebCore::StyleSheet::isXSLStyleSheet):

    StyleSheet now inherits directly from RefCounted and always has a parent CSSRule
    though it can be null. parentStyleSheet() returns that rule's parent style sheet.
    Moved the relevant guts from StyleBase down here.

* loader/cache/CachedStyleSheetClient.h:

    Remove unnecessary WTF_MAKE_FAST_ALLOCATED, we get it from CachedResourceClient.

* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::XSLImportRule):
(WebCore::XSLImportRule::~XSLImportRule):
(WebCore::XSLImportRule::parentStyleSheet):
(WebCore::XSLImportRule::setXSLStyleSheet):
(WebCore::XSLImportRule::loadSheet):
* xml/XSLImportRule.h:
(WebCore::XSLImportRule::create):
(WebCore::XSLImportRule::setParentStyleSheet):

    Remove inheritance from StyleBase, and have create() return a PassOwnPtr instead.
    This is fine, since XSLStyleSheet is the only object that ever manages these rules.

* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::insertedIntoDocument):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::~CSSStyleSheet):
(WebCore::CSSStyleSheet::ownerRule):
(WebCore::CSSStyleSheet::deleteRule):
(WebCore::CSSStyleSheet::checkLoaded):
(WebCore::CSSStyleSheet::document):
(WebCore::CSSStyleSheet::styleSheetChanged):
* css/CSSImportRule.cpp:
(WebCore::CSSImportRule::~CSSImportRule):
(WebCore::CSSImportRule::setCSSStyleSheet):
(WebCore::CSSImportRule::insertedIntoParent):
* css/CSSMediaRule.cpp:
(WebCore::CSSMediaRule::CSSMediaRule):
(WebCore::CSSMediaRule::~CSSMediaRule):
(WebCore::CSSMediaRule::append):
(WebCore::CSSMediaRule::insertRule):
(WebCore::CSSMediaRule::deleteRule):
* css/CSSRegionStyleRule.cpp:
(WebCore::CSSRegionStyleRule::CSSRegionStyleRule):
(WebCore::CSSRegionStyleRule::~CSSRegionStyleRule):
* css/CSSRuleList.cpp:
(WebCore::CSSRuleList::deleteRule):
* css/CSSStyleDeclaration.h:
* css/WebKitCSSKeyframesRule.cpp:
(WebCore::WebKitCSSKeyframesRule::~WebKitCSSKeyframesRule):
(WebCore::WebKitCSSKeyframesRule::setName):
(WebCore::WebKitCSSKeyframesRule::append):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::parseStyleSheet):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::parentStyleSheet):
* xml/XSLStyleSheet.h:
* xml/XSLStyleSheetLibxslt.cpp:
(WebCore::XSLStyleSheet::XSLStyleSheet):
(WebCore::XSLStyleSheet::~XSLStyleSheet):
(WebCore::XSLStyleSheet::checkLoaded):
(WebCore::XSLStyleSheet::loadChildSheet):
* xml/XSLStyleSheetQt.cpp:
(WebCore::XSLStyleSheet::~XSLStyleSheet):

    Use the new, more explicit, parenting functions of StyleSheet.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSNodeCustom.h
Source/WebCore/css/CSSImportRule.cpp
Source/WebCore/css/CSSMediaRule.cpp
Source/WebCore/css/CSSRegionStyleRule.cpp
Source/WebCore/css/CSSRule.cpp
Source/WebCore/css/CSSRule.h
Source/WebCore/css/CSSRuleList.cpp
Source/WebCore/css/CSSStyleDeclaration.h
Source/WebCore/css/CSSStyleSheet.cpp
Source/WebCore/css/CSSStyleSheet.h
Source/WebCore/css/StyleBase.cpp [deleted file]
Source/WebCore/css/StyleBase.h [deleted file]
Source/WebCore/css/StyleSheet.cpp
Source/WebCore/css/StyleSheet.h
Source/WebCore/css/WebKitCSSKeyframesRule.cpp
Source/WebCore/dom/ProcessingInstruction.cpp
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/loader/cache/CachedStyleSheetClient.h
Source/WebCore/svg/SVGFontFaceElement.cpp
Source/WebCore/xml/XSLImportRule.cpp
Source/WebCore/xml/XSLImportRule.h
Source/WebCore/xml/XSLStyleSheet.h
Source/WebCore/xml/XSLStyleSheetLibxslt.cpp
Source/WebCore/xml/XSLStyleSheetQt.cpp