Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2028)

Unified Diff: Source/core/xml/parser/XMLDocumentParser.cpp

Issue 739433003: Remove CDATASection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/xml/parser/XMLDocumentParser.h ('k') | Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/parser/XMLDocumentParser.cpp
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index 7dc6a6ba07062af259058779ead7e93ec3d0845e..fafc3437f448a1738b09e177e27c84f8d924b664 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -34,13 +34,13 @@
#include "core/FetchInitiatorTypeNames.h"
#include "core/HTMLNames.h"
#include "core/XMLNSNames.h"
-#include "core/dom/CDATASection.h"
#include "core/dom/Comment.h"
#include "core/dom/Document.h"
#include "core/dom/DocumentFragment.h"
#include "core/dom/DocumentType.h"
#include "core/dom/ProcessingInstruction.h"
#include "core/dom/ScriptLoader.h"
+#include "core/dom/Text.h"
#include "core/dom/TransformSource.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/fetch/ScriptResource.h"
@@ -222,19 +222,6 @@ private:
String m_data;
};
-class PendingCDATABlockCallback final : public XMLDocumentParser::PendingCallback {
-public:
- explicit PendingCDATABlockCallback(const String& text) : m_text(text) { }
-
- virtual void call(XMLDocumentParser* parser) override
- {
- parser->cdataBlock(m_text);
- }
-
-private:
- String m_text;
-};
-
class PendingCommentCallback final : public XMLDocumentParser::PendingCallback {
public:
explicit PendingCommentCallback(const String& text) : m_text(text) { }
@@ -1176,21 +1163,6 @@ void XMLDocumentParser::processingInstruction(const String& target, const String
}
}
-void XMLDocumentParser::cdataBlock(const String& text)
-{
- if (isStopped())
- return;
-
- if (m_parserPaused) {
- m_pendingCallbacks.append(adoptPtr(new PendingCDATABlockCallback(text)));
- return;
- }
-
- exitText();
-
- m_currentNode->parserAppendChild(CDATASection::create(m_currentNode->document(), text));
-}
-
void XMLDocumentParser::comment(const String& text)
{
if (isStopped())
@@ -1275,11 +1247,6 @@ static void processingInstructionHandler(void* closure, const xmlChar* target, c
getParser(closure)->processingInstruction(toString(target), toString(data));
}
-static void cdataBlockHandler(void* closure, const xmlChar* text, int length)
-{
- getParser(closure)->cdataBlock(toString(text, length));
-}
-
static void commentHandler(void* closure, const xmlChar* text)
{
getParser(closure)->comment(toString(text));
@@ -1431,7 +1398,7 @@ void XMLDocumentParser::initializeParserContext(const CString& chunk)
sax.fatalError = normalErrorHandler;
sax.characters = charactersHandler;
sax.processingInstruction = processingInstructionHandler;
- sax.cdataBlock = cdataBlockHandler;
+ sax.cdataBlock = charactersHandler;
sax.comment = commentHandler;
sax.warning = warningHandler;
sax.startElementNs = startElementNsHandler;
« no previous file with comments | « Source/core/xml/parser/XMLDocumentParser.h ('k') | Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698