Title: [112305] trunk/Source/WebCore
Revision
112305
Author
[email protected]
Date
2012-03-27 13:08:07 -0700 (Tue, 27 Mar 2012)

Log Message

<http://webkit.org/b/82362> Web Inspector: Provide private -[DOMNode inspect]

Patch by Joseph Pecoraro <[email protected]> on 2012-03-27
Reviewed by Timothy Hatcher.

No new tests, this is only an ObjC SPI.

* bindings/objc/DOM.mm:
* bindings/objc/DOMPrivate.h:
(-[DOMNode inspect]):
Call through to InspectorController inspect for the node.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::handleMousePress):
(WebCore::InspectorDOMAgent::inspect):
Whenever we inspect an element, clear the node search.
The frontend already takes this approach.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112304 => 112305)


--- trunk/Source/WebCore/ChangeLog	2012-03-27 20:06:14 UTC (rev 112304)
+++ trunk/Source/WebCore/ChangeLog	2012-03-27 20:08:07 UTC (rev 112305)
@@ -1,3 +1,22 @@
+2012-03-27  Joseph Pecoraro  <[email protected]>
+
+        <http://webkit.org/b/82362> Web Inspector: Provide private -[DOMNode inspect]
+
+        Reviewed by Timothy Hatcher.
+
+        No new tests, this is only an ObjC SPI.
+
+        * bindings/objc/DOM.mm:
+        * bindings/objc/DOMPrivate.h:
+        (-[DOMNode inspect]):
+        Call through to InspectorController inspect for the node.
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::handleMousePress):
+        (WebCore::InspectorDOMAgent::inspect):
+        Whenever we inspect an element, clear the node search.
+        The frontend already takes this approach.
+
 2012-03-27  Joe Mason  <[email protected]>
 
         [BlackBerry] fix confusing destruction sequence in LayerCompositingThread

Modified: trunk/Source/WebCore/bindings/objc/DOM.mm (112304 => 112305)


--- trunk/Source/WebCore/bindings/objc/DOM.mm	2012-03-27 20:06:14 UTC (rev 112304)
+++ trunk/Source/WebCore/bindings/objc/DOM.mm	2012-03-27 20:08:07 UTC (rev 112305)
@@ -44,6 +44,11 @@
 #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"
@@ -389,6 +394,18 @@
     range->textRects(rects);
     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 (112304 => 112305)


--- trunk/Source/WebCore/bindings/objc/DOMPrivate.h	2012-03-27 20:06:14 UTC (rev 112304)
+++ trunk/Source/WebCore/bindings/objc/DOMPrivate.h	2012-03-27 20:08:07 UTC (rev 112305)
@@ -29,6 +29,7 @@
 @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/inspector/InspectorDOMAgent.cpp (112304 => 112305)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2012-03-27 20:06:14 UTC (rev 112304)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2012-03-27 20:08:07 UTC (rev 112305)
@@ -914,7 +914,6 @@
 
     if (m_highlightData && m_highlightData->node) {
         RefPtr<Node> node = m_highlightData->node;
-        setSearchingForNode(false, 0);
         inspect(node.get());
     }
     return true;
@@ -922,6 +921,8 @@
 
 void InspectorDOMAgent::inspect(Node* node)
 {
+    setSearchingForNode(false, 0);
+
     if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE)
         node = node->parentNode();
     m_nodeToFocus = node;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to