Roll out r25082 and the associated tests in r25083 as it introduced crashes in the...
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2007 07:48:22 +0000 (07:48 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2007 07:48:22 +0000 (07:48 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25090 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/emptyStyleTag-expected.txt [deleted file]
LayoutTests/fast/css/emptyStyleTag.html [deleted file]
WebCore/ChangeLog
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/dom/Node.h
WebCore/dom/ProcessingInstruction.cpp
WebCore/dom/StyleElement.cpp
WebCore/dom/StyleElement.h
WebCore/dom/XMLTokenizer.cpp
WebCore/html/HTMLAppletElement.cpp
WebCore/html/HTMLAppletElement.h
WebCore/html/HTMLGenericFormElement.cpp
WebCore/html/HTMLGenericFormElement.h
WebCore/html/HTMLLinkElement.cpp
WebCore/html/HTMLObjectElement.cpp
WebCore/html/HTMLObjectElement.h
WebCore/html/HTMLParser.cpp
WebCore/html/HTMLScriptElement.cpp
WebCore/html/HTMLScriptElement.h
WebCore/html/HTMLStyleElement.cpp
WebCore/html/HTMLStyleElement.h
WebCore/ksvg2/svg/SVGAnimationElement.cpp
WebCore/ksvg2/svg/SVGAnimationElement.h
WebCore/ksvg2/svg/SVGElement.cpp
WebCore/ksvg2/svg/SVGElement.h
WebCore/ksvg2/svg/SVGStyleElement.cpp
WebCore/ksvg2/svg/SVGStyleElement.h
WebCore/page/Frame.cpp

index d63be9cca4280926f8cdb1107046b61eec76e5c4..97846579f7f33ead1849ee3f13ad4554c00f0487 100644 (file)
         * fast/css/computed-style-expected.txt: Updated now that we've eliminated the auto value.
         * fast/css/computed-style-without-renderer-expected.txt: ditto.
 
-2007-08-14  Beth Dakin  <bdakin@apple.com>
-
-        Test for new support of empty style sheets.
-
-        * fast/css/emptyStyleTag-expected.txt: Added.
-        * fast/css/emptyStyleTag.html: Added.
-
 2007-08-14  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by Tim.
diff --git a/LayoutTests/fast/css/emptyStyleTag-expected.txt b/LayoutTests/fast/css/emptyStyleTag-expected.txt
deleted file mode 100644 (file)
index 1f3da5a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-This tests that we support empty style sheets.
-Test succeeded!
diff --git a/LayoutTests/fast/css/emptyStyleTag.html b/LayoutTests/fast/css/emptyStyleTag.html
deleted file mode 100644 (file)
index 25d70ba..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<style></style>
-
-This tests that we support empty style sheets.
-
-<div id="result">Test failed.</div>
-
-<script>
-if (layoutTestController)
-    layoutTestController.dumpAsText();
-
-if (document.styleSheets[0]) {
-    var result = document.getElementById("result");
-    result.innerHTML = "Test succeeded!";
-}
-</script>
-
index 560aeb53b8c708f9e4b654612a44308e0118d3f8..2314e87b7034ed76ccffe5ae33c7884de65826eb 100644 (file)
         * rendering/RenderFlexibleBox.cpp:(WebCore::RenderFlexibleBox::layoutVerticalBox): Use
         max to make sure it never computes a minimum of less than one line.
 
-2007-08-14  Beth Dakin  <bdakin@apple.com>
-
-        Reviewed by Hyatt.
-
-        Refactor of change for <rdar://problem/5404899> REGRESSION: Mail 
-        crash in WebCore::FontFallbackList::fontDataAt() after dragging 
-        image into text multiple times
-
-        The original fix that I made last night prevents the pending style 
-        sheet count from being incremented until the element is in the 
-        document. This fix prevents the style sheet from loading at all 
-        until it is in the document.
-
-        Here is the fix.
-        * dom/StyleElement.cpp:
-        (WebCore::StyleElement::insertedIntoDocument): Call process.
-        (WebCore::StyleElement::removedFromDocument): This can be reverted 
-        to its original state before my patch last night.
-        (WebCore::StyleElement::process): childrenChanged is now called 
-        process. Return early if your not in the document.
-        (WebCore::StyleElement::createSheet): Revert change from last 
-        night. The inDocument check is now in caller childrenChanged.
-        * dom/StyleElement.h: insertedIntoDocument() must now accept an 
-        element in addition to a document.
-
-        This is an optimization to prevent calling updateStyleSelector() 
-        too frequently.
-        * dom/XMLTokenizer.cpp:
-        (WebCore::XMLTokenizer::startElementNs):
-        * html/HTMLStyleElement.cpp:
-        (WebCore::HTMLStyleElement::HTMLStyleElement):
-        (WebCore::HTMLStyleElement::finishedParsing):
-        (WebCore::HTMLStyleElement::insertedIntoDocument):
-        (WebCore::HTMLStyleElement::childrenChanged):
-        (WebCore::HTMLStyleElement::sheetLoaded):
-        * html/HTMLStyleElement.h:
-        * ksvg2/svg/SVGStyleElement.cpp:
-        (WebCore::SVGStyleElement::SVGStyleElement):
-        (WebCore::SVGStyleElement::finishedParsing):
-        (WebCore::SVGStyleElement::insertedIntoDocument):
-        (WebCore::SVGStyleElement::childrenChanged):
-        (WebCore::SVGStyleElement::sheetLoaded):
-        * ksvg2/svg/SVGStyleElement.h:
-        (WebCore::SVGStyleElement::setCreatedByParser):
-
-        This is a name change. Document::stylesheetLoaded() 
-        is now Document::removePendingSheet()
-        * dom/Document.cpp:
-        (WebCore::Document::removePendingSheet):
-        * dom/Document.h:
-        * dom/ProcessingInstruction.cpp:
-        (WebCore::ProcessingInstruction::sheetLoaded):
-        * html/HTMLLinkElement.cpp:
-        (WebCore::HTMLLinkElement::~HTMLLinkElement):
-        (WebCore::HTMLLinkElement::setDisabledState):
-        (WebCore::HTMLLinkElement::process):
-        (WebCore::HTMLLinkElement::sheetLoaded):
-        * page/Frame.cpp:
-        (WebCore::UserStyleSheetLoader::~UserStyleSheetLoader):
-        (WebCore::UserStyleSheetLoader::setCSSStyleSheet):
-
-        This is another name change. closeRenderer() is now 
-        finishedParsing()
-        * dom/Node.h:
-        (WebCore::Node::finishedParsing):
-        * dom/XMLTokenizer.cpp:
-        (WebCore::XMLTokenizer::endElementNs):
-        (WebCore::):
-        * html/HTMLAppletElement.cpp:
-        (WebCore::HTMLAppletElement::finishedParsing):
-        * html/HTMLAppletElement.h:
-        * html/HTMLGenericFormElement.cpp:
-        (WebCore::HTMLFormControlElementWithState::finishedParsing):
-        * html/HTMLGenericFormElement.h:
-        * html/HTMLObjectElement.cpp:
-        (WebCore::HTMLObjectElement::finishedParsing):
-        * html/HTMLObjectElement.h:
-        * html/HTMLParser.cpp:
-        (WebCore::HTMLParser::insertNode):
-        (WebCore::HTMLParser::popOneBlockCommon):
-        * html/HTMLScriptElement.cpp:
-        (WebCore::HTMLScriptElement::finishedParsing):
-        * html/HTMLScriptElement.h:
-        (WebCore::HTMLStyleElement::setCreatedByParser):
-        * ksvg2/svg/SVGAnimationElement.cpp:
-        (WebCore::SVGAnimationElement::finishedParsing):
-        * ksvg2/svg/SVGAnimationElement.h:
-        * ksvg2/svg/SVGElement.cpp:
-        (WebCore::SVGElement::finishedParsing):
-        * ksvg2/svg/SVGElement.h:
-
 2007-08-14  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Darin, John, Maciej, Oliver, and Tim
index 469b6f1efade682b670873c3ab230d80e2f5ed80..4944b130ff251fefecb939393cba9b68b7550910 100644 (file)
@@ -1936,7 +1936,7 @@ void Document::setSelectedStylesheetSet(const String& aString)
 }
 
 // This method is called whenever a top-level stylesheet has finished loading.
-void Document::removePendingSheet()
+void Document::stylesheetLoaded()
 {
     // Make sure we knew this sheet was pending, and that our count isn't out of sync.
     ASSERT(m_pendingStylesheets > 0);
index bf319940e7dbc2e87e4e48e45a3e36c7b8fa492c..6d07fb7fec3e8140fc677bbcb0c1371b15971e47 100644 (file)
@@ -251,7 +251,7 @@ public:
     /**
      * Updates the pending sheet count and then calls updateStyleSelector.
      */
-    void removePendingSheet();
+    void stylesheetLoaded();
 
     /**
      * This method returns true if all top-level stylesheets have loaded (including
index 40625a8ac13503a140372272432ba87b0f3d79df..863ba100b207f73e7b84cfec0127bc6ed5a27e72 100644 (file)
@@ -208,7 +208,7 @@ public:
     // until they know all of their nested <param>s. [Radar 3603191, 4040848].
     // Also used for script elements and some SVG elements for similar purposes,
     // but making parsing a special case in this respect should be avoided if possible.
-    virtual void finishedParsing() { }
+    virtual void closeRenderer() { }
 
     // Called by the frame right before dispatching an unloadEvent. [Radar 4532113]
     // This is needed for HTMLInputElements to tell the frame that it is done editing 
index 39af5b8cc6e2881a129ffce8795c9289d0b9fa18..d6d009e6ca39051812267e415dce0ae1abcc0d0d 100644 (file)
@@ -191,7 +191,7 @@ bool ProcessingInstruction::isLoading() const
 bool ProcessingInstruction::sheetLoaded()
 {
     if (!isLoading()) {
-        document()->removePendingSheet();
+        document()->stylesheetLoaded();
         return true;
     }
     return false;
index 10e429734b8c0aa66f35931a3b5365c4029b39af..b765c94657d616890b86688f290244e23f40c1ca 100644 (file)
@@ -40,22 +40,30 @@ StyleSheet* StyleElement::sheet(Element* e)
     return m_sheet.get();
 }
 
-void StyleElement::insertedIntoDocument(Document* document, Element* element)
+void StyleElement::insertedIntoDocument(Document* document)
 {
-    process(element);
+    if (m_sheet) {
+        if (static_cast<CSSStyleSheet *>(m_sheet.get())->isLoading()
+            && (m_sheet->type().isEmpty() || m_sheet->type() == "text/css"))
+            document->addPendingSheet();
+        document->updateStyleSelector();
+    }
 }
 
 void StyleElement::removedFromDocument(Document* document)
 {
-    if (m_sheet)
+    if (m_sheet) {
+        if (static_cast<CSSStyleSheet *>(m_sheet.get())->isLoading()
+            && (m_sheet->type().isEmpty() || m_sheet->type() == "text/css"))
+            document->stylesheetLoaded();
         document->updateStyleSelector();
+    }
 }
 
-void StyleElement::process(Element* e)
+void StyleElement::childrenChanged(Element* e)
 {
-    if (!e || !e->inDocument())
+    if (!e)
         return;
-
     String text = "";
 
     for (Node* c = e->firstChild(); c; c = c->nextSibling())
@@ -69,8 +77,8 @@ void StyleElement::createSheet(Element* e, const String& text)
 {
     Document* document = e->document();
     if (m_sheet) {
-        if (static_cast<CSSStyleSheet*>(m_sheet.get())->isLoading())
-            document->removePendingSheet();
+        if (static_cast<CSSStyleSheet *>(m_sheet.get())->isLoading())
+            document->stylesheetLoaded(); // Remove ourselves from the sheet list.
         m_sheet = 0;
     }
 
@@ -80,7 +88,8 @@ void StyleElement::createSheet(Element* e, const String& text)
         MediaQueryEvaluator screenEval("screen", true);
         MediaQueryEvaluator printEval("print", true);
         if (screenEval.eval(mediaList.get()) || printEval.eval(mediaList.get())) {
-            document->addPendingSheet();
+            if (e->inDocument())
+                document->addPendingSheet();
             setLoading(true);
             m_sheet = new CSSStyleSheet(e, String(), document->inputEncoding());
             m_sheet->parseString(text, !document->inCompatMode());
@@ -90,7 +99,7 @@ void StyleElement::createSheet(Element* e, const String& text)
         }
     }
 
-    if (m_sheet)
+    if (m_sheet && e->inDocument())
         m_sheet->checkLoaded();
 }
 
index a637d2da63691a5d59da14e664b0811fc68745f5..8b90ba74ee1a36269bf2c16cc9c7482872d83b00 100644 (file)
@@ -41,9 +41,9 @@ protected:
     virtual const AtomicString& type() const = 0;
     virtual const AtomicString& media() const = 0;
 
-    void insertedIntoDocument(Document*, Element*);
+    void insertedIntoDocument(Document*);
     void removedFromDocument(Document*);
-    void process(Element*);
+    void childrenChanged(Element*);
 
     void createSheet(Element* e, const String& text = String());
 
index ec098a41ece828a14a13e87e9f16876717920503..9aaa9260cda5bd2e09523c665c108f5887abdbc1 100644 (file)
 #include "FrameView.h"
 #include "HTMLNames.h"
 #include "HTMLScriptElement.h"
-#include "HTMLStyleElement.h"
 #include "HTMLTableSectionElement.h"
 #include "HTMLTokenizer.h"
 #include "ProcessingInstruction.h"
 #include "ResourceHandle.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
-#include "SVGStyleElement.h"
 #ifndef USE_QXMLSTREAM
 #include <libxml/parser.h>
 #include <libxml/parserInternals.h>
@@ -720,14 +718,6 @@ void XMLTokenizer::startElementNs(const xmlChar* xmlLocalName, const xmlChar* xm
 
     if (newElement->hasTagName(scriptTag))
         static_cast<HTMLScriptElement*>(newElement.get())->setCreatedByParser(true);
-    else if (newElement->hasTagName(HTMLNames::styleTag))
-        static_cast<HTMLStyleElement*>(newElement.get())->setCreatedByParser(true);
-#if ENABLE(SVG)
-    else if (newElement->hasTagName(SVGNames::scriptTag))
-        static_cast<HTMLScriptElement*>(newElement.get())->setCreatedByParser(true);
-    else if (newElement->hasTagName(SVGNames::styleTag))
-        static_cast<SVGStyleElement*>(newElement.get())->setCreatedByParser(true);
-#endif
     
     if (newElement->hasTagName(HTMLNames::scriptTag)
 #if ENABLE(SVG)
@@ -760,7 +750,7 @@ void XMLTokenizer::endElementNs()
 
     Node* n = m_currentNode;
     RefPtr<Node> parent = n->parentNode();
-    n->finishedParsing();
+    n->closeRenderer();
     
     // don't load external scripts for standalone documents (for now)
     if (n->isElementNode() && m_view && (static_cast<Element*>(n)->hasTagName(scriptTag) 
@@ -1783,7 +1773,7 @@ void XMLTokenizer::parseEndElement()
 
     Node* n = m_currentNode;
     RefPtr<Node> parent = n->parentNode();
-    n->finishedParsing();
+    n->closeRenderer();
 
     // don't load external scripts for standalone documents (for now)
     if (n->isElementNode() && m_view && (static_cast<Element*>(n)->hasTagName(scriptTag) 
index 982fddf5c9515ca44d0ba1e1be753e6ef34de840..9a4c2f66da6b2f144d635ed667736a65afb7b567 100644 (file)
@@ -159,13 +159,13 @@ KJS::Bindings::Instance *HTMLAppletElement::getInstance() const
 }
 #endif
 
-void HTMLAppletElement::finishedParsing()
+void HTMLAppletElement::closeRenderer()
 {
     // The parser just reached </applet>, so all the params are available now.
     m_allParamsAvailable = true;
     if (renderer())
         renderer()->setNeedsLayout(true); // This will cause it to create its widget & the Java applet
-    HTMLPlugInElement::finishedParsing();
+    HTMLPlugInElement::closeRenderer();
 }
 
 void HTMLAppletElement::detach()
index 0c3ac0dc98611afeb9a6369c37fdc0fc63f71ae0..43b8f9d5e702d9b193cf2496151283e5e3b486c3 100644 (file)
@@ -50,7 +50,7 @@ public:
     
     virtual bool rendererIsNeeded(RenderStyle*);
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-    virtual void finishedParsing();
+    virtual void closeRenderer();
     virtual void detach();
     
 #if USE(JAVASCRIPTCORE_BINDINGS)
index 18ac7cb8a3bb7a311db596a693554f135e7b24db..fcb3ada1e37cd967526243e99e7ef8186ed7c801 100644 (file)
@@ -230,7 +230,7 @@ void HTMLFormControlElementWithState::didMoveToNewOwnerDocument()
     HTMLGenericFormElement::didMoveToNewOwnerDocument();
 }
 
-void HTMLFormControlElementWithState::finishedParsing()
+void HTMLFormControlElementWithState::closeRenderer()
 {
     Document* doc = document();
     if (doc->hasStateForNewFormElements()) {
index f0f731b7aa7c32edde56d3df99440684beee2866..db2e85fbd57f57110c43e7bda0b34c0f089552c4 100644 (file)
@@ -106,7 +106,7 @@ public:
     HTMLFormControlElementWithState(const QualifiedName& tagName, Document*, HTMLFormElement*);
     virtual ~HTMLFormControlElementWithState();
 
-    virtual void finishedParsing();
+    virtual void closeRenderer();
 
     virtual bool saveState(String& value) const = 0;
 
index c9c19aee100a0ccc4c0b4e48b45171d972293880..faf2ccae9fa93e66ea94d41734fd23fcb42c423b 100644 (file)
@@ -55,7 +55,7 @@ HTMLLinkElement::~HTMLLinkElement()
     if (m_cachedSheet) {
         m_cachedSheet->deref(this);
         if (m_loading && !isDisabled() && !isAlternate())
-            document()->removePendingSheet();
+            document()->stylesheetLoaded();
     }
 }
 
@@ -71,7 +71,7 @@ void HTMLLinkElement::setDisabledState(bool _disabled)
             // a main sheet or a sheet that was previously enabled via script, then we need
             // to remove it from the list of pending sheets.
             if (m_disabledState == 2 && (!m_alternate || oldDisabledState == 1))
-                document()->removePendingSheet();
+                document()->stylesheetLoaded();
 
             // Check #2: An alternate sheet becomes enabled while it is still loading.
             if (m_alternate && m_disabledState == 1)
@@ -186,7 +186,7 @@ void HTMLLinkElement::process()
             
             if (m_cachedSheet) {
                 if (m_loading)
-                    document()->removePendingSheet();
+                    document()->stylesheetLoaded();
                 m_cachedSheet->deref(this);
             }
             m_loading = true;
@@ -195,7 +195,7 @@ void HTMLLinkElement::process()
                 m_cachedSheet->ref(this);
             else if (!isAlternate()) { // request may have been denied if stylesheet is local and document is remote.
                 m_loading = false;
-                document()->removePendingSheet();
+                document()->stylesheetLoaded();
             }
         }
     } else if (m_sheet) {
@@ -242,7 +242,7 @@ bool HTMLLinkElement::isLoading() const
 bool HTMLLinkElement::sheetLoaded()
 {
     if (!isLoading() && !isDisabled() && !isAlternate()) {
-        document()->removePendingSheet();
+        document()->stylesheetLoaded();
         return true;
     }
     return false;
index a49f258e7ae399997244bbcc85653f94a38bcc57..545ca4296b37627a69fc75167af33aa1265958fe 100644 (file)
@@ -193,12 +193,12 @@ void HTMLObjectElement::attach()
     }
 }
 
-void HTMLObjectElement::finishedParsing()
+void HTMLObjectElement::closeRenderer()
 {
     // The parser just reached </object>.
     setComplete(true);
     
-    HTMLPlugInElement::finishedParsing();
+    HTMLPlugInElement::closeRenderer();
 }
 
 void HTMLObjectElement::setComplete(bool complete)
index 5783f72c475c39ebfde215ab8c5dd7e9acdee0ea..5b9baa7afd70ea355692b69dbf2ffa3165e414a9 100644 (file)
@@ -45,7 +45,7 @@ public:
     virtual void attach();
     virtual bool rendererIsNeeded(RenderStyle*);
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-    virtual void finishedParsing();
+    virtual void closeRenderer();
     virtual void detach();
     virtual void insertedIntoDocument();
     virtual void removedFromDocument();
index c4b222f86bacacb15fc261eafcbf059fda09c9cd..b58d47387187fb07c2fb49a72d7160c3e3720ed6 100644 (file)
@@ -326,7 +326,7 @@ bool HTMLParser::insertNode(Node* n, bool flat)
     } else {
         if (parentAttached && !n->attached() && !m_isParsingFragment)
             n->attach();
-        n->finishedParsing();
+        n->closeRenderer();
     }
 
     return true;
@@ -1297,7 +1297,7 @@ inline HTMLStackElem* HTMLParser::popOneBlockCommon()
     // Form elements restore their state during the parsing process.
     // Also, a few elements (<applet>, <object>) need to know when all child elements (<param>s) are available.
     if (current && elem->node != current)
-        current->finishedParsing();
+        current->closeRenderer();
 
     blockStack = elem->next;
     current = elem->node;
index 7253a3489a31623bdd58c1b5946eeb4179197df3..75caea7f034a61e6bfd51c2011c727cfd2566cf3 100644 (file)
@@ -92,13 +92,13 @@ void HTMLScriptElement::parseMappedAttribute(MappedAttribute *attr)
         HTMLElement::parseMappedAttribute(attr);
 }
 
-void HTMLScriptElement::finishedParsing()
+void HTMLScriptElement::closeRenderer()
 {
     // The parser just reached </script>. If we have no src and no text,
     // allow dynamic loading later.
     if (getAttribute(srcAttr).isEmpty() && text().isEmpty())
         setCreatedByParser(false);
-    HTMLElement::finishedParsing();
+    HTMLElement::closeRenderer();
 }
 
 void HTMLScriptElement::insertedIntoDocument()
index 52a8422d8438f42ba3442a0d361dc6c01cd94ee1..0c20e886c4f9be0e3c2cf239c38f538177cd5b85 100644 (file)
@@ -51,7 +51,7 @@ public:
     virtual bool isURLAttribute(Attribute *attr) const;
 
     void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
-    virtual void finishedParsing();
+    virtual void closeRenderer();
 
     bool shouldExecuteAsJavaScript();
     void evaluateScript(const String &URL, const String &script);
index 99b88cd5cd953aa9e5a443d3d714965c78986b51..0833f212e61d8ad98d089245b3e44eb0fd17c729 100644 (file)
@@ -35,7 +35,6 @@ using namespace HTMLNames;
 HTMLStyleElement::HTMLStyleElement(Document* doc)
     : HTMLElement(styleTag, doc)
     , m_loading(false)
-    , m_createdByParser(false)
 {
 }
 
@@ -50,18 +49,10 @@ void HTMLStyleElement::parseMappedAttribute(MappedAttribute *attr)
         HTMLElement::parseMappedAttribute(attr);
 }
 
-void HTMLStyleElement::finishedParsing()
-{
-    StyleElement::process(this);
-    HTMLElement::finishedParsing();
-}
-
 void HTMLStyleElement::insertedIntoDocument()
 {
     HTMLElement::insertedIntoDocument();
-
-    if (!m_createdByParser)
-        StyleElement::insertedIntoDocument(document(), this);
+    StyleElement::insertedIntoDocument(document());
 }
 
 void HTMLStyleElement::removedFromDocument()
@@ -72,7 +63,7 @@ void HTMLStyleElement::removedFromDocument()
 
 void HTMLStyleElement::childrenChanged()
 {
-    StyleElement::process(this);
+    StyleElement::childrenChanged(this);
 }
 
 StyleSheet* HTMLStyleElement::sheet()
@@ -92,7 +83,7 @@ bool HTMLStyleElement::isLoading() const
 bool HTMLStyleElement::sheetLoaded()
 {
     if (!isLoading()) {
-        document()->removePendingSheet();
+        document()->stylesheetLoaded();
         return true;
     }
     return false;
index 6a6a9109c883b65248d6797966cdbf52be42e37e..29593d2c4f455b391b63b51d180ef9082a0aac5e 100644 (file)
@@ -45,9 +45,6 @@ public:
     virtual void removedFromDocument();
     virtual void childrenChanged();
 
-    void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
-    virtual void finishedParsing();
-
     virtual bool isLoading() const;
     virtual bool sheetLoaded();
 
@@ -67,7 +64,6 @@ public:
 protected:
     String m_media;
     bool m_loading;
-    bool m_createdByParser;
 };
 
 } //namespace
index 477c61d0fb3ac726bd6a034244abb5b932b4e3e4..a4e283cd7c859c8f2b5df5aedf6842788b5ee2ef 100644 (file)
@@ -411,10 +411,10 @@ double SVGAnimationElement::parseClockValue(const String& data)
     return result;
 }
 
-void SVGAnimationElement::finishedParsing()
+void SVGAnimationElement::closeRenderer()
 {
     ownerSVGElement()->timeScheduler()->addTimer(this, lround(getStartTime()));
-    SVGElement::finishedParsing();
+    SVGElement::closeRenderer();
 }
 
 String SVGAnimationElement::targetAttributeAnimatedValue() const
index f849c92c63f893e7bc457b6cfc7e6566b49156c3..57f694064a4caf6a6f60e8997d4eebc37d138c8b 100644 (file)
@@ -98,7 +98,7 @@ namespace WebCore {
     
         virtual void parseMappedAttribute(MappedAttribute* attr);
 
-        virtual void finishedParsing();
+        virtual void closeRenderer();
 
         virtual bool updateAnimationBaseValueFromElement();
         bool updateAnimatedValueForElapsedSeconds(double elapsedSeconds);
index f8b9096d9ec1e96ab7e5c230bf660505f81a383d..90fe3608a30d0004166e5ed910e9481ac1180c36 100644 (file)
@@ -172,9 +172,9 @@ void SVGElement::sendSVGLoadEventIfPossible(bool sendParentLoadEvents)
     }
 }
 
-void SVGElement::finishedParsing()
+void SVGElement::closeRenderer()
 {
-    // finishedParsing() is called when the close tag is reached for an element (e.g. </svg>)
+    // closeRenderer() is called when the close tag is reached for an element (e.g. </svg>)
     // we send SVGLoad events here if we can, otherwise they'll be sent when any required loads finish
     sendSVGLoadEventIfPossible();
 }
index bcd7daec2a43d3c86b60775668a0df1d1a7ed6cc..4ac0f9c06c8506ebd1914c38f5b054580fdcd006 100644 (file)
@@ -213,7 +213,7 @@ namespace WebCore {
         // For SVGTests
         virtual bool isValid() const { return true; }
   
-        virtual void finishedParsing();
+        virtual void closeRenderer();
         virtual bool rendererIsNeeded(RenderStyle*) { return false; }
         virtual bool childShouldCreateRenderer(Node*) const;
 
index 0f4648a18684241c30a2bf3eea27a51da4a16ea4..629b5dbda224b864a7ae91d8e5545648b5fe8482 100644 (file)
@@ -37,7 +37,6 @@ using namespace HTMLNames;
 
 SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* doc)
      : SVGElement(tagName, doc)
-     , m_createdByParser(false)
 {
 }
 
@@ -93,18 +92,10 @@ void SVGStyleElement::parseMappedAttribute(MappedAttribute* attr)
         SVGElement::parseMappedAttribute(attr);
 }
 
-void SVGStyleElement::finishedParsing()
-{
-    StyleElement::process(this);
-    SVGElement::finishedParsing();
-}
-
 void SVGStyleElement::insertedIntoDocument()
 {
     SVGElement::insertedIntoDocument();
-
-    if (!m_createdByParser)
-        StyleElement::insertedIntoDocument(document(), this);
+    StyleElement::insertedIntoDocument(document());
 }
 
 void SVGStyleElement::removedFromDocument()
@@ -115,7 +106,7 @@ void SVGStyleElement::removedFromDocument()
 
 void SVGStyleElement::childrenChanged()
 {
-    StyleElement::process(this);
+    StyleElement::childrenChanged(this);
 }
 
 StyleSheet* SVGStyleElement::sheet()
@@ -125,7 +116,7 @@ StyleSheet* SVGStyleElement::sheet()
 
 bool SVGStyleElement::sheetLoaded()
 {
-    document()->removePendingSheet();
+    document()->stylesheetLoaded();
     return true;
 }
 
index cce197084717c9fce78cc0e9ac2656bd2b947f17..4f6c080a7e5ccc0694e3cd95b941ac46fdb72743 100644 (file)
@@ -39,9 +39,6 @@ namespace WebCore {
         virtual void removedFromDocument();
         virtual void childrenChanged();
 
-        void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
-        virtual void finishedParsing();
-
         // 'SVGStyleElement' functions
         const AtomicString& xmlspace() const;
         void setXmlspace(const AtomicString&, ExceptionCode&);
@@ -58,9 +55,6 @@ namespace WebCore {
         void setTitle(const AtomicString&, ExceptionCode&);
 
         StyleSheet* sheet();
-        
-    protected:
-        bool m_createdByParser;
     };
 
 } // namespace WebCore
index 9407d4b4a3177697935bff35c7e07ea3a95bc88d..d9c18fc95913405cd09ebffeb9396eef366440c3 100644 (file)
@@ -105,13 +105,13 @@ public:
     ~UserStyleSheetLoader()
     {
         if (!m_cachedSheet->isLoaded())
-            m_document->removePendingSheet();        
+            m_document->stylesheetLoaded();        
         m_cachedSheet->deref(this);
     }
 private:
     virtual void setCSSStyleSheet(const String& /*URL*/, const String& /*charset*/, const String& sheet)
     {
-        m_document->removePendingSheet();
+        m_document->stylesheetLoaded();
         if (Frame* frame = m_document->frame())
             frame->setUserStyleSheet(sheet);
     }