Web Inspector: subclasses of WI.ClusterContentView don't save/restore content views...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2019 01:23:52 +0000 (01:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2019 01:23:52 +0000 (01:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192451
<rdar://problem/46800958>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-04
Reviewed by Devin Rousso.

* UserInterface/Models/BackForwardEntry.js:
(WI.BackForwardEntry.prototype.prepareToHide):
* UserInterface/Views/ClusterContentView.js:
(WI.ClusterContentView.prototype.get shouldSaveStateOnHide):
* UserInterface/Views/ContentView.js:
(WI.ContentView.prototype.get shouldSaveStateOnHide):
Allow ClusterContentViews to save its state whenever its hidden,
this means it can be properly restored to the last state it had
instead of the initial state it was shown with.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239649 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/BackForwardEntry.js
Source/WebInspectorUI/UserInterface/Views/ClusterContentView.js
Source/WebInspectorUI/UserInterface/Views/ContentView.js

index 710ce75..f05867e 100644 (file)
@@ -1,3 +1,21 @@
+2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: subclasses of WI.ClusterContentView don't save/restore content views after the initial view
+        https://bugs.webkit.org/show_bug.cgi?id=192451
+        <rdar://problem/46800958>
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Models/BackForwardEntry.js:
+        (WI.BackForwardEntry.prototype.prepareToHide):
+        * UserInterface/Views/ClusterContentView.js:
+        (WI.ClusterContentView.prototype.get shouldSaveStateOnHide):
+        * UserInterface/Views/ContentView.js:
+        (WI.ContentView.prototype.get shouldSaveStateOnHide):
+        Allow ClusterContentViews to save its state whenever its hidden,
+        this means it can be properly restored to the last state it had
+        instead of the initial state it was shown with.
+
 2019-01-04  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Audit: disable breakpoints when running Audit
index 34ac1e6..dac195a 100644 (file)
@@ -93,6 +93,11 @@ WI.BackForwardEntry = class BackForwardEntry
         this.contentView.hidden();
 
         this._saveScrollPositions();
+
+        if (this._contentView.shouldSaveStateWhenHidden) {
+            this._cookie = {};
+            this._contentView.saveToCookie(this._cookie);
+        }
     }
 
     isEqual(other)
index 6af3a42..72bce03 100644 (file)
@@ -61,6 +61,11 @@ WI.ClusterContentView = class ClusterContentView extends WI.ContentView
         return super.supportsSplitContentBrowser;
     }
 
+    get shouldSaveStateWhenHidden()
+    {
+        return true;
+    }
+
     shown()
     {
         super.shown();
index e7b30c9..b151033 100644 (file)
@@ -355,6 +355,11 @@ WI.ContentView = class ContentView extends WI.View
         return false;
     }
 
+    get shouldSaveStateWhenHidden()
+    {
+        return false;
+    }
+
     get selectionPathComponents()
     {
         // Implemented by subclasses.