REGRESSION (r203253): Node details sidebar flickers while resizing
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 Aug 2016 01:50:34 +0000 (01:50 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 7 Aug 2016 01:50:34 +0000 (01:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=160631
<rdar://problem/27733024>

Reviewed by Timothy Hatcher.

Sidebar panel layouts can be expensive, and should be performed only
when necessary (i.e., when the panel is shown for the first time, or
model data changed while the panel was hidden).

* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar.prototype._recalculateWidth):

* UserInterface/Views/SidebarPanel.js:
(WebInspector.SidebarPanel.prototype.shown):

* UserInterface/Views/View.js:
(WebInspector.View.prototype.updateLayoutIfNeeded):
Update the layout if an initial layout was never performed.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/Sidebar.js
Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/View.js

index 0f4ebd8..6d506fb 100644 (file)
@@ -1,3 +1,25 @@
+2016-08-06  Matt Baker  <mattbaker@apple.com>
+
+        REGRESSION (r203253): Node details sidebar flickers while resizing
+        https://bugs.webkit.org/show_bug.cgi?id=160631
+        <rdar://problem/27733024>
+
+        Reviewed by Timothy Hatcher.
+
+        Sidebar panel layouts can be expensive, and should be performed only
+        when necessary (i.e., when the panel is shown for the first time, or
+        model data changed while the panel was hidden).
+
+        * UserInterface/Views/Sidebar.js:
+        (WebInspector.Sidebar.prototype._recalculateWidth):
+
+        * UserInterface/Views/SidebarPanel.js:
+        (WebInspector.SidebarPanel.prototype.shown):
+
+        * UserInterface/Views/View.js:
+        (WebInspector.View.prototype.updateLayoutIfNeeded):
+        Update the layout if an initial layout was never performed.
+
 2016-08-04  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: UI polish for Edit Breakpoint dialog
index 20d0d18..6071fa6 100644 (file)
@@ -271,7 +271,7 @@ WebInspector.Sidebar = class Sidebar extends WebInspector.View
             this._navigationBar.needsLayout();
 
         if (!this.collapsed && this._selectedSidebarPanel)
-            this._selectedSidebarPanel.updateLayout(WebInspector.View.LayoutReason.Resize);
+            this._selectedSidebarPanel.updateLayoutIfNeeded(WebInspector.View.LayoutReason.Resize);
 
         this.dispatchEventToListeners(WebInspector.Sidebar.Event.WidthDidChange, {newWidth});
     }
index fc8c1be..f31f951 100644 (file)
@@ -129,7 +129,7 @@ WebInspector.SidebarPanel = class SidebarPanel extends WebInspector.View
         this._contentView.element.scrollTop = this._savedScrollPosition;
 
         // FIXME: remove once <https://webkit.org/b/150741> is fixed.
-        this.updateLayout();
+        this.updateLayoutIfNeeded();
 
         // Implemented by subclasses.
     }
index 3a1ba0c..ace04b9 100644 (file)
@@ -149,7 +149,7 @@ WebInspector.View = class View extends WebInspector.Object
 
     updateLayoutIfNeeded()
     {
-        if (!this._dirty)
+        if (!this._dirty && this._didInitialLayout)
             return;
 
         this.updateLayout();