Reduce include graph of JSDOMBinding.h
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Feb 2013 13:01:06 +0000 (13:01 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Feb 2013 13:01:06 +0000 (13:01 +0000)
<http://webkit.org/b/110709>

Reviewed by Antti Koivisto.

Source/WebCore:

Move WebCore::root(Foo*) to the custom JSFooCustom.h headers.
This reduces the number of headers pulled in by JSDOMBinding.h.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSRuleCustom.cpp:
* bindings/js/JSCSSRuleCustom.h: Added.
(WebCore::root):
* bindings/js/JSCSSRuleListCustom.cpp:
* bindings/js/JSCSSStyleDeclarationCustom.h:
(WebCore::root):
* bindings/js/JSDOMBinding.h:
* bindings/js/JSMediaListCustom.h: Added.
(WebCore::root):
* bindings/js/JSMutationObserverCustom.cpp:
* bindings/js/JSNodeCustom.h:
(WebCore::root):
* bindings/js/JSSVGElementInstanceCustom.cpp:
* bindings/js/JSStyleSheetCustom.h: Added.
(WebCore::root):
* bindings/js/JSTextTrackCustom.h:
* bindings/js/JSTextTrackListCustom.cpp:
* bindings/js/JSXPathResultCustom.cpp:
* bindings/js/SerializedScriptValue.cpp:
* bindings/scripts/CodeGeneratorGObject.pm:
(Generate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/CodeGeneratorObjC.pm:
(AddIncludesForType):
* css/CSSRule.idl:
* css/CSSStyleDeclaration.idl:
* css/MediaList.idl:
* css/StyleSheet.idl:
* editing/mac/EditorMac.mm:

Source/WebKit/mac:

* WebView/WebHTMLView.mm:

Source/WebKit2:

* Shared/WebRenderObject.cpp:
(WebKit::WebRenderObject::WebRenderObject):
* WebProcess/Storage/StorageAreaProxy.cpp:

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

29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
Source/WebCore/bindings/js/JSCSSRuleCustom.h [new file with mode: 0644]
Source/WebCore/bindings/js/JSCSSRuleListCustom.cpp
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.h
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSMediaListCustom.h [new file with mode: 0644]
Source/WebCore/bindings/js/JSMutationObserverCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.h
Source/WebCore/bindings/js/JSSVGElementInstanceCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetCustom.h [new file with mode: 0644]
Source/WebCore/bindings/js/JSTextTrackCustom.h
Source/WebCore/bindings/js/JSTextTrackListCustom.cpp
Source/WebCore/bindings/js/JSXPathResultCustom.cpp
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
Source/WebCore/css/CSSRule.idl
Source/WebCore/css/CSSStyleDeclaration.idl
Source/WebCore/css/MediaList.idl
Source/WebCore/css/StyleSheet.idl
Source/WebCore/editing/mac/EditorMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebRenderObject.cpp
Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp

index e31d6e5..6fac834 100644 (file)
@@ -1,3 +1,45 @@
+2013-02-24  Andreas Kling  <akling@apple.com>
+
+        Reduce include graph of JSDOMBinding.h
+        <http://webkit.org/b/110709>
+
+        Reviewed by Antti Koivisto.
+
+        Move WebCore::root(Foo*) to the custom JSFooCustom.h headers.
+        This reduces the number of headers pulled in by JSDOMBinding.h.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSCSSRuleCustom.cpp:
+        * bindings/js/JSCSSRuleCustom.h: Added.
+        (WebCore::root):
+        * bindings/js/JSCSSRuleListCustom.cpp:
+        * bindings/js/JSCSSStyleDeclarationCustom.h:
+        (WebCore::root):
+        * bindings/js/JSDOMBinding.h:
+        * bindings/js/JSMediaListCustom.h: Added.
+        (WebCore::root):
+        * bindings/js/JSMutationObserverCustom.cpp:
+        * bindings/js/JSNodeCustom.h:
+        (WebCore::root):
+        * bindings/js/JSSVGElementInstanceCustom.cpp:
+        * bindings/js/JSStyleSheetCustom.h: Added.
+        (WebCore::root):
+        * bindings/js/JSTextTrackCustom.h:
+        * bindings/js/JSTextTrackListCustom.cpp:
+        * bindings/js/JSXPathResultCustom.cpp:
+        * bindings/js/SerializedScriptValue.cpp:
+        * bindings/scripts/CodeGeneratorGObject.pm:
+        (Generate):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        (AddIncludesForType):
+        * css/CSSRule.idl:
+        * css/CSSStyleDeclaration.idl:
+        * css/MediaList.idl:
+        * css/StyleSheet.idl:
+        * editing/mac/EditorMac.mm:
+
 2013-02-23  Alexey Proskuryakov  <ap@apple.com>
 
         ResourceRequestBase unnecessarily updates when nothing changes
index f2e50d3..10a3694 100644 (file)
                AD4495F4141FC08900541EDF /* EventListenerMap.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4495F2141FC08900541EDF /* EventListenerMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                AD6E71AC1668899D00320C13 /* DocumentSharedObjectPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD6E71AA1668899D00320C13 /* DocumentSharedObjectPool.cpp */; };
                AD6E71AD1668899D00320C13 /* DocumentSharedObjectPool.h in Headers */ = {isa = PBXBuildFile; fileRef = AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */; };
+               AD726FED16DA1171003A4E6D /* JSCSSStyleDeclarationCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               AD726FEE16DA11BC003A4E6D /* JSStyleSheetCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD726FEC16D9F4B9003A4E6D /* JSStyleSheetCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               AD726FEF16DA11F5003A4E6D /* JSCSSRuleCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD726FE916D9F40A003A4E6D /* JSCSSRuleCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
                ADDF1AD71257CD9A0003A759 /* RenderSVGPath.h in Headers */ = {isa = PBXBuildFile; fileRef = ADDF1AD51257CD9A0003A759 /* RenderSVGPath.h */; };
                B10B6980140C174000BC1C26 /* WebVTTToken.h in Headers */ = {isa = PBXBuildFile; fileRef = B10B697D140C174000BC1C26 /* WebVTTToken.h */; };
                B10B6981140C174000BC1C26 /* WebVTTTokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B10B697E140C174000BC1C26 /* WebVTTTokenizer.cpp */; };
                AD4495F2141FC08900541EDF /* EventListenerMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventListenerMap.h; sourceTree = "<group>"; };
                AD6E71AA1668899D00320C13 /* DocumentSharedObjectPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentSharedObjectPool.cpp; sourceTree = "<group>"; };
                AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentSharedObjectPool.h; sourceTree = "<group>"; };
+               AD726FE716D9F204003A4E6D /* JSMediaListCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaListCustom.h; sourceTree = "<group>"; };
+               AD726FE916D9F40A003A4E6D /* JSCSSRuleCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSRuleCustom.h; sourceTree = "<group>"; };
+               AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSStyleDeclarationCustom.h; sourceTree = "<group>"; };
+               AD726FEC16D9F4B9003A4E6D /* JSStyleSheetCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStyleSheetCustom.h; sourceTree = "<group>"; };
                ADDF1AD41257CD9A0003A759 /* RenderSVGPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGPath.cpp; sourceTree = "<group>"; };
                ADDF1AD51257CD9A0003A759 /* RenderSVGPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGPath.h; sourceTree = "<group>"; };
                B10B697D140C174000BC1C26 /* WebVTTToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVTTToken.h; sourceTree = "<group>"; };
                BC4EDEF70C08F414007EDD49 /* Custom */ = {
                        isa = PBXGroup;
                        children = (
+                               AD726FEC16D9F4B9003A4E6D /* JSStyleSheetCustom.h */,
+                               AD726FE916D9F40A003A4E6D /* JSCSSRuleCustom.h */,
+                               AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */,
                                BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */,
                                86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */,
                                BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */,
                                1C5FAEE60DCFDA6800D58F78 /* JSJavaScriptCallFrameCustom.cpp */,
                                BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */,
                                1464E06B135EC10600FDB00A /* JSMediaListCustom.cpp */,
+                               AD726FE716D9F204003A4E6D /* JSMediaListCustom.h */,
                                9FDC8FF112FAB0060099AB1C /* JSMemoryInfoCustom.cpp */,
                                E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */,
                                410B7E711045FAB000D8224F /* JSMessageEventCustom.cpp */,
                                29A8122E0FBB9C1D00510293 /* AccessibilityARIAGridCell.h in Headers */,
                                29A812330FBB9C1D00510293 /* AccessibilityARIAGridRow.h in Headers */,
                                29A8123B0FBB9C1D00510293 /* AccessibilityImageMapLink.h in Headers */,
+                               AD726FEE16DA11BC003A4E6D /* JSStyleSheetCustom.h in Headers */,
                                29A8122C0FBB9C1D00510293 /* AccessibilityList.h in Headers */,
                                29A812430FBB9C1D00510293 /* AccessibilityListBox.h in Headers */,
                                29A812420FBB9C1D00510293 /* AccessibilityListBoxOption.h in Headers */,
                                07B0113F1032242200FBDC33 /* AccessibilityMediaControls.h in Headers */,
                                76CDD2F31103DA6600680521 /* AccessibilityMenuList.h in Headers */,
                                76CDD2F71103DA6600680521 /* AccessibilityMenuListOption.h in Headers */,
+                               AD726FED16DA1171003A4E6D /* JSCSSStyleDeclarationCustom.h in Headers */,
                                76CDD2F51103DA6600680521 /* AccessibilityMenuListPopup.h in Headers */,
                                29ACB212143E7128006BCA5F /* AccessibilityMockObject.h in Headers */,
                                29A812360FBB9C1D00510293 /* AccessibilityObject.h in Headers */,
                                A409C985116D0DDD007197BD /* AccessibilityProgressIndicator.h in Headers */,
+                               AD726FEF16DA11F5003A4E6D /* JSCSSRuleCustom.h in Headers */,
                                29A812390FBB9C1D00510293 /* AccessibilityRenderObject.h in Headers */,
                                93C4F6EB1108F9A50099D0DB /* AccessibilityScrollbar.h in Headers */,
                                29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */,
index dd21392..925f8cf 100644 (file)
@@ -42,6 +42,7 @@
 #include "JSCSSStyleRule.h"
 #include "JSCSSSupportsRule.h"
 #include "JSNode.h"
+#include "JSStyleSheetCustom.h"
 #include "JSWebKitCSSFilterRule.h"
 #include "JSWebKitCSSKeyframeRule.h"
 #include "JSWebKitCSSKeyframesRule.h"
diff --git a/Source/WebCore/bindings/js/JSCSSRuleCustom.h b/Source/WebCore/bindings/js/JSCSSRuleCustom.h
new file mode 100644 (file)
index 0000000..7205658
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 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 COMPUTER, 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 COMPUTER, 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 JSCSSRuleCustom_h
+#define JSCSSRuleCustom_h
+
+#include "CSSRule.h"
+#include "CSSStyleSheet.h"
+
+namespace WebCore {
+
+void* root(StyleSheet*);
+
+inline void* root(CSSRule* rule)
+{
+    if (rule->parentRule())
+        return root(rule->parentRule());
+    if (rule->parentStyleSheet())
+        return root(rule->parentStyleSheet());
+    return rule;
+}
+
+} // namespace WebCore
+
+#endif // JSCSSRuleCustom_h
index 87b69a6..f60c7a1 100644 (file)
@@ -29,7 +29,8 @@
 #include "CSSRule.h"
 #include "CSSRuleList.h"
 #include "CSSStyleSheet.h"
-#include "JSNode.h"
+#include "JSCSSRuleCustom.h"
+#include "JSStyleSheetCustom.h"
 
 using namespace JSC;
 
index 32ecbe0..6ed1fec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2013 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #ifndef JSCSSStyleDeclarationCustom_h
 #define JSCSSStyleDeclarationCustom_h
 
+#include "CSSRule.h"
+#include "CSSStyleDeclaration.h"
+#include "CSSStyleSheet.h"
 #include "JSCSSStyleDeclaration.h"
+#include "JSStyleSheetCustom.h"
+
+namespace WebCore {
+
+inline void* root(CSSStyleDeclaration* style)
+{
+    if (CSSRule* parentRule = style->parentRule())
+        return root(parentRule);
+    if (CSSStyleSheet* styleSheet = style->parentStyleSheet())
+        return root(styleSheet);
+    return style;
+}
+
+}
 
 #endif // JSCSSStyleDeclarationCustom_h
index c1942a1..af69983 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
- *  Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2013 Apple Inc. All rights reserved.
  *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
  *  Copyright (C) 2009 Google, Inc. All rights reserved.
  *  Copyright (C) 2012 Ericsson AB. All rights reserved.
 #define JSDOMBinding_h
 
 #include "BindingState.h"
-#include "CSSImportRule.h"
-#include "CSSStyleDeclaration.h"
-#include "CSSStyleSheet.h"
 #include "JSDOMGlobalObject.h"
 #include "JSDOMWrapper.h"
 #include "DOMWrapperWorld.h"
 #include "Document.h"
-#include "Element.h"
-#include "MediaList.h"
 #include "ScriptWrappable.h"
-#include "StylePropertySet.h"
-#include "StyledElement.h"
 #include <heap/SlotVisitor.h>
 #include <heap/Weak.h>
 #include <runtime/Error.h>
@@ -206,54 +199,6 @@ class DOMStringList;
         return createWrapper<WrapperClass>(exec, globalObject, domObject);
     }
 
-    inline void* root(Node* node)
-    {
-        if (node->inDocument())
-            return node->document();
-
-        while (node->parentOrShadowHostNode())
-            node = node->parentOrShadowHostNode();
-        return node;
-    }
-
-    inline void* root(StyleSheet*);
-
-    inline void* root(CSSRule* rule)
-    {
-        if (rule->parentRule())
-            return root(rule->parentRule());
-        if (rule->parentStyleSheet())
-            return root(rule->parentStyleSheet());
-        return rule;
-    }
-
-    inline void* root(StyleSheet* styleSheet)
-    {
-        if (styleSheet->ownerRule())
-            return root(styleSheet->ownerRule());
-        if (styleSheet->ownerNode())
-            return root(styleSheet->ownerNode());
-        return styleSheet;
-    }
-
-    inline void* root(CSSStyleDeclaration* style)
-    {
-        if (CSSRule* parentRule = style->parentRule())
-            return root(parentRule);
-        if (CSSStyleSheet* styleSheet = style->parentStyleSheet())
-            return root(styleSheet);
-        return style;
-    }
-
-    inline void* root(MediaList* mediaList)
-    {
-        if (CSSRule* parentRule = mediaList->parentRule())
-            return root(parentRule);
-        if (CSSStyleSheet* parentStyleSheet = mediaList->parentStyleSheet())
-            return root(parentStyleSheet);
-        return mediaList;
-    }
-
     inline JSC::JSValue argumentOrNull(JSC::ExecState* exec, unsigned index)
     {
         return index >= exec->argumentCount() ? JSC::JSValue() : exec->argument(index);
diff --git a/Source/WebCore/bindings/js/JSMediaListCustom.h b/Source/WebCore/bindings/js/JSMediaListCustom.h
new file mode 100644 (file)
index 0000000..8f4ff7a
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2013 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 COMPUTER, 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 COMPUTER, 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 JSMediaListCustom_h
+#define JSMediaListCustom_h
+
+#include "CSSRule.h"
+#include "CSSStyleSheet.h"
+#include "JSCSSRuleCustom.h"
+#include "JSStyleSheetCustom.h"
+#include "MediaList.h"
+
+namespace WebCore {
+
+inline void* root(MediaList* mediaList)
+{
+    if (CSSRule* parentRule = mediaList->parentRule())
+        return root(parentRule);
+    if (CSSStyleSheet* parentStyleSheet = mediaList->parentStyleSheet())
+        return root(parentStyleSheet);
+    return mediaList;
+}
+
+} // namespace WebCore
+
+#endif // JSMediaListCustom_h
index 24c0fd1..c7c99e7 100644 (file)
@@ -32,7 +32,9 @@
 
 #include "JSMutationObserver.h"
 
+#include "ExceptionCode.h"
 #include "JSMutationCallback.h"
+#include "JSNodeCustom.h"
 #include "MutationObserver.h"
 #include <runtime/Error.h>
 #include <runtime/PrivateName.h>
index cc04fbf..194185b 100644 (file)
@@ -27,8 +27,8 @@
 #define JSNodeCustom_h
 
 #include "JSDOMBinding.h"
+#include "JSNode.h"
 #include "ScriptState.h"
-#include <wtf/AlwaysInline.h>
 
 namespace WebCore {
 
@@ -62,6 +62,16 @@ inline void willCreatePossiblyOrphanedTreeByRemoval(Node* root)
     willCreatePossiblyOrphanedTreeByRemovalSlowCase(root);
 }
 
+inline void* root(Node* node)
+{
+    if (node->inDocument())
+        return node->document();
+
+    while (node->parentOrShadowHostNode())
+        node = node->parentOrShadowHostNode();
+    return node;
+}
+
 } // namespace WebCore
 
 #endif // JSDOMNodeCustom_h
index 8f2645a..02266a1 100644 (file)
@@ -31,6 +31,7 @@
 #include "JSSVGElementInstance.h"
 
 #include "JSEventTarget.h"
+#include "JSNodeCustom.h"
 
 namespace WebCore {
 
diff --git a/Source/WebCore/bindings/js/JSStyleSheetCustom.h b/Source/WebCore/bindings/js/JSStyleSheetCustom.h
new file mode 100644 (file)
index 0000000..8c9c187
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 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 COMPUTER, 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 COMPUTER, 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 JSStyleSheetCustom_h
+#define JSStyleSheetCustom_h
+
+#include "CSSImportRule.h"
+#include "CSSStyleSheet.h"
+#include "JSCSSRuleCustom.h"
+#include "JSNodeCustom.h"
+
+namespace WebCore {
+
+inline void* root(StyleSheet* styleSheet)
+{
+    if (CSSImportRule* ownerRule = styleSheet->ownerRule())
+        return root(ownerRule);
+    if (Node* ownerNode = styleSheet->ownerNode())
+        return root(ownerNode);
+    return styleSheet;
+}
+
+} // namespace WebCore
+
+#endif // JSStyleSheetCustom_h
index 0de522c..7bfde28 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "HTMLMediaElement.h"
 #include "HTMLTrackElement.h"
+#include "JSNodeCustom.h"
 #include "LoadableTextTrack.h"
 
 using namespace JSC;
index a967fe1..1da1332 100644 (file)
@@ -29,6 +29,7 @@
 #include "JSTextTrackList.h"
 
 #include "HTMLMediaElement.h"
+#include "JSNodeCustom.h"
 
 using namespace JSC;
 
index bdaf195..715f745 100644 (file)
@@ -27,6 +27,7 @@
 #include "JSXPathResult.h"
 
 #include "JSDOMBinding.h"
+#include "JSNodeCustom.h"
 #include "XPathResult.h"
 #include "XPathValue.h"
 
index 079da58..6f0e77f 100644 (file)
@@ -28,6 +28,7 @@
 #include "SerializedScriptValue.h"
 
 #include "Blob.h"
+#include "ExceptionCode.h"
 #include "File.h"
 #include "FileList.h"
 #include "ImageData.h"
index 7a5d73f..06cfaa3 100644 (file)
@@ -1382,6 +1382,7 @@ sub Generate {
     $implIncludes{"${className}Private.h"} = 1;
     $implIncludes{"JSMainThreadExecState.h"} = 1;
     $implIncludes{"ExceptionCode.h"} = 1;
+    $implIncludes{"CSSImportRule.h"} = 1;
 
     $hdrIncludes{"webkitdom/${parentClassName}.h"} = 1;
 
index feeab3d..310dc95 100644 (file)
@@ -2512,6 +2512,8 @@ sub GenerateImplementation
                 $rootString .= "    if (!root)\n";
                 $rootString .= "        return false;\n";
             } elsif (GetGenerateIsReachable($interface) eq "ImplElementRoot") {
+                $implIncludes{"Element.h"} = 1;
+                $implIncludes{"JSNodeCustom.h"} = 1;
                 $rootString  = "    Element* element = js${interfaceName}->impl()->element();\n";
                 $rootString .= "    if (!element)\n";
                 $rootString .= "        return false;\n";
@@ -2519,6 +2521,8 @@ sub GenerateImplementation
             } elsif ($interfaceName eq "CanvasRenderingContext") {
                 $rootString  = "    void* root = WebCore::root(js${interfaceName}->impl()->canvas());\n";
             } elsif (GetGenerateIsReachable($interface) eq "ImplOwnerNodeRoot") {
+                $implIncludes{"Element.h"} = 1;
+                $implIncludes{"JSNodeCustom.h"} = 1;
                 $rootString  = "    void* root = WebCore::root(js${interfaceName}->impl()->ownerNode());\n";
             } else {
                 $rootString  = "    void* root = WebCore::root(js${interfaceName}->impl());\n";
index f1430d3..2950a2a 100644 (file)
@@ -620,6 +620,7 @@ sub AddIncludesForType
     }
 
     # FIXME: won't compile without these
+    $implIncludes{"CSSImportRule.h"} = 1 if $type eq "CSSRule";
     $implIncludes{"StylePropertySet.h"} = 1 if $type eq "CSSStyleDeclaration";
     $implIncludes{"NameNodeList.h"} = 1 if $type eq "NodeList";
 
index b8bca3c..4c18e52 100644 (file)
@@ -20,6 +20,7 @@
 
 // Introduced in DOM Level 2:
 [
+    JSCustomHeader,
     JSCustomMarkFunction,
     JSGenerateIsReachable,
     CustomToJSObject,
index 1849ed8..ba544ac 100644 (file)
@@ -20,6 +20,7 @@
 
 // Introduced in DOM Level 2:
 [
+    JSCustomHeader,
     JSCustomMarkFunction,
     JSGenerateIsReachable,
     JSCustomGetOwnPropertySlotAndDescriptor,
index b454d1e..5c8ea3c 100644 (file)
@@ -25,6 +25,7 @@
 
 // Introduced in DOM Level 2:
 [
+    JSCustomHeader,
     JSGenerateIsReachable,
     IndexedGetter,
     ImplementationLacksVTable
index b2d3a11..9d6d845 100644 (file)
@@ -20,6 +20,7 @@
 
 // Introduced in DOM Level 2:
 [
+    JSCustomHeader,
     JSCustomMarkFunction,
     JSGenerateIsReachable,
     CustomToJSObject,
index 8c3355a..7bfea06 100644 (file)
@@ -47,6 +47,7 @@
 #import "RenderBlock.h"
 #import "RuntimeApplicationChecks.h"
 #import "Sound.h"
+#import "StylePropertySet.h"
 #import "Text.h"
 #import "TypingCommand.h"
 #import "htmlediting.h"
index bedd77e..f9226de 100644 (file)
@@ -1,3 +1,12 @@
+2013-02-24  Andreas Kling  <akling@apple.com>
+
+        Reduce include graph of JSDOMBinding.h
+        <http://webkit.org/b/110709>
+
+        Reviewed by Antti Koivisto.
+
+        * WebView/WebHTMLView.mm:
+
 2013-02-21  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
 
         Allow to retrieve the request data from abstract TextCheckingRequest to be accessible for WK2
index 6245a68..f85de0d 100644 (file)
@@ -80,6 +80,7 @@
 #import <WebCore/ColorMac.h>
 #import <WebCore/ContextMenu.h>
 #import <WebCore/ContextMenuController.h>
+#import <WebCore/CSSStyleDeclaration.h>
 #import <WebCore/Document.h>
 #import <WebCore/DocumentFragment.h>
 #import <WebCore/DocumentMarkerController.h>
index 0e76f48..29c047a 100644 (file)
@@ -1,3 +1,14 @@
+2013-02-24  Andreas Kling  <akling@apple.com>
+
+        Reduce include graph of JSDOMBinding.h
+        <http://webkit.org/b/110709>
+
+        Reviewed by Antti Koivisto.
+
+        * Shared/WebRenderObject.cpp:
+        (WebKit::WebRenderObject::WebRenderObject):
+        * WebProcess/Storage/StorageAreaProxy.cpp:
+
 2013-02-22  Sam Weinig  <sam@webkit.org>
 
         Add temporary work around for 32-bit plugins not working in production builds as XPCServices
index 28f6391..3a25edf 100644 (file)
@@ -64,11 +64,10 @@ WebRenderObject::WebRenderObject(RenderObject* renderer, bool shouldIncludeDesce
             m_elementTagName = element->tagName();
             m_elementID = element->getIdAttribute();
             if (element->isStyledElement() && element->hasClass()) {
-                StyledElement* styledElement = static_cast<StyledElement*>(element);
-                if (size_t classNameCount = styledElement->classNames().size()) {
+                if (size_t classNameCount = element->classNames().size()) {
                     m_elementClassNames = MutableArray::create();
                     for (size_t i = 0; i < classNameCount; ++i)
-                        m_elementClassNames->append(WebString::create(styledElement->classNames()[i]).get());
+                        m_elementClassNames->append(WebString::create(element->classNames()[i]).get());
                 }
             }
         }
index 4170d20..a50f0ec 100644 (file)
@@ -30,6 +30,7 @@
 #include "StorageManagerMessages.h"
 #include "StorageNamespaceProxy.h"
 #include "WebProcess.h"
+#include <WebCore/ExceptionCode.h>
 #include <WebCore/Frame.h>
 #include <WebCore/Page.h>
 #include <WebCore/SchemeRegistry.h>