Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c81ca28ecaec67aae3d468094d633e2d3011511c
      
https://github.com/WebKit/WebKit/commit/c81ca28ecaec67aae3d468094d633e2d3011511c
  Author: Devin Rousso <[email protected]>
  Date:   2026-07-19 (Sun, 19 Jul 2026)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js
    M Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js

  Log Message:
  -----------
  Web Inspector: Sources: `file://` URLs have nameless ancestor folders when 
"Group by Path"
https://bugs.webkit.org/show_bug.cgi?id=319752

Reviewed by Taher Ali.

`parseURL(url).origin` is `null` for `file://` and other URLs with opaque 
origins.
Prefer the owning frame's valid security origin, then use the URL scheme or 
`WI.Resource.Type.Other` as a stable grouping title.

* Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.originForURLComponents): Added.
(WI.SourcesNavigationSidebarPanel.prototype._updateMainFrameTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addResource):
Ensure a valid grouping origin for `file://`, opaque, invalid, and empty URLs.
Always place "Group by Path" resources below that origin so malformed URLs 
cannot add unexpected top-level folders.
`blob:` URLs include their creator's origin in `urlComponents.path`; use only 
their final path component when creating folders.

* Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js:
(WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath):
Ignore empty path components and remove the filename before creating folders.
This also allows a directory to have the same name as the resource.

Canonical link: https://commits.webkit.org/317518@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to