Title: [254633] trunk/Source/WebInspectorUI
Revision
254633
Author
drou...@apple.com
Date
2020-01-15 13:41:50 -0800 (Wed, 15 Jan 2020)

Log Message

Web Inspector: collapsing a virtualized folder in a `WI.TreeOutline` doesn't updated the DOM
https://bugs.webkit.org/show_bug.cgi?id=206302

Reviewed by Timothy Hatcher.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._updateVirtualizedElements):
When collapsing a currently visible `WI.TreeElement`, it will still be in the cached set of
visible and attached `WI.TreeElement`s, meaning that `_updateVirtualizedElements` will early
return since it thinks that the same `WI.TreeElement` are being shown. Add another check to
ensure that it only thinks that if the same number of `WI.TreeElement` are visible.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (254632 => 254633)


--- trunk/Source/WebInspectorUI/ChangeLog	2020-01-15 21:30:57 UTC (rev 254632)
+++ trunk/Source/WebInspectorUI/ChangeLog	2020-01-15 21:41:50 UTC (rev 254633)
@@ -1,3 +1,17 @@
+2020-01-15  Devin Rousso  <drou...@apple.com>
+
+        Web Inspector: collapsing a virtualized folder in a `WI.TreeOutline` doesn't updated the DOM
+        https://bugs.webkit.org/show_bug.cgi?id=206302
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TreeOutline.js:
+        (WI.TreeOutline.prototype._updateVirtualizedElements):
+        When collapsing a currently visible `WI.TreeElement`, it will still be in the cached set of
+        visible and attached `WI.TreeElement`s, meaning that `_updateVirtualizedElements` will early
+        return since it thinks that the same `WI.TreeElement` are being shown. Add another check to
+        ensure that it only thinks that if the same number of `WI.TreeElement` are visible.
+
 2020-01-13  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: "Enable Local Override" and "Delete Local Override" are displayed twice in the contextual menu

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (254632 => 254633)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2020-01-15 21:30:57 UTC (rev 254632)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2020-01-15 21:41:50 UTC (rev 254633)
@@ -1042,11 +1042,14 @@
 
         // Redraw if we are about to scroll.
         if (!shouldScroll) {
-            // Redraw if all of the previously centered `WI.TreeElement` are no longer centered.
-            if (visibleTreeElements.intersects(this._virtualizedVisibleTreeElements)) {
-                // Redraw if there is a `WI.TreeElement` that should be shown that isn't attached.
-                if (visibleTreeElements.isSubsetOf(this._virtualizedAttachedTreeElements))
-                    return;
+            // Redraw if there are a different number of items to show.
+            if (visibleTreeElements.size === this._virtualizedVisibleTreeElements.size) {
+                // Redraw if all of the previously centered `WI.TreeElement` are no longer centered.
+                if (visibleTreeElements.intersects(this._virtualizedVisibleTreeElements)) {
+                    // Redraw if there is a `WI.TreeElement` that should be shown that isn't attached.
+                    if (visibleTreeElements.isSubsetOf(this._virtualizedAttachedTreeElements))
+                        return;
+                }
             }
         }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to