Skip to content

Commit 2a2a0ee

Browse files
committed
Web Inspector: drop shown/hidden in favor of attached/detached
https://bugs.webkit.org/show_bug.cgi?id=218678 Reviewed by Brian Burg. * UserInterface/Views/View.js: (WI.View.prototype.removeSubview): Ensure that `detached` is called before the node is removed from the DOM so that any state currently held in the DOM can be recorded (e.g. scroll position). * UserInterface/Views/ContentBrowserTabContentView.js: (WI.ContentBrowserTabContentView.prototype.attached): (WI.ContentBrowserTabContentView.prototype.showNavigationSidebarPanel): (WI.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels): (WI.ContentBrowserTabContentView.prototype._navigationSidebarCollapsedStateDidChange): (WI.ContentBrowserTabContentView.prototype._detailsSidebarCollapsedStateDidChange): (WI.ContentBrowserTabContentView.prototype._detailsSidebarPanelSelected): (WI.ContentBrowserTabContentView.prototype.shown): Deleted. (WI.ContentBrowserTabContentView.prototype.hidden): Deleted. * UserInterface/Views/SingleSidebar.js: (WI.SingleSidebar.prototype.willSetSelectedSidebarPanel): (WI.SingleSidebar.prototype.didSetSelectedSidebarPanel): (WI.SingleSidebar.prototype.didSetCollapsed): Ensure that any state modifications happen before adding/removing the selected sidebar panel to/from the DOM so that it (and the previously selected sidebar panel) doesn't re-`layout` multiple times. * UserInterface/Views/ConsoleDrawer.js: (WI.ConsoleDrawer.prototype.set collapsed): (WI.ConsoleDrawer.prototype.attached): Added. (WI.ConsoleDrawer.prototype.shown): Deleted. Add special logic in `collapsed` since this is never removed from the DOM. * UserInterface/Views/ConsoleTabContentView.js: (WI.ConsoleTabContentView): (WI.ConsoleTabContentView.prototype.attached): Added. (WI.ConsoleTabContentView.prototype.detached): Added. (WI.ConsoleTabContentView.prototype.shown): Deleted. Remember whether the split console was expanded before the Console Tab is shown and restore that state after the Console Tab is hidden. * UserInterface/Views/TimelineOverview.js: (WI.TimelineOverview.prototype.get height): (WI.TimelineOverview.prototype.attached): (WI.TimelineOverview.prototype.detached): (WI.TimelineOverview.prototype.recordWasFiltered): (WI.TimelineOverview.prototype.selectRecord): (WI.TimelineOverview.prototype.updateLayoutIfNeeded): (WI.TimelineOverview.prototype.layout): (WI.TimelineOverview.prototype._instrumentAdded): (WI.TimelineOverview.prototype._timelineRulerMouseClicked): (WI.TimelineOverview.prototype._viewModeDidChange): (WI.TimelineOverview.prototype.get visible): Deleted. (WI.TimelineOverview.prototype.shown): Deleted. (WI.TimelineOverview.prototype.hidden): Deleted. * UserInterface/Views/TimelineOverviewGraph.js: (WI.TimelineOverviewGraph): (WI.TimelineOverviewGraph.prototype.get hidden): (WI.TimelineOverviewGraph.prototype.set hidden): (WI.TimelineOverviewGraph.prototype.needsLayout): (WI.TimelineOverviewGraph.prototype.get visible): Deleted. (WI.TimelineOverviewGraph.prototype.shown): Deleted. (WI.TimelineOverviewGraph.prototype.hidden): Deleted. * UserInterface/Views/CPUTimelineOverviewGraph.js: (WI.CPUTimelineOverviewGraph.prototype.layout): * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js: (WI.HeapAllocationsTimelineOverviewGraph.prototype.layout): * UserInterface/Views/LayoutTimelineOverviewGraph.js: (WI.LayoutTimelineOverviewGraph.prototype.layout): * UserInterface/Views/MediaTimelineOverviewGraph.js: (WI.MediaTimelineOverviewGraph.prototype.layout): * UserInterface/Views/MemoryTimelineOverviewGraph.js: (WI.MemoryTimelineOverviewGraph.prototype.layout): * UserInterface/Views/NetworkTimelineOverviewGraph.js: (WI.NetworkTimelineOverviewGraph.prototype.layout): * UserInterface/Views/RenderingFrameTimelineOverviewGraph.js: (WI.RenderingFrameTimelineOverviewGraph.prototype.layout): * UserInterface/Views/ScriptTimelineOverviewGraph.js: (WI.ScriptTimelineOverviewGraph.prototype.layout): * UserInterface/Views/TimelineView.js: (WI.TimelineView.prototype.needsLayout): Deleted. Add a special `hidden` instead of the previously inherited `visible` so that the existing logic for editing timeline instruments stays (mostly) the same. * UserInterface/Views/ApplicationCacheFrameContentView.js: (WI.ApplicationCacheFrameContentView): (WI.ApplicationCacheFrameContentView.prototype.attached): (WI.ApplicationCacheFrameContentView.prototype.detached): (WI.ApplicationCacheFrameContentView.prototype.layout): (WI.ApplicationCacheFrameContentView.prototype.updateStatus): (WI.ApplicationCacheFrameContentView.prototype.shown): Deleted. (WI.ApplicationCacheFrameContentView.prototype.closed): Deleted. (WI.ApplicationCacheFrameContentView.prototype._maybeUpdate): Deleted. (WI.ApplicationCacheFrameContentView.prototype._markDirty): Deleted. (WI.ApplicationCacheFrameContentView.prototype._updateStatus): Deleted. (WI.ApplicationCacheFrameContentView.prototype._update): Deleted. No need to maintain a separate "dirty" flag based on visibility since `attached`/`detached` are called whenever the view is added/removed to/from the DOM. * UserInterface/Debug/DebugContentView.js: (WI.DebugContentView.prototype.attached): Added. (WI.DebugContentView.prototype.detached): Added. (WI.DebugContentView.prototype.shown): Deleted. (WI.DebugContentView.prototype.hidden): Deleted. * UserInterface/Views/AnimationDetailsSidebarPanel.js: (WI.AnimationDetailsSidebarPanel.prototype.attached): Added. (WI.AnimationDetailsSidebarPanel.prototype.shown): Deleted. * UserInterface/Views/AuditTabContentView.js: (WI.AuditTabContentView.prototype.attached): Added. (WI.AuditTabContentView.prototype.detached): Added. (WI.AuditTabContentView.prototype.shown): Deleted. (WI.AuditTabContentView.prototype.hidden): Deleted. * UserInterface/Views/AuditTestContentView.js: (WI.AuditTestContentView.prototype.attached): Added. (WI.AuditTestContentView.prototype.detached): Added. (WI.AuditTestContentView.prototype.shown): Deleted. (WI.AuditTestContentView.prototype.hidden): Deleted. * UserInterface/Views/CPUTimelineView.js: (WI.CPUTimelineView.prototype.attached): Added. (WI.CPUTimelineView.prototype.shown): Deleted. * UserInterface/Views/CanvasSidebarPanel.js: (WI.CanvasSidebarPanel.prototype.attached): Added. (WI.CanvasSidebarPanel.prototype.detached): Added. (WI.CanvasSidebarPanel.prototype.shown): Deleted. (WI.CanvasSidebarPanel.prototype.hidden): Deleted. * UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView.prototype.attached): (WI.DOMTreeContentView.prototype.detached): (WI.DOMTreeContentView.prototype.shown): Deleted. (WI.DOMTreeContentView.prototype.hidden): Deleted. * UserInterface/Views/ElementsTabContentView.js: (WI.ElementsTabContentView.prototype.attached): (WI.ElementsTabContentView.prototype.shown): Deleted. * UserInterface/Views/FontResourceContentView.js: (WI.FontResourceContentView.prototype.attached): (WI.FontResourceContentView.prototype.detached): (WI.FontResourceContentView.prototype.shown): Deleted. (WI.FontResourceContentView.prototype.hidden): Deleted. * UserInterface/Views/HeapSnapshotClusterContentView.js: (WI.HeapSnapshotClusterContentView.prototype.attached): Added. (WI.HeapSnapshotClusterContentView.prototype.shown): Deleted. * UserInterface/Views/HeapSnapshotContentView.js: (WI.HeapSnapshotContentView.prototype.attached): Added. (WI.HeapSnapshotContentView.prototype.detached): Added. (WI.HeapSnapshotContentView.prototype.shown): Deleted. (WI.HeapSnapshotContentView.prototype.hidden): Deleted. * UserInterface/Views/ImageResourceContentView.js: (WI.ImageResourceContentView.prototype.attached): Added. (WI.ImageResourceContentView.prototype.detached): Added. (WI.ImageResourceContentView.prototype.shown): Deleted. (WI.ImageResourceContentView.prototype.hidden): Deleted. * UserInterface/Views/LayerTreeDetailsSidebarPanel.js: (WI.LayerTreeDetailsSidebarPanel.prototype.attached): (WI.LayerTreeDetailsSidebarPanel.prototype.detached): Added. (WI.LayerTreeDetailsSidebarPanel.prototype.shown): Deleted. (WI.LayerTreeDetailsSidebarPanel.prototype.hidden): Deleted. * UserInterface/Views/Layers3DContentView.js: (WI.Layers3DContentView.prototype.attached): Added. (WI.Layers3DContentView.prototype.detached): Added. (WI.Layers3DContentView.prototype.shown): Deleted. (WI.Layers3DContentView.prototype.hidden): Deleted. * UserInterface/Views/LayersTabContentView.js: (WI.LayersTabContentView.prototype.attached): Added. (WI.LayersTabContentView.prototype.shown): Deleted. * UserInterface/Views/LayoutTimelineView.js: (WI.LayoutTimelineView.prototype.attached): Added. (WI.LayoutTimelineView.prototype.detached): Added. (WI.LayoutTimelineView.prototype.shown): Deleted. (WI.LayoutTimelineView.prototype.hidden): Deleted. * UserInterface/Views/LogContentView.js: (WI.LogContentView.prototype.attached): Added. (WI.LogContentView.prototype.showCustomFindBanner): (WI.LogContentView.prototype.get supportsSave): (WI.LogContentView.prototype.shown): Deleted. * UserInterface/Views/MemoryTimelineView.js: (WI.MemoryTimelineView.prototype.attached): Added. (WI.MemoryTimelineView.prototype.shown): Deleted. * UserInterface/Views/NavigationSidebarPanel.js: (WI.NavigationSidebarPanel.prototype.attached): Added. (WI.NavigationSidebarPanel.prototype.shown): Deleted. * UserInterface/Views/NetworkDetailView.js: (WI.NetworkDetailView.prototype.attached): Added. (WI.NetworkDetailView.prototype.shown): Deleted. (WI.NetworkDetailView.prototype.hidden): Deleted. * UserInterface/Views/NetworkResourceDetailView.js: (WI.NetworkResourceDetailView.prototype.attached): Added. (WI.NetworkResourceDetailView.prototype.shown): Deleted. * UserInterface/Views/OverviewTimelineView.js: (WI.OverviewTimelineView.prototype.attached): Added. (WI.OverviewTimelineView.prototype.shown): Deleted. * UserInterface/Views/RecordingContentView.js: (WI.RecordingContentView.prototype.attached): Added. (WI.RecordingContentView.prototype.detached): Added. (WI.RecordingContentView.prototype.shown): Deleted. (WI.RecordingContentView.prototype.hidden): Deleted. * UserInterface/Views/ResourceClusterContentView.js: (WI.ResourceClusterContentView.prototype.attached): Added. (WI.ResourceClusterContentView.prototype.shown): Deleted. * UserInterface/Views/ResourceHeadersContentView.js: (WI.ResourceHeadersContentView.prototype.detached): Added. (WI.ResourceHeadersContentView.prototype.hidden): Deleted. * UserInterface/Views/SearchTabContentView.js: (WI.SearchTabContentView.prototype.attached): Added. (WI.SearchTabContentView.prototype.shown): Deleted. * UserInterface/Views/ShaderProgramContentView.js: (WI.ShaderProgramContentView.prototype.attached): Added. (WI.ShaderProgramContentView.prototype.shown): Deleted. (WI.ShaderProgramContentView.prototype.hidden): Deleted. * UserInterface/Views/SidebarPanel.js: (WI.SidebarPanel.prototype.attached): Added. (WI.SidebarPanel.prototype.detached): Added. (WI.SidebarPanel.prototype.shown): Deleted. (WI.SidebarPanel.prototype.hidden): Deleted. * UserInterface/Views/SourceCodeTextEditor.js: (WI.SourceCodeTextEditor.prototype.attached): Added. (WI.SourceCodeTextEditor.prototype.detached): Added. (WI.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState): (WI.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled): (WI.SourceCodeTextEditor.prototype.shown): Deleted. (WI.SourceCodeTextEditor.prototype.hidden): Deleted. * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.detached): (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.hidden): Deleted. * UserInterface/Views/SpreadsheetStyleProperty.js: (WI.SpreadsheetStyleProperty.prototype.detached): (WI.SpreadsheetStyleProperty.prototype.hidden): Deleted. * UserInterface/Views/StyleDetailsPanel.js: (WI.StyleDetailsPanel): (WI.StyleDetailsPanel.prototype.attached): (WI.StyleDetailsPanel.prototype.markAsNeedsRefresh): (WI.StyleDetailsPanel.prototype.nodeStylesRefreshed): (WI.StyleDetailsPanel.prototype._nodeStylesNeedsRefreshed): (WI.StyleDetailsPanel.prototype.shown): Deleted. (WI.StyleDetailsPanel.prototype.hidden): Deleted. * UserInterface/Views/TabContentView.js: (WI.TabContentView.prototype.attached): Added. (WI.TabContentView.prototype.restoreStateFromCookie): (WI.TabContentView.prototype.shown): Deleted. * UserInterface/Views/Table.js: (WI.Table.prototype.attached): Added. (WI.Table.prototype.restoreScrollPosition): Deleted. * UserInterface/Views/TextEditor.js: (WI.TextEditor.prototype.attached): Added. (WI.TextEditor.prototype.layout): (WI.TextEditor.prototype._revealPendingPositionIfPossible): (WI.TextEditor.prototype.get visible): Deleted. (WI.TextEditor.prototype.shown): Deleted. (WI.TextEditor.prototype.hidden): Deleted. * UserInterface/Views/TimelineDataGrid.js: (WI.TimelineDataGrid.prototype.detached): Added. (WI.TimelineDataGrid.prototype.shown): Deleted. (WI.TimelineDataGrid.prototype.hidden): Deleted. * UserInterface/Views/TimelineRecordingContentView.js: (WI.TimelineRecordingContentView.prototype.attached): Added. (WI.TimelineRecordingContentView.prototype.detached): Added. (WI.TimelineRecordingContentView.prototype.initialLayout): Added. (WI.TimelineRecordingContentView.prototype._contentViewSelectionPathComponentDidChange): (WI.TimelineRecordingContentView.prototype._update): (WI.TimelineRecordingContentView.prototype._handleTimelineViewRecordSelected): (WI.TimelineRecordingContentView.prototype._handleTimelineViewScannerShow): (WI.TimelineRecordingContentView.prototype._handleTimelineViewScannerHide): (WI.TimelineRecordingContentView.prototype._handleTimelineViewNeedsEntireSelectedRange): (WI.TimelineRecordingContentView.prototype.shown): Deleted. (WI.TimelineRecordingContentView.prototype.hidden): Deleted. * UserInterface/Views/TimelineTabContentView.js: (WI.TimelineTabContentView.prototype.attached): Added. (WI.TimelineTabContentView.prototype.detached): Added. (WI.TimelineTabContentView.prototype._inspectorVisibilityChanged): (WI.TimelineTabContentView.prototype.shown): Deleted. (WI.TimelineTabContentView.prototype.hidden): Deleted. * UserInterface/Views/WebSocketContentView.js: (WI.WebSocketContentView.prototype.attached): Added. (WI.WebSocketContentView.prototype.detached): Added. (WI.WebSocketContentView.prototype.shown): Deleted. (WI.WebSocketContentView.prototype.hidden): Deleted. * UserInterface/Controllers/JavaScriptLogViewController.js: (WI.JavaScriptLogViewController.prototype._appendConsoleMessageView): Move logic inside `shown`/`hidden` to `attached`/`detached`. Use `isAttached` instead of `visible`. * UserInterface/Models/BackForwardEntry.js: (WI.BackForwardEntry.prototype.prepareToShow): (WI.BackForwardEntry.prototype.prepareToHide): * UserInterface/Views/AuditTestGroupContentView.js: (WI.AuditTestGroupContentView.prototype.attached): Added. (WI.AuditTestGroupContentView.prototype.detached): Added. (WI.AuditTestGroupContentView.prototype._addTest): (WI.AuditTestGroupContentView.prototype._handleTestGroupTestRemoved): (WI.AuditTestGroupContentView.prototype.shown): Deleted. (WI.AuditTestGroupContentView.prototype.hidden): Deleted. * UserInterface/Views/ChangesDetailsSidebarPanel.js: (WI.ChangesDetailsSidebarPanel.prototype.shown): Deleted. * UserInterface/Views/ClusterContentView.js: (WI.ClusterContentView.prototype.shown): Deleted. (WI.ClusterContentView.prototype.hidden): Deleted. * UserInterface/Views/CollectionContentView.js: (WI.CollectionContentView.prototype.addContentViewForItem): (WI.CollectionContentView.prototype.removeContentViewForItem): (WI.CollectionContentView.prototype.shown): Deleted. (WI.CollectionContentView.prototype.hidden): Deleted. * UserInterface/Views/ComputedStyleSection.js: (WI.ComputedStyleSection.prototype.hidden): Deleted. * UserInterface/Views/ContentBrowser.js: (WI.ContentBrowser.prototype.attached): Added. (WI.ContentBrowser.prototype.shown): Deleted. (WI.ContentBrowser.prototype.hidden): Deleted. * UserInterface/Views/ContentView.js: (WI.ContentView.prototype.get visible): Deleted. (WI.ContentView.prototype.set visible): Deleted. (WI.ContentView.prototype.shown): Deleted. (WI.ContentView.prototype.hidden): Deleted. * UserInterface/Views/ContentViewContainer.js: (WI.ContentViewContainer.prototype.showContentView): (WI.ContentViewContainer.prototype.showBackForwardEntryForIndex): (WI.ContentViewContainer.prototype.replaceContentView): (WI.ContentViewContainer.prototype.closeContentView): (WI.ContentViewContainer.prototype.attached): Added. (WI.ContentViewContainer.prototype.detached): Added. (WI.ContentViewContainer.prototype._disassociateFromContentView): (WI.ContentViewContainer.prototype._showEntry): (WI.ContentViewContainer.prototype.shown): Deleted. (WI.ContentViewContainer.prototype.hidden): Deleted. * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js: (WI.GeneralStyleDetailsSidebarPanel.prototype.get minimumWidth): (WI.GeneralStyleDetailsSidebarPanel.prototype.attached): Added. (WI.GeneralStyleDetailsSidebarPanel.prototype._showPanel): (WI.GeneralStyleDetailsSidebarPanel.prototype.hidden): Deleted. (WI.GeneralStyleDetailsSidebarPanel.prototype.shown): Deleted. * UserInterface/Views/HeapAllocationsTimelineView.js: (WI.HeapAllocationsTimelineView.prototype.showHeapSnapshotList): (WI.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord): (WI.HeapAllocationsTimelineView.prototype.showHeapSnapshotDiff): (WI.HeapAllocationsTimelineView.prototype.shown): Deleted. (WI.HeapAllocationsTimelineView.prototype.hidden): Deleted. * UserInterface/Views/MediaTimelineView.js: (WI.MediaTimelineView.prototype.shown): Deleted. (WI.MediaTimelineView.prototype.hidden): Deleted. * UserInterface/Views/NetworkTabContentView.js: (WI.NetworkTabContentView.prototype.shown): Deleted. (WI.NetworkTabContentView.prototype.hidden): Deleted. * UserInterface/Views/NetworkTableContentView.js: (WI.NetworkTableContentView.prototype.detached): Added. (WI.NetworkTableContentView.prototype._hideDetailView): (WI.NetworkTableContentView.prototype._showDetailView): (WI.NetworkTableContentView.prototype.shown): Deleted. (WI.NetworkTableContentView.prototype.hidden): Deleted. * UserInterface/Views/NetworkTimelineView.js: (WI.NetworkTimelineView.prototype.shown): Deleted. (WI.NetworkTimelineView.prototype.hidden): Deleted. * UserInterface/Views/RenderingFrameTimelineView.js: (WI.RenderingFrameTimelineView.prototype.shown): Deleted. (WI.RenderingFrameTimelineView.prototype.hidden): Deleted. * UserInterface/Views/ScriptContentView.js: (WI.ScriptContentView.prototype.shown): Deleted. (WI.ScriptContentView.prototype.hidden): Deleted. * UserInterface/Views/ScriptDetailsTimelineView.js: (WI.ScriptDetailsTimelineView.prototype.shown): Deleted. (WI.ScriptDetailsTimelineView.prototype.hidden): Deleted. * UserInterface/Views/Sidebar.js: (WI.Sidebar.prototype.set collapsed): * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: (WI.SpreadsheetCSSStyleDeclarationSection.prototype.hidden): Deleted. * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js: (WI.SpreadsheetRulesStyleDetailsPanel.prototype.hidden): Deleted. * UserInterface/Views/TextContentView.js: (WI.TextContentView.prototype.shown): Deleted. (WI.TextContentView.prototype.hidden): Deleted. * UserInterface/Views/TextResourceContentView.js: (WI.TextResourceContentView.prototype.shown): Deleted. (WI.TextResourceContentView.prototype.hidden): Deleted. Remove `shown`/`hidden` calls since that state is propagated to subviews by `WI.View` logic. Canonical link: https://commits.webkit.org/231843@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 34341e0 commit 2a2a0ee

81 files changed

Lines changed: 710 additions & 742 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Source/WebInspectorUI/ChangeLog

Lines changed: 374 additions & 0 deletions
Large diffs are not rendered by default.

Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ WI.JavaScriptLogViewController = class JavaScriptLogViewController extends WI.Ob
279279
if (messageView.message && messageView.message.source !== WI.ConsoleMessage.MessageSource.JS)
280280
this._lastCommitted = "";
281281

282-
if (WI.consoleContentView.visible)
282+
if (WI.consoleContentView.isAttached)
283283
this.renderPendingMessagesSoon();
284284

285285
if (!WI.isShowingConsoleTab() && messageView.message && messageView.message.shouldRevealConsole)

Source/WebInspectorUI/UserInterface/Debug/DebugContentView.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ WI.DebugContentView = class DebugContentView extends WI.ContentView
3737

3838
// Protected
3939

40-
shown()
40+
attached()
4141
{
42-
super.shown();
43-
console.debug(`shown: ${this._string}`);
42+
super.attached();
43+
console.debug(`attached: ${this._string}`);
4444
}
4545

46-
hidden()
46+
detached()
4747
{
48-
console.debug(`hidden: ${this._string}`);
49-
super.hidden();
48+
console.debug(`detached: ${this._string}`);
49+
super.detached();
5050
}
5151

5252
closed()

Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,19 @@ WI.BackForwardEntry = class BackForwardEntry
7373
this._tombstone = tombstone;
7474
}
7575

76-
prepareToShow(shouldCallShown)
76+
prepareToShow()
7777
{
7878
console.assert(!this._tombstone, "Should not be calling shown on a tombstone");
7979

8080
this._restoreFromCookie();
8181

82-
this.contentView.visible = true;
83-
if (shouldCallShown)
84-
this.contentView.shown();
8582
this.contentView.needsLayout();
8683
}
8784

8885
prepareToHide()
8986
{
9087
console.assert(!this._tombstone, "Should not be calling hidden on a tombstone");
9188

92-
this.contentView.visible = false;
93-
this.contentView.hidden();
94-
9589
this._saveScrollPositions();
9690

9791
if (this._contentView.shouldSaveStateWhenHidden) {

Source/WebInspectorUI/UserInterface/Views/AnimationDetailsSidebarPanel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ WI.AnimationDetailsSidebarPanel = class AnimationDetailsSidebarPanel extends WI.
142142
codeMirror.refresh();
143143
}
144144

145-
shown()
145+
attached()
146146
{
147-
super.shown();
147+
super.attached();
148148

149149
for (let codeMirror of this._codeMirrorSectionMap.values())
150150
codeMirror.refresh();

Source/WebInspectorUI/UserInterface/Views/ApplicationCacheFrameContentView.js

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,28 @@ WI.ApplicationCacheFrameContentView = class ApplicationCacheFrameContentView ext
3838
this._emptyView = WI.createMessageTextView(WI.UIString("No Application Cache information available"), false);
3939
this._emptyView.classList.add("hidden");
4040
this.element.appendChild(this._emptyView);
41+
}
4142

42-
this._markDirty();
43-
44-
var status = representedObject.status;
45-
this.updateStatus(status);
43+
attached()
44+
{
45+
super.attached();
4646

47-
WI.applicationCacheManager.addEventListener(WI.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._updateStatus, this);
47+
WI.applicationCacheManager.addEventListener(WI.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._handleFrameManifestStatusChanged, this);
48+
this.updateStatus(this.representedObject.status);
4849
}
4950

50-
shown()
51+
detached()
5152
{
52-
super.shown();
53+
WI.applicationCacheManager.removeEventListener(WI.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._handleFrameManifestStatusChanged, this);
5354

54-
this._maybeUpdate();
55+
super.detached();
5556
}
5657

57-
closed()
58+
layout()
5859
{
59-
WI.applicationCacheManager.removeEventListener(WI.ApplicationCacheManager.Event.FrameManifestStatusChanged, this._updateStatus, this);
60+
super.layout();
6061

61-
super.closed();
62+
this.updateStatus();
6263
}
6364

6465
saveToCookie(cookie)
@@ -75,21 +76,7 @@ WI.ApplicationCacheFrameContentView = class ApplicationCacheFrameContentView ext
7576
return [this._dataGrid.scrollContainer];
7677
}
7778

78-
_maybeUpdate()
79-
{
80-
if (!this.visible || !this._viewDirty)
81-
return;
82-
83-
this._update();
84-
this._viewDirty = false;
85-
}
86-
87-
_markDirty()
88-
{
89-
this._viewDirty = true;
90-
}
91-
92-
_updateStatus(event)
79+
_handleFrameManifestStatusChanged(event)
9380
{
9481
var frameManifest = event.data.frameManifest;
9582
if (frameManifest !== this.representedObject)
@@ -105,15 +92,8 @@ WI.ApplicationCacheFrameContentView = class ApplicationCacheFrameContentView ext
10592
var oldStatus = this._status;
10693
this._status = status;
10794

108-
if (this.visible && this._status === WI.ApplicationCacheManager.Status.Idle && (oldStatus === WI.ApplicationCacheManager.Status.UpdateReady || !this._resources))
109-
this._markDirty();
110-
111-
this._maybeUpdate();
112-
}
113-
114-
_update()
115-
{
116-
WI.applicationCacheManager.requestApplicationCache(this._frame, this._updateCallback.bind(this));
95+
if (this._status === WI.ApplicationCacheManager.Status.Idle && (oldStatus === WI.ApplicationCacheManager.Status.UpdateReady || !this._resources))
96+
WI.applicationCacheManager.requestApplicationCache(this._frame, this._updateCallback.bind(this));
11797
}
11898

11999
_updateCallback(applicationCache)

Source/WebInspectorUI/UserInterface/Views/AuditTabContentView.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ WI.AuditTabContentView = class AuditTabContentView extends WI.ContentBrowserTabC
7373
|| representedObject instanceof WI.AuditTestGroupResult;
7474
}
7575

76-
shown()
76+
attached()
7777
{
78-
super.shown();
78+
super.attached();
7979

8080
this._startStopShortcut.disabled = false;
8181
}
8282

83-
hidden()
83+
detached()
8484
{
8585
this._startStopShortcut.disabled = true;
8686

87-
super.hidden();
87+
super.detached();
8888
}
8989

9090
// DropZoneView delegate

Source/WebInspectorUI/UserInterface/Views/AuditTestContentView.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ WI.AuditTestContentView = class AuditTestContentView extends WI.ContentView
258258
this._updateExportNavigationItems();
259259
}
260260

261-
shown()
261+
attached()
262262
{
263-
super.shown();
263+
super.attached();
264264

265265
if (this.representedObject instanceof WI.AuditTestBase) {
266266
this.representedObject.addEventListener(WI.AuditTestBase.Event.Completed, this._handleTestChanged, this);
@@ -275,7 +275,7 @@ WI.AuditTestContentView = class AuditTestContentView extends WI.ContentView
275275
}
276276
}
277277

278-
hidden()
278+
detached()
279279
{
280280
if (this.representedObject instanceof WI.AuditTestBase) {
281281
this.representedObject.removeEventListener(WI.AuditTestBase.Event.Completed, this._handleTestChanged, this);
@@ -289,7 +289,7 @@ WI.AuditTestContentView = class AuditTestContentView extends WI.ContentView
289289
WI.auditManager.removeEventListener(WI.AuditManager.Event.EditingChanged, this._handleEditingChanged, this);
290290
}
291291

292-
super.hidden();
292+
super.detached();
293293
}
294294

295295
handleResultChanged(event)

Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ WI.AuditTestGroupContentView = class AuditTestGroupContentView extends WI.AuditT
194194
this.showFilteredPlaceholder();
195195
}
196196

197-
shown()
197+
attached()
198198
{
199-
super.shown();
199+
super.attached();
200200

201201
if (this.representedObject instanceof WI.AuditTestGroup) {
202202
this.representedObject.addEventListener(WI.AuditTestBase.Event.Progress, this._handleTestGroupProgress, this);
@@ -213,7 +213,7 @@ WI.AuditTestGroupContentView = class AuditTestGroupContentView extends WI.AuditT
213213
this._addTest(subobject);
214214
}
215215

216-
hidden()
216+
detached()
217217
{
218218
if (this.representedObject instanceof WI.AuditTestGroup) {
219219
this.representedObject.removeEventListener(WI.AuditTestBase.Event.Progress, this._handleTestGroupProgress, this);
@@ -225,12 +225,10 @@ WI.AuditTestGroupContentView = class AuditTestGroupContentView extends WI.AuditT
225225
}
226226
}
227227

228-
for (let view of this._viewForSubobject.values())
229-
view.hidden();
230228
this.contentView.removeAllSubviews();
231229
this._viewForSubobject.clear();
232230

233-
super.hidden();
231+
super.detached();
234232
}
235233

236234
applyFilter(levels)
@@ -317,7 +315,6 @@ WI.AuditTestGroupContentView = class AuditTestGroupContentView extends WI.AuditT
317315

318316
let view = WI.ContentView.contentViewForRepresentedObject(test);
319317
this.contentView.addSubview(view);
320-
view.shown();
321318

322319
this._viewForSubobject.set(test, view);
323320
}
@@ -355,7 +352,6 @@ WI.AuditTestGroupContentView = class AuditTestGroupContentView extends WI.AuditT
355352
let view = this._viewForSubobject.get(test);
356353
console.assert(view);
357354

358-
view.hidden();
359355
this.contentView.removeSubview(view);
360356

361357
this._updateClassList();

Source/WebInspectorUI/UserInterface/Views/CPUTimelineOverviewGraph.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ WI.CPUTimelineOverviewGraph = class CPUTimelineOverviewGraph extends WI.Timeline
7878

7979
layout()
8080
{
81-
if (!this.visible)
81+
super.layout();
82+
83+
if (this.hidden)
8284
return;
8385

8486
this._updateLegend();

0 commit comments

Comments
 (0)