Bug 143845 - Web Inspector: Should include "Log Value" context menu item in Preview and Collapsed ObjectTree
Summary: Web Inspector: Should include "Log Value" context menu item in Preview and Co...
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-16 14:14 PDT by Joseph Pecoraro
Modified: 2015-04-20 14:24 PDT (History)
7 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (6.86 KB, patch)
2015-04-16 16:28 PDT, Joseph Pecoraro
timothy: review+
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-16 14:14:23 PDT
* SUMMARY
Should include "Log Value" context menu item in Preview and Collapsed ObjectTree.

For instance, if I console.log("onclick", event) and I see an event I am interested in, I want to just be able to right click it and "Log Value" to get a $n reference to poke around the object. Currently "Log Value" only happens for the properties inside the expanded event.
Comment 1 Radar WebKit Bug Importer 2015-04-16 14:14:49 PDT
<rdar://problem/20576655>
Comment 2 Joseph Pecoraro 2015-04-16 16:28:30 PDT
Created attachment 250975 [details]
[PATCH] Proposed Fix

NOTE: The previews inside of ObjectTreePropertyTreeElement don't get originating information because the TreeElement already handles context menus.
Comment 3 Timothy Hatcher 2015-04-16 16:34:23 PDT
Comment on attachment 250975 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js:57
> +            this._previewView.setOriginatingObjectInfo(this._object, providedPropertyPath ? propertyPath : null);

Is providedPropertyPath just to avoid maybe passing a non-WebInspector.PropertyPath? The assert at the top should be enough.

Why not this._propertyPath?
Comment 4 Joseph Pecoraro 2015-04-16 17:45:37 PDT
(In reply to comment #3)
> Comment on attachment 250975 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=250975&action=review
> 
> > Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js:57
> > +            this._previewView.setOriginatingObjectInfo(this._object, providedPropertyPath ? propertyPath : null);
> 
> Is providedPropertyPath just to avoid maybe passing a
> non-WebInspector.PropertyPath? The assert at the top should be enough.
> 
> Why not this._propertyPath?

If a property path was not provided, we provide a default root path of "this" and in that case I do not want to pass the property path along, because it won't be accurate. Only in the case where the ObjectTree was initialized with a property path will I pass it on. I could have written "var providedPropertyPath = !!propertyPath;" but chose the more explicit route.
Comment 5 Joseph Pecoraro 2015-04-16 17:46:51 PDT
Comment on attachment 250975 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js:254
> +
> +        contextMenu.appendSeparator();

I have a feeling this separator is not actually needed and can be removed. I'll test.
Comment 6 Joseph Pecoraro 2015-04-16 18:01:43 PDT
http://trac.webkit.org/changeset/182933