Title: [90654] trunk/Source/WebCore
Revision
90654
Author
[email protected]
Date
2011-07-08 12:31:34 -0700 (Fri, 08 Jul 2011)

Log Message

Add framework for a new/dummy XMLDocumentParser
https://bugs.webkit.org/show_bug.cgi?id=63955

Reviewed by Adam Barth.

Added a dummy framework NewXMLDocumentParser

* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::createParser):
* xml/parser/NewXMLDocumentParser.cpp: Added.
(WebCore::NewXMLDocumentParser::NewXMLDocumentParser):
(WebCore::NewXMLDocumentParser::textPosition):
(WebCore::NewXMLDocumentParser::lineNumber):
(WebCore::NewXMLDocumentParser::insert):
(WebCore::NewXMLDocumentParser::append):
(WebCore::NewXMLDocumentParser::finish):
(WebCore::NewXMLDocumentParser::detach):
(WebCore::NewXMLDocumentParser::hasInsertionPoint):
(WebCore::NewXMLDocumentParser::finishWasCalled):
(WebCore::NewXMLDocumentParser::processingData):
(WebCore::NewXMLDocumentParser::prepareToStopParsing):
(WebCore::NewXMLDocumentParser::stopParsing):
(WebCore::NewXMLDocumentParser::isWaitingForScripts):
(WebCore::NewXMLDocumentParser::isExecutingScript):
(WebCore::NewXMLDocumentParser::executeScriptsWaitingForStylesheets):
* xml/parser/NewXMLDocumentParser.h: Added.
(WebCore::NewXMLDocumentParser::create):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (90653 => 90654)


--- trunk/Source/WebCore/ChangeLog	2011-07-08 19:27:44 UTC (rev 90653)
+++ trunk/Source/WebCore/ChangeLog	2011-07-08 19:31:34 UTC (rev 90654)
@@ -1,3 +1,34 @@
+2011-07-08  Jeffrey Pfau  <[email protected]>
+
+        Add framework for a new/dummy XMLDocumentParser
+        https://bugs.webkit.org/show_bug.cgi?id=63955
+
+        Reviewed by Adam Barth.
+
+        Added a dummy framework NewXMLDocumentParser
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/Document.cpp:
+        (WebCore::Document::createParser):
+        * xml/parser/NewXMLDocumentParser.cpp: Added.
+        (WebCore::NewXMLDocumentParser::NewXMLDocumentParser):
+        (WebCore::NewXMLDocumentParser::textPosition):
+        (WebCore::NewXMLDocumentParser::lineNumber):
+        (WebCore::NewXMLDocumentParser::insert):
+        (WebCore::NewXMLDocumentParser::append):
+        (WebCore::NewXMLDocumentParser::finish):
+        (WebCore::NewXMLDocumentParser::detach):
+        (WebCore::NewXMLDocumentParser::hasInsertionPoint):
+        (WebCore::NewXMLDocumentParser::finishWasCalled):
+        (WebCore::NewXMLDocumentParser::processingData):
+        (WebCore::NewXMLDocumentParser::prepareToStopParsing):
+        (WebCore::NewXMLDocumentParser::stopParsing):
+        (WebCore::NewXMLDocumentParser::isWaitingForScripts):
+        (WebCore::NewXMLDocumentParser::isExecutingScript):
+        (WebCore::NewXMLDocumentParser::executeScriptsWaitingForStylesheets):
+        * xml/parser/NewXMLDocumentParser.h: Added.
+        (WebCore::NewXMLDocumentParser::create):
+
 2011-07-08  David Reveman  <[email protected]>
 
         Remove unused function parameters.

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (90653 => 90654)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-07-08 19:27:44 UTC (rev 90653)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-07-08 19:31:34 UTC (rev 90654)
@@ -53,6 +53,8 @@
 		00B9318913BA8DBC0035A948 /* XMLDocumentParserLibxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00B9318313BA867F0035A948 /* XMLDocumentParserLibxml2.cpp */; };
 		00B9318B13BA8DC90035A948 /* XMLDocumentParserScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00B9318513BA867F0035A948 /* XMLDocumentParserScope.cpp */; };
 		00B9318C13BA8DCC0035A948 /* XMLDocumentParserScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 00B9318613BA867F0035A948 /* XMLDocumentParserScope.h */; };
+		00CA93B213C6691600F7FE95 /* NewXMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 00CA93B113C6691600F7FE95 /* NewXMLDocumentParser.h */; };
+		00CA93B513C6697C00F7FE95 /* NewXMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00CA93B413C6697C00F7FE95 /* NewXMLDocumentParser.cpp */; };
 		052BFCE9128ABF1500FD338D /* GeolocationClientMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 052BFCE8128ABF1500FD338D /* GeolocationClientMock.cpp */; };
 		052BFCEB128ABF2100FD338D /* GeolocationClientMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 052BFCEA128ABF2100FD338D /* GeolocationClientMock.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */ = {isa = PBXBuildFile; fileRef = 05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -6412,6 +6414,8 @@
 		00B9318313BA867F0035A948 /* XMLDocumentParserLibxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParserLibxml2.cpp; sourceTree = "<group>"; };
 		00B9318513BA867F0035A948 /* XMLDocumentParserScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParserScope.cpp; sourceTree = "<group>"; };
 		00B9318613BA867F0035A948 /* XMLDocumentParserScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLDocumentParserScope.h; sourceTree = "<group>"; };
+		00CA93B113C6691600F7FE95 /* NewXMLDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewXMLDocumentParser.h; sourceTree = "<group>"; };
+		00CA93B413C6697C00F7FE95 /* NewXMLDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewXMLDocumentParser.cpp; sourceTree = "<group>"; };
 		052BFCE8128ABF1500FD338D /* GeolocationClientMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GeolocationClientMock.cpp; path = mock/GeolocationClientMock.cpp; sourceTree = "<group>"; };
 		052BFCEA128ABF2100FD338D /* GeolocationClientMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GeolocationClientMock.h; path = mock/GeolocationClientMock.h; sourceTree = "<group>"; };
 		05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMTimeStamp.h; sourceTree = "<group>"; };
@@ -12708,6 +12712,8 @@
 				00B9318313BA867F0035A948 /* XMLDocumentParserLibxml2.cpp */,
 				00B9318513BA867F0035A948 /* XMLDocumentParserScope.cpp */,
 				00B9318613BA867F0035A948 /* XMLDocumentParserScope.h */,
+				00CA93B113C6691600F7FE95 /* NewXMLDocumentParser.h */,
+				00CA93B413C6697C00F7FE95 /* NewXMLDocumentParser.cpp */,
 			);
 			path = parser;
 			sourceTree = "<group>";
@@ -22152,6 +22158,7 @@
 				628D214C12131ED10055DCFC /* NetworkingContext.h in Headers */,
 				59C27F07138D28CF0079B7E2 /* NetworkResourcesData.h in Headers */,
 				1A7FA6190DDA3B3A0028F8A5 /* NetworkStateNotifier.h in Headers */,
+				00CA93B213C6691600F7FE95 /* NewXMLDocumentParser.h in Headers */,
 				BCEF43DD0E674012001C1287 /* NinePieceImage.h in Headers */,
 				14115B5209F84B7100CA4FC1 /* Node.h in Headers */,
 				854FE7310A2297BE0058D7AD /* NodeFilter.h in Headers */,
@@ -25129,6 +25136,7 @@
 				59C27F05138D28C10079B7E2 /* NetworkResourcesData.cpp in Sources */,
 				1A7FA61B0DDA3BBE0028F8A5 /* NetworkStateNotifier.cpp in Sources */,
 				1A7FA6490DDA3CBA0028F8A5 /* NetworkStateNotifierMac.cpp in Sources */,
+				00CA93B513C6697C00F7FE95 /* NewXMLDocumentParser.cpp in Sources */,
 				BCEF43E00E674110001C1287 /* NinePieceImage.cpp in Sources */,
 				A8C4A80009D563270003AC8D /* Node.cpp in Sources */,
 				854FE7300A2297BE0058D7AD /* NodeFilter.cpp in Sources */,

Modified: trunk/Source/WebCore/dom/Document.cpp (90653 => 90654)


--- trunk/Source/WebCore/dom/Document.cpp	2011-07-08 19:27:44 UTC (rev 90653)
+++ trunk/Source/WebCore/dom/Document.cpp	2011-07-08 19:31:34 UTC (rev 90654)
@@ -106,6 +106,7 @@
 #include "MutationEvent.h"
 #include "NameNodeList.h"
 #include "NestingLevelIncrementer.h"
+#include "NewXMLDocumentParser.h"
 #include "NodeFilter.h"
 #include "NodeIterator.h"
 #include "NodeWithIndex.h"
@@ -1913,7 +1914,11 @@
 PassRefPtr<DocumentParser> Document::createParser()
 {
     // FIXME: this should probably pass the frame instead
+#if ENABLE(NEW_XML)
+    return NewXMLDocumentParser::create(this);
+#else
     return XMLDocumentParser::create(this, view());
+#endif
 }
 
 ScriptableDocumentParser* Document::scriptableDocumentParser() const

Added: trunk/Source/WebCore/xml/parser/NewXMLDocumentParser.cpp (0 => 90654)


--- trunk/Source/WebCore/xml/parser/NewXMLDocumentParser.cpp	                        (rev 0)
+++ trunk/Source/WebCore/xml/parser/NewXMLDocumentParser.cpp	2011-07-08 19:31:34 UTC (rev 90654)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NewXMLDocumentParser.h"
+
+namespace WebCore {
+
+NewXMLDocumentParser::NewXMLDocumentParser(Document* document)
+    : ScriptableDocumentParser(document)
+{
+}
+
+TextPosition0 NewXMLDocumentParser::textPosition() const
+{
+    return TextPosition0(WTF::ZeroBasedNumber::fromZeroBasedInt(0),
+                         WTF::ZeroBasedNumber::fromZeroBasedInt(0));
+}
+
+int NewXMLDocumentParser::lineNumber() const
+{
+    return 0;
+}
+
+void NewXMLDocumentParser::insert(const SegmentedString&)
+{
+    ASSERT_NOT_REACHED();
+}
+
+void NewXMLDocumentParser::append(const SegmentedString&)
+{
+}
+
+void NewXMLDocumentParser::finish()
+{
+}
+
+void NewXMLDocumentParser::detach()
+{
+    ScriptableDocumentParser::detach();
+}
+
+bool NewXMLDocumentParser::hasInsertionPoint()
+{
+    return false;
+}
+
+bool NewXMLDocumentParser::finishWasCalled()
+{
+    return false;
+}
+
+bool NewXMLDocumentParser::processingData() const
+{
+    return false;
+}
+
+void NewXMLDocumentParser::prepareToStopParsing()
+{
+}
+
+void NewXMLDocumentParser::stopParsing()
+{
+}
+
+bool NewXMLDocumentParser::isWaitingForScripts() const
+{
+    return false;
+}
+
+bool NewXMLDocumentParser::isExecutingScript() const
+{
+    return false;
+}
+
+void NewXMLDocumentParser::executeScriptsWaitingForStylesheets()
+{
+}
+
+}

Added: trunk/Source/WebCore/xml/parser/NewXMLDocumentParser.h (0 => 90654)


--- trunk/Source/WebCore/xml/parser/NewXMLDocumentParser.h	                        (rev 0)
+++ trunk/Source/WebCore/xml/parser/NewXMLDocumentParser.h	2011-07-08 19:31:34 UTC (rev 90654)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NewXMLDocumentParser_h
+#define NewXMLDocumentParser_h
+
+#include "CachedResourceClient.h"
+#include "ScriptableDocumentParser.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class Document;
+
+class NewXMLDocumentParser : public ScriptableDocumentParser {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static PassRefPtr<NewXMLDocumentParser> create(Document* document)
+    {
+        return adoptRef(new NewXMLDocumentParser(document));
+    }
+    
+    virtual TextPosition0 textPosition() const;
+    virtual int lineNumber() const;
+
+protected:
+    virtual void insert(const SegmentedString&);
+    virtual void append(const SegmentedString&);
+    virtual void finish();
+
+
+private:
+    NewXMLDocumentParser(Document*);
+
+    // DocumentParser
+    virtual void detach();
+    virtual bool hasInsertionPoint();
+    virtual bool finishWasCalled();
+    virtual bool processingData() const;
+    virtual void prepareToStopParsing();
+    virtual void stopParsing();
+    virtual bool isWaitingForScripts() const;
+    virtual bool isExecutingScript() const;
+    virtual void executeScriptsWaitingForStylesheets();
+};
+
+}
+
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to