Bug 126018

Summary: Web Inspector: Uncaught Exception: NavigationSidebarPanel.js: ERROR: TypeError: undefined is not a function (evaluating 'representedObject.saveIdentityToCookie(candidateObjectCookie)')
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: burg, commit-queue, eflews.bot, graouts, gyuyoung.kim, joepeck, timothy, webkit-bug-importer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
eflews.bot: commit-queue-
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2013-12-19 14:14:06 PST
SUMMARY:
file:///Volumes/Data/Build/Debug/WebInspectorUI.framework/Resources/NavigationSidebarPanel.js:582:51:JS ERROR: TypeError: undefined is not a function (evaluating 'representedObject.saveIdentityToCookie(candidateObjectCookie)')

STEPS TO REPRODUCE:
1. Open Inspector for <http://bogojoker.com>
2. Inspect the Inspector (I typically do by the Resources Sidebar)
  => Exception in console, inspector² is broken
Comment 1 Joseph Pecoraro 2013-12-19 14:19:28 PST
Seems like the issue crops up when the item I have selected in the Resources Navigation sidebar is a FolderTreeElement, like "Scripts".
Comment 2 Joseph Pecoraro 2013-12-19 14:23:08 PST
Yes.

All new WebInspector.FolderTreeElement's are passed a representedObject of null or undefined. Eventually in TreeElement, that becomes just an empty object:

    this.representedObject = (representedObject || {});

Which is what I'm seeing here.
Comment 3 Joseph Pecoraro 2013-12-19 14:53:10 PST
Created attachment 219685 [details]
[PATCH] Proposed Fix
Comment 4 EFL EWS Bot 2013-12-19 16:56:39 PST
Comment on attachment 219685 [details]
[PATCH] Proposed Fix

Attachment 219685 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/50568041
Comment 5 Joseph Pecoraro 2013-12-19 17:01:31 PST
Created attachment 219706 [details]
[PATCH] Proposed Fix

On IRC the feedback was we should still be resilient against a missing representedObject.saveIdentityToCookie. So I added the if check, and console.error warn if it didn't exist.
Comment 6 WebKit Commit Bot 2013-12-19 17:56:56 PST
Comment on attachment 219706 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 219706

Committed r160888: <http://trac.webkit.org/changeset/160888>
Comment 7 WebKit Commit Bot 2013-12-19 17:56:58 PST
All reviewed patches have been landed.  Closing bug.