Bug 195732

Summary: Web Inspector: REGRESSION: Canvas: the first processed action should be selected as soon as it's available if no previous selected action exists
Product: WebKit Reporter: Devin Rousso <drousso>
Component: Web InspectorAssignee: Devin Rousso <drousso>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, drousso, inspector-bugzilla-changes, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 173807, 175485    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Devin Rousso 2019-03-13 20:19:37 PDT
# STEPS TO REPRODUCE:
1. inspect any page with a <canvas>
2. take a multi-frame recording (or a single frame that is very very long)
3. stop the recording
4. wait for the recording content view to appear and the recording actions to start processing
 => no action is initially selected, which means that there is no preview in the main content area
Comment 1 Radar WebKit Bug Importer 2019-03-13 20:20:43 PDT
<rdar://problem/48875214>
Comment 2 Devin Rousso 2019-03-13 20:23:32 PDT
Created attachment 364619 [details]
Patch
Comment 3 Devin Rousso 2019-03-13 20:25:18 PDT
Created attachment 364620 [details]
Patch
Comment 4 Matt Baker 2019-03-14 11:43:11 PDT
Comment on attachment 364620 [details]
Patch

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

r=me

> Source/WebInspectorUI/ChangeLog:11
> +        Rather than wait till the entire recording is ready, set the selected action as soon as the

s/till/until

> Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js:581
> +            this.action = action;

So `action` here is equivalent to this._recording.actions[0], if the recording were ready?
Comment 5 Devin Rousso 2019-03-14 13:17:58 PDT
Comment on attachment 364620 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js:581
>> +            this.action = action;
> 
> So `action` here is equivalent to this._recording.actions[0], if the recording were ready?

Yes, but not if the recording is ready.  This event listener is only fired when processing actions, so this check is basically saying "when we process an action, if we haven't set a selected action yet, use this action".  Although it's effectively impossible (unless some funky stuff happens, or this is changed in the future) for this if to be hit by anything other than the first action, I'll change it to `this._recording.actions[0]` just in case.
Comment 6 Devin Rousso 2019-03-14 13:21:10 PDT
Created attachment 364679 [details]
Patch
Comment 7 WebKit Commit Bot 2019-03-14 13:48:44 PDT
Comment on attachment 364679 [details]
Patch

Clearing flags on attachment: 364679

Committed r242962: <https://trac.webkit.org/changeset/242962>
Comment 8 WebKit Commit Bot 2019-03-14 13:48:45 PDT
All reviewed patches have been landed.  Closing bug.