Changeset 243300 in webkit


Ignore:
Timestamp:
Mar 21, 2019 11:00:43 AM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Sources: the name of the file should not be used as a folder
https://bugs.webkit.org/show_bug.cgi?id=196064
<rdar://problem/49097710>

Reviewed by Timothy Hatcher.

  • UserInterface/Views/GeneralTreeElement.js:

(WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath):

  • UserInterface/Views/SourcesNavigationSidebarPanel.js:

(WI.SourcesNavigationSidebarPanel.prototype._addResource):
Drive-by: sort resources in each folder by name when grouping by path.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r243272 r243300  
     12019-03-21  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Sources: the name of the file should not be used as a folder
     4        https://bugs.webkit.org/show_bug.cgi?id=196064
     5        <rdar://problem/49097710>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * UserInterface/Views/GeneralTreeElement.js:
     10        (WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath):
     11
     12        * UserInterface/Views/SourcesNavigationSidebarPanel.js:
     13        (WI.SourcesNavigationSidebarPanel.prototype._addResource):
     14        Drive-by: sort resources in each folder by name when grouping by path.
     15
    1162019-03-20  Devin Rousso  <drousso@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js

    r243180 r243300  
    208208
    209209        for (let component of components) {
     210            if (component === components.lastValue)
     211                break;
     212
    210213            if (currentPath)
    211214                currentPath += "/";
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js

    r243271 r243300  
    683683            }
    684684
     685            let resourceTreeElement = null;
     686            if (resource instanceof WI.CSSStyleSheet)
     687                resourceTreeElement = new WI.CSSStyleSheetTreeElement(resource);
     688            else
     689                resourceTreeElement = new WI.ResourceTreeElement(resource, resource, {allowDirectoryAsName: true, hideOrigin: true});
     690
    685691            let subpath = resource.urlComponents.path;
    686692            if (subpath && subpath[0] === "/")
     
    688694
    689695            let parent = frameTreeElement.createFoldersAsNeededForSubpath(subpath);
    690             if (resource instanceof WI.CSSStyleSheet)
    691                 parent.appendChild(new WI.CSSStyleSheetTreeElement(resource));
    692             else
    693                 parent.appendChild(new WI.ResourceTreeElement(resource, resource, {allowDirectoryAsName: true, hideOrigin: true}));
     696            let index = insertionIndexForObjectInListSortedByFunction(resourceTreeElement, parent.children, this._boundCompareTreeElements);
     697            parent.insertChild(resourceTreeElement, index);
    694698        }
    695699
Note: See TracChangeset for help on using the changeset viewer.