Bug 129857

Summary: Web Inspector: JSContext inspection - TypeError: null is not an object (evaluating 'contentView.showSourceCode')
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
timothy: review+, joepeck: commit-queue-
[PATCH] Simpler Solution
none
[PATCH] Rebaselined none

Description Joseph Pecoraro 2014-03-06 18:13:44 PST
There is no "MainFrame" when inspecting a JSContext.

[Error] TypeError: null is not an object (evaluating 'contentView.showSourceCode')
	showMainFrameSourceCode (ResourceSidebarPanel.js, line 123)
	showDefaultContentView (DebuggerSidebarPanel.js, line 134)
	_revealAndSelectRepresentedObjectInNavigationSidebar (Main.js, line 911)
	_updateNavigationSidebarForCurrentContentView (Main.js, line 940)
	_navigationSidebarPanelSelected (Main.js, line 949)
	dispatch (Object.js, line 180)
	dispatchEventToListeners (Object.js, line 187)
	selectedSidebarPanel (Sidebar.js, line 153)
	show (SidebarPanel.js, line 96)
	show (NavigationSidebarPanel.js, line 397)
	_debuggerDidPause (Main.js, line 748)
	dispatch (Object.js, line 180)
	dispatchEventToListeners (Object.js, line 187)
	debuggerDidPause (DebuggerManager.js, line 378)
	paused (DebuggerObserver.js, line 58)
	dispatch (InspectorBackend.js, line 256)
	dispatchNextQueuedMessageFromBackend (MessageDispatcher.js, line 31)
	(anonymous function) ([native code], line 0)
Comment 1 Joseph Pecoraro 2014-03-06 19:01:17 PST
Created attachment 226074 [details]
[PATCH] Proposed Fix

I'm open to better ideas. This seemed to work okay.
Comment 2 Joseph Pecoraro 2014-03-06 19:52:48 PST
Comment on attachment 226074 [details]
[PATCH] Proposed Fix

Hmmm, no I think this might break split console toggling.
Comment 3 Timothy Hatcher 2014-03-12 11:23:13 PDT
Comment on attachment 226074 [details]
[PATCH] Proposed Fix

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

I think this is fine. Only concern I have is the use of this.parentSidebar.selectedSidebarPanel.show().

> Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:112
> +            this.parentSidebar.selectedSidebarPanel.show();

I am not sure this is right. Why do we need to force the sidebar to show? A comment would be good about why it is forced to show and why this uses this.parentSidebar.selectedSidebarPanel.

> Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:117
> +        this.parentSidebar.selectedSidebarPanel.show();

Ditto.
Comment 4 Joseph Pecoraro 2014-04-04 16:22:18 PDT
This patch still hasn't landed yet. I still don't like the patch, let me investigate some more.
Comment 5 Radar WebKit Bug Importer 2014-04-04 16:23:32 PDT
<rdar://problem/16530662>
Comment 6 Joseph Pecoraro 2014-04-04 18:44:21 PDT
Created attachment 228642 [details]
[PATCH] Simpler Solution
Comment 7 Joseph Pecoraro 2014-04-04 18:53:20 PDT
Created attachment 228644 [details]
[PATCH] Rebaselined
Comment 8 WebKit Commit Bot 2014-04-04 20:52:31 PDT
Comment on attachment 228644 [details]
[PATCH] Rebaselined

Clearing flags on attachment: 228644

Committed r166824: <http://trac.webkit.org/changeset/166824>
Comment 9 WebKit Commit Bot 2014-04-04 20:52:34 PDT
All reviewed patches have been landed.  Closing bug.