Bug 162642 - Web Inspector: TimelineDataGridNode assertions when refreshing page
Summary: Web Inspector: TimelineDataGridNode assertions when refreshing page
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-09-27 16:07 PDT by Matt Baker
Modified: 2016-11-18 14:04 PST (History)
7 users (show)

See Also:


Attachments
Patch (11.03 KB, patch)
2016-10-01 16:20 PDT, Matt Baker
no flags Details | Formatted Diff | Diff
Patch for landing (11.21 KB, patch)
2016-11-18 13:28 PST, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2016-09-27 16:07:29 PDT
Summary:
TimelineDataGridNode assertions when refreshing page.

NetworkSidebarPanel is marking NetworkGridContentView visible when the network timeline resets. Once marked visible, the view will try to create data grid nodes for incoming timeline records, causing layouts and causing a flood of assertions.

Note:
ElementsTabContentView also attempts to show a DOM tree content view when the main frame navigates.

Steps to Reproduce:
1. Open Inspector
2. Make active tab something other than Network
3. Reload inspected page
  => Inspector² shows hundreds of asserts:
[Error] Assertion Failed
	refreshGraph (TimelineDataGridNode.js:230)
	refreshGraph

and:
[Error] Assertion Failed
	refresh (TimelineRecordBar.js:238)
	createBar (TimelineDataGridNode.js:243)
	createBar
	createCombinedBars (TimelineRecordBar.js:87)
	refreshGraph (TimelineDataGridNode.js:284)
	refreshGraph
Comment 1 Radar WebKit Bug Importer 2016-09-27 16:07:56 PDT
<rdar://problem/28505898>
Comment 2 Matt Baker 2016-10-01 16:20:33 PDT
Created attachment 290447 [details]
Patch
Comment 3 Timothy Hatcher 2016-10-05 10:38:59 PDT
Comment on attachment 290447 [details]
Patch

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

> Source/WebInspectorUI/ChangeLog:15
> +        * UserInterface/Views/ElementsTabContentView.js:
> +        (WebInspector.ElementsTabContentView):
> +        (WebInspector.ElementsTabContentView.prototype.shown):
> +        Drive-by fix: defer showing the DOM content view until the tab is shown.

I worry this might have some side effects. The view might need to be created eagerly to get event listeners set up early. Can you look into this more or split it out for further consideration?

> Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js:145
> +        this._dataGrid.updateLayout(WebInspector.View.LayoutReason.Resize);

Is this needed because the DataGrid isn't added as a subview?
Comment 4 Matt Baker 2016-11-18 12:14:45 PST
Comment on attachment 290447 [details]
Patch

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

>> Source/WebInspectorUI/ChangeLog:15
>> +        Drive-by fix: defer showing the DOM content view until the tab is shown.
> 
> I worry this might have some side effects. The view might need to be created eagerly to get event listeners set up early. Can you look into this more or split it out for further consideration?

FrameDOMTreeContentView will be lazily created, and so will its DOMTree.Event.RootDOMNodeInvalidated listener. This is fine because the handler for the listener just requests a new DOM root node, which is always done when the content view is constructed anyway.

>> Source/WebInspectorUI/UserInterface/Views/NetworkGridContentView.js:145
>> +        this._dataGrid.updateLayout(WebInspector.View.LayoutReason.Resize);
> 
> Is this needed because the DataGrid isn't added as a subview?

The grid is added as a subview, this is needed because View doesn't have a shown/hidden concept.
Comment 5 Matt Baker 2016-11-18 13:28:00 PST
Created attachment 295184 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2016-11-18 14:04:16 PST
Comment on attachment 295184 [details]
Patch for landing

Clearing flags on attachment: 295184

Committed r208895: <http://trac.webkit.org/changeset/208895>
Comment 7 WebKit Commit Bot 2016-11-18 14:04:19 PST
All reviewed patches have been landed.  Closing bug.