WebKit Bugzilla
Attachment 340366 Details for
Bug 182950
: Web Inspector: Canvas tab: don't automatically select a recording when viewing a canvas
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-182950-20180514151604.patch (text/plain), 6.08 KB, created by
Devin Rousso
on 2018-05-14 15:16:05 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-05-14 15:16:05 PDT
Size:
6.08 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 6efefec3acced54adfdd34da75fe4ce9cf81e02d..7d35625c1b986fb2927acbae4aefe259d8d088c9 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,22 @@ >+2018-05-14 Devin Rousso <webkit@devinrousso.com> >+ >+ Web Inspector: Canvas tab: don't automatically select a recording when viewing a canvas >+ https://bugs.webkit.org/show_bug.cgi?id=182950 >+ >+ Reviewed by Matt Baker. >+ >+ * UserInterface/Views/CanvasSidebarPanel.js: >+ (WI.CanvasSidebarPanel): >+ (WI.CanvasSidebarPanel.prototype._currentRepresentedObjectsDidChange): >+ (WI.CanvasSidebarPanel.prototype._treeOutlineSelectionDidChange): >+ (WI.CanvasSidebarPanel.prototype._canvasChanged): >+ (WI.CanvasSidebarPanel.prototype._recordingChanged): >+ (WI.CanvasSidebarPanel.prototype._updateRecordingScopeBar): >+ Add a "dummy" ScopeBarItem to the recording ScopeBar that is selected whenever a TreeElement >+ that doesn't correspond to a Recording is selected. This way, the Recording ScopeBar will >+ become deselected, and the list of actions will disappear. Clicking on the Recording ScopeBar >+ will show the previously selected Recording. >+ > 2018-05-08 Matt Baker <mattbaker@apple.com> > > Web Inspector: Console drawer resizing is broken when console prompt has >1 line of code >diff --git a/Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js b/Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js >index f2398868d974a19610494ee7d954a4bed4c716bc..75c30b5320eec0e3d47e7a03f9c427e1dcc143ea 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js >+++ b/Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js >@@ -34,6 +34,7 @@ WI.CanvasSidebarPanel = class CanvasSidebarPanel extends WI.NavigationSidebarPan > > this._navigationBar = new WI.NavigationBar; > this._scopeBar = null; >+ this._placeholderScopeBarItem = null; > > const toolTip = WI.UIString("Start recording canvas actions.\nShift-click to record a single frame."); > const altToolTip = WI.UIString("Stop recording canvas actions"); >@@ -259,9 +260,8 @@ WI.CanvasSidebarPanel = class CanvasSidebarPanel extends WI.NavigationSidebarPan > > let recording = objects.find((object) => object instanceof WI.Recording); > if (recording) { >- this.canvas = recording.source; >+ recording[WI.CanvasSidebarPanel.SelectedActionSymbol] = objects.find((object) => object instanceof WI.RecordingAction); > this.recording = recording; >- this.action = objects.find((object) => object instanceof WI.RecordingAction); > return; > } > >@@ -276,6 +276,9 @@ WI.CanvasSidebarPanel = class CanvasSidebarPanel extends WI.NavigationSidebarPan > return; > > if ((treeElement instanceof WI.CanvasTreeElement) || (treeElement instanceof WI.ShaderProgramTreeElement)) { >+ if (this._placeholderScopeBarItem) >+ this._placeholderScopeBarItem.selected = true; >+ > this.showDefaultContentViewForTreeElement(treeElement); > return; > } >@@ -316,17 +319,12 @@ WI.CanvasSidebarPanel = class CanvasSidebarPanel extends WI.NavigationSidebarPan > if (WI.Canvas.ContextType.Canvas2D || this._canvas.contextType === WI.Canvas.ContextType.WebGL) > this._recordButtonNavigationItem.enabled = true; > >- let defaultSelectedRecording = null; >- if (this._canvas.recordingCollection.size) >- defaultSelectedRecording = Array.from(this._canvas.recordingCollection).lastValue; >- >- this.recording = defaultSelectedRecording; >+ this.recording = null; > } > > _recordingChanged() > { > this._recordingTreeOutline.removeChildren(); >- this.element.classList.toggle("has-recordings", !!this._recording); > > if (!this._recording) > return; >@@ -405,12 +403,17 @@ WI.CanvasSidebarPanel = class CanvasSidebarPanel extends WI.NavigationSidebarPan > _updateRecordingScopeBar() > { > if (this._scopeBar) { >+ this._placeholderScopeBarItem = null; >+ > this._recordingNavigationBar.removeNavigationItem(this._scopeBar); > this._scopeBar = null; > } > >- this._recordingNavigationBar.element.classList.toggle("hidden", !this._canvas || !this._recording); >- if (!this._recording || !this._canvas) >+ this._recordingNavigationBar.element.classList.toggle("hidden", !this._canvas); >+ >+ let hasRecordings = this._canvas && this._canvas.recordingCollection.size; >+ this.element.classList.toggle("has-recordings", hasRecordings); >+ if (!hasRecordings) > return; > > let scopeBarItems = []; >@@ -419,13 +422,24 @@ WI.CanvasSidebarPanel = class CanvasSidebarPanel extends WI.NavigationSidebarPan > let scopeBarItem = new WI.ScopeBarItem(recording.displayName, recording.displayName); > if (recording === this._recording) > selectedScopeBarItem = scopeBarItem; >+ else >+ scopeBarItem.selected = false; > scopeBarItem.__recording = recording; > scopeBarItems.push(scopeBarItem); > } > >- if (!selectedScopeBarItem) >+ if (!selectedScopeBarItem) { > selectedScopeBarItem = scopeBarItems[0]; > >+ const exclusive = true; >+ const className = null; >+ const hidden = true; >+ this._placeholderScopeBarItem = new WI.ScopeBarItem("canvas-recording-scope-bar-item-placeholder", WI.UIString("Recordings"), exclusive, className, hidden); >+ this._placeholderScopeBarItem.selected = true; >+ >+ scopeBarItems.unshift(this._placeholderScopeBarItem); >+ } >+ > this._scopeBar = new WI.ScopeBar("canvas-recordinga-scope-bar", scopeBarItems, selectedScopeBarItem, true); > this._scopeBar.addEventListener(WI.ScopeBar.Event.SelectionChanged, this._scopeBarSelectionChanged, this); > this._recordingNavigationBar.insertNavigationItem(this._scopeBar, 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 182950
:
334215
|
334216
| 340366