WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
121382
Web Inspector: TypeError when updating ResourceTreeElement created in strange order
https://bugs.webkit.org/show_bug.cgi?id=121382
Summary
Web Inspector: TypeError when updating ResourceTreeElement created in strange...
Brian Burg
Reported
2013-09-15 03:17:29 PDT
Created
attachment 211698
[details]
trivial fix for missing instanceof check Repro: Go to any web page with the inspector open. Then, navigate to
http://www.pixastic.com/labs/digg_attack/
. The inspector will encounter a TypeError. [Error] TypeError: undefined is not a function (evaluating 'this.updateStatusForMainFrame()') _updateStatus (ResourceTreeElement.js, line 188) dispatch (Object.js, line 180) dispatchEventToListeners (Object.js, line 187) markAsFinished (Resource.js, line 593) resourceRequestDidFinishLoading (FrameResourceManager.js, line 320) loadingFinished (NetworkObserver.js, line 58) dispatch (InspectorBackend.js, line 262) dispatchNextQueuedMessageFromBackend (Main.js, line 298) (anonymous function) Analysis: It appears this happens only on navigating to this page, not on reloading it. When reloaded, a ResourceTreeElement for the main frame resource is created (triggered by adding breakpoints, IIRC), then a FrameTreeElement for the main frame resource is created later. In the navigation case, the instantiation order is reversed for some reason; since the main frame is already established by this later time, the guard inside ResourceTreeElement._updateStatus succeeds despite the constructor being incorrect. Fix: I was able to avoid this error by adding an instanceof check to the guard. A trivial patch (with some previously missed code cleanup) is attached; I'm busy this weekend and won't have time to update my integration checkout, rebase, make changelog, etc until later this week. Feel free to commit it, or not.
Attachments
trivial fix for missing instanceof check
(2.36 KB, patch)
2013-09-15 03:17 PDT
,
Brian Burg
no flags
Details
Formatted Diff
Diff
[PATCH] Brian's fix with ChangeLog
(2.67 KB, patch)
2013-09-16 11:41 PDT
,
Joseph Pecoraro
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2013-09-15 03:17:42 PDT
<
rdar://problem/14994748
>
Timothy Hatcher
Comment 2
2013-09-15 11:48:41 PDT
Looks like stuff Joe was working on recently for the download button.
Joseph Pecoraro
Comment 3
2013-09-16 11:13:57 PDT
Patch looks good. I'm going to try to reproduce, confirm the patch works, and get it reviewed. Thanks for finding this!
Joseph Pecoraro
Comment 4
2013-09-16 11:38:29 PDT
(In reply to
comment #3
)
> Patch looks good. I'm going to try to reproduce, confirm the patch works, and get it reviewed. Thanks for finding this!
I wasn't able to reproduce the original uncaught exception. But the patch is good regardless.
Joseph Pecoraro
Comment 5
2013-09-16 11:41:26 PDT
Created
attachment 211811
[details]
[PATCH] Brian's fix with ChangeLog
Darin Adler
Comment 6
2013-09-16 11:57:38 PDT
Comment on
attachment 211811
[details]
[PATCH] Brian's fix with ChangeLog View in context:
https://bugs.webkit.org/attachment.cgi?id=211811&action=review
> Source/WebInspectorUI/UserInterface/ResourceTreeElement.js:-175 > - _updateStatusWithMainFrameButtons: function() > - { > - if (this._reloadButton) { > - this.status = this._reloadButton; > - return; > - } > - > - if (!this._loadingMainFrameButtons) { > - this._loadingMainFrameButtons = true; > - var tooltip = WebInspector.UIString("Reload page (%s)\nReload ignoring cache (%s)").format(WebInspector._reloadPageKeyboardShortcut.displayName, WebInspector._reloadPageIgnoringCacheKeyboardShortcut.displayName); > - wrappedSVGDocument("Images/Reload.svg", "reload-button", tooltip, function(svgDocument) { > - this._reloadButton = svgDocument; > - this._reloadButton.addEventListener("click", this._reloadPageClicked); > - this.status = this._reloadButton; > - delete this._loadingMainFrameButtons; > - }.bind(this)); > - } > - },
Change log doesn’t mentioned this deletion.
Joseph Pecoraro
Comment 7
2013-09-16 12:02:58 PDT
(In reply to
comment #6
)
> (From update of
attachment 211811
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=211811&action=review
> > > Source/WebInspectorUI/UserInterface/ResourceTreeElement.js:-175 > > - _updateStatusWithMainFrameButtons: function() > > - { > > - if (this._reloadButton) { > > - this.status = this._reloadButton; > > - return; > > - } > > - > > - if (!this._loadingMainFrameButtons) { > > - this._loadingMainFrameButtons = true; > > - var tooltip = WebInspector.UIString("Reload page (%s)\nReload ignoring cache (%s)").format(WebInspector._reloadPageKeyboardShortcut.displayName, WebInspector._reloadPageIgnoringCacheKeyboardShortcut.displayName); > > - wrappedSVGDocument("Images/Reload.svg", "reload-button", tooltip, function(svgDocument) { > > - this._reloadButton = svgDocument; > > - this._reloadButton.addEventListener("click", this._reloadPageClicked); > > - this.status = this._reloadButton; > > - delete this._loadingMainFrameButtons; > > - }.bind(this)); > > - } > > - }, > > Change log doesn’t mentioned this deletion.
I guess that is a prepare-ChangeLog issue. This function is unused code that should have been removed when we switched to "updateStatusForMainFrame".
Timothy Hatcher
Comment 8
2013-09-16 12:59:44 PDT
Comment on
attachment 211811
[details]
[PATCH] Brian's fix with ChangeLog View in context:
https://bugs.webkit.org/attachment.cgi?id=211811&action=review
>>> Source/WebInspectorUI/UserInterface/ResourceTreeElement.js:-175 >>> - }, >> >> Change log doesn’t mentioned this deletion. > > I guess that is a prepare-ChangeLog issue. This function is unused code that should have been removed when we switched to "updateStatusForMainFrame".
prepare-ChangeLog has never called out removed functions. That is something you need to manual do.
WebKit Commit Bot
Comment 9
2013-09-16 13:23:11 PDT
Comment on
attachment 211811
[details]
[PATCH] Brian's fix with ChangeLog Clearing flags on attachment: 211811 Committed
r155896
: <
http://trac.webkit.org/changeset/155896
>
WebKit Commit Bot
Comment 10
2013-09-16 13:23:13 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug