Changeset 243225 in webkit
- Timestamp:
- Mar 20, 2019, 12:37:16 PM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Views/SourcesNavigationSidebarPanel.css (modified) (4 diffs)
-
UserInterface/Views/SourcesNavigationSidebarPanel.js (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r243224 r243225 1 2019-03-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Sources: disabled breakpoints banner should be sticky 4 https://bugs.webkit.org/show_bug.cgi?id=195104 5 <rdar://problem/48442259> 6 7 Reviewed by Timothy Hatcher. 8 9 Allow each of the individual sections to be scrolled separately from the entire sidebar. 10 11 Leverage CSS variables set via JavaScript to be able to calculate the maximum height of each 12 `WI.TreeOutline` section based on the number of items. 13 14 * UserInterface/Views/SourcesNavigationSidebarPanel.js: 15 (WI.SourcesNavigationSidebarPanel): 16 (WI.SourcesNavigationSidebarPanel.prototype._handleCallStackElementAddedOrRemoved): Added. 17 (WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved): 18 (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused): 19 (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed): 20 * UserInterface/Views/SourcesNavigationSidebarPanel.css: 21 (.sidebar > .panel.navigation.sources > .content): 22 (.sidebar > .panel.navigation.sources > .content .details-section): Added. 23 (.sidebar > .panel.navigation.sources > .content .details-section.paused-reason.collapsed > .header > .options,): Added. 24 (.sidebar > .panel.navigation.sources > .content .details-section.collapsed > .content): Added. 25 (.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Added. 26 (.sidebar > .panel.navigation.sources > .content > .call-stack-container): Added. 27 (.sidebar > .panel.navigation.sources > .content > .breakpoints-container): Added. 28 (.sidebar > .panel.navigation.sources > .content > .breakpoints-container .create-breakpoint): Added. 29 (.sidebar > .panel.navigation.sources > .content > .resources-container): Added. 30 (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread): Added. 31 (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread > .item.thread): Added. 32 (@media (min-height: 600px) .sidebar > .panel.navigation.sources > .content): Added. 33 (@media (min-height: 600px) .sidebar > .panel.navigation.sources > .content > .pause-reason-container): Added. 34 (@media (min-height: 600px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container)): Added. 35 (.sidebar > .panel.navigation.sources > .content > .details-section): Deleted. 36 (.sidebar > .panel.navigation.sources > .content > .details-section.paused-reason.collapsed > .header > .options,): Deleted. 37 (.sidebar > .panel.navigation.sources > .content > .details-section.collapsed > .content): Deleted. 38 (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint): Deleted. 39 (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread): Deleted. 40 (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread > .item.thread): Deleted. 41 (.sidebar > .panel.navigation.sources > .content > .resources): Deleted. 42 1 43 2019-03-20 Devin Rousso <drousso@apple.com> 2 44 -
trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.css
r243180 r243225 25 25 26 26 .sidebar > .panel.navigation.sources > .content { 27 display: flex;28 flex-direction: column;29 27 top: var(--navigation-bar-height); 30 28 } … … 69 67 } 70 68 71 .sidebar > .panel.navigation.sources > .content >.details-section {69 .sidebar > .panel.navigation.sources > .content .details-section { 72 70 padding-bottom: 1px; 73 71 font-size: 11px; 74 border- width: 1px !important;72 border-bottom: none; 75 73 } 76 74 77 .sidebar > .panel.navigation.sources > .content > .details-section.paused-reason.collapsed > .header > .options, 78 .sidebar > .panel.navigation.sources > .content > .details-section.breakpoints.collapsed > .header > .options, 79 .sidebar > .panel.navigation.sources > .content > .details-section > .content, 80 .sidebar > .panel.navigation.sources > .content > .details-section > .content > .group { 75 .sidebar > .panel.navigation.sources > .content .details-section:matches(.paused-reason, .breakpoins).collapsed > .header > .options, 76 .sidebar > .panel.navigation.sources > .content .details-section > .content, 77 .sidebar > .panel.navigation.sources > .content .details-section > .content > .group { 81 78 display: block; 82 79 } 83 80 84 .sidebar > .panel.navigation.sources > .content >.details-section.collapsed > .content {81 .sidebar > .panel.navigation.sources > .content .details-section.collapsed > .content { 85 82 display: none; 86 83 } 87 84 88 .sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint { 85 .sidebar > .panel.navigation.sources > .content .details-section.breakpoints > .header > .options .create-breakpoint { 86 width: 15px; 87 } 88 89 .sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container) { 90 border-bottom: 1px solid var(--border-color); 91 overflow-y: auto; 92 } 93 94 .sidebar > .panel.navigation.sources > .content > .call-stack-container { 95 /* 24px from .details-section > .header (23px height and -1px top) */ 96 /* 1px from .sidebar > .panel.navigation.sources > .content > .call-stack-container (border-bottom) */ 97 /* 5.5 to ensure that half of the next item is shown when overflowing */ 98 min-height: calc(25px + calc(min(var(--call-stack-count), 5.5) * 20px)); 99 } 100 101 .sidebar > .panel.navigation.sources > .content > .breakpoints-container { 102 /* 24px from `.details-section > .header` (23px height and -1px top) */ 103 /* 1px from .sidebar > .panel.navigation.sources > .content > .breakpoints-container (border-bottom) */ 104 /* 5.5 to ensure that half of the next item is shown when overflowing */ 105 min-height: calc(25px + calc(min(var(--breakpoints-count), 5.5) * 20px)); 106 } 107 108 .sidebar > .panel.navigation.sources > .content > .breakpoints-container .create-breakpoint { 89 109 width: 15px; 90 110 } … … 94 114 } 95 115 96 .sidebar > .panel.navigation.sources > .content > .resources { 97 position: relative; 98 height: 100%; 116 .sidebar > .panel.navigation.sources > .content > .resources-container { 117 overflow-y: auto; 99 118 } 100 119 … … 107 126 } 108 127 128 @media (min-height: 600px) { 129 .sidebar > .panel.navigation.sources > .content { 130 display: flex; 131 flex-direction: column; 132 overflow-y: hidden; 133 } 134 135 .sidebar > .panel.navigation.sources > .content > .pause-reason-container { 136 flex-shrink: 0; 137 } 138 139 .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container) { 140 height: 100%; 141 } 142 } 143 109 144 @media (prefers-dark-interface) { 110 145 .sidebar > .panel.navigation.sources > .content > .warning-banner { -
trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js
r243180 r243225 112 112 this._pauseReasonTextRow = new WI.DetailsSectionTextRow; 113 113 this._pauseReasonGroup = new WI.DetailsSectionGroup([this._pauseReasonTextRow]); 114 this._pauseReasonSection = new WI.DetailsSection("paused-reason", WI.UIString("Pause Reason"), [this._pauseReasonGroup], this._pauseReasonLinkContainerElement); 114 let pauseReasonSection = new WI.DetailsSection("paused-reason", WI.UIString("Pause Reason"), [this._pauseReasonGroup], this._pauseReasonLinkContainerElement); 115 116 this._pauseReasonContainer = document.createElement("div"); 117 this._pauseReasonContainer.className = "pause-reason-container"; 118 this._pauseReasonContainer.appendChild(pauseReasonSection.element); 115 119 116 120 this._callStackTreeOutline = this.createContentTreeOutline({suppressFiltering: true}); 121 this._callStackTreeOutline.addEventListener(WI.TreeOutline.Event.ElementAdded, this._handleCallStackElementAddedOrRemoved, this); 122 this._callStackTreeOutline.addEventListener(WI.TreeOutline.Event.ElementRemoved, this._handleCallStackElementAddedOrRemoved, this); 117 123 this._callStackTreeOutline.addEventListener(WI.TreeOutline.Event.SelectionDidChange, this._handleTreeSelectionDidChange, this); 118 124 … … 121 127 122 128 let callStackGroup = new WI.DetailsSectionGroup([callStackRow]); 123 this._callStackSection = new WI.DetailsSection("call-stack", WI.UIString("Call Stack"), [callStackGroup]); 129 let callStackSection = new WI.DetailsSection("call-stack", WI.UIString("Call Stack"), [callStackGroup]); 130 131 this._callStackContainer = document.createElement("div"); 132 this._callStackContainer.className = "call-stack-container"; 133 this._callStackContainer.appendChild(callStackSection.element); 124 134 125 135 this._mainTargetTreeElement = null; … … 184 194 let breakpointsGroup = new WI.DetailsSectionGroup([breakpointsRow]); 185 195 let breakpointsSection = new WI.DetailsSection("breakpoints", WI.UIString("Breakpoints"), [breakpointsGroup], breakpointNavigationBarWrapper); 186 this.contentView.element.insertBefore(breakpointsSection.element, this.contentView.element.firstChild); 196 197 let breakpointsContainer = this.contentView.element.insertBefore(document.createElement("div"), this.contentView.element.firstChild); 198 breakpointsContainer.classList.add("breakpoints-container"); 199 breakpointsContainer.appendChild(breakpointsSection.element); 187 200 188 201 this._resourcesNavigationBar = new WI.NavigationBar; … … 214 227 215 228 let resourcesContainer = this.contentView.element.insertBefore(document.createElement("div"), this._resourcesNavigationBar.element.nextSibling); 216 resourcesContainer.classList.add("resources ");229 resourcesContainer.classList.add("resources-container"); 217 230 218 231 this._resourcesTreeOutline = this.contentTreeOutline; … … 1422 1435 } 1423 1436 1437 _handleCallStackElementAddedOrRemoved(event) 1438 { 1439 let count = this._callStackTreeOutline.children.length; 1440 for (let child of this._callStackTreeOutline.children) 1441 count += child.children.length; 1442 1443 // Don't count the main thread element when it is hidden. 1444 if (WI.targets.length === 1) 1445 --count; 1446 1447 this.element.style.setProperty("--call-stack-count", count); 1448 } 1449 1424 1450 _handleBreakpointElementAddedOrRemoved(event) 1425 1451 { … … 1434 1460 if (setting) 1435 1461 setting.value = !!treeElement.parent; 1462 1463 let count = this._breakpointsTreeOutline.children.length; 1464 for (let child of this._breakpointsTreeOutline.children) 1465 count += child.children.length; 1466 this.element.style.setProperty("--breakpoints-count", count); 1436 1467 } 1437 1468 … … 1636 1667 _handleDebuggerPaused(event) 1637 1668 { 1638 this.contentView.element.insertBefore(this._callStack Section.element, this.contentView.element.firstChild);1669 this.contentView.element.insertBefore(this._callStackContainer, this.contentView.element.firstChild); 1639 1670 1640 1671 if (this._updatePauseReason()) 1641 this.contentView.element.insertBefore(this._pauseReason Section.element, this.contentView.element.firstChild);1672 this.contentView.element.insertBefore(this._pauseReasonContainer, this.contentView.element.firstChild); 1642 1673 1643 1674 this._debuggerPauseResumeButtonItem.enabled = true; … … 1652 1683 _handleDebuggerResumed(event) 1653 1684 { 1654 this._callStack Section.element.remove();1655 1656 this._pauseReason Section.element.remove();1685 this._callStackContainer.remove(); 1686 1687 this._pauseReasonContainer.remove(); 1657 1688 1658 1689 this._debuggerPauseResumeButtonItem.enabled = true;
Note:
See TracChangeset
for help on using the changeset viewer.