Bug 134698 - Web Inspector: SearchResultTreeElement.representedObject is missing a saveIdentityToCookie implementation
Summary: Web Inspector: SearchResultTreeElement.representedObject is missing a saveIde...
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: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-07 15:30 PDT by Joseph Pecoraro
Modified: 2015-03-11 07:10 PDT (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (4.98 KB, patch)
2015-03-10 22:21 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 2014-07-07 15:30:52 PDT
Represented object types:

    console.assert(representedObject instanceof WebInspector.DOMSearchMatchObject || representedObject instanceof WebInspector.ResourceSearchMatchObject);

Seems like we should avoid having a saved cookie for search results.
Comment 1 Joseph Pecoraro 2014-07-07 15:31:43 PDT
Full console log was:
[Error] Error: TreeElement.representedObject is missing a saveIdentityToCookie implementation. TreeElement.constructor: function (representedObject) {
    console.assert(representedObject instanceof WebInspector.DOMSearchMatchObject || representedObject instanceof WebInspector.ResourceSearchMatchObject);

    var title = WebInspector.SearchResultTreeElement.truncateAndHighlightTitle(representedObject.title, representedObject.searchTerm, representedObject.sourceCodeTextRange);

    WebInspector.GeneralTreeElement.call(this, representedObject.className, title, null, representedObject, false);
    this.small = true;
}


Meaning it was WebInspector.SearchResultTreeElement represented object types listed in the above comment.
Comment 2 Radar WebKit Bug Importer 2014-07-07 15:31:52 PDT
<rdar://problem/17581638>
Comment 3 Radar WebKit Bug Importer 2014-07-07 15:32:02 PDT
<rdar://problem/17581640>
Comment 4 Joseph Pecoraro 2014-07-07 15:51:57 PDT
Test comment.
Comment 5 Joseph Pecoraro 2015-03-10 21:51:42 PDT
* STEPS TO REPRODUCE
1. Inspect <http://bogojoker.com>
2. Shift+Cmd+F for global search "div"
3. Select any result (text result or DOM result)
5. Cmd+R Reload
  => error and sidebar is empty, it hasn't re-triggered the search or cleared the search
Comment 6 Joseph Pecoraro 2015-03-10 21:56:35 PDT
Also, the backtrace is:

[Error] Error: TreeElement.representedObject is missing a saveIdentityToCookie implementation....
    saveStateToCookie (Main.js, line 4379)
    _updateCookieForInspectorViewState (Main.js, line 10938)
    _provisionalLoadStarted (Main.js, line 10853)
    dispatch (Main.js, line 67)
    dispatchEventToListeners (Main.js, line 69)
    startProvisionalLoad (Main.js, line 1947)
    _addResourceToFrame (Main.js, line 10293)
    _addNewResourceToFrame (Main.js, line 10288)
    resourceRequestWillBeSent (Main.js, line 10248)
    requestWillBeSent (Main.js, line 716)
    dispatchEvent (Main.js, line 605)
    _dispatchEvent (Main.js, line 583)
    dispatch (Main.js, line 556)
    dispatchNextQueuedMessageFromBackend (Main.js, line 707)
Comment 7 Joseph Pecoraro 2015-03-10 22:19:30 PDT
(In reply to comment #5)
> * STEPS TO REPRODUCE
> 1. Inspect <http://bogojoker.com>
> 2. Shift+Cmd+F for global search "div"
> 3. Select any result (text result or DOM result)
> 4. Cmd+R Reload
>   => error and sidebar is empty, it hasn't re-triggered the search or

Better steps here for testing is to replace step 4:

  4. Close Inspector
  5. Open Inspector
    => ensure same search tree item is selected.

Now, we still should fix the scenario above for search term, but that can be handled separately. I have a fix for saveIdentityToCookie here, testable with these steps.
Comment 8 Joseph Pecoraro 2015-03-10 22:21:15 PDT
Created attachment 248399 [details]
[PATCH] Proposed Fix
Comment 9 WebKit Commit Bot 2015-03-11 07:09:59 PDT
Comment on attachment 248399 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 248399

Committed r181386: <http://trac.webkit.org/changeset/181386>
Comment 10 WebKit Commit Bot 2015-03-11 07:10:05 PDT
All reviewed patches have been landed.  Closing bug.