Bug 194687 - Web Inspector: Canvas: recordings with a single frame sometimes missing TreeElement
Summary: Web Inspector: Canvas: recordings with a single frame sometimes missing TreeE...
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:
Blocks: WebInspectorCanvasTab
  Show dependency treegraph
 
Reported: 2019-02-14 18:24 PST by Devin Rousso
Modified: 2019-02-21 14:11 PST (History)
5 users (show)

See Also:


Attachments
Patch (3.81 KB, patch)
2019-02-14 19:24 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 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>