<http://webkit.org/b/82419> Web Inspector: Create -[DOMNode inspect] from IDL
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2012 19:22:07 +0000 (19:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2012 19:22:07 +0000 (19:22 +0000)
Source/WebCore:

Instead of manually creating the method in DOM.mm we can specify it in
Node.idl and autogenerate part of the interface.

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2012-03-28
Reviewed by Timothy Hatcher.

* bindings/objc/DOM.mm:
* bindings/objc/DOMPrivate.h:
Move the call to InspectorController::inspect from here ...

* dom/Node.h:
* dom/Node.idl: IDL only in an ObjC block.
* dom/Node.cpp:
(WebCore::Node::inspect):
... to here.

* WebCore.xcodeproj/project.pbxproj:
Add the new generated file so we can Copy it in the build phase.

Source/WebKit/mac:

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2012-03-28
Reviewed by Timothy Hatcher.

* MigrateHeaders.make: Copy DOMNodePrivate.h to PrivateHeaders.

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/objc/DOM.mm
Source/WebCore/bindings/objc/DOMPrivate.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/Node.idl
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/MigrateHeaders.make

index 8ee2dc8..506a518 100644 (file)
@@ -1,3 +1,25 @@
+2012-03-28  Joseph Pecoraro  <pecoraro@apple.com>
+
+        <http://webkit.org/b/82419> Web Inspector: Create -[DOMNode inspect] from IDL
+
+        Instead of manually creating the method in DOM.mm we can specify it in
+        Node.idl and autogenerate part of the interface.
+
+        Reviewed by Timothy Hatcher.
+
+        * bindings/objc/DOM.mm:
+        * bindings/objc/DOMPrivate.h:
+        Move the call to InspectorController::inspect from here ...
+
+        * dom/Node.h:
+        * dom/Node.idl: IDL only in an ObjC block.
+        * dom/Node.cpp:
+        (WebCore::Node::inspect):
+        ... to here.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Add the new generated file so we can Copy it in the build phase.
+
 2012-03-28  Tommy Widenflycht  <tommyw@google.com>
 
         [chromium] MediaStream API (JSEP): Introducing WebPeerConnection00Handler
index 8f0273d..fcf5ab7 100644 (file)
                44311CD612E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 44311CD412E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h */; };
                44311CD712E4E22D000A8D19 /* DOMDocumentPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 44311CD512E4E22D000A8D19 /* DOMDocumentPrivate.h */; };
                44311CD812E4E24B000A8D19 /* DOMDocumentPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 44311CD512E4E22D000A8D19 /* DOMDocumentPrivate.h */; };
+               A54A82EC15228D2F00C72BA6 /* DOMNodePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
+               A54A82F115228DF600C72BA6 /* DOMNodePrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
                44311CD912E4E257000A8D19 /* DOMDocumentFragmentPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 44311CD412E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h */; };
                44311F8212E4E66C000A8D19 /* DOMDocumentFragmentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711450AC5D5340053270F /* DOMDocumentFragmentInternal.h */; };
                448A29BF0A46D9CB0030759F /* JSHTMLOptionsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */; };
                                9307F1130AF2C8BE00DBA31A /* DOMNodeInternal.h in Copy Generated Headers */,
                                85526C720AB0AE2F000302EA /* DOMNodeIterator.h in Copy Generated Headers */,
                                1C11CCBE0AA6093700DADB20 /* DOMNodeList.h in Copy Generated Headers */,
+                               A54A82F115228DF600C72BA6 /* DOMNodePrivate.h in Copy Generated Headers */,
                                1C11CCB50AA6093700DADB20 /* DOMNotation.h in Copy Generated Headers */,
                                85DF345F0AAFC2D400E59AE3 /* DOMOverflowEvent.h in Copy Generated Headers */,
                                1C11CCC30AA6093700DADB20 /* DOMProcessingInstruction.h in Copy Generated Headers */,
                A454424D119B3687009BE912 /* RenderMeter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMeter.h; sourceTree = "<group>"; };
                A456FA2411AD4A830020B420 /* LabelsNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LabelsNodeList.cpp; sourceTree = "<group>"; };
                A456FA2511AD4A830020B420 /* LabelsNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelsNodeList.h; sourceTree = "<group>"; };
+               A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMNodePrivate.h; sourceTree = "<group>"; };
                A5732B08136A161D005C8D7C /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };
                A5732B09136A161D005C8D7C /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };
                A5732B0C136A16C4005C8D7C /* LocalizedDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedDate.h; sourceTree = "<group>"; };
                                853BF4DA0ABB6B55008647BB /* DOMNode.mm */,
                                85ACAA890A9B759C00671E90 /* DOMNodeList.h */,
                                85ACAA8A0A9B759C00671E90 /* DOMNodeList.mm */,
+                               A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */,
                                85CA96E80A9624E900690CCF /* DOMNotation.h */,
                                85CA96E90A9624E900690CCF /* DOMNotation.mm */,
                                85F56A780A98CE3700ADB60A /* DOMProcessingInstruction.h */,
                                850B41C20AD9E7E700A6ED4F /* DOMNodeIteratorInternal.h in Headers */,
                                85ACAA8D0A9B759C00671E90 /* DOMNodeList.h in Headers */,
                                85E711D30AC5D5350053270F /* DOMNodeListInternal.h in Headers */,
+                               A54A82EC15228D2F00C72BA6 /* DOMNodePrivate.h in Headers */,
                                85CA96EA0A9624E900690CCF /* DOMNotation.h in Headers */,
                                85E711D40AC5D5350053270F /* DOMNotationInternal.h in Headers */,
                                856C8AE40A912649005C687B /* DOMObject.h in Headers */,
index b35ce4a..abc5298 100644 (file)
 #import "WebScriptObjectPrivate.h"
 #import <wtf/HashMap.h>
 
-#if ENABLE(INSPECTOR)
-#import "InspectorController.h"
-#import "Page.h"
-#endif
-
 #if ENABLE(SVG_DOM_OBJC_BINDINGS)
 #import "DOMSVG.h"
 #import "SVGElementInstance.h"
@@ -395,17 +390,6 @@ id <DOMEventTarget> kit(WebCore::EventTarget* eventTarget)
     return kit(rects);
 }
 
-- (void)inspect
-{
-#if ENABLE(INSPECTOR)
-    WebCore::Node* node = core(self);
-    if (WebCore::Document* document = node->document()) {
-        if (WebCore::Page* page = document->page())
-            page->inspectorController()->inspect(node);
-    }
-#endif
-}
-
 @end
 
 @implementation DOMRange (DOMRangeExtensions)
index 456d92b..fe70bc9 100644 (file)
@@ -29,7 +29,6 @@
 @interface DOMNode (DOMNodeExtensionsPendingPublic)
 - (NSImage *)renderedImage;
 - (NSArray *)textRects;
-- (void)inspect;
 @end
 
 // FIXME: this should be removed as soon as all internal Apple uses of it have been replaced with
index 5340cb4..480e5bb 100644 (file)
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 
+#if ENABLE(INSPECTOR)
+#include "InspectorController.h"
+#endif
+
 #if ENABLE(SVG)
 #include "SVGElementInstance.h"
 #include "SVGUseElement.h"
@@ -717,6 +721,14 @@ bool Node::isContentRichlyEditable()
     return rendererIsEditable(RichlyEditable);
 }
 
+void Node::inspect()
+{
+#if ENABLE(INSPECTOR)
+    if (document() && document()->page())
+        document()->page()->inspectorController()->inspect(this);
+#endif
+}
+
 bool Node::rendererIsEditable(EditableLevel editableLevel) const
 {
     if (document()->frame() && document()->frame()->page() && document()->frame()->page()->isEditable() && !shadowTreeRootNode())
index 19661f6..ab5b99a 100644 (file)
@@ -349,6 +349,8 @@ public:
     bool isContentEditable();
     bool isContentRichlyEditable();
 
+    void inspect();
+
     bool rendererIsEditable(EditableType editableType = ContentIsEditable) const
     {
         switch (editableType) {
index e27a215..fc4a882 100644 (file)
@@ -136,6 +136,8 @@ module core {
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
         // Objective-C extensions
         readonly attribute boolean          isContentEditable;
+
+        void inspect();
 #endif /* defined(LANGUAGE_OBJECTIVE_C) */
 
 #if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
index 5fd2fa7..b28c45b 100644 (file)
@@ -1,3 +1,11 @@
+2012-03-28  Joseph Pecoraro  <pecoraro@apple.com>
+
+        <http://webkit.org/b/82419> Web Inspector: Create -[DOMNode inspect] from IDL
+
+        Reviewed by Timothy Hatcher.
+
+        * MigrateHeaders.make: Copy DOMNodePrivate.h to PrivateHeaders.
+
 2012-03-27  Timothy Hatcher  <timothy@apple.com>
 
         Make WebKit properly load a staged framework when soft linking.
index 0f85542..fd6a1f5 100644 (file)
@@ -152,6 +152,7 @@ all : \
     $(PUBLIC_HEADERS_DIR)/DOMNamedNodeMap.h \
     $(PUBLIC_HEADERS_DIR)/DOMNode.h \
     $(INTERNAL_HEADERS_DIR)/DOMNodeInternal.h \
+    $(PRIVATE_HEADERS_DIR)/DOMNodePrivate.h \
     $(PUBLIC_HEADERS_DIR)/DOMNodeFilter.h \
     $(PUBLIC_HEADERS_DIR)/DOMNodeIterator.h \
     $(PUBLIC_HEADERS_DIR)/DOMNodeList.h \