Bug 143813 - Web Inspector: Give DOM Nodes a Context Menu to Log Element to the console
Summary: Web Inspector: Give DOM Nodes a Context Menu to Log Element to the console
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-04-15 21:12 PDT by Joseph Pecoraro
Modified: 2015-04-16 12:50 PDT (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (6.81 KB, patch)
2015-04-15 21:14 PDT, Joseph Pecoraro
burg: review+
burg: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-04-15 21:12:25 PDT
* SUMMARY
Give DOM Nodes a Context Menu to Log Element to the console.

Anywhere we show a DOMTreeOutline we should be able to log to the console. This will give a $n value, so the $1-$9 case is conveniently replaceable by this.
Comment 1 Radar WebKit Bug Importer 2015-04-15 21:12:46 PDT
<rdar://problem/20565622>
Comment 2 Joseph Pecoraro 2015-04-15 21:14:55 PDT
Created attachment 250895 [details]
[PATCH] Proposed Fix
Comment 3 Brian Burg 2015-04-16 08:05:18 PDT
Comment on attachment 250895 [details]
[PATCH] Proposed Fix

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

r=me

Nice! Great to see a simple added use case to the console API. This change will be helpful reference.

> Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js:59
> +    this._domTreeOutline = new WebInspector.DOMTreeOutline(true, true, true);

In a separate patch, we should convert these boolean arguments into setters. There's no reason they need to be constructor arguments.
Comment 4 Timothy Hatcher 2015-04-16 10:13:59 PDT
Comment on attachment 250895 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js:496
> +                var text = WebInspector.UIString("Selected Element");

The more we do this the more I think the text needs a special formatting. Italics? Tokenized?
Comment 5 Joseph Pecoraro 2015-04-16 12:50:51 PDT
http://trac.webkit.org/changeset/182902