Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: b8bd34d2de248effbd779dca443b2a583b80837e https://github.com/WebKit/WebKit/commit/b8bd34d2de248effbd779dca443b2a583b80837e Author: Devin Rousso <h...@devinrousso.com> Date: 2025-02-25 (Tue, 25 Feb 2025)
Changed paths: M LayoutTests/inspector/unit-tests/map-utilities-expected.txt M LayoutTests/inspector/unit-tests/map-utilities.html M Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js M Source/WebInspectorUI/UserInterface/Base/Utilities.js M Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js M Source/WebInspectorUI/UserInterface/Main.html A Source/WebInspectorUI/UserInterface/Models/ScriptTimeline.js M Source/WebInspectorUI/UserInterface/Models/Timeline.js M Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js M Source/WebInspectorUI/UserInterface/Test.html M Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css M Source/WebInspectorUI/UserInterface/Views/ScriptClusterTimelineView.js M Source/WebInspectorUI/UserInterface/Views/ScriptDetailsTimelineView.js R Source/WebInspectorUI/UserInterface/Views/ScriptProfileTimelineView.css M Source/WebInspectorUI/UserInterface/Views/ScriptProfileTimelineView.js M Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js M Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js Log Message: ----------- Web Inspector: Timelines: Script: make the target into a hierarchical path component https://bugs.webkit.org/show_bug.cgi?id=288262 Reviewed by BJ Burg. Instead of having a `WI.DataGrid` column for the `target`/"context" in `WI.ScriptDetailsTimelineView` and a dropdown to switch the `WI.CallingContextTree` based on the selected `WI.Target` in `WI.ScriptProfileTimelineView`, the `WI.Target` should be a hierarchical path component to have similar behavior to elsewhere in Web Inspector. This also means that distinct `WI.ScriptProfileTimelineView` and `WI.ScriptDetailsTimelineView` are created for each `WI.Target` (as needed) instead of having each hold and switch between or display all `WI.Target` in the `WI.TimelineRecording`. Note that the `WI.HierarchicalPathComponent` for the `WI.Target` is only shown if there's more than one `WI.Target` in the `WI.TimelineRecording`. * Source/WebInspectorUI/UserInterface/Views/ScriptClusterTimelineView.js: (WI.ScriptClusterTimelineView): (WI.ScriptClusterTimelineView.createPathComponent): (WI.ScriptClusterTimelineView.prototype.reset): (WI.ScriptClusterTimelineView.prototype.get selectionPathComponents): (WI.ScriptClusterTimelineView.prototype.saveToCookie): (WI.ScriptClusterTimelineView.prototype.restoreFromCookie): (WI.ScriptClusterTimelineView.prototype.closed): (WI.ScriptClusterTimelineView.prototype._updateCurrentContentView): (WI.ScriptClusterTimelineView.prototype._createTargetPathComponent): Added. (WI.ScriptClusterTimelineView.prototype._sortTargetPathComponents): Added. (WI.ScriptClusterTimelineView.prototype._handleViewPathComponentSelected): (WI.ScriptClusterTimelineView.prototype._handleTargetAdded): Added. (WI.ScriptClusterTimelineView.prototype._handleTargetPathComponentSelected): Added. (WI.ScriptClusterTimelineView.prototype._scriptClusterViewCurrentContentViewDidChange): (WI.ScriptClusterTimelineView.prototype.get eventsContentView): Deleted. (WI.ScriptClusterTimelineView.prototype.get profileContentView): Deleted. (WI.ScriptClusterTimelineView.prototype.showEvents): Deleted. (WI.ScriptClusterTimelineView.prototype.showProfile): Deleted. (WI.ScriptClusterTimelineView.prototype._pathComponentForContentView): Deleted. (WI.ScriptClusterTimelineView.prototype._identifierForContentView): Deleted. (WI.ScriptClusterTimelineView.prototype._showContentViewForIdentifier): Deleted. (WI.ScriptClusterTimelineView.prototype._pathComponentSelected): Deleted. * Source/WebInspectorUI/UserInterface/Views/ScriptProfileTimelineView.js: (WI.ScriptProfileTimelineView): (WI.ScriptProfileTimelineView.prototype.get scrollableElements): (WI.ScriptProfileTimelineView.prototype.closed): (WI.ScriptProfileTimelineView.prototype.get navigationItems): (WI.ScriptProfileTimelineView.prototype.reset): (WI.ScriptProfileTimelineView.prototype._callingContextTreeForOrientation): (WI.ScriptProfileTimelineView.prototype._clearFocusNodes): (WI.ScriptProfileTimelineView.prototype._updateTargetNavigationItemDisplay): Deleted. (WI.ScriptProfileTimelineView.prototype._displayNameForTarget): Deleted. (WI.ScriptProfileTimelineView.prototype._handleRecordingTargetAdded): Deleted. (WI.ScriptProfileTimelineView.prototype._populateTargetNavigationItemContextMenu): Deleted. * Source/WebInspectorUI/UserInterface/Views/ScriptProfileTimelineView.css: Removed. * Source/WebInspectorUI/UserInterface/Views/ScriptDetailsTimelineView.js: (WI.ScriptDetailsTimelineView): (WI.ScriptDetailsTimelineView.prototype._processPendingRecords): (WI.ScriptDetailsTimelineView.prototype._processRecord): * Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js: (WI.ScriptTimelineDataGridNode.prototype.get data): Remove logic around and data for the `target`/"Context" column. * Source/WebInspectorUI/UserInterface/Views/PathComponentIcons.css: (.page-icon .icon): Added. (.worker-icon .icon): Added. (@media (prefers-color-scheme: dark) .page-icon .icon): Added. (@media (prefers-color-scheme: dark) .worker-icon .icon): Added. Add `WI.HierarchicalPathComponent` icons to represent "Page" and `Worker`. These icons are the same as what's used in the Sources Tab to represent the main frame/page resource and `Worker` script respectively. * Source/WebInspectorUI/UserInterface/Models/ScriptTimeline.js: Added. (WI.ScriptTimeline.prototype.get targets): (WI.ScriptTimeline.prototype.reset): (WI.ScriptTimeline.prototype.callingContextTree): (WI.ScriptTimeline.prototype.updateCallingContextTrees): * Source/WebInspectorUI/UserInterface/Models/Timeline.js: (WI.Timeline.create): * Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js: (WI.TimelineRecording): (WI.TimelineRecording.async import): (WI.TimelineRecording.prototype.reset): (WI.TimelineRecording.prototype.updateCallingContextTrees): (WI.TimelineRecording.prototype.get targets): Deleted. (WI.TimelineRecording.prototype.callingContextTree): Deleted. * Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js: (WI.TimelineManager.prototype.scriptProfilerTrackingCompleted): Drive-by: move the `WI.CallingContextTree` to a newly defined `WI.ScriptTimeline` so that `WI.ScriptProfileTimelineView` can use them without also requiring the entire `WI.TimelineRecording` to be provided. * Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js: (WI.TimelineTabContentView.displayNameForRecord): Drive-by: simplify naming of `WI.TargetType.Worker` to just the last path component of the main script (or the `name` if provided) to match elsewhere in Web Inspector (e.g. when paused in a `Worker` in the Sources Tab). * Source/WebInspectorUI/UserInterface/Base/Utilities.js: (Map.prototype.get firstKey): Added. * LayoutTests/inspector/unit-tests/map-utilities.html: * LayoutTests/inspector/unit-tests/map-utilities-expected.txt: Add a helper method to grab the first key of a `Map` similar to how `Array`/`Set` have `firstValue`. * Source/WebInspectorUI/UserInterface/Main.html: * Source/WebInspectorUI/UserInterface/Test.html: * Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js: Canonical link: https://commits.webkit.org/291074@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes