Changeset 112305 in webkit


Ignore:
Timestamp:
Mar 27, 2012 1:08:07 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Joseph Pecoraro <Joseph Pecoraro> 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.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112304 r112305  
     12012-03-27  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        <http://webkit.org/b/82362> Web Inspector: Provide private -[DOMNode inspect]
     4
     5        Reviewed by Timothy Hatcher.
     6
     7        No new tests, this is only an ObjC SPI.
     8
     9        * bindings/objc/DOM.mm:
     10        * bindings/objc/DOMPrivate.h:
     11        (-[DOMNode inspect]):
     12        Call through to InspectorController inspect for the node.
     13
     14        * inspector/InspectorDOMAgent.cpp:
     15        (WebCore::InspectorDOMAgent::handleMousePress):
     16        (WebCore::InspectorDOMAgent::inspect):
     17        Whenever we inspect an element, clear the node search.
     18        The frontend already takes this approach.
     19
    1202012-03-27  Joe Mason  <jmason@rim.com>
    221
  • trunk/Source/WebCore/bindings/objc/DOM.mm

    r109663 r112305  
    4444#import "WebScriptObjectPrivate.h"
    4545#import <wtf/HashMap.h>
     46
     47#if ENABLE(INSPECTOR)
     48#import "InspectorController.h"
     49#import "Page.h"
     50#endif
    4651
    4752#if ENABLE(SVG_DOM_OBJC_BINDINGS)
     
    390395    return kit(rects);
    391396}
     397
     398- (void)inspect
     399{
     400#if ENABLE(INSPECTOR)
     401    WebCore::Node* node = core(self);
     402    if (WebCore::Document* document = node->document()) {
     403        if (WebCore::Page* page = document->page())
     404            page->inspectorController()->inspect(node);
     405    }
     406#endif
     407}
     408
    392409@end
    393410
  • trunk/Source/WebCore/bindings/objc/DOMPrivate.h

    r99099 r112305  
    3030- (NSImage *)renderedImage;
    3131- (NSArray *)textRects;
     32- (void)inspect;
    3233@end
    3334
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r111574 r112305  
    915915    if (m_highlightData && m_highlightData->node) {
    916916        RefPtr<Node> node = m_highlightData->node;
    917         setSearchingForNode(false, 0);
    918917        inspect(node.get());
    919918    }
     
    923922void InspectorDOMAgent::inspect(Node* node)
    924923{
     924    setSearchingForNode(false, 0);
     925
    925926    if (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE)
    926927        node = node->parentNode();
Note: See TracChangeset for help on using the changeset viewer.