Title: [112424] trunk/Source
Revision
112424
Author
[email protected]
Date
2012-03-28 12:22:07 -0700 (Wed, 28 Mar 2012)

Log Message

<http://webkit.org/b/82419> Web Inspector: Create -[DOMNode inspect] from IDL

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 <[email protected]> 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 <[email protected]> on 2012-03-28
Reviewed by Timothy Hatcher.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112423 => 112424)


--- trunk/Source/WebCore/ChangeLog	2012-03-28 19:19:36 UTC (rev 112423)
+++ trunk/Source/WebCore/ChangeLog	2012-03-28 19:22:07 UTC (rev 112424)
@@ -1,3 +1,25 @@
+2012-03-28  Joseph Pecoraro  <[email protected]>
+
+        <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  <[email protected]>
 
         [chromium] MediaStream API (JSEP): Introducing WebPeerConnection00Handler

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (112423 => 112424)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-03-28 19:19:36 UTC (rev 112423)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-03-28 19:22:07 UTC (rev 112424)
@@ -1160,6 +1160,8 @@
 		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 */; };
@@ -6506,6 +6508,7 @@
 				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 */,
@@ -10667,6 +10670,7 @@
 		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>"; };
@@ -15498,6 +15502,7 @@
 				853BF4DA0ABB6B55008647BB /* DOMNode.mm */,
 				85ACAA890A9B759C00671E90 /* DOMNodeList.h */,
 				85ACAA8A0A9B759C00671E90 /* DOMNodeList.mm */,
+				A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */,
 				85CA96E80A9624E900690CCF /* DOMNotation.h */,
 				85CA96E90A9624E900690CCF /* DOMNotation.mm */,
 				85F56A780A98CE3700ADB60A /* DOMProcessingInstruction.h */,
@@ -22102,6 +22107,7 @@
 				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 */,

Modified: trunk/Source/WebCore/bindings/objc/DOM.mm (112423 => 112424)


--- trunk/Source/WebCore/bindings/objc/DOM.mm	2012-03-28 19:19:36 UTC (rev 112423)
+++ trunk/Source/WebCore/bindings/objc/DOM.mm	2012-03-28 19:22:07 UTC (rev 112424)
@@ -44,11 +44,6 @@
 #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 @@
     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)

Modified: trunk/Source/WebCore/bindings/objc/DOMPrivate.h (112423 => 112424)


--- trunk/Source/WebCore/bindings/objc/DOMPrivate.h	2012-03-28 19:19:36 UTC (rev 112423)
+++ trunk/Source/WebCore/bindings/objc/DOMPrivate.h	2012-03-28 19:22:07 UTC (rev 112424)
@@ -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

Modified: trunk/Source/WebCore/dom/Node.cpp (112423 => 112424)


--- trunk/Source/WebCore/dom/Node.cpp	2012-03-28 19:19:36 UTC (rev 112423)
+++ trunk/Source/WebCore/dom/Node.cpp	2012-03-28 19:22:07 UTC (rev 112424)
@@ -107,6 +107,10 @@
 #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 @@
     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())

Modified: trunk/Source/WebCore/dom/Node.h (112423 => 112424)


--- trunk/Source/WebCore/dom/Node.h	2012-03-28 19:19:36 UTC (rev 112423)
+++ trunk/Source/WebCore/dom/Node.h	2012-03-28 19:22:07 UTC (rev 112424)
@@ -349,6 +349,8 @@
     bool isContentEditable();
     bool isContentRichlyEditable();
 
+    void inspect();
+
     bool rendererIsEditable(EditableType editableType = ContentIsEditable) const
     {
         switch (editableType) {

Modified: trunk/Source/WebCore/dom/Node.idl (112423 => 112424)


--- trunk/Source/WebCore/dom/Node.idl	2012-03-28 19:19:36 UTC (rev 112423)
+++ trunk/Source/WebCore/dom/Node.idl	2012-03-28 19:22:07 UTC (rev 112424)
@@ -136,6 +136,8 @@
 #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

Modified: trunk/Source/WebKit/mac/ChangeLog (112423 => 112424)


--- trunk/Source/WebKit/mac/ChangeLog	2012-03-28 19:19:36 UTC (rev 112423)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-03-28 19:22:07 UTC (rev 112424)
@@ -1,3 +1,11 @@
+2012-03-28  Joseph Pecoraro  <[email protected]>
+
+        <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  <[email protected]>
 
         Make WebKit properly load a staged framework when soft linking.

Modified: trunk/Source/WebKit/mac/MigrateHeaders.make (112423 => 112424)


--- trunk/Source/WebKit/mac/MigrateHeaders.make	2012-03-28 19:19:36 UTC (rev 112423)
+++ trunk/Source/WebKit/mac/MigrateHeaders.make	2012-03-28 19:22:07 UTC (rev 112424)
@@ -152,6 +152,7 @@
     $(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 \
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to