Changeset 39180 in webkit


Ignore:
Timestamp:
Dec 10, 2008 11:18:58 AM (15 years ago)
Author:
jchaffraix@webkit.org
Message:

2008-12-10 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Eric Seidel.

Bug 22665: Remove setCreatedByParser(bool) from the few elements that use it
https://bugs.webkit.org/show_bug.cgi?id=22665

  • Removed setCreatedByParser from style and link elements.
  • Removed XMLTokenizer::eventuallyMarkAsCreatedByParser.
  • dom/XMLTokenizer.cpp:
  • dom/XMLTokenizer.h:
  • dom/XMLTokenizerLibxml2.cpp: (WebCore::XMLTokenizer::startElementNs):
  • dom/XMLTokenizerQt.cpp: (WebCore::XMLTokenizer::parseStartElement):
  • html/HTMLElementFactory.cpp: (WebCore::linkConstructor): (WebCore::styleConstructor):
  • html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::HTMLLinkElement):
  • html/HTMLLinkElement.h:
  • html/HTMLStyleElement.cpp: (WebCore::HTMLStyleElement::HTMLStyleElement):
  • html/HTMLStyleElement.h:
  • html/HTMLTagNames.in:
  • svg/SVGStyleElement.cpp: (WebCore::SVGStyleElement::SVGStyleElement):
  • svg/SVGStyleElement.h:
  • svg/svgtags.in:
Location:
trunk/WebCore
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r39178 r39180  
     12008-12-09  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Bug 22665: Remove setCreatedByParser(bool) from the few elements that use it
     6        https://bugs.webkit.org/show_bug.cgi?id=22665
     7
     8        - Removed setCreatedByParser from style and link elements.
     9
     10        - Removed XMLTokenizer::eventuallyMarkAsCreatedByParser.
     11
     12        * dom/XMLTokenizer.cpp:
     13        * dom/XMLTokenizer.h:
     14        * dom/XMLTokenizerLibxml2.cpp:
     15        (WebCore::XMLTokenizer::startElementNs):
     16        * dom/XMLTokenizerQt.cpp:
     17        (WebCore::XMLTokenizer::parseStartElement):
     18        * html/HTMLElementFactory.cpp:
     19        (WebCore::linkConstructor):
     20        (WebCore::styleConstructor):
     21        * html/HTMLLinkElement.cpp:
     22        (WebCore::HTMLLinkElement::HTMLLinkElement):
     23        * html/HTMLLinkElement.h:
     24        * html/HTMLStyleElement.cpp:
     25        (WebCore::HTMLStyleElement::HTMLStyleElement):
     26        * html/HTMLStyleElement.h:
     27        * html/HTMLTagNames.in:
     28        * svg/SVGStyleElement.cpp:
     29        (WebCore::SVGStyleElement::SVGStyleElement):
     30        * svg/SVGStyleElement.h:
     31        * svg/svgtags.in:
     32
    1332008-12-10  Brady Eidson  <beidson@apple.com>
    234
  • trunk/WebCore/dom/XMLTokenizer.cpp

    r39111 r39180  
    133133}
    134134
    135 void XMLTokenizer::eventuallyMarkAsParserCreated(Element* element)
    136 {
    137     if (element->hasTagName(HTMLNames::styleTag))
    138         static_cast<HTMLStyleElement*>(element)->setCreatedByParser(true);
    139 #if ENABLE(SVG)
    140     else if (element->hasTagName(SVGNames::styleTag))
    141         static_cast<SVGStyleElement*>(element)->setCreatedByParser(true);
    142 #endif
    143     else if (element->hasTagName(HTMLNames::linkTag))
    144         static_cast<HTMLLinkElement*>(element)->setCreatedByParser(true);
    145 }
    146 
    147 
    148135void XMLTokenizer::handleError(ErrorType type, const char* m, int lineNumber, int columnNumber)
    149136{
  • trunk/WebCore/dom/XMLTokenizer.h

    r38577 r39180  
    119119        friend bool parseXMLDocumentFragment(const String& chunk, DocumentFragment* fragment, Element* parent);
    120120
    121         static void eventuallyMarkAsParserCreated(Element* element);
    122121        void initializeParserContext(const char* chunk = 0);
    123122        void setCurrentNode(Node*);
  • trunk/WebCore/dom/XMLTokenizerLibxml2.cpp

    r38729 r39180  
    755755
    756756    newElement->beginParsingChildren();
    757     eventuallyMarkAsParserCreated(newElement.get());
    758757
    759758    if (isScriptElement(newElement.get()))
  • trunk/WebCore/dom/XMLTokenizerQt.cpp

    r38729 r39180  
    541541    }
    542542
    543     eventuallyMarkAsParserCreated(newElement.get());
    544 
    545543    if (isScriptElement(newElement.get()))
    546544        m_scriptStartLine = lineNumber();
  • trunk/WebCore/html/HTMLElementFactory.cpp

    r39111 r39180  
    116116static PassRefPtr<HTMLElement> linkConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser)
    117117{
    118     RefPtr<HTMLLinkElement> link = new HTMLLinkElement(linkTag, doc);
    119     link->setCreatedByParser(createdByParser);
    120     return link.release();
     118    return new HTMLLinkElement(linkTag, doc, createdByParser);
    121119}
    122120
     
    128126static PassRefPtr<HTMLElement> styleConstructor(const QualifiedName&, Document* doc, HTMLFormElement*, bool createdByParser)
    129127{
    130     RefPtr<HTMLStyleElement> style = new HTMLStyleElement(styleTag, doc);
    131     style->setCreatedByParser(createdByParser);
    132     return style.release();
     128    return new HTMLStyleElement(styleTag, doc, createdByParser);
    133129}
    134130
  • trunk/WebCore/html/HTMLLinkElement.cpp

    r39065 r39180  
    4343using namespace HTMLNames;
    4444
    45 HTMLLinkElement::HTMLLinkElement(const QualifiedName& qName, Document *doc)
     45HTMLLinkElement::HTMLLinkElement(const QualifiedName& qName, Document *doc, bool createdByParser)
    4646    : HTMLElement(qName, doc)
    4747    , m_cachedSheet(0)
     
    5252    , m_isIcon(false)
    5353    , m_isDNSPrefetch(false)
    54     , m_createdByParser(false)
     54    , m_createdByParser(createdByParser)
    5555{
    5656    ASSERT(hasTagName(linkTag));
  • trunk/WebCore/html/HTMLLinkElement.h

    r39065 r39180  
    3636class HTMLLinkElement : public HTMLElement, public CachedResourceClient {
    3737public:
    38     HTMLLinkElement(const QualifiedName&, Document*);
     38    HTMLLinkElement(const QualifiedName&, Document*, bool createdByParser);
    3939    ~HTMLLinkElement();
    4040
     
    9898    virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
    9999
    100     void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
    101100    virtual void finishParsingChildren();
    102101
  • trunk/WebCore/html/HTMLStyleElement.cpp

    r39065 r39180  
    3131using namespace HTMLNames;
    3232
    33 HTMLStyleElement::HTMLStyleElement(const QualifiedName& tagName, Document* doc)
     33HTMLStyleElement::HTMLStyleElement(const QualifiedName& tagName, Document* doc, bool createdByParser)
    3434    : HTMLElement(tagName, doc)
    3535    , m_loading(false)
    36     , m_createdByParser(false)
     36    , m_createdByParser(createdByParser)
    3737{
    3838    ASSERT(hasTagName(styleTag));
  • trunk/WebCore/html/HTMLStyleElement.h

    r39065 r39180  
    11/*
    2  * This file is part of the DOM implementation for KDE.
    3  *
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
     
    3432{
    3533public:
    36     HTMLStyleElement(const QualifiedName&, Document*);
     34    HTMLStyleElement(const QualifiedName&, Document*, bool createdByParser);
    3735
    3836    virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
     
    4644    virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
    4745
    48     void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
    4946    virtual void finishParsingChildren();
    5047
  • trunk/WebCore/html/HTMLTagNames.in

    r39111 r39180  
    6464legend
    6565li interfaceName=HTMLLIElement
    66 link
     66link constructorNeedsCreatedByParser=1
    6767listing JSInterfaceName=HTMLPreElement
    6868map
     
    9595strike JSInterfaceName=HTMLElement
    9696strong JSInterfaceName=HTMLElement
    97 style
     97style constructorNeedsCreatedByParser=1
    9898sub JSInterfaceName=HTMLElement
    9999sup JSInterfaceName=HTMLElement
  • trunk/WebCore/svg/SVGStyleElement.cpp

    r38418 r39180  
    3737using namespace HTMLNames;
    3838
    39 SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* doc)
     39SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* doc, bool createdByParser)
    4040     : SVGElement(tagName, doc)
    41      , m_createdByParser(false)
     41     , m_createdByParser(createdByParser)
    4242{
    4343}
  • trunk/WebCore/svg/SVGStyleElement.h

    r30633 r39180  
    3232    class SVGStyleElement : public SVGElement, public StyleElement {
    3333    public:
    34         SVGStyleElement(const QualifiedName&, Document*);
     34        SVGStyleElement(const QualifiedName&, Document*, bool createdByParser);
    3535
    3636        // Derived from: 'Element'
     
    4040        virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
    4141
    42         void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
    4342        virtual void finishParsingChildren();
    4443
  • trunk/WebCore/svg/svgtags.in

    r39111 r39180  
    101101script constructorNeedsCreatedByParser=1
    102102stop
    103 style
     103style constructorNeedsCreatedByParser=1
    104104svg interfaceName=SVGSVGElement
    105105switch
Note: See TracChangeset for help on using the changeset viewer.