Move HTMLTokenTypes to its own file
authortonyg@chromium.org <tonyg@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Jan 2013 02:05:52 +0000 (02:05 +0000)
committertonyg@chromium.org <tonyg@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 12 Jan 2013 02:05:52 +0000 (02:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=106722

Reviewed by Levi Weintraub.

Also mark AtomicHTMLToken ctor as explicit.

No new tests because no new functionality.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* html/parser/HTMLToken.h:
(WebCore::AtomicHTMLToken::AtomicHTMLToken):
* html/parser/HTMLTokenTypes.h: Added.
(WebCore):
(HTMLTokenTypes):
(DoctypeData):
(WebCore::HTMLTokenTypes::DoctypeData::DoctypeData):

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

Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/parser/HTMLToken.h
Source/WebCore/html/parser/HTMLTokenTypes.h [new file with mode: 0644]

index eb48df8..f4cd7b9 100644 (file)
@@ -1,3 +1,27 @@
+2013-01-11  Tony Gentilcore  <tonyg@chromium.org>
+
+        Move HTMLTokenTypes to its own file
+        https://bugs.webkit.org/show_bug.cgi?id=106722
+
+        Reviewed by Levi Weintraub.
+
+        Also mark AtomicHTMLToken ctor as explicit.
+
+        No new tests because no new functionality.
+
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/parser/HTMLToken.h:
+        (WebCore::AtomicHTMLToken::AtomicHTMLToken):
+        * html/parser/HTMLTokenTypes.h: Added.
+        (WebCore):
+        (HTMLTokenTypes):
+        (DoctypeData):
+        (WebCore::HTMLTokenTypes::DoctypeData::DoctypeData):
+
 2013-01-11  Elliott Sprehn  <esprehn@chromium.org>
 
         No need to initialize RefPtrs to 0 in ElementRareData
index baa757f..fabf353 100644 (file)
@@ -3562,6 +3562,7 @@ webcore_sources += \
        Source/WebCore/html/parser/HTMLSourceTracker.h \
        Source/WebCore/html/parser/HTMLStackItem.h \
        Source/WebCore/html/parser/HTMLToken.h \
+       Source/WebCore/html/parser/HTMLTokenTypes.h \
        Source/WebCore/html/parser/HTMLTokenizer.cpp \
        Source/WebCore/html/parser/HTMLTokenizer.h \
        Source/WebCore/html/parser/HTMLTreeBuilder.cpp \
index 34f50f0..eddfa72 100644 (file)
@@ -1891,6 +1891,7 @@ HEADERS += \
     html/parser/HTMLScriptRunner.h \
     html/parser/HTMLScriptRunnerHost.h \
     html/parser/HTMLToken.h \
+    html/parser/HTMLTokenTypes.h \
     html/parser/HTMLTokenizer.h \
     html/parser/HTMLTreeBuilder.h \
     html/parser/HTMLViewSourceParser.h \
index edd4c2d..da292c1 100644 (file)
             'html/parser/HTMLSourceTracker.h',
             'html/parser/HTMLStackItem.h',
             'html/parser/HTMLToken.h',
+            'html/parser/HTMLTokenTypes.h',
             'html/parser/HTMLTokenizer.cpp',
             'html/parser/HTMLTokenizer.h',
             'html/parser/HTMLTreeBuilder.cpp',
index c15bc21..99ca1cf 100755 (executable)
                                        >
                                </File>
                                <File
+                                       RelativePath="..\html\parser\HTMLTokenTypes.h"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\html\parser\HTMLTokenizer.cpp"
                                        >
                                </File>
index 92a8145..7f11414 100644 (file)
                97C0784F1165D5BE003A32EF /* SuffixTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SuffixTree.h; sourceTree = "<group>"; };
                97C1F552122855CB00EDE615 /* HTMLStackItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLStackItem.h; path = parser/HTMLStackItem.h; sourceTree = "<group>"; };
                97C1F552122855CB00EDE616 /* HTMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLToken.h; path = parser/HTMLToken.h; sourceTree = "<group>"; };
+               97C1F552122855CB00EDE617 /* HTMLTokenTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLTokenTypes.h; path = parser/HTMLTokenTypes.h; sourceTree = "<group>"; };
                97C471D912F925BC0086354B /* ContentSecurityPolicy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentSecurityPolicy.cpp; sourceTree = "<group>"; };
                97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentSecurityPolicy.h; sourceTree = "<group>"; };
                97C740121603F7A10011FF2D /* FeatureObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FeatureObserver.cpp; sourceTree = "<group>"; };
                                977E2DCC12F0E28300C13379 /* HTMLSourceTracker.h */,
                                97C1F552122855CB00EDE615 /* HTMLStackItem.h */,
                                97C1F552122855CB00EDE616 /* HTMLToken.h */,
+                               97C1F552122855CB00EDE617 /* HTMLTokenTypes.h */,
                                977B385E122883E900B81FF8 /* HTMLTokenizer.cpp */,
                                977B385F122883E900B81FF8 /* HTMLTokenizer.h */,
                                977B37211228721700B81FF8 /* HTMLTreeBuilder.cpp */,
index e2e93a7..fac81fe 100644 (file)
 #ifndef HTMLToken_h
 #define HTMLToken_h
 
+#include "HTMLTokenTypes.h"
 #include "MarkupTokenBase.h"
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 
-class HTMLTokenTypes {
-public:
-    enum Type {
-        Uninitialized,
-        DOCTYPE,
-        StartTag,
-        EndTag,
-        Comment,
-        Character,
-        EndOfFile,
-    };
-
-    class DoctypeData : public DoctypeDataBase {
-        WTF_MAKE_NONCOPYABLE(DoctypeData);
-    public:
-        DoctypeData()
-            : m_forceQuirks(false)
-        {
-        }
-
-        bool m_forceQuirks;
-    };
-};
-
 class HTMLToken : public MarkupTokenBase<HTMLTokenTypes, HTMLTokenTypes::DoctypeData> {
 public:
     void appendToName(UChar character)
@@ -102,7 +79,7 @@ public:
         return m_doctypeData->m_forceQuirks;
     }
 private:
-    AtomicHTMLToken(HTMLToken& token)
+    explicit AtomicHTMLToken(HTMLToken& token)
         : AtomicMarkupTokenBase<HTMLToken>(&token)
     {
     }
diff --git a/Source/WebCore/html/parser/HTMLTokenTypes.h b/Source/WebCore/html/parser/HTMLTokenTypes.h
new file mode 100644 (file)
index 0000000..240e254
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2013 Google, 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 HTMLTokenTypes_h
+#define HTMLTokenTypes_h
+
+#include "MarkupTokenBase.h"
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class HTMLTokenTypes {
+public:
+    enum Type {
+        Uninitialized,
+        DOCTYPE,
+        StartTag,
+        EndTag,
+        Comment,
+        Character,
+        EndOfFile,
+    };
+
+    class DoctypeData : public DoctypeDataBase {
+        WTF_MAKE_NONCOPYABLE(DoctypeData);
+    public:
+        DoctypeData()
+            : m_forceQuirks(false)
+        {
+        }
+
+        bool m_forceQuirks;
+    };
+};
+
+}
+
+#endif