Title: [276958] trunk/Source/WebInspectorUI
Revision
276958
Author
[email protected]
Date
2021-05-04 08:26:58 -0700 (Tue, 04 May 2021)

Log Message

Web Inspector: Sources: Inconsistent selection in source tree when grouped by path
https://bugs.webkit.org/show_bug.cgi?id=225317

Reviewed by Devin Rousso.

Ensure origin tree elements for different domains in the Sources Tab behave as folder tree elements
in that they can be individually selected without triggering rendering of any resource.

In essence, restore behavior prior to https://trac.webkit.org/changeset/248912/webkit

The only exception is for document resources. Clicking on the origin tree element associated with a document resource,
triggers rendering of the corresponding document.

* UserInterface/Views/OriginTreeElement.js:
(WI.OriginTreeElement):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._addResource):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (276957 => 276958)


--- trunk/Source/WebInspectorUI/ChangeLog	2021-05-04 15:02:03 UTC (rev 276957)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-05-04 15:26:58 UTC (rev 276958)
@@ -1,3 +1,23 @@
+2021-05-04  Razvan Caliman  <[email protected]>
+
+        Web Inspector: Sources: Inconsistent selection in source tree when grouped by path
+        https://bugs.webkit.org/show_bug.cgi?id=225317
+
+        Reviewed by Devin Rousso.
+
+        Ensure origin tree elements for different domains in the Sources Tab behave as folder tree elements
+        in that they can be individually selected without triggering rendering of any resource.
+
+        In essence, restore behavior prior to https://trac.webkit.org/changeset/248912/webkit
+
+        The only exception is for document resources. Clicking on the origin tree element associated with a document resource,
+        triggers rendering of the corresponding document.
+
+        * UserInterface/Views/OriginTreeElement.js:
+        (WI.OriginTreeElement):
+        * UserInterface/Views/SourcesNavigationSidebarPanel.js:
+        (WI.SourcesNavigationSidebarPanel.prototype._addResource):
+
 2021-04-28  Razvan Caliman  <[email protected]>
 
         Web Inspector: CSS Grid - measure usage of grid overlay options

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/OriginTreeElement.js (276957 => 276958)


--- trunk/Source/WebInspectorUI/UserInterface/Views/OriginTreeElement.js	2021-05-04 15:02:03 UTC (rev 276957)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OriginTreeElement.js	2021-05-04 15:26:58 UTC (rev 276958)
@@ -27,6 +27,9 @@
 {
     constructor(title, representedObject, options)
     {
+        // Representing any object other than a WI.Frame yields erratic behavior when navigating sources grouped by path (Bug 225317).
+        console.assert(!representedObject || representedObject instanceof WI.Frame);
+
         const classNames = ["origin-icon"];
         const subtitle = null;
         super(classNames, title, subtitle, representedObject, options);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js (276957 => 276958)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js	2021-05-04 15:02:03 UTC (rev 276957)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js	2021-05-04 15:26:58 UTC (rev 276958)
@@ -1047,7 +1047,8 @@
                 if (origin) {
                     let originTreeElement = this._originTreeElementMap.get(origin);
                     if (!originTreeElement) {
-                        originTreeElement = new WI.OriginTreeElement(origin, resource.parentFrame, {hasChildren: true});
+                        let representedObject = resource.type === WI.Resource.Type.Document ? resource.parentFrame : null;
+                        originTreeElement = new WI.OriginTreeElement(origin, representedObject, {hasChildren: true});
                         this._originTreeElementMap.set(origin, originTreeElement);
 
                         let index = insertionIndexForObjectInListSortedByFunction(originTreeElement, this._resourcesTreeOutline.children, this._boundCompareTreeElements);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to