Changeset 183821 in webkit
- Timestamp:
- May 5, 2015, 11:11:50 AM (11 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 13 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Views/GeneralTreeElement.js (modified) (4 diffs)
-
UserInterface/Views/NavigationSidebarPanel.js (modified) (2 diffs)
-
UserInterface/Views/NetworkTimelineView.js (modified) (3 diffs)
-
UserInterface/Views/OverviewTimelineView.js (modified) (3 diffs)
-
UserInterface/Views/RenderingFrameTimelineView.js (modified) (1 diff)
-
UserInterface/Views/ResourceTimelineDataGridNode.js (modified) (2 diffs)
-
UserInterface/Views/ScriptTimelineView.js (modified) (2 diffs)
-
UserInterface/Views/TimelineRecordTreeElement.js (modified) (1 diff)
-
UserInterface/Views/TimelineSidebarPanel.css (modified) (1 diff)
-
UserInterface/Views/TimelineSidebarPanel.js (modified) (2 diffs)
-
UserInterface/Views/TimelineView.js (modified) (6 diffs)
-
UserInterface/Views/TreeElementStatusButton.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r183816 r183821 1 2015-05-05 Timothy Hatcher <timothy@apple.com> 2 3 REGRESSION: Web Inspector: no way to navigate to a resource/source location from overview timeline view 4 https://bugs.webkit.org/show_bug.cgi?id=144539 5 6 Reviewed by Brian Burg. 7 8 * UserInterface/Views/GeneralTreeElement.js: 9 (WebInspector.GeneralTreeElement.prototype.set status): Call didChange() so the onchange event fires. This allows 10 TimelineSidebarPanel to update the status element when it goes from a spinner to empty for ResourceTreeElements. 11 (WebInspector.GeneralTreeElement.prototype.onattach): Don't call _updateStatusElement, just append it if needed. 12 Calling _updateStatusElement caused DOMNodeFragments as status elements to be appended a second time and fail. 13 * UserInterface/Views/NavigationSidebarPanel.js: 14 (WebInspector.NavigationSidebarPanel.prototype.treeElementAddedOrChanged): 15 (WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged): 16 * UserInterface/Views/NetworkTimelineView.js: 17 (WebInspector.NetworkTimelineView.prototype.canShowContentViewForTreeElement): 18 (WebInspector.NetworkTimelineView.prototype.showContentViewForTreeElement): 19 (WebInspector.NetworkTimelineView.prototype.treeElementSelected): 20 (WebInspector.NetworkTimelineView.prototype._dataGridNodeSelected): 21 (WebInspector.NetworkTimelineView.prototype._updateTreeElementWithCloseButton): Deleted. 22 (WebInspector.NetworkTimelineView.prototype._closeStatusButtonClicked): Deleted. 23 * UserInterface/Views/OverviewTimelineView.js: 24 (WebInspector.OverviewTimelineView.prototype.canShowContentViewForTreeElement): 25 (WebInspector.OverviewTimelineView.prototype.showContentViewForTreeElement): 26 (WebInspector.OverviewTimelineView.prototype._dataGridNodeSelected): 27 (WebInspector.OverviewTimelineView.prototype._treeElementDeselected): Deleted. 28 (WebInspector.OverviewTimelineView.prototype._treeElementSelected): Deleted. 29 (WebInspector.OverviewTimelineView.prototype._updateTreeElementWithCloseButton): Deleted. 30 (WebInspector.OverviewTimelineView.prototype._closeStatusButtonClicked): Deleted. 31 * UserInterface/Views/RenderingFrameTimelineView.js: 32 (WebInspector.RenderingFrameTimelineView.prototype.canShowContentViewForTreeElement): 33 (WebInspector.RenderingFrameTimelineView.prototype.showContentViewForTreeElement): 34 * UserInterface/Views/ResourceTimelineDataGridNode.js: 35 (WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent): Don't show a go-to arrow in the Domain column. 36 (WebInspector.ResourceTimelineDataGridNode.prototype._goToResource): Deleted. 37 * UserInterface/Views/ScriptTimelineView.js: 38 (WebInspector.ScriptTimelineView.prototype.canShowContentViewForTreeElement): 39 (WebInspector.ScriptTimelineView.prototype.showContentViewForTreeElement): 40 (WebInspector.ScriptTimelineView.prototype.treeElementSelected): 41 * UserInterface/Views/TimelineRecordTreeElement.js: 42 (WebInspector.TimelineRecordTreeElement.prototype.get sourceCodeLocation): 43 * UserInterface/Views/TimelineSidebarPanel.css: 44 (.sidebar > .panel.navigation.timeline .item:hover:not(.selected) .status .close.status-button): 45 (.sidebar > .panel.navigation.timeline:not(.timeline-recording-content-view-showing) .status .go-to-arrow.status-button): 46 (.sidebar > .panel.navigation.timeline.timeline-recording-content-view-showing .status .close.status-button): 47 * UserInterface/Views/TimelineSidebarPanel.js: 48 (WebInspector.TimelineSidebarPanel.prototype.treeElementAddedOrChanged): Added. 49 (WebInspector.TimelineSidebarPanel.prototype.canShowDifferentContentView): 50 (WebInspector.TimelineSidebarPanel.prototype._treeElementGoToArrowWasClicked): Added. 51 (WebInspector.TimelineSidebarPanel.prototype._treeElementCloseButtonClicked): Added. 52 * UserInterface/Views/TimelineView.js: 53 (WebInspector.TimelineView): 54 (WebInspector.TimelineView.prototype.canShowContentViewForTreeElement): 55 (WebInspector.TimelineView.prototype.showContentViewForTreeElement): 56 (WebInspector.TimelineView.prototype.treeElementDeselected): 57 (WebInspector.TimelineView.prototype.treeElementSelected): 58 (WebInspector.TimelineView.prototype.needsLayout): 59 (WebInspector.TimelineView.prototype._closeStatusButtonClicked): Deleted. 60 (WebInspector.TimelineView.prototype._updateTreeElementWithCloseButton): Deleted. 61 * UserInterface/Views/TreeElementStatusButton.css: 62 (.item > .status > .status-button): Fix an alignment issue with close and go-to arrows being side-by-side. 63 Does not happen in the final patch because they are mutually exclusive, but still good to fix. 64 1 65 2015-05-05 Timothy Hatcher <timothy@apple.com> 2 66 -
trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js
r182990 r183821 189 189 this._status = x || ""; 190 190 this._updateStatusElement(); 191 this.didChange(); 191 192 } 192 193 … … 220 221 this._listItemNode.classList.add("item"); 221 222 222 if (this._classNames) {223 if (this._classNames) 223 224 this._listItemNode.classList.add(...this._classNames); 224 }225 225 226 226 if (this._small) … … 232 232 this._listItemNode.appendChild(this._disclosureButton); 233 233 this._listItemNode.appendChild(this._iconElement); 234 if (this._statusElement) 235 this._listItemNode.appendChild(this._statusElement); 234 236 this._listItemNode.appendChild(this._titlesElement); 235 237 … … 243 245 this._listItemNode.addEventListener("contextmenu", this._boundContextMenuEventHandler); 244 246 } 245 246 this._updateStatusElement();247 247 } 248 248 -
trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js
r183713 r183821 389 389 } 390 390 391 treeElementAddedOrChanged(treeElement) 392 { 393 // Implemented by subclasses if needed. 394 } 395 391 396 show() 392 397 { … … 521 526 if (this.selected) 522 527 this._checkElementsForPendingViewStateCookie(treeElement); 528 529 this.treeElementAddedOrChanged(treeElement); 523 530 } 524 531 -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js
r183764 r183821 155 155 // Protected 156 156 157 canShowContentViewForTreeElement: function(treeElement) 158 { 159 if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) 160 return true; 161 return WebInspector.TimelineView.prototype.canShowContentViewForTreeElement(treeElement); 162 }, 163 157 164 showContentViewForTreeElement: function(treeElement) 158 165 { 159 166 if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) { 160 167 WebInspector.showSourceCode(treeElement.representedObject); 161 return true;168 return; 162 169 } 163 170 164 171 console.error("Unknown tree element selected.", treeElement); 165 return false;166 172 }, 167 173 … … 177 183 { 178 184 if (this._dataGrid.shouldIgnoreSelectionEvent()) 179 return false;185 return; 180 186 181 187 WebInspector.TimelineView.prototype.treeElementSelected.call(this, treeElement, selectedByUser); … … 222 228 { 223 229 this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange); 224 },225 226 _updateTreeElementWithCloseButton: function(treeElement)227 {228 if (this._closeStatusButton) {229 treeElement.status = this._closeStatusButton.element;230 return;231 }232 233 wrappedSVGDocument("Images/Close.svg", null, WebInspector.UIString("Close resource view"), function(element) {234 this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);235 this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);236 if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)237 this._updateTreeElementWithCloseButton(treeElement);238 }.bind(this));239 },240 241 _closeStatusButtonClicked: function(event)242 {243 this.navigationSidebarTreeOutline.selectedTreeElement.deselect();244 this.timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);245 230 } 246 231 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js
r183764 r183821 28 28 WebInspector.TimelineView.call(this, recording, extraArguments); 29 29 30 this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);31 this.navigationSidebarTreeOutline.ondeselect = this._treeElementDeselected.bind(this);32 33 30 this._recording = recording; 34 31 … … 160 157 }, 161 158 159 canShowContentViewForTreeElement: function(treeElement) 160 { 161 if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) 162 return true; 163 return WebInspector.TimelineView.prototype.canShowContentViewForTreeElement(treeElement); 164 }, 165 166 showContentViewForTreeElement: function(treeElement) 167 { 168 if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) { 169 WebInspector.showSourceCode(treeElement.representedObject); 170 return; 171 } 172 173 if (!(treeElement instanceof WebInspector.SourceCodeTimelineTreeElement)) { 174 console.error("Unknown tree element selected."); 175 return; 176 } 177 178 if (!treeElement.sourceCodeTimeline.sourceCodeLocation) { 179 this.timelineSidebarPanel.showTimelineOverview(); 180 return; 181 } 182 183 WebInspector.showOriginalOrFormattedSourceCodeLocation(treeElement.sourceCodeTimeline.sourceCodeLocation); 184 }, 185 162 186 // Private 163 187 … … 330 354 { 331 355 this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange); 332 },333 334 _treeElementDeselected: function(treeElement)335 {336 if (treeElement.status)337 treeElement.status = "";338 },339 340 _treeElementSelected: function(treeElement, selectedByUser)341 {342 if (!this.timelineSidebarPanel.canShowDifferentContentView())343 return;344 345 if (treeElement instanceof WebInspector.FolderTreeElement)346 return;347 348 if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {349 WebInspector.showSourceCode(treeElement.representedObject);350 this._updateTreeElementWithCloseButton(treeElement);351 return;352 }353 354 if (!(treeElement instanceof WebInspector.SourceCodeTimelineTreeElement)) {355 console.error("Unknown tree element selected.");356 return;357 }358 359 if (!treeElement.sourceCodeTimeline.sourceCodeLocation) {360 this.timelineSidebarPanel.showTimelineOverview();361 this.dispatchEventToListeners(WebInspector.ContentView.Event.SelectionPathComponentsDidChange);362 return;363 }364 365 WebInspector.showOriginalOrFormattedSourceCodeLocation(treeElement.sourceCodeTimeline.sourceCodeLocation);366 this._updateTreeElementWithCloseButton(treeElement);367 },368 369 _updateTreeElementWithCloseButton: function(treeElement)370 {371 if (this._closeStatusButton) {372 treeElement.status = this._closeStatusButton.element;373 return;374 }375 376 wrappedSVGDocument("Images/Close.svg", null, WebInspector.UIString("Close resource view"), function(element) {377 this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);378 this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);379 if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)380 this._updateTreeElementWithCloseButton(treeElement);381 }.bind(this));382 },383 384 _closeStatusButtonClicked: function(event)385 {386 this.navigationSidebarTreeOutline.selectedTreeElement.deselect();387 this.timelineSidebarPanel.showTimelineOverview();388 356 } 389 357 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/RenderingFrameTimelineView.js
r183764 r183821 157 157 // Protected 158 158 159 canShowContentViewForTreeElement: function(treeElement) 160 { 161 if (treeElement instanceof WebInspector.ProfileNodeTreeElement) 162 return !!treeElement.profileNode.sourceCodeLocation; 163 return WebInspector.TimelineView.prototype.canShowContentViewForTreeElement(treeElement); 164 }, 165 159 166 showContentViewForTreeElement: function(treeElement) 160 167 { 161 if (treeElement instanceof WebInspector.ProfileNodeTreeElement && treeElement.profileNode.sourceCodeLocation) { 162 WebInspector.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation); 163 return true; 168 if (treeElement instanceof WebInspector.ProfileNodeTreeElement) { 169 if (treeElement.profileNode.sourceCodeLocation) 170 WebInspector.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation); 171 return; 164 172 } 165 173 166 returnWebInspector.TimelineView.prototype.showContentViewForTreeElement.call(this, treeElement);174 WebInspector.TimelineView.prototype.showContentViewForTreeElement.call(this, treeElement); 167 175 }, 168 176 -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTimelineDataGridNode.js
r183331 r183821 117 117 118 118 case "domain": 119 var fragment = document.createDocumentFragment(); 120 121 var goToButton = WebInspector.createGoToArrowButton(); 122 goToButton.addEventListener("click", this._goToResource.bind(this)); 123 fragment.appendChild(goToButton); 124 125 var text = document.createTextNode(value || emptyValuePlaceholderString); 126 fragment.appendChild(text); 127 128 return fragment; 119 return value || emptyValuePlaceholderString; 129 120 130 121 case "size": … … 168 159 }, 169 160 170 _goToResource: function(event)171 {172 WebInspector.showSourceCode(this._resource);173 },174 175 161 _timelineRecordUpdated: function(event) 176 162 { -
trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js
r183764 r183821 170 170 // Protected 171 171 172 canShowContentViewForTreeElement: function(treeElement) 173 { 174 if (treeElement instanceof WebInspector.ProfileNodeTreeElement) 175 return !!treeElement.profileNode.sourceCodeLocation; 176 return WebInspector.TimelineView.prototype.canShowContentViewForTreeElement(treeElement); 177 }, 178 172 179 showContentViewForTreeElement: function(treeElement) 173 180 { 174 if (treeElement instanceof WebInspector.ProfileNodeTreeElement && treeElement.profileNode.sourceCodeLocation) { 175 WebInspector.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation); 176 return true; 177 } 178 179 return WebInspector.TimelineView.prototype.showContentViewForTreeElement.call(this, treeElement); 181 if (treeElement instanceof WebInspector.ProfileNodeTreeElement) { 182 if (treeElement.profileNode.sourceCodeLocation) 183 WebInspector.showOriginalOrFormattedSourceCodeLocation(treeElement.profileNode.sourceCodeLocation); 184 return; 185 } 186 187 WebInspector.TimelineView.prototype.showContentViewForTreeElement.call(this, treeElement); 180 188 }, 181 189 … … 191 199 { 192 200 if (this._dataGrid.shouldIgnoreSelectionEvent()) 193 return false;201 return; 194 202 195 203 WebInspector.TimelineView.prototype.treeElementSelected.call(this, treeElement, selectedByUser); -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordTreeElement.js
r182660 r183821 134 134 } 135 135 136 get sourceCodeLocation() 137 { 138 return this._sourceCodeLocation; 139 } 140 136 141 // Protected 137 142 -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.css
r183721 r183821 194 194 } 195 195 196 .sidebar > .panel.navigation.timeline .item:not(:hover, .selected) .status .status-button, 197 .sidebar > .panel.navigation.timeline .item:hover:not(.selected) .status .close.status-button { 198 display: none; 199 } 200 201 .sidebar > .panel.navigation.timeline:not(.timeline-recording-content-view-showing) .status .go-to-arrow.status-button { 202 display: none; 203 } 204 205 .sidebar > .panel.navigation.timeline.timeline-recording-content-view-showing .status .close.status-button { 206 display: none; 207 } 208 196 209 .sidebar > .panel.navigation.timeline > .timelines-content > .details-section > div.header { 197 210 display: none; -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js
r183764 r183821 355 355 } 356 356 357 treeElementAddedOrChanged(treeElement) 358 { 359 if (treeElement.status) 360 return; 361 362 if (!treeElement.treeOutline || typeof treeElement.treeOutline.__canShowContentViewForTreeElement !== "function") 363 return; 364 365 if (!treeElement.treeOutline.__canShowContentViewForTreeElement(treeElement)) 366 return; 367 368 wrappedSVGDocument("Images/Close.svg", null, WebInspector.UIString("Close resource view"), function(element) { 369 var fragment = document.createDocumentFragment(); 370 371 var closeButton = new WebInspector.TreeElementStatusButton(element); 372 closeButton.element.classList.add("close"); 373 closeButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._treeElementCloseButtonClicked, this); 374 fragment.appendChild(closeButton.element); 375 376 var goToButton = new WebInspector.TreeElementStatusButton(WebInspector.createGoToArrowButton()); 377 goToButton.__treeElement = treeElement; 378 goToButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._treeElementGoToArrowWasClicked, this); 379 fragment.appendChild(goToButton.element); 380 381 treeElement.status = fragment; 382 }.bind(this)); 383 } 384 357 385 canShowDifferentContentView() 358 386 { 387 if (this._clickedTreeElementGoToArrow) 388 return true; 389 359 390 if (this.contentBrowser.currentContentView instanceof WebInspector.TimelineRecordingContentView) 360 391 return false; … … 409 440 410 441 // Private 442 443 _treeElementGoToArrowWasClicked(event) 444 { 445 this._clickedTreeElementGoToArrow = true; 446 447 var treeElement = event.target.__treeElement; 448 console.assert(treeElement instanceof WebInspector.TreeElement); 449 450 treeElement.select(true, true); 451 452 this._clickedTreeElementGoToArrow = false; 453 } 454 455 _treeElementCloseButtonClicked(event) 456 { 457 var currentTimelineView = this._displayedContentView ? this._displayedContentView.currentTimelineView : null; 458 if (currentTimelineView && currentTimelineView.representedObject instanceof WebInspector.Timeline) 459 this.showTimelineViewForTimeline(currentTimelineView.representedObject); 460 else 461 this.showTimelineOverview(); 462 } 411 463 412 464 _recordingsTreeElementSelected(treeElement, selectedByUser) -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js
r183579 r183821 40 40 this._contentTreeOutline.onselect = this.treeElementSelected.bind(this); 41 41 this._contentTreeOutline.ondeselect = this.treeElementDeselected.bind(this); 42 this._contentTreeOutline.__canShowContentViewForTreeElement = this.canShowContentViewForTreeElement.bind(this); 42 43 43 44 this.element.classList.add("timeline-view"); … … 192 193 // Protected 193 194 195 canShowContentViewForTreeElement: function(treeElement) 196 { 197 // Implemented by sub-classes if needed. 198 199 if (treeElement instanceof WebInspector.TimelineRecordTreeElement) 200 return !!treeElement.sourceCodeLocation; 201 return false; 202 }, 203 194 204 showContentViewForTreeElement: function(treeElement) 195 205 { … … 198 208 if (!(treeElement instanceof WebInspector.TimelineRecordTreeElement)) { 199 209 console.error("Unknown tree element selected.", treeElement); 200 return false;201 } 202 203 var sourceCodeLocation = treeElement. record.sourceCodeLocation;210 return; 211 } 212 213 var sourceCodeLocation = treeElement.sourceCodeLocation; 204 214 if (!sourceCodeLocation) { 205 215 this._timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject); 206 return true;216 return; 207 217 } 208 218 209 219 WebInspector.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation); 210 return true;211 220 }, 212 221 … … 219 228 { 220 229 // Implemented by sub-classes if needed. 221 222 if (this._closeStatusButton && treeElement.status === this._closeStatusButton.element)223 treeElement.status = "";224 230 }, 225 231 … … 234 240 return; 235 241 236 if (!this.showContentViewForTreeElement(treeElement)) 237 return; 238 239 this._updateTreeElementWithCloseButton(treeElement); 242 this.showContentViewForTreeElement(treeElement); 240 243 }, 241 244 … … 249 252 250 253 this._scheduledLayoutUpdateIdentifier = requestAnimationFrame(this.updateLayout.bind(this)); 251 },252 253 // Private254 255 _closeStatusButtonClicked: function(event)256 {257 if (this.navigationSidebarTreeOutline.selectedTreeElement)258 this.navigationSidebarTreeOutline.selectedTreeElement.deselect();259 260 this._timelineSidebarPanel.showTimelineViewForTimeline(this.representedObject);261 },262 263 _updateTreeElementWithCloseButton: function(treeElement)264 {265 if (this._closeStatusButton) {266 treeElement.status = this._closeStatusButton.element;267 return;268 }269 270 wrappedSVGDocument("Images/Close.svg", null, WebInspector.UIString("Close resource view"), function(element) {271 this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);272 this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);273 if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)274 this._updateTreeElementWithCloseButton(treeElement);275 }.bind(this));276 254 } 277 255 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.css
r183579 r183821 28 28 height: 16px; 29 29 display: inline-block; 30 vertical-align: middle; 30 31 } 31 32
Note:
See TracChangeset
for help on using the changeset viewer.