REGRESSION(r237196): Web Inspector: Computed panel shouldn't update when it isn't...
authornvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 Apr 2019 02:54:58 +0000 (02:54 +0000)
committernvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 Apr 2019 02:54:58 +0000 (02:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196667
<rdar://problem/49664912>

Reviewed by Timothy Hatcher.

Explicitly define `hidden` and `shown` methods instead of relying on SidebarPanel's `visible` getter.

* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.visibilityDidChange): Deleted.
(WI.GeneralStyleDetailsSidebarPanel.prototype.hidden): Added.
(WI.GeneralStyleDetailsSidebarPanel.prototype.shown): Added.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js

index edf9f7c..47b1c60 100644 (file)
@@ -1,3 +1,18 @@
+2019-04-06  Nikita Vasilyev  <nvasilyev@apple.com>
+
+        REGRESSION(r237196): Web Inspector: Computed panel shouldn't update when it isn't visible
+        https://bugs.webkit.org/show_bug.cgi?id=196667
+        <rdar://problem/49664912>
+
+        Reviewed by Timothy Hatcher.
+
+        Explicitly define `hidden` and `shown` methods instead of relying on SidebarPanel's `visible` getter.
+
+        * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
+        (WI.GeneralStyleDetailsSidebarPanel.prototype.visibilityDidChange): Deleted.
+        (WI.GeneralStyleDetailsSidebarPanel.prototype.hidden): Added.
+        (WI.GeneralStyleDetailsSidebarPanel.prototype.shown): Added.
+
 2019-04-05  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: TestSuite test cases should have their own timeout to ensure tests fail with output instead of timeout by test runner
index d9b165e..f09a95c 100644 (file)
@@ -45,20 +45,24 @@ WI.GeneralStyleDetailsSidebarPanel = class GeneralStyleDetailsSidebarPanel exten
         return nodeToInspect.nodeType() === Node.ELEMENT_NODE;
     }
 
-    visibilityDidChange()
+    hidden()
     {
-        super.visibilityDidChange();
+        super.hidden();
+
+        if (this._panel)
+            this._panel.hidden();
+    }
+
+    shown()
+    {
+        super.shown();
 
         if (!this._panel)
             return;
 
-        if (!this.visible) {
-            this._panel.hidden();
-            return;
-        }
+        console.assert(this.visible, `Shown panel ${this._identifier} must be visible.`);
 
         this._updateNoForcedPseudoClassesScrollOffset();
-
         this._panel.shown();
         this._panel.markAsNeedsRefresh(this.domNode);
     }