2006-06-20 Anders Carlsson <acarlsson@apple.com>
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Jun 2006 21:34:35 +0000 (21:34 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Jun 2006 21:34:35 +0000 (21:34 +0000)
        Reviewed by Geoff.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9509
        Would like a way to pause/resume XML parsing

        * dom/xml_tokenizer.cpp:
        (WebCore::PendingCallbacks::PendingCallbacks):
        (WebCore::PendingCallbacks::appendStartElementNSCallback):
        (WebCore::PendingCallbacks::appendEndElementNSCallback):
        (WebCore::PendingCallbacks::appendCharactersCallback):
        (WebCore::PendingCallbacks::appendProcessingInstructionCallback):
        (WebCore::PendingCallbacks::appendCDATABlockCallback):
        (WebCore::PendingCallbacks::appendCommentCallback):
        (WebCore::PendingCallbacks::appendInternalSubsetCallback):
        (WebCore::PendingCallbacks::appendErrorCallback):
        (WebCore::PendingCallbacks::callAndRemoveFirstCallback):
        (WebCore::PendingCallbacks::isEmpty):
        (WebCore::PendingCallbacks::PendingCallback::~PendingCallback):
        (WebCore::PendingCallbacks::PendingStartElementNSCallback::~PendingStartElementNSCallback):
        (WebCore::PendingCallbacks::PendingStartElementNSCallback::call):
        (WebCore::PendingCallbacks::PendingEndElementNSCallback::call):
        (WebCore::PendingCallbacks::PendingCharactersCallback::~PendingCharactersCallback):
        (WebCore::PendingCallbacks::PendingCharactersCallback::call):
        (WebCore::PendingCallbacks::PendingProcessingInstructionCallback::~PendingProcessingInstructionCallback):
        (WebCore::PendingCallbacks::PendingProcessingInstructionCallback::call):
        (WebCore::PendingCallbacks::PendingCDATABlockCallback::~PendingCDATABlockCallback):
        (WebCore::PendingCallbacks::PendingCDATABlockCallback::call):
        (WebCore::PendingCallbacks::PendingCommentCallback::~PendingCommentCallback):
        (WebCore::PendingCallbacks::PendingCommentCallback::call):
        (WebCore::PendingCallbacks::PendingInternalSubsetCallback::~PendingInternalSubsetCallback):
        (WebCore::PendingCallbacks::PendingInternalSubsetCallback::call):
        (WebCore::PendingCallbacks::):
        New classes which manage a list of pending SAX callbacks that have not yet
        been sent to the tokenizer.

        (WebCore::XMLTokenizer::XMLTokenizer):
        Initialize new member variables.

        (WebCore::XMLTokenizer::~XMLTokenizer):
        Delete PendingCallbacks object.

        (WebCore::XMLTokenizer::write):
        If the parser is paused, queue the data to be written.

        (WebCore::XMLTokenizer::startElementNs):
        (WebCore::XMLTokenizer::endElementNs):
        (WebCore::XMLTokenizer::characters):
        (WebCore::XMLTokenizer::error):
        (WebCore::XMLTokenizer::processingInstruction):
        (WebCore::XMLTokenizer::cdataBlock):
        (WebCore::XMLTokenizer::comment):
        (WebCore::XMLTokenizer::internalSubset):
        If the parser has been paused, queue the callbacks instead.

        (WebCore::XMLTokenizer::handleError):
        New function, called by both ::error and :PendingCallbacks::callAndRemoveFirstCallback

        (WebCore::XMLTokenizer::finish):
        (WebCore::XMLTokenizer::pauseParsing):
         Set m_parserPaused to true.

        (WebCore::XMLTokenizer::resumeParsing):
        Call the pending callbacks and then parse the pending source.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14927 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/dom/xml_tokenizer.cpp

index 6e5d9d37148192d9861245793445a82b58e61dff..6d080697deae5ef0e210433a1af45e37c85bfcfc 100644 (file)
@@ -1,3 +1,69 @@
+2006-06-20  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Geoff.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9509
+        Would like a way to pause/resume XML parsing
+
+        * dom/xml_tokenizer.cpp:
+        (WebCore::PendingCallbacks::PendingCallbacks):
+        (WebCore::PendingCallbacks::appendStartElementNSCallback):
+        (WebCore::PendingCallbacks::appendEndElementNSCallback):
+        (WebCore::PendingCallbacks::appendCharactersCallback):
+        (WebCore::PendingCallbacks::appendProcessingInstructionCallback):
+        (WebCore::PendingCallbacks::appendCDATABlockCallback):
+        (WebCore::PendingCallbacks::appendCommentCallback):
+        (WebCore::PendingCallbacks::appendInternalSubsetCallback):
+        (WebCore::PendingCallbacks::appendErrorCallback):
+        (WebCore::PendingCallbacks::callAndRemoveFirstCallback):
+        (WebCore::PendingCallbacks::isEmpty):
+        (WebCore::PendingCallbacks::PendingCallback::~PendingCallback):
+        (WebCore::PendingCallbacks::PendingStartElementNSCallback::~PendingStartElementNSCallback):
+        (WebCore::PendingCallbacks::PendingStartElementNSCallback::call):
+        (WebCore::PendingCallbacks::PendingEndElementNSCallback::call):
+        (WebCore::PendingCallbacks::PendingCharactersCallback::~PendingCharactersCallback):
+        (WebCore::PendingCallbacks::PendingCharactersCallback::call):
+        (WebCore::PendingCallbacks::PendingProcessingInstructionCallback::~PendingProcessingInstructionCallback):
+        (WebCore::PendingCallbacks::PendingProcessingInstructionCallback::call):
+        (WebCore::PendingCallbacks::PendingCDATABlockCallback::~PendingCDATABlockCallback):
+        (WebCore::PendingCallbacks::PendingCDATABlockCallback::call):
+        (WebCore::PendingCallbacks::PendingCommentCallback::~PendingCommentCallback):
+        (WebCore::PendingCallbacks::PendingCommentCallback::call):
+        (WebCore::PendingCallbacks::PendingInternalSubsetCallback::~PendingInternalSubsetCallback):
+        (WebCore::PendingCallbacks::PendingInternalSubsetCallback::call):
+        (WebCore::PendingCallbacks::):
+        New classes which manage a list of pending SAX callbacks that have not yet
+        been sent to the tokenizer.
+        
+        (WebCore::XMLTokenizer::XMLTokenizer):
+        Initialize new member variables.
+        
+        (WebCore::XMLTokenizer::~XMLTokenizer):
+        Delete PendingCallbacks object.
+        
+        (WebCore::XMLTokenizer::write):
+        If the parser is paused, queue the data to be written.
+        
+        (WebCore::XMLTokenizer::startElementNs):
+        (WebCore::XMLTokenizer::endElementNs):
+        (WebCore::XMLTokenizer::characters):
+        (WebCore::XMLTokenizer::error):
+        (WebCore::XMLTokenizer::processingInstruction):
+        (WebCore::XMLTokenizer::cdataBlock):
+        (WebCore::XMLTokenizer::comment):
+        (WebCore::XMLTokenizer::internalSubset):
+        If the parser has been paused, queue the callbacks instead.
+
+        (WebCore::XMLTokenizer::handleError):
+        New function, called by both ::error and :PendingCallbacks::callAndRemoveFirstCallback
+        
+        (WebCore::XMLTokenizer::finish):
+        (WebCore::XMLTokenizer::pauseParsing):
+         Set m_parserPaused to true.
+        
+        (WebCore::XMLTokenizer::resumeParsing):
+        Call the pending callbacks and then parse the pending source.
+        
 2006-06-20  David Hyatt  <hyatt@apple.com>
 
         Don't send the custom highlighter callback when painting is disabled.
index d529a27dddba0c0369a64c7551d596cdc65f95c0..63d4cd06a752471ed43021caa2245ab94706dd68 100644 (file)
@@ -805,7 +805,7 @@ void XMLTokenizer::finish()
         m_doc->setParsing(true);
         m_parserStopped = true;
     }
-    
+        
     if (m_context) {
         // Tell libxml we're done.
         xmlParseChunk(m_context, 0, 0, 1);
@@ -826,7 +826,7 @@ void XMLTokenizer::finish()
         m_scriptsIt = new DeprecatedPtrListIterator<Element>(m_scripts);
         executeScripts();
     }
-
+    
     setCurrentNode(0);
     m_doc->finishedParsing();
 }