Changeset 242737 in webkit
- Timestamp:
- Mar 11, 2019, 1:35:21 PM (7 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Controllers/CanvasManager.js (modified) (1 diff)
-
UserInterface/Views/CanvasOverviewContentView.css (modified) (1 diff)
-
UserInterface/Views/CanvasOverviewContentView.js (modified) (3 diffs)
-
UserInterface/Views/MemoryCategoryView.css (modified) (1 diff)
-
UserInterface/Views/MemoryTimelineView.js (modified) (4 diffs)
-
UserInterface/Views/NetworkTableContentView.css (modified) (1 diff)
-
UserInterface/Views/NetworkTableContentView.js (modified) (5 diffs)
-
UserInterface/Views/TreeOutline.css (modified) (2 diffs)
-
UserInterface/Views/TreeOutline.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r242731 r242737 1 2019-03-11 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: eliminate manual syncing of numeric constants used by JavaScript and CSS 4 https://bugs.webkit.org/show_bug.cgi?id=194883 5 <rdar://problem/48257785> 6 7 Reviewed by Joseph Pecoraro. 8 9 * UserInterface/Views/CanvasOverviewContentView.js: 10 (WI.CanvasOverviewContentView): 11 (WI.CanvasOverviewContentView.static get recordingAutoCaptureInputMargin): Added. 12 (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize): 13 * UserInterface/Views/CanvasOverviewContentView.css: 14 (.navigation-bar > .item.canvas-recording-auto-capture > label > input): 15 16 * UserInterface/Views/MemoryTimelineView.js: 17 (WI.MemoryTimelineView.static get memoryCategoryViewHeight): Added. 18 (WI.MemoryTimelineView.prototype.initialLayout): Added. 19 (WI.MemoryTimelineView.prototype.layout): 20 * UserInterface/Views/MemoryCategoryView.css: 21 (.memory-category-view): 22 23 * UserInterface/Views/NetworkTableContentView.js: 24 (WI.NetworkTableContentView.static get nodeWaterfallDOMEventSize): Added. 25 (WI.NetworkTableContentView.prototype.initialLayout): 26 * UserInterface/Views/NetworkTableContentView.css: 27 (.content-view.network .network-table): Deleted. 28 29 * UserInterface/Views/TreeOutline.js: 30 (WI.TreeOutline._generateStyleRulesIfNeeded): 31 * UserInterface/Views/TreeOutline.css: 32 (.tree-outline, .tree-outline .children): 33 (.tree-outline .item): 34 35 * UserInterface/Controllers/CanvasManager.js: 36 (WI.CanvasManager.supportsRecordingAutoCapture): 37 Drive-by: fix usage of InspectorBackend.domains.{CanvasAgent => Canvas} 38 1 39 2019-03-11 Nikita Vasilyev <nvasilyev@apple.com> 2 40 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/CanvasManager.js
r242374 r242737 55 55 static supportsRecordingAutoCapture() 56 56 { 57 return InspectorBackend.domains.Canvas Agent && InspectorBackend.domains.CanvasAgent.setRecordingAutoCaptureFrameCount;57 return InspectorBackend.domains.Canvas && InspectorBackend.domains.Canvas.setRecordingAutoCaptureFrameCount; 58 58 } 59 59 -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.css
r239760 r242737 184 184 margin: 0 var(--recording-auto-capture-input-margin); 185 185 text-align: center; 186 187 --recording-auto-capture-input-margin: 4px; /* Keep this in sync with `recordingAutoCaptureInputMargin`. */188 186 } 189 187 -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js
r242217 r242737 49 49 this._recordingAutoCaptureFrameCountInputElement.type = "number"; 50 50 this._recordingAutoCaptureFrameCountInputElement.min = 0; 51 this._recordingAutoCaptureFrameCountInputElement.style.setProperty("--recording-auto-capture-input-margin", CanvasOverviewContentView.recordingAutoCaptureInputMargin + "px"); 51 52 this._recordingAutoCaptureFrameCountInputElement.addEventListener("input", this._handleRecordingAutoCaptureInput.bind(this)); 52 53 this._recordingAutoCaptureFrameCountInputElementValue = WI.settings.canvasRecordingAutoCaptureFrameCount.value; … … 78 79 this._importButtonNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._handleImportButtonNavigationItemClicked, this); 79 80 } 81 82 // Static 83 84 static get recordingAutoCaptureInputMargin() { return 4; } 80 85 81 86 // Public … … 249 254 } 250 255 251 const recordingAutoCaptureInputMargin = 8; // Keep this in sync with `--recording-auto-capture-input-margin`.252 253 256 context.font = this._recordingAutoCaptureFrameCountInputElement.__cachedFont; 254 257 let textMetrics = context.measureText(this._recordingAutoCaptureFrameCountInputElement.value || this._recordingAutoCaptureFrameCountInputElement.placeholder); 255 this._recordingAutoCaptureFrameCountInputElement.style.setProperty("width", (textMetrics.width + recordingAutoCaptureInputMargin) + "px");258 this._recordingAutoCaptureFrameCountInputElement.style.setProperty("width", (textMetrics.width + (2 * CanvasOverviewContentView.recordingAutoCaptureInputMargin)) + "px"); 256 259 }); 257 260 -
trunk/Source/WebInspectorUI/UserInterface/Views/MemoryCategoryView.css
r242197 r242737 27 27 display: flex; 28 28 width: 100%; 29 height: 76px; /* Keep this in sync with memoryCategoryViewHeight + 1 (for border-bottom) */29 height: calc(var(--memory-category-view-height) + 1px); 30 30 border-bottom: 1px solid var(--border-color); 31 31 } -
trunk/Source/WebInspectorUI/UserInterface/Views/MemoryTimelineView.js
r242194 r242737 115 115 } 116 116 117 static get memoryCategoryViewHeight() { return 75; } 118 117 119 // Public 118 120 … … 165 167 166 168 get showsFilterBar() { return false; } 169 170 initialLayout() 171 { 172 super.initialLayout(); 173 174 this.element.style.setProperty("--memory-category-view-height", MemoryTimelineView.memoryCategoryViewHeight + "px"); 175 } 167 176 168 177 layout() … … 178 187 if (!this._didInitializeCategories) 179 188 return; 180 181 const memoryCategoryViewHeight = 75; // Keep this in sync with .memory-category-view182 189 183 190 let graphStartTime = this.startTime; … … 266 273 } 267 274 268 let size = new WI.Size(xScale(graphEndTime), memoryCategoryViewHeight);275 let size = new WI.Size(xScale(graphEndTime), MemoryTimelineView.memoryCategoryViewHeight); 269 276 270 277 function yScale(value) { -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.css
r239760 r242737 24 24 */ 25 25 26 .content-view.network .network-table {27 --node-waterfall-dom-event-size: 8px; /* Keep this in sync with `domEventElementSize`. */28 }29 30 26 .content-view.network .navigation-bar .filter-bar { 31 27 background: none; -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
r242018 r242737 199 199 } 200 200 201 static get nodeWaterfallDOMEventSize() { return 8; } 202 201 203 // Public 202 204 … … 678 680 let domNode = entry.domNode; 679 681 if (domNode) { 680 const domEventElementSize = 8; // Keep this in sync with `--node-waterfall-dom-event-size`.681 682 682 let groupedDOMEvents = []; 683 683 for (let domEvent of domNode.domEvents) { … … 685 685 continue; 686 686 687 if (!groupedDOMEvents.length || (domEvent.timestamp - groupedDOMEvents.lastValue.endTimestamp) >= ( domEventElementSize * secondsPerPixel)) {687 if (!groupedDOMEvents.length || (domEvent.timestamp - groupedDOMEvents.lastValue.endTimestamp) >= (NetworkTableContentView.nodeWaterfallDOMEventSize * secondsPerPixel)) { 688 688 groupedDOMEvents.push({ 689 689 startTimestamp: domEvent.timestamp, … … 763 763 764 764 for (let {startTimestamp, endTimestamp, domEvents} of groupedDOMEvents) { 765 let paddingForCentering = domEventElementSize * secondsPerPixel / 2;765 let paddingForCentering = NetworkTableContentView.nodeWaterfallDOMEventSize * secondsPerPixel / 2; 766 766 767 767 let eventElement = container.appendChild(document.createElement("div")); … … 973 973 initialLayout() 974 974 { 975 super.initialLayout(); 976 977 this.element.style.setProperty("--node-waterfall-dom-event-size", NetworkTableContentView.nodeWaterfallDOMEventSize + "px"); 978 975 979 this._waterfallTimelineRuler = new WI.TimelineRuler; 976 980 this._waterfallTimelineRuler.allowsClippedLabels = true; -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.css
r239858 r242737 31 31 outline: none; 32 32 33 --tree-outline-item-padding: 5px; 34 33 35 --tree-outline-icon-margin-start: 16px; 34 36 --tree-outline-icon-margin-end: 3px; … … 48 50 height: 20px; 49 51 50 padding: 0 5px;52 padding: 0 var(--tree-outline-item-padding); 51 53 52 54 border-top: 1px solid transparent; -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js
r242577 r242737 947 947 948 948 let maximumTreeDepth = 32; 949 let baseLeftPadding = 5; // Matches the padding in TreeOutline.css for the item class. Keep in sync.950 949 let depthPadding = 10; 951 950 … … 956 955 childrenSubstring += i === maximumTreeDepth ? " .children" : " > .children"; 957 956 styleText += `.${WI.TreeOutline.ElementStyleClassName}:not(.${WI.TreeOutline.CustomIndentStyleClassName})${childrenSubstring} > .item { `; 958 959 if (WI.resolvedLayoutDirection() === WI.LayoutDirection.RTL) 960 styleText += "padding-right: "; 961 else 962 styleText += "padding-left: "; 963 964 styleText += (baseLeftPadding + (depthPadding * i)) + "px; }\n"; 957 styleText += `-webkit-padding-start: calc(var(--tree-outline-item-padding) + ${depthPadding * i}px);`; 958 styleText += ` };\n`; 965 959 } 966 960
Note:
See TracChangeset
for help on using the changeset viewer.