Changeset 197488 in webkit
- Timestamp:
- Mar 2, 2016 7:50:37 PM (8 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r197487 r197488 1 2016-03-02 Matt Baker <mattbaker@apple.com> 2 3 Web Inspector: Timelines UI redesign: replace content view container with a content browser 4 https://bugs.webkit.org/show_bug.cgi?id=153033 5 <rdar://problem/24195565> 6 7 Reviewed by Timothy Hatcher. 8 9 This patch replaces the ContentViewContainer in the Timelines tab with a ContentBrowser, 10 moves filtering controls from the sidebar to the new browser's navigation bar, and adds 11 a new leaf path component for the current ruler selection to the main content browser's 12 navigation bar. 13 14 * Localizations/en.lproj/localizedStrings.js: 15 New UI strings. 16 17 * UserInterface/Base/Utilities.js: 18 Added global en dash string. 19 20 * UserInterface/Main.html: 21 * UserInterface/Test.html: 22 New files. 23 24 * UserInterface/Models/TimelineRange.js: 25 (WebInspector.TimelineRange): 26 (WebInspector.TimelineRange.prototype.get startValue): 27 (WebInspector.TimelineRange.prototype.set startValue): 28 (WebInspector.TimelineRange.prototype.get endValue): 29 (WebInspector.TimelineRange.prototype.set endValue): 30 New represented object used by ruler selection path components. 31 32 * UserInterface/Views/FilterBarNavigationItem.js: 33 (WebInspector.FilterBarNavigationItem): 34 (WebInspector.FilterBarNavigationItem.prototype.get filterBar): 35 Adapter class for using a FilterBar as a NavigationItem. 36 37 * UserInterface/Views/TimelineIcons.css: 38 (.time-icon .icon): 39 Icon class used by ruler selection path component. 40 41 * UserInterface/Views/TimelineRecordingContentView.css: 42 (.content-view.timeline-recording > .content-browser): 43 (.content-view.timeline-recording > .content-browser > .navigation-bar): 44 (.content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected > .multiple): 45 (.content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected > .multiple .arrows): 46 (.content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid td): 47 (.content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid table.data): 48 (.content-view.timeline-recording > .content-view-container): Deleted. 49 (.content-view.timeline-recording > .content-view-container > .timeline-view > .data-grid td): Deleted. 50 (.content-view.timeline-recording > .content-view-container > .timeline-view > .data-grid table.data): Deleted. 51 New styles for the ContentBrowser that replaces the ContentViewContainer. 52 53 * UserInterface/Views/TimelineRecordingContentView.js: 54 (WebInspector.TimelineRecordingContentView): 55 Create the ContentBrowser, ruler selection path components, and the browser's filter bar. 56 57 (WebInspector.TimelineRecordingContentView.prototype.showOverviewTimelineView): 58 (WebInspector.TimelineRecordingContentView.prototype.showTimelineViewForTimeline): 59 Implemented by the content browser instead of the view container. 60 61 (WebInspector.TimelineRecordingContentView.prototype.get selectionPathComponents): 62 Add timeline and selection path components. Components for the current TimelineView 63 are now located in the lower content browser's navigation bar. 64 65 (WebInspector.TimelineRecordingContentView.prototype.get supplementalRepresentedObjects): 66 (WebInspector.TimelineRecordingContentView.prototype.get handleCopyEvent): 67 (WebInspector.TimelineRecordingContentView.prototype.get supportsSave): 68 (WebInspector.TimelineRecordingContentView.prototype.get saveData): 69 (WebInspector.TimelineRecordingContentView.prototype.get currentTimelineView): 70 (WebInspector.TimelineRecordingContentView.prototype.shown): 71 (WebInspector.TimelineRecordingContentView.prototype.hidden): 72 (WebInspector.TimelineRecordingContentView.prototype.closed): 73 (WebInspector.TimelineRecordingContentView.prototype.canGoBack): 74 (WebInspector.TimelineRecordingContentView.prototype.canGoForward): 75 (WebInspector.TimelineRecordingContentView.prototype.goBack): 76 (WebInspector.TimelineRecordingContentView.prototype.goForward): 77 (WebInspector.TimelineRecordingContentView.prototype.saveToCookie): 78 Implemented by the content browser instead of the view container. 79 80 (WebInspector.TimelineRecordingContentView.prototype.contentBrowserTreeElementForRepresentedObject): 81 Create the root tree element for the lower content browser's navigation bar. 82 83 (WebInspector.TimelineRecordingContentView.prototype._timeRangePathComponentSelected): 84 Update the ruler selection based on the new path component. 85 86 (WebInspector.TimelineRecordingContentView.prototype._contentViewSelectionPathComponentDidChange): 87 (WebInspector.TimelineRecordingContentView.prototype._contentViewSupplementalRepresentedObjectsDidChange): 88 (WebInspector.TimelineRecordingContentView.prototype._updateTimes): 89 (WebInspector.TimelineRecordingContentView.prototype._updateTimelineOverviewHeight): 90 Implemented by the content browser instead of the view container. 91 92 (WebInspector.TimelineRecordingContentView.prototype._timeRangeSelectionChanged): 93 Update the currently selected path component when the ruler selection changes. 94 If the entire range is selected, show the "Entire Recording" path component, 95 otherwise update the TimelineRange of the path component for the user-defined 96 selection and refresh all timeline range path components. 97 98 (WebInspector.TimelineRecordingContentView.prototype._updateTimeRangePathComponents): 99 Update title text and sibling relationships for ruler selection path components. 100 101 (WebInspector.TimelineRecordingContentView.prototype._createTimelineRangePathComponent): 102 Helper function for creating TimelineRange path components. 103 104 (WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange): 105 The TimelineView scope bar is no longer added to the sidebar. The UI has been moved 106 to the lower content browser navigation bar. 107 108 (WebInspector.TimelineRecordingContentView.prototype._updateFrameSelection): Deleted. 109 No longer needed since the selected range is shown in the navigation bar. 110 111 * UserInterface/Views/TimelineView.js: 112 (WebInspector.TimelineView.prototype.get navigationItems): 113 Adds the TimelineView's scope bar (if any) to the lower content browser's navigation 114 bar. Items are inserted before the filter bar, which is always the right-most item. 115 1 116 2016-03-02 Matt Baker <mattbaker@apple.com> 2 117 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r197479 r197488 32 32 localizedStrings["%s Event Dispatched"] = "%s Event Dispatched"; 33 33 localizedStrings["%s Prototype"] = "%s Prototype"; 34 localizedStrings["%s \u2013 %s"] = "%s \u2013 %s"; 34 35 localizedStrings["%s \u2014 %s"] = "%s \u2014 %s"; 35 36 localizedStrings["%s delay"] = "%s delay"; … … 286 287 localizedStrings["Enter a value"] = "Enter a value"; 287 288 localizedStrings["Enter the name of a Keyframe"] = "Enter the name of a Keyframe"; 289 localizedStrings["Entire Recording"] = "Entire Recording"; 288 290 localizedStrings["Error: "] = "Error: "; 289 291 localizedStrings["Errors"] = "Errors"; … … 308 310 localizedStrings["Filter Breakpoint List"] = "Filter Breakpoint List"; 309 311 localizedStrings["Filter Console Log"] = "Filter Console Log"; 312 localizedStrings["Filter Records"] = "Filter Records"; 310 313 localizedStrings["Filter Resource List"] = "Filter Resource List"; 311 314 localizedStrings["Filter Search Results"] = "Filter Search Results"; … … 337 340 localizedStrings["Frame: %d (%s \u2013 %s)"] = "Frame: %d (%s \u2013 %s)"; 338 341 localizedStrings["Frames"] = "Frames"; 342 localizedStrings["Frames %d \u2013 %d"] = "Frames %d \u2013 %d"; 339 343 localizedStrings["Frames: %d \u2013 %d (%s \u2013 %s)"] = "Frames: %d \u2013 %d (%s \u2013 %s)"; 340 344 localizedStrings["Frames: None Selected"] = "Frames: None Selected"; … … 498 502 localizedStrings["Over 15 ms"] = "Over 15 ms"; 499 503 localizedStrings["Overflow"] = "Overflow"; 504 localizedStrings["Overview"] = "Overview"; 500 505 localizedStrings["Owns"] = "Owns"; 501 506 localizedStrings["Padding"] = "Padding"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js
r196867 r197488 25 25 26 26 var emDash = "\u2014"; 27 var enDash = "\u2013"; 27 28 var ellipsis = "\u2026"; 28 29 -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r197479 r197488 267 267 <script src="Models/SourceCodeLocation.js"></script> 268 268 <script src="Models/Timeline.js"></script> 269 <script src="Models/TimelineRange.js"></script> 269 270 <script src="Models/TimelineRecord.js"></script> 270 271 … … 490 491 <script src="Views/FilterBar.js"></script> 491 492 <script src="Views/FilterBarButton.js"></script> 493 <script src="Views/FilterBarNavigationItem.js"></script> 492 494 <script src="Views/FindBanner.js"></script> 493 495 <script src="Views/FlexibleSpaceNavigationItem.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRange.js
r197487 r197488 1 1 /* 2 * Copyright (C) 201 3Apple Inc. All rights reserved.2 * Copyright (C) 2016 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 .content-view.timeline-recording > .timeline-overview { 27 position: absolute; 28 top: 0; 29 left: 0; 30 right: 0; 31 } 26 WebInspector.TimelineRange = class TimelineRange extends WebInspector.Object 27 { 28 constructor(startValue, endValue) 29 { 30 super(); 32 31 33 .content-view.timeline-recording > .content-view-container { 34 position: absolute; 35 left: 0; 36 right: 0; 37 bottom: 0; 38 overflow: hidden; 39 } 32 this._startValue = startValue; 33 this._endValue = endValue; 34 } 40 35 41 .content-view.timeline-recording > .content-view-container > .timeline-view > .data-grid td { 42 height: 16px; 43 line-height: 16px; 44 } 36 get startValue() { return this._startValue; } 37 set startValue(x) { this._startValue = x; } 45 38 46 .content-view.timeline-recording > .content-view-container > .timeline-view > .data-grid table.data { 47 background-image: linear-gradient(to bottom, white, white 50%, hsl(0, 0%, 95%) 50%, hsl(0, 0%, 95%)); 48 background-size: 100% 40px; 49 } 39 get endValue() { return this._endValue; } 40 set endValue(x) { this._endValue = x; } 41 }; -
trunk/Source/WebInspectorUI/UserInterface/Test.html
r195305 r197488 83 83 <script src="Models/SourceCodeLocation.js"></script> 84 84 <script src="Models/Timeline.js"></script> 85 <script src="Models/TimelineRange.js"></script> 85 86 <script src="Models/TimelineRecord.js"></script> 86 87 -
trunk/Source/WebInspectorUI/UserInterface/Views/FilterBarNavigationItem.js
r197487 r197488 1 1 /* 2 * Copyright (C) 201 3Apple Inc. All rights reserved.2 * Copyright (C) 2016 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 .content-view.timeline-recording > .timeline-overview { 27 position: absolute; 28 top: 0; 29 left: 0; 30 right: 0; 31 } 26 WebInspector.FilterBarNavigationItem = class FilterBarNavigationItem extends WebInspector.NavigationItem 27 { 28 constructor() 29 { 30 super(); 32 31 33 .content-view.timeline-recording > .content-view-container { 34 position: absolute; 35 left: 0; 36 right: 0; 37 bottom: 0; 38 overflow: hidden; 39 } 32 this._filterBar = new WebInspector.FilterBar(this.element); 33 } 40 34 41 .content-view.timeline-recording > .content-view-container > .timeline-view > .data-grid td { 42 height: 16px; 43 line-height: 16px; 44 } 35 // Public 45 36 46 .content-view.timeline-recording > .content-view-container > .timeline-view > .data-grid table.data { 47 background-image: linear-gradient(to bottom, white, white 50%, hsl(0, 0%, 95%) 50%, hsl(0, 0%, 95%)); 48 background-size: 100% 40px; 49 } 37 get filterBar() 38 { 39 return this._filterBar; 40 } 41 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css
r197046 r197488 82 82 } 83 83 84 .time-icon .icon { 85 content: url(../Images/Timeline.svg); 86 width: 13px; 87 opacity: 0.6; 88 } 89 84 90 .style-record .icon { 85 91 content: url(../Images/TimelineRecordStyle.svg); -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.css
r187105 r197488 31 31 } 32 32 33 .content-view.timeline-recording > .content- view-container {33 .content-view.timeline-recording > .content-browser { 34 34 position: absolute; 35 35 left: 0; … … 37 37 bottom: 0; 38 38 overflow: hidden; 39 40 border-top: 1px solid var(--border-color); 39 41 } 40 42 41 .content-view.timeline-recording > .content-view-container > .timeline-view > .data-grid td { 43 .content-view.timeline-recording > .content-browser > .navigation-bar { 44 background-color: var(--panel-background-color); 45 border-bottom: none; 46 } 47 48 .content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected > .multiple { 49 background-color: transparent; 50 color: black; 51 } 52 53 .content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected > .multiple .arrows { 54 color: black; 55 } 56 57 .content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid td { 42 58 height: 16px; 43 59 line-height: 16px; 44 60 } 45 61 46 .content-view.timeline-recording > .content- view-container > .timeline-view > .data-grid table.data {62 .content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid table.data { 47 63 background-image: linear-gradient(to bottom, white, white 50%, hsl(0, 0%, 95%) 50%, hsl(0, 0%, 95%)); 48 64 background-size: 100% 40px; -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js
r197473 r197488 45 45 this.addSubview(this._timelineOverview); 46 46 47 this._contentViewContainer = new WebInspector.ContentViewContainer; 48 this._contentViewContainer.addEventListener(WebInspector.ContentViewContainer.Event.CurrentContentViewDidChange, this._currentContentViewDidChange, this); 49 this.addSubview(this._contentViewContainer); 47 const disableBackForward = true; 48 this._timelineContentBrowser = new WebInspector.ContentBrowser(null, this, disableBackForward); 49 this._timelineContentBrowser.addEventListener(WebInspector.ContentBrowser.Event.CurrentContentViewDidChange, this._currentContentViewDidChange, this); 50 51 this._entireRecordingPathComponent = this._createTimelineRangePathComponent(WebInspector.UIString("Entire Recording")); 52 this._timelineSelectionPathComponent = this._createTimelineRangePathComponent(); 53 this._timelineSelectionPathComponent.previousSibling = this._entireRecordingPathComponent; 54 this._selectedTimeRangePathComponent = this._entireRecordingPathComponent; 55 56 this._filterBarNavigationItem = new WebInspector.FilterBarNavigationItem; 57 this._filterBarNavigationItem.filterBar.placeholder = WebInspector.UIString("Filter Records"); 58 this._timelineContentBrowser.navigationBar.addNavigationItem(this._filterBarNavigationItem); 59 this.addSubview(this._timelineContentBrowser); 50 60 51 61 this._clearTimelineNavigationItem = new WebInspector.ButtonNavigationItem("clear-timeline", WebInspector.UIString("Clear Timeline"), "Images/NavigationItemTrash.svg", 15, 15); … … 88 98 showOverviewTimelineView() 89 99 { 90 this._ contentViewContainer.showContentView(this._overviewTimelineView);100 this._timelineContentBrowser.showContentView(this._overviewTimelineView); 91 101 } 92 102 … … 98 108 return; 99 109 100 this._ contentViewContainer.showContentView(this._timelineViewMap.get(timeline));110 this._timelineContentBrowser.showContentView(this._timelineViewMap.get(timeline)); 101 111 } 102 112 … … 109 119 get selectionPathComponents() 110 120 { 111 if (!this._ contentViewContainer.currentContentView)121 if (!this._timelineContentBrowser.currentContentView) 112 122 return []; 113 123 114 var pathComponents = this._contentViewContainer.currentContentView.selectionPathComponents ||[];115 var representedObject = this._contentViewContainer.currentContentView.representedObject;124 let pathComponents = []; 125 let representedObject = this._timelineContentBrowser.currentContentView.representedObject; 116 126 if (representedObject instanceof WebInspector.Timeline) 117 pathComponents.unshift(this._pathComponentMap.get(representedObject)); 127 pathComponents.push(this._pathComponentMap.get(representedObject)); 128 129 pathComponents.push(this._selectedTimeRangePathComponent); 118 130 return pathComponents; 119 131 } … … 121 133 get supplementalRepresentedObjects() 122 134 { 123 if (!this._ contentViewContainer.currentContentView)135 if (!this._timelineContentBrowser.currentContentView) 124 136 return []; 125 return this._ contentViewContainer.currentContentView.supplementalRepresentedObjects;137 return this._timelineContentBrowser.currentContentView.supplementalRepresentedObjects; 126 138 } 127 139 … … 133 145 get handleCopyEvent() 134 146 { 135 var currentContentView = this._contentViewContainer.currentContentView;147 let currentContentView = this._timelineContentBrowser.currentContentView; 136 148 return currentContentView && typeof currentContentView.handleCopyEvent === "function" ? currentContentView.handleCopyEvent.bind(currentContentView) : null; 137 149 } … … 139 151 get supportsSave() 140 152 { 141 var currentContentView = this._contentViewContainer.currentContentView;153 let currentContentView = this._timelineContentBrowser.currentContentView; 142 154 return currentContentView && currentContentView.supportsSave; 143 155 } … … 145 157 get saveData() 146 158 { 147 var currentContentView = this._contentViewContainer.currentContentView;159 let currentContentView = this._timelineContentBrowser.currentContentView; 148 160 return currentContentView && currentContentView.saveData || null; 149 161 } … … 151 163 get currentTimelineView() 152 164 { 153 var contentView = this._contentViewContainer.currentContentView;165 let contentView = this._timelineContentBrowser.currentContentView; 154 166 return (contentView instanceof WebInspector.TimelineView) ? contentView : null; 155 167 } … … 163 175 { 164 176 this._timelineOverview.shown(); 165 this._ contentViewContainer.shown();177 this._timelineContentBrowser.shown(); 166 178 this._clearTimelineNavigationItem.enabled = !this._recording.readonly && !isNaN(this._recording.startTime); 167 179 … … 175 187 { 176 188 this._timelineOverview.hidden(); 177 this._ contentViewContainer.hidden();189 this._timelineContentBrowser.hidden(); 178 190 179 191 if (this._updating) … … 183 195 closed() 184 196 { 185 this._ contentViewContainer.closeAllContentViews();197 this._timelinContentBrowser.contentViewContainer.closeAllContentViews(); 186 198 187 199 this._recording.removeEventListener(null, null, this); … … 194 206 canGoBack() 195 207 { 196 return this._ contentViewContainer.canGoBack();208 return this._timelineContentBrowser.canGoBack(); 197 209 } 198 210 199 211 canGoForward() 200 212 { 201 return this._ contentViewContainer.canGoForward();213 return this._timelineContentBrowser.canGoForward(); 202 214 } 203 215 204 216 goBack() 205 217 { 206 this._ contentViewContainer.goBack();218 this._timelineContentBrowser.goBack(); 207 219 } 208 220 209 221 goForward() 210 222 { 211 this._ contentViewContainer.goForward();223 this._timelineContentBrowser.goForward(); 212 224 } 213 225 … … 216 228 cookie.type = WebInspector.ContentViewCookieType.Timelines; 217 229 218 var currentContentView = this._contentViewContainer.currentContentView;230 let currentContentView = this._timelineContentBrowser.currentContentView; 219 231 if (!currentContentView || currentContentView === this._overviewTimelineView) 220 232 cookie[WebInspector.TimelineRecordingContentView.SelectedTimelineTypeCookieKey] = WebInspector.TimelineRecordingContentView.OverviewTimelineViewCookieValue; … … 318 330 console.error("Unknown TreeElement, can't filter by time."); 319 331 return true; 332 } 333 334 // ContentBrowser delegate 335 336 contentBrowserTreeElementForRepresentedObject(contentBrowser, representedObject) 337 { 338 if (!(representedObject instanceof WebInspector.Timeline) && !(representedObject instanceof WebInspector.TimelineRecording)) 339 return null; 340 341 let iconClassName; 342 let title; 343 if (representedObject instanceof WebInspector.Timeline) { 344 iconClassName = WebInspector.TimelineTabContentView.iconClassNameForTimeline(representedObject); 345 title = WebInspector.UIString("Details"); 346 } else { 347 iconClassName = "stopwatch-icon"; 348 title = WebInspector.UIString("Overview"); 349 } 350 351 const hasChildren = false; 352 return new WebInspector.GeneralTreeElement(iconClassName, title, representedObject, hasChildren); 320 353 } 321 354 … … 336 369 this._timelineSidebarPanel.contentTreeOutline = timelineView.navigationSidebarTreeOutline; 337 370 this._timelineSidebarPanel.contentTreeOutlineLabel = timelineView.navigationSidebarTreeOutlineLabel; 338 this._timelineSidebarPanel.contentTreeOutlineScopeBar = timelineView.navigationSidebarTreeOutlineScopeBar;339 371 340 372 this._updateTimelineViewSelection(timelineView); … … 357 389 } 358 390 391 _timeRangePathComponentSelected(event) 392 { 393 let selectedPathComponent = event.data.pathComponent; 394 if (selectedPathComponent === this._selectedTimeRangePathComponent) 395 return; 396 397 let timelineRuler = this._timelineOverview.timelineRuler 398 if (selectedPathComponent === this._entireRecordingPathComponent) 399 timelineRuler.selectEntireRange(); 400 else { 401 let timelineRange = selectedPathComponent.representedObject; 402 timelineRuler.selectionStartTime = timelineRuler.zeroTime + timelineRange.startValue; 403 timelineRuler.selectionEndTime = timelineRuler.zeroTime + timelineRange.endValue; 404 } 405 } 406 359 407 _contentViewSelectionPathComponentDidChange(event) 360 408 { 361 if (event.target !== this._ contentViewContainer.currentContentView)409 if (event.target !== this._timelineContentBrowser.currentContentView) 362 410 return; 363 411 … … 374 422 _contentViewSupplementalRepresentedObjectsDidChange(event) 375 423 { 376 if (event.target !== this._ contentViewContainer.currentContentView)424 if (event.target !== this._timelineContentBrowser.currentContentView) 377 425 return; 378 426 this.dispatchEventToListeners(WebInspector.ContentView.Event.SupplementalRepresentedObjectsDidChange); … … 413 461 this._timelineOverview.startTime = startTime; 414 462 this._overviewTimelineView.zeroTime = startTime; 415 for (var timelineView of this._timelineViewMap.values()) 463 for (var timelineView of this._timelineViewMap.values()) { 464 if (timelineView.representedObject.type === WebInspector.TimelineRecord.Type.RenderingFrame) 465 continue; 466 416 467 timelineView.zeroTime = startTime; 468 } 417 469 418 470 this._startTimeNeedsReset = false; … … 540 592 let styleValue = (rulerHeight + this.timelineOverviewHeight) + "px"; 541 593 this._timelineOverview.element.style.height = styleValue; 542 this._ contentViewContainer.element.style.top = styleValue;594 this._timelineContentBrowser.element.style.top = styleValue; 543 595 } 544 596 … … 631 683 _timeRangeSelectionChanged(event) 632 684 { 633 if (this.currentTimelineView) { 634 this._updateTimelineViewSelection(this.currentTimelineView); 635 636 if (this.currentTimelineView.representedObject.type === WebInspector.TimelineRecord.Type.RenderingFrame) 637 this._updateFrameSelection(); 685 console.assert(this.currentTimelineView); 686 if (!this.currentTimelineView) 687 return; 688 689 this._updateTimelineViewSelection(this.currentTimelineView); 690 691 let selectedPathComponent; 692 if (this._timelineOverview.timelineRuler.entireRangeSelected) 693 selectedPathComponent = this._entireRecordingPathComponent; 694 else { 695 let timelineRange = this._timelineSelectionPathComponent.representedObject; 696 timelineRange.startValue = this.currentTimelineView.startTime; 697 timelineRange.endValue = this.currentTimelineView.endTime; 698 699 this._updateTimeRangePathComponents(); 700 selectedPathComponent = this._timelineSelectionPathComponent; 701 } 702 703 if (this._selectedTimeRangePathComponent !== selectedPathComponent) { 704 this._selectedTimeRangePathComponent = selectedPathComponent; 705 this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange); 638 706 } 639 707 … … 685 753 } 686 754 687 _updateFrameSelection() 688 { 689 console.assert(this._renderingFrameTimeline); 690 if (!this._renderingFrameTimeline) 691 return; 692 693 let startIndex = this._timelineOverview.selectionStartTime; 694 let endIndex = startIndex + this._timelineOverview.selectionDuration - 1; 695 this._timelineSidebarPanel.updateFrameSelection(startIndex, endIndex); 755 _updateTimeRangePathComponents() 756 { 757 let timelineRange = this._timelineSelectionPathComponent.representedObject; 758 let startValue = timelineRange.startValue; 759 let endValue = timelineRange.endValue; 760 if (isNaN(startValue) || isNaN(endValue)) { 761 this._entireRecordingPathComponent.nextSibling = null; 762 return; 763 } 764 765 this._entireRecordingPathComponent.nextSibling = this._timelineSelectionPathComponent; 766 767 let displayName; 768 if (this._timelineOverview.viewMode === WebInspector.TimelineOverview.ViewMode.Timelines) { 769 let selectionStart = Number.secondsToString(startValue, true); 770 let selectionEnd = Number.secondsToString(endValue, true); 771 displayName = WebInspector.UIString("%s \u2013 %s").format(selectionStart, selectionEnd); 772 } else { 773 startValue += 1; // Convert index to frame number. 774 if (startValue === endValue) 775 displayName = WebInspector.UIString("Frame %d").format(startValue); 776 else 777 displayName = WebInspector.UIString("Frames %d \u2013 %d").format(startValue, endValue); 778 } 779 780 this._timelineSelectionPathComponent.displayName = displayName; 781 this._timelineSelectionPathComponent.title = displayName; 782 } 783 784 _createTimelineRangePathComponent(title) 785 { 786 let range = new WebInspector.TimelineRange(NaN, NaN); 787 let pathComponent = new WebInspector.HierarchicalPathComponent(title || enDash, "time-icon", range); 788 pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._timeRangePathComponentSelected, this); 789 790 return pathComponent; 696 791 } 697 792 -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js
r193612 r197488 53 53 // Public 54 54 55 get navigationItems() 56 { 57 return this._scopeBar ? [this._scopeBar] : []; 58 } 59 55 60 get navigationSidebarTreeOutline() 56 61 {
Note: See TracChangeset
for help on using the changeset viewer.