Bug 194687

Summary: Web Inspector: Canvas: recordings with a single frame sometimes missing TreeElement
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=194721
Bug Depends on:    
Bug Blocks: 175485    
Attachments:
Description Flags
Patch none

Description Devin Rousso 2019-02-14 18:24:30 PST
# STEPS TO REPRODUCE:
1. inspect <https://devinrousso.com/demo/WebKit/canvas.html>
2. open the Canvas tab
3. start a single-frame recording of the 2D canvas
4. click the button with "8"
5. once the recording loads, select the "Frame 1" tree element
6. start a single-frame recording of the 2D canvas
7. click the button with "9"
 => there is no "Frame 1" tree element, even though the visual action scrubber says there are at least 2 visual actions
Comment 1 Devin Rousso 2019-02-14 18:29:11 PST
AFAICT, it looks like the issue has to do with `Object.prototype.soon`.  Here's the stream of calls:

1. `appendChild` for "Initial State"
2. `soon` `updateVirtualizedElements` for the recording actions `TreeOutline`
3. the timeout from (2) fires, which actually adds the `TreeElement` from (1) to the DOM
4. `appendChild` for "Frame 1"
5. `soon` `updateVirtualizedElements` for the recording actions `TreeOutline`
 => the timeout from (5) never seems to fire
Comment 2 Devin Rousso 2019-02-14 18:41:02 PST
(In reply to Devin Rousso from comment #0)
> 5. once the recording loads, select the "Frame 1" tree element
Interestingly, the issue only reproduces when any `TreeElement` other than the first one is selected.  Additionally, the first recording (3) can be multi-frame, but the second recording (6) has to be single-frame.
Comment 3 Devin Rousso 2019-02-14 19:24:19 PST
Created attachment 362092 [details]
Patch
Comment 4 Joseph Pecoraro 2019-02-21 11:30:44 PST
Comment on attachment 362092 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2019-02-21 11:59:06 PST
Comment on attachment 362092 [details]
Patch

Clearing flags on attachment: 362092

Committed r241875: <https://trac.webkit.org/changeset/241875>
Comment 6 WebKit Commit Bot 2019-02-21 11:59:08 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-02-21 14:11:25 PST
<rdar://problem/48289926>