Bug 183015 - Web Inspector: Canvas tab: ensure that the Recording TreeOutline has a specified height for virtualization
Summary: Web Inspector: Canvas tab: ensure that the Recording TreeOutline has a specif...
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: Devin Rousso
URL:
Keywords: InRadar
Depends on: 174968 182667
Blocks: WebInspectorCanvasTab
  Show dependency treegraph
 
Reported: 2018-02-21 13:20 PST by Devin Rousso
Modified: 2018-03-07 15:09 PST (History)
4 users (show)

See Also:


Attachments
Patch (6.60 KB, patch)
2018-02-21 13:25 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (4.99 KB, patch)
2018-03-07 13:04 PST, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2018-02-21 13:20:06 PST
The Recording TreeOutline was added to its own container, but that container's height was never constrained, meaning that it's height is the full height of all the TreeElement children.  Since TreeOutline uses `offsetHeight` to determine how many elements to show, the virtualization logic of TreeOutline then proceeds to add everything back to the DOM since it thinks it has room.
Comment 1 Devin Rousso 2018-02-21 13:25:23 PST
Created attachment 334409 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2018-02-21 13:26:13 PST
<rdar://problem/37758441>
Comment 3 Matt Baker 2018-03-07 12:42:04 PST
Comment on attachment 334409 [details]
Patch

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

r-, because it looks like this breaks the recording tree outline:

1. Goto https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations
2. Record frames from "a looping panorama" demo
3. Open recording, expand first frame
  => No child elements

> Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:716
> +        if (!isNaN(this._virtualizedPreviousFirstItem) && Math.abs(firstItem - this._virtualizedPreviousFirstItem) < numberVisible)

Why is this needed? The bug title/summary gives the impression that the problem is with how TreeOutline is used in the CanvasSidebarPanel, not with TreeOutline itself. Please add a clarifying comment to the change log.
Comment 4 Devin Rousso 2018-03-07 13:04:12 PST
Comment on attachment 334409 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:716
>> +        if (!isNaN(this._virtualizedPreviousFirstItem) && Math.abs(firstItem - this._virtualizedPreviousFirstItem) < numberVisible)
> 
> Why is this needed? The bug title/summary gives the impression that the problem is with how TreeOutline is used in the CanvasSidebarPanel, not with TreeOutline itself. Please add a clarifying comment to the change log.

This is what caused the breakage.  I was trying to optimize the virtualization functionality, but I see that it needs some tweaking.  :P
Comment 5 Devin Rousso 2018-03-07 13:04:57 PST
Created attachment 335208 [details]
Patch
Comment 6 Matt Baker 2018-03-07 14:39:19 PST
Comment on attachment 335208 [details]
Patch

r=me
Comment 7 WebKit Commit Bot 2018-03-07 15:09:05 PST
Comment on attachment 335208 [details]
Patch

Clearing flags on attachment: 335208

Committed r229377: <https://trac.webkit.org/changeset/229377>
Comment 8 WebKit Commit Bot 2018-03-07 15:09:07 PST
All reviewed patches have been landed.  Closing bug.