Changeset 18106 in webkit


Ignore:
Timestamp:
Dec 9, 2006 9:22:13 AM (17 years ago)
Author:
rwlbuis
Message:

Reviewed by Darin.

http://bugs.webkit.org/show_bug.cgi?id=11625
Investigate possibility to share code between HTMLStyleElement and SVGStyleElement

Add a class shared by both HTMLStyleElement and SVGStyleElement that
encapsulates the common logic.

Location:
trunk/WebCore
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/CMakeLists.txt

    r18096 r18106  
    794794    dom/Range.cpp
    795795    dom/RegisteredEventListener.cpp
     796    dom/StyleElement.cpp
    796797    dom/StyledElement.cpp
    797798    dom/Text.cpp
  • trunk/WebCore/ChangeLog

    r18098 r18106  
     12006-12-09  Rob Buis  <buis@kde.org>
     2
     3        Reviewed by Darin.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=11625
     6        Investigate possibility to share code between HTMLStyleElement and SVGStyleElement
     7
     8        Add a class shared by both HTMLStyleElement and SVGStyleElement that
     9        encapsulates the common logic.
     10
     11        * CMakeLists.txt:
     12        * WebCore.xcodeproj/project.pbxproj:
     13        * dom/Document.cpp:
     14        (WebCore::Document::recalcStyleSelector):
     15        Generalize stylesheet processing of svg and html.
     16
     17        * dom/StyleElement.cpp: Added.
     18        (WebCore::StyleElement::StyleElement):
     19        (WebCore::StyleElement::sheet):
     20        (WebCore::StyleElement::insertedIntoDocument):
     21        (WebCore::StyleElement::removedFromDocument):
     22        (WebCore::StyleElement::childrenChanged):
     23        * dom/StyleElement.h: Added.
     24        (WebCore::StyleElement::~StyleElement):
     25        (WebCore::StyleElement::isLoading):
     26        Common base class for SVGStyleElement and HTMLStyleElement.
     27
     28        * html/HTMLStyleElement.cpp:
     29        (WebCore::HTMLStyleElement::HTMLStyleElement):
     30        (WebCore::HTMLStyleElement::parseMappedAttribute):
     31        (WebCore::HTMLStyleElement::insertedIntoDocument):
     32        (WebCore::HTMLStyleElement::removedFromDocument):
     33        (WebCore::HTMLStyleElement::childrenChanged):
     34        (WebCore::HTMLStyleElement::media):
     35        (WebCore::HTMLStyleElement::setMedia):
     36        (WebCore::HTMLStyleElement::type):
     37        (WebCore::HTMLStyleElement::setType):
     38        * html/HTMLStyleElement.h:
     39        Use new common class.
     40
     41        * ksvg2/svg/SVGElement.cpp:
     42        * ksvg2/svg/SVGElement.h:
     43        * ksvg2/svg/SVGSVGElement.cpp:
     44        (WebCore::SVGSVGElement::contentScriptType):
     45        (WebCore::SVGSVGElement::contentStyleType):
     46        * ksvg2/svg/SVGSVGElement.h:
     47        Do not use tryGetAttribute(NS) anymore.
     48
     49        * ksvg2/svg/SVGStyleElement.cpp:
     50        (WebCore::SVGStyleElement::SVGStyleElement):
     51        (WebCore::SVGStyleElement::xmlspace):
     52        (WebCore::SVGStyleElement::type):
     53        (WebCore::SVGStyleElement::media):
     54        (WebCore::SVGStyleElement::title):
     55        (WebCore::SVGStyleElement::insertedIntoDocument):
     56        (WebCore::SVGStyleElement::removedFromDocument):
     57        (WebCore::SVGStyleElement::childrenChanged):
     58        * ksvg2/svg/SVGStyleElement.h:
     59        Use new common class.
     60
    1612006-12-08  David Hyatt  <hyatt@apple.com>
    262
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r18098 r18106  
    22022202                AA21ECCA0ABF0FBA002B834C /* CSSCursorImageValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0978ED0ABAA6E100874480 /* CSSCursorImageValue.cpp */; };
    22032203                AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
     2204                AA4C3A760B2B1679002334A2 /* StyleElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA4C3A740B2B1679002334A2 /* StyleElement.cpp */; };
     2205                AA4C3A770B2B1679002334A2 /* StyleElement.h in Headers */ = {isa = PBXBuildFile; fileRef = AA4C3A750B2B1679002334A2 /* StyleElement.h */; };
    22042206                AAC8DAB10AA1002000DC0907 /* SVGMetadataElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAC8DAAF0AA1002000DC0907 /* SVGMetadataElement.cpp */; };
    22052207                AAC8DAB20AA1002000DC0907 /* SVGMetadataElement.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC8DAB00AA1002000DC0907 /* SVGMetadataElement.h */; };
     
    28242826                };
    28252827/* End PBXBuildRule section */
    2826 
    2827 /* Begin PBXBuildStyle section */
    2828                 BC18C5C70B2A883B0018461D /* Development */ = {
    2829                         isa = PBXBuildStyle;
    2830                         buildSettings = {
    2831                                 COPY_PHASE_STRIP = NO;
    2832                         };
    2833                         name = Development;
    2834                 };
    2835                 BC18C5C80B2A883B0018461D /* Deployment */ = {
    2836                         isa = PBXBuildStyle;
    2837                         buildSettings = {
    2838                                 COPY_PHASE_STRIP = YES;
    2839                         };
    2840                         name = Deployment;
    2841                 };
    2842 /* End PBXBuildStyle section */
    28432828
    28442829/* Begin PBXContainerItemProxy section */
     
    51765161                AA0978ED0ABAA6E100874480 /* CSSCursorImageValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCursorImageValue.cpp; sourceTree = "<group>"; };
    51775162                AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSCursorImageValue.h; sourceTree = "<group>"; };
     5163                AA4C3A740B2B1679002334A2 /* StyleElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleElement.cpp; sourceTree = "<group>"; };
     5164                AA4C3A750B2B1679002334A2 /* StyleElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleElement.h; sourceTree = "<group>"; };
    51785165                AAC8DAAF0AA1002000DC0907 /* SVGMetadataElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGMetadataElement.cpp; sourceTree = "<group>"; };
    51795166                AAC8DAB00AA1002000DC0907 /* SVGMetadataElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGMetadataElement.h; sourceTree = "<group>"; };
     
    92569243                        isa = PBXGroup;
    92579244                        children = (
     9245                                AA4C3A740B2B1679002334A2 /* StyleElement.cpp */,
     9246                                AA4C3A750B2B1679002334A2 /* StyleElement.h */,
    92589247                                BC3B364705C9D5E200E42902 /* AtomicStringList.h */,
    92599248                                A8C4A7FC09D563270003AC8D /* Attr.cpp */,
     
    1084110830                                E1D8E3160B29E39C00F4BAF6 /* HTTPParsers.h in Headers */,
    1084210831                                BC18C5D00B2A886F0018461D /* TextBreakIterator.h in Headers */,
     10832                                AA4C3A770B2B1679002334A2 /* StyleElement.h in Headers */,
    1084310833                        );
    1084410834                        runOnlyForDeploymentPostprocessing = 0;
     
    1087810868                        isa = PBXProject;
    1087910869                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
    10880                         buildSettings = {
    10881                         };
    10882                         buildStyles = (
    10883                                 BC18C5C70B2A883B0018461D /* Development */,
    10884                                 BC18C5C80B2A883B0018461D /* Deployment */,
    10885                         );
    1088610870                        hasScannedForEncodings = 1;
    1088710871                        knownRegions = (
     
    1216412148                                E1D8E31A0B29E3B600F4BAF6 /* HTTPParsers.cpp in Sources */,
    1216512149                                BC18C5D10B2A886F0018461D /* TextBreakIteratorICU.cpp in Sources */,
     12150                                AA4C3A760B2B1679002334A2 /* StyleElement.cpp in Sources */,
    1216612151                        );
    1216712152                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/dom/Document.cpp

    r18098 r18106  
    18541854            }
    18551855
    1856         }
    1857         else if (n->isHTMLElement() && (n->hasTagName(linkTag) || n->hasTagName(styleTag))) {
    1858             HTMLElement *e = static_cast<HTMLElement *>(n);
     1856        } else if (n->isHTMLElement() && (n->hasTagName(linkTag) || n->hasTagName(styleTag))
     1857#ifdef SVG_SUPPORT
     1858            ||  (n->isSVGElement() && n->hasTagName(SVGNames::styleTag))
     1859#endif
     1860        ) {
     1861            Element* e = static_cast<Element*>(n);
    18591862            DeprecatedString title = e->getAttribute(titleAttr).deprecatedString();
    18601863            bool enabledViaScript = false;
     
    18711874            // Get the current preferred styleset.  This is the
    18721875            // set of sheets that will be enabled.
     1876#ifdef SVG_SUPPORT
     1877            if (n->isSVGElement() && n->hasTagName(SVGNames::styleTag))
     1878                sheet = static_cast<SVGStyleElement*>(n)->sheet();
     1879            else
     1880#endif
    18731881            if (e->hasLocalName(linkTag))
    18741882                sheet = static_cast<HTMLLinkElement*>(n)->sheet();
     
    18941902                if (title != m_preferredStylesheetSet)
    18951903                    sheet = 0;
     1904
     1905#ifdef SVG_SUPPORT
     1906                if (!n->isHTMLElement())
     1907                    title = title.replace('&', "&&");
     1908#endif
    18961909            }
    18971910        }
    1898 #ifdef SVG_SUPPORT
    1899         else if (n->isSVGElement() && n->hasTagName(SVGNames::styleTag)) {
    1900             DeprecatedString title;
    1901             // <STYLE> element
    1902             SVGStyleElement *s = static_cast<SVGStyleElement*>(n);
    1903             if (!s->isLoading()) {
    1904                 sheet = s->sheet();
    1905                 if(sheet)
    1906                     title = s->getAttribute(SVGNames::titleAttr).deprecatedString();
    1907             }
    1908 
    1909             if (!title.isEmpty() && m_preferredStylesheetSet.isEmpty())
    1910                 m_preferredStylesheetSet = m_selectedStylesheetSet = title;
    1911 
    1912             if (!title.isEmpty()) {
    1913                 if (title != m_preferredStylesheetSet)
    1914                     sheet = 0; // don't use it
    1915 
    1916                 title = title.replace('&', "&&");
    1917             }
    1918        }
    1919 #endif
    19201911
    19211912        if (sheet) {
  • trunk/WebCore/html/HTMLStyleElement.cpp

    r17825 r18106  
    2727#include "Document.h"
    2828#include "HTMLNames.h"
    29 #include "MediaList.h"
    30 #include "MediaQueryEvaluator.h"
    3129
    3230namespace WebCore {
     
    3634HTMLStyleElement::HTMLStyleElement(Document* doc)
    3735    : HTMLElement(styleTag, doc)
    38     , m_loading(false)
    3936{
    40 }
    41 
    42 StyleSheet* HTMLStyleElement::sheet() const
    43 {
    44     return m_sheet.get();
    4537}
    4638
     
    4840void HTMLStyleElement::parseMappedAttribute(MappedAttribute *attr)
    4941{
    50     if (attr->name() == typeAttr)
    51         m_type = attr->value().domString().lower();
    52     else if (attr->name() == mediaAttr)
     42    if (attr->name() == mediaAttr)
    5343        m_media = attr->value().deprecatedString().lower();
    5444    else
     
    5949{
    6050    HTMLElement::insertedIntoDocument();
    61     if (m_sheet)
    62         document()->updateStyleSelector();
     51    StyleElement::insertedIntoDocument(document());
    6352}
    6453
     
    6655{
    6756    HTMLElement::removedFromDocument();
    68     if (m_sheet)
    69         document()->updateStyleSelector();
     57    StyleElement::removedFromDocument(document());
    7058}
    7159
    7260void HTMLStyleElement::childrenChanged()
    7361{
    74     String text = "";
    75 
    76     for (Node* c = firstChild(); c; c = c->nextSibling())
    77         if (c->nodeType() == TEXT_NODE || c->nodeType() == CDATA_SECTION_NODE || c->nodeType() == COMMENT_NODE)
    78             text += c->nodeValue();
    79 
    80     if (m_sheet) {
    81         if (static_cast<CSSStyleSheet *>(m_sheet.get())->isLoading())
    82             document()->stylesheetLoaded(); // Remove ourselves from the sheet list.
    83         m_sheet = 0;
    84     }
    85 
    86     m_loading = false;
    87     if (m_type.isEmpty() || m_type == "text/css") { // Type must be empty or CSS
    88         RefPtr<MediaList> media = new MediaList((CSSStyleSheet*)0, m_media, true);
    89         MediaQueryEvaluator screenEval("screen", true);
    90         MediaQueryEvaluator printEval("print", true);
    91         if (screenEval.eval(media.get()) || printEval.eval(media.get())) {
    92             document()->addPendingSheet();
    93             m_loading = true;
    94             m_sheet = new CSSStyleSheet(this, String(), document()->inputEncoding());
    95             m_sheet->parseString(text, !document()->inCompatMode());
    96             m_sheet->setMedia(media.get());
    97             m_loading = false;
    98         }
    99     }
    100 
    101     if (!isLoading() && m_sheet)
    102         document()->stylesheetLoaded();
     62    StyleElement::childrenChanged(this);
    10363}
    10464
     
    13191}
    13292
    133 String HTMLStyleElement::media() const
     93const AtomicString& HTMLStyleElement::media() const
    13494{
    13595    return getAttribute(mediaAttr);
    13696}
    13797
    138 void HTMLStyleElement::setMedia(const String &value)
     98void HTMLStyleElement::setMedia(const AtomicString &value)
    13999{
    140100    setAttribute(mediaAttr, value);
    141101}
    142102
    143 String HTMLStyleElement::type() const
     103const AtomicString& HTMLStyleElement::type() const
    144104{
    145105    return getAttribute(typeAttr);
    146106}
    147107
    148 void HTMLStyleElement::setType(const String &value)
     108void HTMLStyleElement::setType(const AtomicString &value)
    149109{
    150110    setAttribute(typeAttr, value);
  • trunk/WebCore/html/HTMLStyleElement.h

    r17825 r18106  
    2525#define HTMLStyleElement_H
    2626
     27#include "CSSStyleSheet.h"
    2728#include "HTMLElement.h"
    28 #include "CSSStyleSheet.h"
     29#include "StyleElement.h"
    2930
    3031namespace WebCore {
    3132
    32 class HTMLStyleElement : public HTMLElement
     33class HTMLStyleElement : public HTMLElement, public StyleElement
    3334{
    3435public:
     
    3940    virtual bool checkDTD(const Node* newChild) { return newChild->isTextNode(); }
    4041
    41     StyleSheet* sheet() const;
    42 
    4342    // overload from HTMLElement
    4443    virtual void parseMappedAttribute(MappedAttribute*);
     
    4746    virtual void childrenChanged();
    4847
    49     bool isLoading() const;
     48    virtual bool isLoading() const;
    5049    virtual bool sheetLoaded();
    5150
     
    5352    void setDisabled(bool);
    5453
    55     String media() const;
    56     void setMedia(const String&);
     54    const AtomicString& media() const;
     55    void setMedia(const AtomicString&);
    5756
    58     String type() const;
    59     void setType(const String&);
     57    const AtomicString& type() const;
     58    void setType(const AtomicString&);
    6059
    6160protected:
    62     RefPtr<CSSStyleSheet> m_sheet;
    63     bool m_loading;
    64     String m_type;
    6561    String m_media;
    6662};
  • trunk/WebCore/ksvg2/svg/SVGElement.cpp

    r17976 r18106  
    106106}
    107107
    108 AtomicString SVGElement::tryGetAttribute(const String& name, AtomicString defaultVal) const
    109 {
    110     if (hasAttribute(name))
    111         return getAttribute(name);
    112 
    113     return defaultVal;
    114 }
    115 
    116 AtomicString SVGElement::tryGetAttributeNS(const String& namespaceURI, const String& localName, AtomicString defaultVal) const
    117 {
    118     if (hasAttributeNS(namespaceURI, localName))
    119         return getAttributeNS(namespaceURI, localName);
    120 
    121     return defaultVal;
    122 }
    123 
    124108void SVGElement::addSVGEventListener(const AtomicString& eventType, const Attribute* attr)
    125109{
  • trunk/WebCore/ksvg2/svg/SVGElement.h

    r17062 r18106  
    161161        SVGElement* viewportElement() const;
    162162
    163         // Helper methods that returns the attr value if attr is set, otherwise the default value.
    164         // It throws NO_MODIFICATION_ALLOWED_ERR if the element is read-only.
    165         AtomicString tryGetAttribute(const String& name, AtomicString defaultValue = AtomicString()) const;
    166         AtomicString tryGetAttributeNS(const String& namespaceURI, const String& localName, AtomicString defaultValue = AtomicString()) const;
    167 
    168163        // Internal
    169164        virtual void parseMappedAttribute(MappedAttribute*);
  • trunk/WebCore/ksvg2/svg/SVGSVGElement.cpp

    r18030 r18106  
    3535#include "SVGLength.h"
    3636#include "SVGMatrix.h"
     37#include "SVGNames.h"
    3738#include "SVGPreserveAspectRatio.h"
    3839#include "SVGTransform.h"
     
    4445using namespace HTMLNames;
    4546using namespace EventNames;
     47using namespace SVGNames;
    4648
    4749SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc)
     
    7779ANIMATED_PROPERTY_DEFINITIONS(SVGSVGElement, SVGLength*, Length, length, Height, height, SVGNames::heightAttr.localName(), m_height.get())
    7880
    79 AtomicString SVGSVGElement::contentScriptType() const
    80 {
    81     return tryGetAttribute("contentScriptType", "text/ecmascript");
     81const AtomicString& SVGSVGElement::contentScriptType() const
     82{
     83    static const AtomicString defaultValue("text/ecmascript");
     84    const AtomicString& n = getAttribute(contentScriptTypeAttr);
     85    return n.isNull() ? defaultValue : n;
    8286}
    8387
     
    8791}
    8892
    89 AtomicString SVGSVGElement::contentStyleType() const
    90 {
    91     return tryGetAttribute("contentStyleType", "text/css");
     93const AtomicString& SVGSVGElement::contentStyleType() const
     94{
     95    static const AtomicString defaultValue("text/css");
     96    const AtomicString& n = getAttribute(contentStyleTypeAttr);
     97    return n.isNull() ? defaultValue : n;
    9298}
    9399
  • trunk/WebCore/ksvg2/svg/SVGSVGElement.h

    r18030 r18106  
    6262
    6363        // 'SVGSVGElement' functions
    64         AtomicString contentScriptType() const;
     64        const AtomicString& contentScriptType() const;
    6565        void setContentScriptType(const AtomicString& type);
    6666
    67         AtomicString contentStyleType() const;
     67        const AtomicString& contentStyleType() const;
    6868        void setContentStyleType(const AtomicString& type);
    6969
  • trunk/WebCore/ksvg2/svg/SVGStyleElement.cpp

    r17136 r18106  
    11/*
    22    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
    3                   2004, 2005 Rob Buis <buis@kde.org>
     3                  2004, 2005, 2006 Rob Buis <buis@kde.org>
    44    Copyright (C) 2006 Apple Computer, Inc.
    55
     
    2929#include "Document.h"
    3030#include "ExceptionCode.h"
    31 #include "MediaList.h"
    32 #include "MediaQueryEvaluator.h"
    33 #include "PlatformString.h"
     31#include "HTMLNames.h"
    3432
    3533namespace WebCore {
    3634
    37 SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document *doc) : SVGElement(tagName, doc)
    38 {
    39     m_loading = false;
    40 }
     35using namespace HTMLNames;
    4136
    42 SVGStyleElement::~SVGStyleElement()
     37SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* doc)
     38     : SVGElement(tagName, doc)
    4339{
    4440}
    4541
    46 AtomicString SVGStyleElement::xmlspace() const
     42const AtomicString& SVGStyleElement::xmlspace() const
    4743{
    48     return tryGetAttribute("xml:space");
     44    static const AtomicString defaultValue("xml:space");
     45    return getAttribute(defaultValue);
    4946}
    5047
     
    5451}
    5552
    56 AtomicString SVGStyleElement::type() const
     53const AtomicString& SVGStyleElement::type() const
    5754{
    58     return tryGetAttribute("type", "text/css");
     55    static const AtomicString defaultValue("text/css");
     56    const AtomicString& n = getAttribute(typeAttr);
     57    return n.isNull() ? defaultValue : n;
    5958}
    6059
     
    6463}
    6564
    66 AtomicString SVGStyleElement::media() const
     65const AtomicString& SVGStyleElement::media() const
    6766{
    68     return tryGetAttribute("media", "all");
     67    static const AtomicString defaultValue("all");
     68    const AtomicString& n = getAttribute(mediaAttr);
     69    return n.isNull() ? defaultValue : n;
    6970}
    7071
     
    7475}
    7576
    76 AtomicString SVGStyleElement::title() const
     77const AtomicString& SVGStyleElement::title() const
    7778{
    78     return tryGetAttribute("title");
     79    return getAttribute(titleAttr);
    7980}
    8081
     
    8485}
    8586
    86 CSSStyleSheet *SVGStyleElement::sheet()
     87void SVGStyleElement::insertedIntoDocument()
    8788{
    88     return m_sheet.get();
     89    SVGElement::insertedIntoDocument();
     90    StyleElement::insertedIntoDocument(document());
     91}
     92
     93void SVGStyleElement::removedFromDocument()
     94{
     95    SVGElement::removedFromDocument();
     96    StyleElement::removedFromDocument(document());
    8997}
    9098
    9199void SVGStyleElement::childrenChanged()
    92100{
    93     SVGElement::childrenChanged();
    94 
    95     if(m_sheet)
    96         m_sheet = 0;
    97 
    98     // FIXME: this code should be shared with HTMLStyleElement::childrenChanged()
    99     m_loading = false;
    100     MediaQueryEvaluator screenEval("screen", true);
    101     MediaQueryEvaluator printEval("print", true);   
    102     RefPtr<MediaList> mediaList = new MediaList((CSSStyleSheet*)0, media());
    103     if ((type().isEmpty() || type() == "text/css") && (screenEval.eval(mediaList.get()) || printEval.eval(mediaList.get()))) {
    104         ownerDocument()->addPendingSheet();
    105 
    106         m_loading = true;
    107  
    108         m_sheet = new CSSStyleSheet(this, String(), document()->inputEncoding());
    109         m_sheet->parseString(textContent()); // SVG css is always parsed in strict mode
    110        
    111         m_sheet->setMedia(mediaList.get());
    112         m_loading = false;
    113     }
    114 
    115     if(!isLoading() && m_sheet)
    116         document()->stylesheetLoaded();
    117 }
    118 
    119 bool SVGStyleElement::isLoading() const
    120 {
    121     return false;
     101    StyleElement::childrenChanged(this);
    122102}
    123103
  • trunk/WebCore/ksvg2/svg/SVGStyleElement.h

    r15828 r18106  
    11/*
    22    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
    3                   2004, 2005 Rob Buis <buis@kde.org>
     3                  2004, 2005, 2006 Rob Buis <buis@kde.org>
    44
    55    This file is part of the KDE project
     
    2626
    2727#include <SVGElement.h>
     28#include "StyleElement.h"
    2829
    2930namespace WebCore {
    3031
    31     class CSSStyleSheet;
    32 
    33     class SVGStyleElement : public SVGElement {
     32    class SVGStyleElement : public SVGElement, public StyleElement {
    3433    public:
    3534        SVGStyleElement(const QualifiedName&, Document*);
    36         virtual ~SVGStyleElement();
    3735
    3836        // Derived from: 'Element'
     37        virtual void insertedIntoDocument();
     38        virtual void removedFromDocument();
    3939        virtual void childrenChanged();
    4040
    4141        // 'SVGStyleElement' functions
    42         AtomicString xmlspace() const;
     42        const AtomicString& xmlspace() const;
    4343        void setXmlspace(const AtomicString&, ExceptionCode&);
    4444
    45         AtomicString type() const;
     45        virtual const AtomicString& type() const;
    4646        void setType(const AtomicString&, ExceptionCode&);
    4747
    48         AtomicString media() const;
     48        const AtomicString& media() const;
    4949        void setMedia(const AtomicString&, ExceptionCode&);
    5050
    51         AtomicString title() const;
     51        const AtomicString& title() const;
    5252        void setTitle(const AtomicString&, ExceptionCode&);
    53 
    54         CSSStyleSheet *sheet();
    55 
    56         // Internal
    57         bool isLoading() const;
    58 
    59     protected:
    60         RefPtr<CSSStyleSheet> m_sheet;
    61         bool m_loading;
    6253    };
    6354
Note: See TracChangeset for help on using the changeset viewer.