Remove extraneous includes (Node.h, Document.h, Element.h, RenderObject.h)
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2012 19:11:32 +0000 (19:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2012 19:11:32 +0000 (19:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=95259

Patch by Nikhil Bhargava <nbhargava@google.com> on 2012-08-31
Reviewed by Sam Weinig.

Node.h, Document.h, Element.h, and RenderObject.h are four of the most
expensive headers to include. This patch removes them from many of the
places they are not needed. There is a minor compile-time performance
boost.

* dom/ElementShadow.h:
* dom/Range.h:
(WebCore):
* dom/TreeScopeAdopter.h:
(WebCore):
* editing/VisiblePosition.h:
(WebCore):
* html/HTMLCollection.h:
(WebCore):
* html/parser/HTMLElementStack.h:
* html/parser/HTMLTreeBuilder.h:
(WebCore):
* html/track/WebVTTParser.h:
(WebCore):
* inspector/InspectorCSSAgent.h:
(WebCore):
* inspector/InspectorInstrumentation.h:
(WebCore):
* inspector/InspectorOverlay.h:
* loader/ImageLoader.h:
* loader/TextTrackLoader.h:
(WebCore):
* platform/chromium/PopupListBox.cpp:
* platform/chromium/PopupListBox.h:
(WebCore):
* platform/graphics/MediaPlayer.h:
(WebCore):
* rendering/FilterEffectRenderer.h:
* rendering/InlineFlowBox.cpp:
* rendering/RenderCounter.cpp:
* rendering/RenderGeometryMap.h:
(WebCore):
* rendering/RenderInputSpeech.h:
(WebCore):
* rendering/RenderMediaControls.h:
(WebCore):
* rendering/RenderMediaControlsChromium.h:
(WebCore):
* rendering/RenderQuote.cpp:
* rendering/RenderQuote.h:
(WebCore):
* rendering/RenderScrollbar.h:
(WebCore):
* rendering/RenderText.h:
(WebCore):
* rendering/RenderTheme.h:
(WebCore):
* rendering/RenderThemeChromiumSkia.h:
(WebCore):
* rendering/svg/RenderSVGResourceMarker.h:
(WebCore):
* svg/graphics/filters/SVGFilterBuilder.h:
(WebCore):
* xml/NativeXPathNSResolver.h:
(WebCore):
(NativeXPathNSResolver):
(WebCore::NativeXPathNSResolver::create):
* xml/XPathStep.h:
(WebCore):
(XPath):
(Step):
(NodeTest):
(WebCore::XPath::Step::NodeTest::NodeTest):
(WebCore::XPath::Step::NodeTest::kind):
(WebCore::XPath::Step::NodeTest::data):
(WebCore::XPath::Step::NodeTest::namespaceURI):
(WebCore::XPath::Step::NodeTest::mergedPredicates):
(WebCore::XPath::Step::axis):
(WebCore::XPath::Step::nodeTest):
* xml/parser/NewXMLDocumentParser.cpp:
* xml/parser/NewXMLDocumentParser.h:
(WebCore):
* xml/parser/XMLToken.h:
* xml/parser/XMLTreeBuilder.cpp:
* xml/parser/XMLTreeBuilder.h:
(WebCore):

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

35 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/ElementShadow.h
Source/WebCore/dom/Range.h
Source/WebCore/dom/TreeScopeAdopter.h
Source/WebCore/editing/VisiblePosition.h
Source/WebCore/html/HTMLCollection.h
Source/WebCore/html/parser/HTMLElementStack.h
Source/WebCore/html/parser/HTMLTreeBuilder.h
Source/WebCore/html/track/WebVTTParser.h
Source/WebCore/inspector/InspectorCSSAgent.h
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorOverlay.h
Source/WebCore/loader/ImageLoader.h
Source/WebCore/loader/TextTrackLoader.h
Source/WebCore/platform/chromium/PopupListBox.h
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/rendering/FilterEffectRenderer.h
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderGeometryMap.h
Source/WebCore/rendering/RenderInputSpeech.h
Source/WebCore/rendering/RenderMediaControls.h
Source/WebCore/rendering/RenderMediaControlsChromium.h
Source/WebCore/rendering/RenderQuote.cpp
Source/WebCore/rendering/RenderQuote.h
Source/WebCore/rendering/RenderScrollbar.h
Source/WebCore/rendering/svg/RenderSVGResourceMarker.h
Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h
Source/WebCore/xml/NativeXPathNSResolver.h
Source/WebCore/xml/XPathStep.h
Source/WebCore/xml/parser/NewXMLDocumentParser.cpp
Source/WebCore/xml/parser/NewXMLDocumentParser.h
Source/WebCore/xml/parser/XMLToken.h
Source/WebCore/xml/parser/XMLTreeBuilder.cpp
Source/WebCore/xml/parser/XMLTreeBuilder.h

index 01e5422..c2c8de1 100644 (file)
@@ -1,3 +1,92 @@
+2012-08-31  Nikhil Bhargava  <nbhargava@google.com>
+
+        Remove extraneous includes (Node.h, Document.h, Element.h, RenderObject.h)
+        https://bugs.webkit.org/show_bug.cgi?id=95259
+
+        Reviewed by Sam Weinig.
+
+        Node.h, Document.h, Element.h, and RenderObject.h are four of the most
+        expensive headers to include. This patch removes them from many of the
+        places they are not needed. There is a minor compile-time performance
+        boost.
+
+        * dom/ElementShadow.h:
+        * dom/Range.h:
+        (WebCore):
+        * dom/TreeScopeAdopter.h:
+        (WebCore):
+        * editing/VisiblePosition.h:
+        (WebCore):
+        * html/HTMLCollection.h:
+        (WebCore):
+        * html/parser/HTMLElementStack.h:
+        * html/parser/HTMLTreeBuilder.h:
+        (WebCore):
+        * html/track/WebVTTParser.h:
+        (WebCore):
+        * inspector/InspectorCSSAgent.h:
+        (WebCore):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore):
+        * inspector/InspectorOverlay.h:
+        * loader/ImageLoader.h:
+        * loader/TextTrackLoader.h:
+        (WebCore):
+        * platform/chromium/PopupListBox.cpp:
+        * platform/chromium/PopupListBox.h:
+        (WebCore):
+        * platform/graphics/MediaPlayer.h:
+        (WebCore):
+        * rendering/FilterEffectRenderer.h:
+        * rendering/InlineFlowBox.cpp:
+        * rendering/RenderCounter.cpp:
+        * rendering/RenderGeometryMap.h:
+        (WebCore):
+        * rendering/RenderInputSpeech.h:
+        (WebCore):
+        * rendering/RenderMediaControls.h:
+        (WebCore):
+        * rendering/RenderMediaControlsChromium.h:
+        (WebCore):
+        * rendering/RenderQuote.cpp:
+        * rendering/RenderQuote.h:
+        (WebCore):
+        * rendering/RenderScrollbar.h:
+        (WebCore):
+        * rendering/RenderText.h:
+        (WebCore):
+        * rendering/RenderTheme.h:
+        (WebCore):
+        * rendering/RenderThemeChromiumSkia.h:
+        (WebCore):
+        * rendering/svg/RenderSVGResourceMarker.h:
+        (WebCore):
+        * svg/graphics/filters/SVGFilterBuilder.h:
+        (WebCore):
+        * xml/NativeXPathNSResolver.h:
+        (WebCore):
+        (NativeXPathNSResolver):
+        (WebCore::NativeXPathNSResolver::create):
+        * xml/XPathStep.h:
+        (WebCore):
+        (XPath):
+        (Step):
+        (NodeTest):
+        (WebCore::XPath::Step::NodeTest::NodeTest):
+        (WebCore::XPath::Step::NodeTest::kind):
+        (WebCore::XPath::Step::NodeTest::data):
+        (WebCore::XPath::Step::NodeTest::namespaceURI):
+        (WebCore::XPath::Step::NodeTest::mergedPredicates):
+        (WebCore::XPath::Step::axis):
+        (WebCore::XPath::Step::nodeTest):
+        * xml/parser/NewXMLDocumentParser.cpp:
+        * xml/parser/NewXMLDocumentParser.h:
+        (WebCore):
+        * xml/parser/XMLToken.h:
+        * xml/parser/XMLTreeBuilder.cpp:
+        * xml/parser/XMLTreeBuilder.h:
+        (WebCore):
+
 2012-08-31  David Hyatt  <hyatt@apple.com>
 
         [New Multicolumn] Implement column repainting.
index f58616e..9d839a4 100644 (file)
@@ -28,7 +28,6 @@
 #define ElementShadow_h
 
 #include "ContentDistributor.h"
-#include "Element.h"
 #include "ExceptionCode.h"
 #include "ShadowRoot.h"
 #include <wtf/DoublyLinkedList.h>
index dffaefc..b6bf771 100644 (file)
@@ -29,7 +29,6 @@
 #include "FloatRect.h"
 #include "FragmentScriptingPermission.h"
 #include "IntRect.h"
-#include "Node.h"
 #include "RangeBoundaryPoint.h"
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
@@ -43,6 +42,7 @@ class ContainerNode;
 class Document;
 class DocumentFragment;
 class FloatQuad;
+class Node;
 class NodeWithIndex;
 class Text;
 
index d2bd4d4..4ca4182 100644 (file)
 #ifndef TreeScopeAdopter_h
 #define TreeScopeAdopter_h
 
-#include "Element.h"
+#include "Node.h"
 
 namespace WebCore {
 
+class TreeScope;
+
 class TreeScopeAdopter {
 public:
     explicit TreeScopeAdopter(Node* toAdopt, TreeScope* newScope);
index c3f11f3..1f58f68 100644 (file)
@@ -27,7 +27,6 @@
 #define VisiblePosition_h
 
 #include "EditingBoundary.h"
-#include "Node.h"
 #include "Position.h"
 #include "TextDirection.h"
 
@@ -47,6 +46,7 @@ namespace WebCore {
 #define VP_UPSTREAM_IF_POSSIBLE UPSTREAM
 
 class InlineBox;
+class Node;
 
 class VisiblePosition {
 public:
index 8336183..51c7809 100644 (file)
@@ -23,7 +23,6 @@
 #ifndef HTMLCollection_h
 #define HTMLCollection_h
 
-#include "Node.h"
 #include "CollectionType.h"
 #include "DynamicNodeList.h"
 #include <wtf/Forward.h>
@@ -35,6 +34,7 @@ namespace WebCore {
 
 class Document;
 class Element;
+class Node;
 class NodeList;
 
 class HTMLCollectionCacheBase : public DynamicNodeListCacheBase {
index 1aaa204..b203ef1 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef HTMLElementStack_h
 #define HTMLElementStack_h
 
-#include "Element.h"
 #include "HTMLNames.h"
 #include "HTMLStackItem.h"
 #include <wtf/Forward.h>
index c573627..8ff0f58 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef HTMLTreeBuilder_h
 #define HTMLTreeBuilder_h
 
-#include "Element.h"
 #include "FragmentScriptingPermission.h"
 #include "HTMLConstructionSite.h"
 #include "HTMLElementStack.h"
@@ -47,6 +46,7 @@ namespace WebCore {
 class AtomicHTMLToken;
 class Document;
 class DocumentFragment;
+class Element;
 class Frame;
 class HTMLToken;
 class HTMLDocument;
index 522bbff..6490206 100644 (file)
@@ -33,7 +33,6 @@
 
 #if ENABLE(VIDEO_TRACK)
 
-#include "Document.h"
 #include "DocumentFragment.h"
 #include "HTMLNames.h"
 #include "TextTrackCue.h"
@@ -45,6 +44,8 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
+class Document;
+
 class WebVTTParserClient {
 public:
     virtual ~WebVTTParserClient() { }
index 2b82b4c..fe1a3b1 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "CSSSelector.h"
 #include "ContentSecurityPolicy.h"
-#include "Document.h"
 #include "InspectorBaseAgent.h"
 #include "InspectorDOMAgent.h"
 #include "InspectorStyleSheet.h"
@@ -53,7 +52,9 @@ class InspectorFrontend;
 class InstrumentingAgents;
 class NameNodeMap;
 class Node;
+class NodeList;
 class SelectorProfile;
+class StyleResolver;
 
 #if ENABLE(INSPECTOR)
 
index 0cc0cc2..c25d372 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "CSSSelector.h"
 #include "ConsoleTypes.h"
-#include "Document.h"
 #include "Element.h"
 #include "Frame.h"
 #include "Page.h"
@@ -53,6 +52,7 @@ class CharacterData;
 class DOMWindow;
 class DOMWrapperWorld;
 class Database;
+class Document;
 class Element;
 class EventContext;
 class DocumentLoader;
index 72d5431..3cd5759 100644 (file)
 #include "Color.h"
 #include "FloatQuad.h"
 #include "LayoutTypes.h"
-#include "Node.h"
 
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
index d3b7669..796d718 100644 (file)
@@ -26,7 +26,6 @@
 #include "CachedImage.h"
 #include "CachedImageClient.h"
 #include "CachedResourceHandle.h"
-#include "Element.h"
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/text/AtomicString.h>
index 76da390..74334f9 100644 (file)
 #include "CachedResourceClient.h"
 #include "CachedResourceHandle.h"
 #include "CachedTextTrack.h"
-#include "Document.h"
 #include "Timer.h"
 #include "WebVTTParser.h"
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
+class Document;
 class TextTrackLoader;
 class ScriptExecutionContext;
 
index 522376e..6575aee 100644 (file)
 #ifndef PopupListBox_h
 #define PopupListBox_h
 
-#include "Font.h"
-#include "FontSelector.h"
 #include "FramelessScrollView.h"
-#include "IntRect.h"
 #include "Node.h"
+#include "TextDirection.h"
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
@@ -48,7 +47,9 @@ static const int kMinEndOfLinePadding = 2;
 static const int kTextToLabelPadding = 10;
 static const TimeStamp kTypeAheadTimeoutMs = 1000;
 
+class Font;
 class GraphicsContext;
+class IntRect;
 class PlatformKeyboardEvent;
 class PlatformMouseEvent;
 #if ENABLE(GESTURE_EVENTS)
index eac345c..2e060b4 100644 (file)
 #include "MediaPlayerProxy.h"
 #endif
 
-#include "Document.h"
 #include "IntRect.h"
 #include "KURL.h"
+#include "LayoutTypesInlineMethods.h"
+#include "Timer.h"
 #include <wtf/Forward.h>
 #include <wtf/HashSet.h>
 #include <wtf/OwnPtr.h>
@@ -56,8 +57,10 @@ class QTMovieVisualContext;
 namespace WebCore {
 
 class AudioSourceProvider;
+class Document;
 class GStreamerGWorld;
 class MediaPlayerPrivateInterface;
+class MediaSource;
 
 // Structure that will hold every native
 // types supported by the current media player.
index caeeda9..bc53cdc 100644 (file)
@@ -35,6 +35,7 @@
 #include "FractionalLayoutRect.h"
 #include "GraphicsContext.h"
 #include "ImageBuffer.h"
+#include "LayoutTypesInlineMethods.h"
 #include "SVGFilterBuilder.h"
 #include "SourceGraphic.h"
 
index 615a4b0..7755091 100644 (file)
@@ -36,6 +36,7 @@
 #include "RenderRubyRun.h"
 #include "RenderRubyText.h"
 #include "RenderTableCell.h"
+#include "RenderView.h"
 #include "RootInlineBox.h"
 #include "Text.h"
 
index de45d89..d0aa8da 100644 (file)
@@ -30,6 +30,7 @@
 #include "RenderListItem.h"
 #include "RenderListMarker.h"
 #include "RenderStyle.h"
+#include "RenderView.h"
 #include <wtf/StdLibExtras.h>
 
 #ifndef NDEBUG
index 98f44c6..495d0bf 100644 (file)
 #include "FloatPoint.h"
 #include "FloatQuad.h"
 #include "IntSize.h"
-#include "RenderObject.h"
+#include "LayoutTypesInlineMethods.h"
 #include "TransformationMatrix.h"
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
+class RenderBoxModelObject;
 class RenderLayer;
+class RenderObject;
+class RenderView;
+class TransformState;
 
 // Stores data about how to map from one renderer to its container.
 struct RenderGeometryMapStep {
index f37b836..6735961 100644 (file)
 #ifndef RenderInputSpeech_h
 #define RenderInputSpeech_h
 
-#include "RenderObject.h"
-
 #if ENABLE(INPUT_SPEECH)
 
 namespace WebCore {
 
+struct PaintInfo;
+
+class Element;
+class IntRect;
+class RenderObject;
+class RenderStyle;
+class StyleResolver;
+
 class RenderInputSpeech {
 public:
     static void adjustInputFieldSpeechButtonStyle(StyleResolver*, RenderStyle*, Element*);
index f9d3f3d..8a16c2f 100644 (file)
 
 #if ENABLE(VIDEO)
 
-#include "RenderObject.h"
 #include "MediaControlElements.h"
 
 namespace WebCore {
 
+struct PaintInfo;
+
 class HTMLMediaElement;
+class IntRect;
+class IntSize;
+class RenderBox;
+class RenderObject;
+class RenderStyle;
 
 class RenderMediaControls {
 public:
index c3b801b..6015cb1 100644 (file)
 #ifndef RenderMediaControlsChromium_h
 #define RenderMediaControlsChromium_h
 
-#include "RenderObject.h"
 #include "MediaControlElements.h"
 
 namespace WebCore {
 
+struct PaintInfo;
+
 class HTMLMediaElement;
+class IntRect;
+class RenderObject;
+
 class RenderMediaControlsChromium {
 public:
     static bool paintMediaControlsPart(MediaControlElementType, RenderObject*, const PaintInfo&, const IntRect&);
index 679e55b..88e9c55 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 #include "RenderQuote.h"
 
+#include "RenderView.h"
 #include <wtf/text/AtomicString.h>
 
 #define U(x) ((const UChar*)L##x)
index 7917fc1..b51ca7a 100644 (file)
@@ -22,7 +22,6 @@
 #ifndef RenderQuote_h
 #define RenderQuote_h
 
-#include "Document.h"
 #include "QuotesData.h"
 #include "RenderStyle.h"
 #include "RenderStyleConstants.h"
@@ -30,6 +29,8 @@
 
 namespace WebCore {
 
+class Document;
+
 class RenderQuote : public RenderText {
 public:
     RenderQuote(Document*, const QuoteType);
index 61d9803..918eee0 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef RenderScrollbar_h
 #define RenderScrollbar_h
 
-#include "Node.h"
 #include "RenderStyleConstants.h"
 #include "Scrollbar.h"
 #include <wtf/HashMap.h>
@@ -34,6 +33,7 @@
 namespace WebCore {
 
 class Frame;
+class Node;
 class RenderBox;
 class RenderScrollbarPart;
 class RenderStyle;
index faa2258..26fbc6f 100644 (file)
@@ -22,7 +22,6 @@
 
 #if ENABLE(SVG)
 #include "FloatRect.h"
-#include "RenderObject.h"
 #include "RenderSVGResourceContainer.h"
 #include "SVGMarkerElement.h"
 #include "SVGStyledElement.h"
@@ -32,6 +31,7 @@
 namespace WebCore {
 
 class AffineTransform;
+class RenderObject;
 
 class RenderSVGResourceMarker : public RenderSVGResourceContainer {
 public:
index 44d3227..8e3d75c 100644 (file)
@@ -24,7 +24,6 @@
 #if ENABLE(SVG) && ENABLE(FILTERS)
 #include "FilterEffect.h"
 #include "PlatformString.h"
-#include "RenderObject.h"
 
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
@@ -33,6 +32,8 @@
 
 namespace WebCore {
 
+class RenderObject;
+
 class SVGFilterBuilder : public RefCounted<SVGFilterBuilder> {
 public:
     typedef HashSet<FilterEffect*> FilterEffectSet;
index 559624f..69cd840 100644 (file)
 #define NativeXPathNSResolver_h
 
 #include "XPathNSResolver.h"
-#include "Node.h"
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 
-    class NativeXPathNSResolver : public XPathNSResolver {
-    public:
-        static PassRefPtr<NativeXPathNSResolver> create(PassRefPtr<Node> node) { return adoptRef(new NativeXPathNSResolver(node)); }
-        virtual ~NativeXPathNSResolver();
+class Node;
 
-        virtual String lookupNamespaceURI(const String& prefix);
+class NativeXPathNSResolver : public XPathNSResolver {
+public:
+    static PassRefPtr<NativeXPathNSResolver> create(PassRefPtr<Node> node) { return adoptRef(new NativeXPathNSResolver(node)); }
+    virtual ~NativeXPathNSResolver();
 
-    private:
-        NativeXPathNSResolver(PassRefPtr<Node>);
-        RefPtr<Node> m_node;
-    };
+    virtual String lookupNamespaceURI(const String& prefix);
+
+private:
+    NativeXPathNSResolver(PassRefPtr<Node>);
+    RefPtr<Node> m_node;
+};
 
 } // namespace WebCore
 
index 136fd12..f678f92 100644 (file)
 #ifndef XPathStep_h
 #define XPathStep_h
 
-#include "Node.h"
 #include "XPathExpressionNode.h"
 #include "XPathNodeSet.h"
 
 namespace WebCore {
 
-    namespace XPath {
+class Node;
 
-        class Predicate;
+namespace XPath {
+
+class Predicate;
         
-        class Step : public ParseNode {
-            WTF_MAKE_NONCOPYABLE(Step); WTF_MAKE_FAST_ALLOCATED;
-        public:
-            enum Axis {
-                AncestorAxis, AncestorOrSelfAxis, AttributeAxis,
-                ChildAxis, DescendantAxis, DescendantOrSelfAxis,
-                FollowingAxis, FollowingSiblingAxis, NamespaceAxis,
-                ParentAxis, PrecedingAxis, PrecedingSiblingAxis,
-                SelfAxis
-            };
-            
-            class NodeTest {
-                WTF_MAKE_FAST_ALLOCATED;
-            public:
-                enum Kind {
-                    TextNodeTest, CommentNodeTest, ProcessingInstructionNodeTest, AnyNodeTest, NameTest
-                };
-                
-                NodeTest(Kind kind) : m_kind(kind) {}
-                NodeTest(Kind kind, const String& data) : m_kind(kind), m_data(data) {}
-                NodeTest(Kind kind, const String& data, const String& namespaceURI) : m_kind(kind), m_data(data), m_namespaceURI(namespaceURI) {}
+class Step : public ParseNode {
+    WTF_MAKE_NONCOPYABLE(Step);
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    enum Axis {
+        AncestorAxis, AncestorOrSelfAxis, AttributeAxis,
+        ChildAxis, DescendantAxis, DescendantOrSelfAxis,
+        FollowingAxis, FollowingSiblingAxis, NamespaceAxis,
+        ParentAxis, PrecedingAxis, PrecedingSiblingAxis,
+        SelfAxis
+    };
+           
+    class NodeTest {
+        WTF_MAKE_FAST_ALLOCATED;
+    public:
+        enum Kind {
+            TextNodeTest, CommentNodeTest, ProcessingInstructionNodeTest, AnyNodeTest, NameTest
+        };
+
+        NodeTest(Kind kind) : m_kind(kind) { }
+        NodeTest(Kind kind, const String& data) : m_kind(kind), m_data(data) { }
+        NodeTest(Kind kind, const String& data, const String& namespaceURI) : m_kind(kind), m_data(data), m_namespaceURI(namespaceURI) { }
                 
-                Kind kind() const { return m_kind; }
-                const AtomicString& data() const { return m_data; }
-                const AtomicString& namespaceURI() const { return m_namespaceURI; }
-                Vector<Predicate*>& mergedPredicates() { return m_mergedPredicates; }
-                const Vector<Predicate*>& mergedPredicates() const { return m_mergedPredicates; }
+        Kind kind() const { return m_kind; }
+        const AtomicString& data() const { return m_data; }
+        const AtomicString& namespaceURI() const { return m_namespaceURI; }
+        Vector<Predicate*>& mergedPredicates() { return m_mergedPredicates; }
+        const Vector<Predicate*>& mergedPredicates() const { return m_mergedPredicates; }
                 
-            private:
-                Kind m_kind;
-                AtomicString m_data;
-                AtomicString m_namespaceURI;
+    private:
+        Kind m_kind;
+        AtomicString m_data;
+        AtomicString m_namespaceURI;
 
-                // When possible, we merge some or all predicates with node test for better performance.
-                Vector<Predicate*> m_mergedPredicates;
-            };
+        // When possible, we merge some or all predicates with node test for better performance.
+        Vector<Predicate*> m_mergedPredicates;
+    };
 
-            Step(Axis, const NodeTest& nodeTest, const Vector<Predicate*>& predicates = Vector<Predicate*>());
-            ~Step();
+    Step(Axis, const NodeTest&, const Vector<Predicate*>& predicates = Vector<Predicate*>());
+    ~Step();
 
-            void optimize();
+    void optimize();
 
-            void evaluate(Node* context, NodeSet&) const;
+    void evaluate(Node* context, NodeSet&) const;
 
-            Axis axis() const { return m_axis; }
-            const NodeTest& nodeTest() const { return m_nodeTest; }
+    Axis axis() const { return m_axis; }
+    const NodeTest& nodeTest() const { return m_nodeTest; }
 
-        private:
-            friend void optimizeStepPair(Step*, Step*, bool&);
-            bool predicatesAreContextListInsensitive() const;
+private:
+    friend void optimizeStepPair(Step*, Step*, bool&);
+    bool predicatesAreContextListInsensitive() const;
 
-            void parseNodeTest(const String&);
-            void nodesInAxis(Node* context, NodeSet&) const;
-            String namespaceFromNodetest(const String& nodeTest) const;
+    void parseNodeTest(const String&);
+    void nodesInAxis(Node* context, NodeSet&) const;
+    String namespaceFromNodetest(const String& nodeTest) const;
 
-            Axis m_axis;
-            NodeTest m_nodeTest;
-            Vector<Predicate*> m_predicates;
-        };
+    Axis m_axis;
+    NodeTest m_nodeTest;
+    Vector<Predicate*> m_predicates;
+};
+
+void optimizeStepPair(Step*, Step*, bool& dropSecondStep);
 
-        void optimizeStepPair(Step*, Step*, bool& dropSecondStep);
-    }
+} // namespace XPath
 
-}
+} // namespace WebCore
 
 #endif // XPathStep_h
index be72c5d..63c33d6 100644 (file)
@@ -27,6 +27,7 @@
 #include "NewXMLDocumentParser.h"
 
 #include "DocumentFragment.h"
+#include "Element.h"
 #include "ScriptElement.h"
 #include "ScriptSourceCode.h"
 #include "SegmentedString.h"
index d48f352..975d67b 100644 (file)
@@ -29,6 +29,7 @@
 #include "CachedResourceClient.h"
 #include "CachedResourceHandle.h"
 #include "CachedScript.h"
+#include "FragmentScriptingPermission.h"
 #include "ScriptableDocumentParser.h"
 #include "XMLToken.h"
 #include "XMLTokenizer.h"
@@ -39,6 +40,7 @@ namespace WebCore {
 
 class ContainerNode;
 class Document;
+class DocumentFragment;
 class ScriptElement;
 class XMLTreeBuilder;
 
index 73b9b01..2a22331 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef XMLToken_h
 #define XMLToken_h
 
-#include "Element.h"
 #include "MarkupTokenBase.h"
 
 namespace WebCore {
index 7dd8901..cc0d722 100644 (file)
@@ -32,6 +32,7 @@
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "DocumentType.h"
+#include "Element.h"
 #include "Frame.h"
 // FIXME: Why are we including HTML entity information in the XML parser?
 #include "HTMLEntitySearch.h"
index 39ee59b..9c9186e 100644 (file)
@@ -36,6 +36,7 @@ namespace WebCore {
 
 class ContainerNode;
 class Document;
+class DocumentFragment;
 class NewXMLDocumentParser;
 
 class XMLTreeBuilder {