Bug 176563 - Augmented Inspector: Provide a way to inspect a DOM Node (DOM.inspect)
Summary: Augmented Inspector: Provide a way to inspect a DOM Node (DOM.inspect)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-09-07 13:43 PDT by Joseph Pecoraro
Modified: 2017-09-07 15:22 PDT (History)
10 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (6.51 KB, patch)
2017-09-07 13:52 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Proposed Fix (9.49 KB, patch)
2017-09-07 14:32 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-09-07 13:43:26 PDT
Augmented Inspector: Provide a way to inspect a DOM Node (DOM.inspect)

Augmented Agents don't have access to the Inspector domain so they can't send Inspector.inspect events with a RemoteObject. They do however have access to the DOM domain and control nodeIds, so lets provide a parallel DOM.inspect(nodeId).
Comment 1 Joseph Pecoraro 2017-09-07 13:46:36 PDT
<rdar://problem/19639583>
Comment 2 Joseph Pecoraro 2017-09-07 13:52:16 PDT
Created attachment 320174 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2017-09-07 13:58:58 PDT
Normally I am adamant about writing a test for all protocol changes, but interestingly this is a protocol method that WebKit doesn't implement, but an Augmented JSContext exercises via the generated ObjC API:

    @interface RWIProtocolDOMDomainEventDispatcher : NSObject
    - (void)inspectWithNodeId:(int)nodeId;
    ...
    @end

I tested it manually. Maybe I can write a protocol test for this by supplying some kind of pre-canned response.
Comment 4 Joseph Pecoraro 2017-09-07 14:04:32 PDT
Comment on attachment 320174 [details]
[PATCH] Proposed Fix

Yeah, I think I can write a test!
Comment 5 Joseph Pecoraro 2017-09-07 14:32:56 PDT
Created attachment 320183 [details]
[PATCH] Proposed Fix
Comment 6 Matt Baker 2017-09-07 14:46:33 PDT
Comment on attachment 320183 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=320183&action=review

r=me

> Source/WebInspectorUI/UserInterface/Base/Main.js:393
> +    var activatedToolTip = WI.UIString("Stop element selection (%s)").format(WI._inspectModeKeyboardShortcut.displayName);

let
Comment 7 Joseph Pecoraro 2017-09-07 14:52:58 PDT
Comment on attachment 320183 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=320183&action=review

>> Source/WebInspectorUI/UserInterface/Base/Main.js:393
>> +    var activatedToolTip = WI.UIString("Stop element selection (%s)").format(WI._inspectModeKeyboardShortcut.displayName);
> 
> let

Due to surrounding code this might actually cause an exception. It needs a more holistic var=>let conversion.
Comment 8 WebKit Commit Bot 2017-09-07 15:22:41 PDT
Comment on attachment 320183 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 320183

Committed r221765: <http://trac.webkit.org/changeset/221765>
Comment 9 WebKit Commit Bot 2017-09-07 15:22:43 PDT
All reviewed patches have been landed.  Closing bug.