Changeset 271236 in webkit
- Timestamp:
- Jan 7, 2021 8:36:44 AM (19 months ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 1 added
- 7 edited
- 1 copied
-
ChangeLog (modified) (1 diff)
-
Localizations/en.lproj/localizedStrings.js (modified) (3 diffs)
-
UserInterface/Main.html (modified) (2 diffs)
-
UserInterface/Views/BannerView.css (copied) (copied from trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.css) (2 diffs)
-
UserInterface/Views/BannerView.js (added)
-
UserInterface/Views/HeapAllocationsTimelineView.css (modified) (1 diff)
-
UserInterface/Views/HeapAllocationsTimelineView.js (modified) (6 diffs)
-
UserInterface/Views/TimelineRecordingContentView.js (modified) (2 diffs)
-
UserInterface/Views/TimelineView.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r270637 r271236 1 2021-01-07 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: console.takeHeapSnapshot() appears to have no effect 4 https://bugs.webkit.org/show_bug.cgi?id=219987 5 6 Reviewed by Devin Rousso. 7 8 Added a banner that appears above the snapshots data grid when there are new (unseen) snapshots that are being 9 filtered by either the selected time range or filter text. 10 11 * Localizations/en.lproj/localizedStrings.js: 12 * UserInterface/Main.html: 13 * UserInterface/Views/BannerView.css: Added. 14 (.banner-view): 15 (.banner-view > button): 16 (.banner-view > .dismiss): 17 * UserInterface/Views/BannerView.js: Added. 18 (WI.BannerView.prototype._handleActionButtonClicked): 19 (WI.BannerView.prototype._handleDismissButtonClicked): 20 (WI.BannerView): 21 - Added `WI.BannerView` to handle layout and styling of banners. 22 * UserInterface/Views/HeapAllocationsTimelineView.css: 23 (.timeline-view.heap-allocations > .banner-view + .data-grid): 24 * UserInterface/Views/HeapAllocationsTimelineView.js: 25 (WI.HeapAllocationsTimelineView): 26 (WI.HeapAllocationsTimelineView.prototype.layout): 27 - Take note of any new records that are immediately hidden. 28 (WI.HeapAllocationsTimelineView.prototype.reset): 29 (WI.HeapAllocationsTimelineView.prototype.filterDidChange): 30 (WI.HeapAllocationsTimelineView.prototype._updateUnseenRecordsBannerView): 31 - Check that unseen messages are still hidden and add/remove the banner as appropriate. 32 (WI.HeapAllocationsTimelineView.prototype._handleUnseenRecordsBannerClearFiltersClicked): 33 (WI.HeapAllocationsTimelineView.prototype._handleUnseenRecordsBannerDismissClicked): 34 * UserInterface/Views/TimelineRecordingContentView.js: 35 (WI.TimelineRecordingContentView): 36 (WI.TimelineRecordingContentView.prototype._handleTimelineViewNeedsFiltersCleared): 37 - Handle the `WI.TimelineView.Event.NeedsFiltersCleared` event. 38 * UserInterface/Views/TimelineView.js: 39 - Added `WI.TimelineView.Event.NeedsFiltersCleared` event. 40 1 41 2020-12-10 Patrick Angle <pangle@apple.com> 2 42 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r270637 r271236 292 292 localizedStrings["Clear Cookies"] = "Clear Cookies"; 293 293 localizedStrings["Clear Filters"] = "Clear Filters"; 294 /* Text for button that will clear both text filters and time range filters. */ 295 localizedStrings["Clear Filters @ Heap Allocations Timeline View"] = "Clear Filters"; 294 296 localizedStrings["Clear Local Storage"] = "Clear Local Storage"; 295 297 localizedStrings["Clear Log"] = "Clear Log"; … … 469 471 localizedStrings["Disk Cache"] = "Disk Cache"; 470 472 localizedStrings["Dismiss"] = "Dismiss"; 473 /* Tooltip for the dismiss button in banner views. */ 474 localizedStrings["Dismiss @ Banner View"] = "Dismiss"; 471 475 localizedStrings["Displayed Columns"] = "Displayed Columns"; 472 476 localizedStrings["Do not clear network items on new page loads"] = "Do not clear network items on new page loads"; … … 1435 1439 localizedStrings["The page's content has changed"] = "The page's content has changed"; 1436 1440 localizedStrings["The resource was requested insecurely."] = "The resource was requested insecurely."; 1441 /* Message displayed in a banner when one or more snapshots that the user has not yet seen are being filtered. */ 1442 localizedStrings["There are new snapshots that have been filtered @ Heap Allocations Timeline View"] = "There are new snapshots that have been filtered"; 1437 1443 localizedStrings["There are unread messages that have been filtered"] = "There are unread messages that have been filtered"; 1438 1444 localizedStrings["There is an incurred energy penalty each time the page enters script. This commonly happens with timers, event handlers, and observers."] = "There is an incurred energy penalty each time the page enters script. This commonly happens with timers, event handlers, and observers."; -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r270637 r271236 40 40 <link rel="stylesheet" href="Views/AuditTestGroupContentView.css"> 41 41 <link rel="stylesheet" href="Views/AuditTreeElement.css"> 42 <link rel="stylesheet" href="Views/BannerView.css"> 42 43 <link rel="stylesheet" href="Views/BezierEditor.css"> 43 44 <link rel="stylesheet" href="Views/BlackboxSettingsView.css"> … … 616 617 <script src="Views/AuditTestGroupContentView.js"></script> 617 618 <script src="Views/AuditTreeElement.js"></script> 619 <script src="Views/BannerView.js"></script> 618 620 <script src="Views/BezierEditor.js"></script> 619 621 <script src="Views/BlackboxSettingsView.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Views/BannerView.css
r271235 r271236 1 1 /* 2 * Copyright (C) 20 16-2020 Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 .timeline-view.heap-allocations > .data-grid { 27 position: absolute; 28 top: 0; 29 left: 0; 30 right: 0; 31 bottom: 0; 26 .banner-view { 27 display: flex; 28 flex-shrink: 0; 29 justify-content: center; 30 align-items: center; 31 position: relative; 32 height: var(--navigation-bar-height); 33 padding: 0 4px; 34 color: var(--yellow-highlight-text-color); 35 white-space: nowrap; 36 text-overflow: ellipsis; 37 overflow: hidden; 38 background-color: var(--yellow-highlight-background-color); 39 border-bottom: 1px solid var(--border-color); 32 40 } 33 41 34 . timeline-view.heap-allocations > .data-grid td .icon.heap-snapshot{35 content: url(../Images/TypeIcons.svg#HeapSnapshot-light);42 .banner-view > button { 43 margin-inline-start: 4px; 36 44 } 37 45 38 .timeline-view.heap-allocations > .data-grid tr.invalid { 39 color: gray; 46 .banner-view > .dismiss { 47 position: absolute; 48 inset-inline-end: 5px; 49 width: 16px; 50 height: 16px; 51 padding-bottom: 2px; 40 52 } 41 42 .timeline-view.heap-allocations > .data-grid:not(:focus) tr.selected.invalid {43 color: gray !important;44 }45 46 .timeline-view.heap-allocations > .data-grid tr.baseline {47 background: hsl(129, 29%, 77%);48 }49 50 .timeline-view.heap-allocations > .content-view-container {51 position: absolute;52 top: 0;53 bottom: 0;54 left: 0;55 right: 0;56 }57 58 @media (prefers-color-scheme: dark) {59 .timeline-view.heap-allocations > .data-grid td .icon.heap-snapshot {60 content: url(../Images/TypeIcons.svg#HeapSnapshot-dark);61 }62 } -
trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.css
r256774 r271236 32 32 } 33 33 34 .timeline-view.heap-allocations > .banner-view + .data-grid { 35 top: var(--navigation-bar-height); 36 } 37 34 38 .timeline-view.heap-allocations > .data-grid td .icon.heap-snapshot { 35 39 content: url(../Images/TypeIcons.svg#HeapSnapshot-light); -
trunk/Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js
r270134 r271236 89 89 this._snapshotListPathComponent.addEventListener(WI.HierarchicalPathComponent.Event.Clicked, this._snapshotListPathComponentClicked, this); 90 90 91 this._unseenRecords = []; 92 this._unseenRecordsBannerView = new WI.BannerView(WI.UIString("There are new snapshots that have been filtered", "There are new snapshots that have been filtered @ Heap Allocations Timeline View", "Message displayed in a banner when one or more snapshots that the user has not yet seen are being filtered."), { 93 actionButtonMessage: WI.UIString("Clear Filters", "Clear Filters @ Heap Allocations Timeline View", "Text for button that will clear both text filters and time range filters."), 94 showDismissButton: true, 95 }); 96 this._unseenRecordsBannerView.addEventListener(WI.BannerView.Event.ActionButtonClicked, this._handleUnseenRecordsBannerClearFiltersClicked, this); 97 this._unseenRecordsBannerView.addEventListener(WI.BannerView.Event.DismissButtonClicked, this._handleUnseenRecordsBannerDismissClicked, this); 98 91 99 this._dataGrid = new WI.TimelineDataGrid(columns); 92 100 this._dataGrid.sortColumnIdentifier = "timestamp"; … … 249 257 250 258 for (let heapAllocationsTimelineRecord of this._pendingRecords) { 251 this._dataGrid.addRowInSortOrder(new WI.HeapAllocationsTimelineDataGridNode(heapAllocationsTimelineRecord, {259 let dataGridNode = new WI.HeapAllocationsTimelineDataGridNode(heapAllocationsTimelineRecord, { 252 260 graphDataSource: this, 253 261 heapAllocationsView: this, 254 })); 262 }); 263 this._dataGrid.addRowInSortOrder(dataGridNode); 264 if (dataGridNode.hidden) 265 this._unseenRecords.push(dataGridNode); 255 266 } 256 267 257 268 this._pendingRecords = []; 269 this._updateUnseenRecordsBannerView(); 258 270 this._updateCompareHeapSnapshotButton(); 259 271 } … … 267 279 this.showHeapSnapshotList(); 268 280 this._pendingRecords = []; 281 this._unseenRecords = []; 282 this._updateUnseenRecordsBannerView(); 269 283 this._updateCompareHeapSnapshotButton(); 270 284 } … … 279 293 console.assert(this._contentViewContainer.currentContentView); 280 294 this._contentViewContainer.currentContentView.updateFilter(filters); 295 } 296 297 filterDidChange() 298 { 299 super.filterDidChange(); 300 301 this._updateUnseenRecordsBannerView(); 281 302 } 282 303 … … 366 387 367 388 this._compareHeapSnapshotsButtonItem.enabled = hasAtLeastTwoValidSnapshots; 389 } 390 391 _updateUnseenRecordsBannerView() 392 { 393 this._unseenRecords = this._unseenRecords.filter((record) => record.hidden); 394 if (this._unseenRecords.length) { 395 if (this._unseenRecordsBannerView.parentView !== this) 396 this.insertSubviewBefore(this._unseenRecordsBannerView, this._dataGrid); 397 } else { 398 if (this._unseenRecordsBannerView.parentView === this) 399 this.removeSubview(this._unseenRecordsBannerView); 400 } 368 401 } 369 402 … … 478 511 this._compareHeapSnapshotsButtonItem.activated = false; 479 512 } 513 514 _handleUnseenRecordsBannerClearFiltersClicked(event) 515 { 516 this.dispatchEventToListeners(WI.TimelineView.Event.NeedsFiltersCleared); 517 this.dispatchEventToListeners(WI.TimelineView.Event.NeedsEntireSelectedRange); 518 } 519 520 _handleUnseenRecordsBannerDismissClicked(event) 521 { 522 this._unseenRecords = []; 523 this._updateUnseenRecordsBannerView(); 524 } 480 525 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js
r270134 r271236 115 115 WI.TimelineView.addEventListener(WI.TimelineView.Event.ScannerHide, this._handleTimelineViewScannerHide, this); 116 116 WI.TimelineView.addEventListener(WI.TimelineView.Event.NeedsEntireSelectedRange, this._handleTimelineViewNeedsEntireSelectedRange, this); 117 WI.TimelineView.addEventListener(WI.TimelineView.Event.NeedsFiltersCleared, this._handleTimelineViewNeedsFiltersCleared, this); 118 117 119 118 120 WI.notifications.addEventListener(WI.Notification.VisibilityStateDidChange, this._inspectorVisibilityStateChanged, this); … … 971 973 } 972 974 975 _handleTimelineViewNeedsFiltersCleared(event) 976 { 977 if (!this.isAttached) 978 return; 979 980 this._filterBarNavigationItem.filterBar.clear(); 981 } 982 973 983 _updateProgressView() 974 984 { -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js
r270134 r271236 338 338 ScannerHide: "timeline-view-scanner-hide", 339 339 NeedsEntireSelectedRange: "timeline-view-needs-entire-selected-range", 340 NeedsFiltersCleared: "timeline-view-needs-filters-cleared", 340 341 };
Note: See TracChangeset
for help on using the changeset viewer.