Web Inspector: Canvas: imported recordings aren't processed when the navigation sideb...
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2019-04-17  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: Canvas: imported recordings aren't processed when the navigation sidebar is collapsed
4         https://bugs.webkit.org/show_bug.cgi?id=196921
5         <rdar://problem/49910815>
6
7         Reviewed by Timothy Hatcher.
8
9         * UserInterface/Views/RecordingContentView.js:
10         (WI.RecordingContentView.prototype.initialLayout):
11
12 2019-04-17  Joseph Pecoraro  <pecoraro@apple.com>
13
14         Web Inspector: Extension scripts with parse errors do not show up in Web Inspector
15         https://bugs.webkit.org/show_bug.cgi?id=196996
16         <rdar://problem/47054804>
17
18         Reviewed by Devin Rousso.
19
20         * UserInterface/Controllers/DebuggerManager.js:
21         (WI.DebuggerManager.prototype.scriptDidFail):
22         Create a LocalScript that can be linked to but ignore it
23         if we already have a Resource for the URL.
24
25         * UserInterface/Protocol/DebuggerObserver.js:
26         (WI.DebuggerObserver.prototype.scriptFailedToParse):
27         Let DebuggerManager potentially create a script for this.
28
29         * UserInterface/Models/Script.js:
30         (WI.Script):
31         Local scripts provide a null id and id is not required below.
32
33 2019-04-16  Joseph Pecoraro  <pecoraro@apple.com>
34
35         Web Inspector: Worker imported scripts not showing up in Open Quickly dialog if inspector open after workers exist
36         https://bugs.webkit.org/show_bug.cgi?id=196986
37
38         Reviewed by Devin Rousso.
39
40         * UserInterface/Views/OpenResourceDialog.js:
41         (WI.OpenResourceDialog.prototype._addScriptsForTarget):
42         We were unnecessary skipping Scripts that do not have a sourceURL but do
43         have a URL, which ends up being Worker populated scripts.
44
45 2019-04-16  Joseph Pecoraro  <pecoraro@apple.com>
46
47         REGRESSION(r238168) Web Inspector: <iframe src=...> request does not show up in Network Tab
48         https://bugs.webkit.org/show_bug.cgi?id=193505
49         <rdar://problem/47325957>
50
51         Reviewed by Devin Rousso.
52
53         * UserInterface/Views/NetworkTableContentView.js:
54         (WI.NetworkTableContentView):
55         (WI.NetworkTableContentView.prototype._handleFrameWasAdded):
56         Handle new frames by adding the frame's main resource.
57
58 2019-04-16  Devin Rousso  <drousso@apple.com>
59
60         Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'this._contentViewContainer.currentContentView.selectionPathComponents')
61         https://bugs.webkit.org/show_bug.cgi?id=196936
62         <rdar://problem/49917789>
63
64         Reviewed by Joseph Pecoraro.
65
66         * UserInterface/Views/HeapAllocationsTimelineView.js:
67         (WI.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
68         (WI.HeapAllocationsTimelineView.prototype.get navigationItems):
69         (WI.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
70         Drive-by: when selecting a record, force it to be visible before selecting it, as otherwise
71         the selection events won't be fired.
72
73         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
74         (WI.HeapAllocationsTimelineOverviewGraph.prototype.layout):
75         Drive-by: ensure that clicking on a [S] heap snapshot record icon actually selects the record.
76
77 2019-04-16  Devin Rousso  <drousso@apple.com>
78
79         Unprefix -webkit-sticky
80         https://bugs.webkit.org/show_bug.cgi?id=196962
81         <rdar://problem/40903458>
82
83         Reviewed by Simon Fraser.
84
85         Replace all `-webkit-sticky` with `sticky`.
86
87         * UserInterface/Models/CSSKeywordCompletions.js:
88         * UserInterface/Views/AuditTestCaseContentView.css:
89         (.content-view-container > .content-view.audit-test-case > header):
90         * UserInterface/Views/AuditTestGroupContentView.css:
91         (.content-view.audit-test-group.contains-test-case > header):
92         * UserInterface/Views/ChangesDetailsSidebarPanel.css:
93         (.changes-panel .resource-section > .header):
94         * UserInterface/Views/DetailsSection.css:
95         (.details-section > .header):
96         * UserInterface/Views/NetworkDetailView.css:
97         (.network-detail .navigation-bar):
98         * UserInterface/Views/SettingsTabContentView.css:
99         (.content-view.settings .navigation-bar):
100         * UserInterface/Views/Table.css:
101         (.table > .header):
102
103 2019-04-16  Devin Rousso  <drousso@apple.com>
104
105         Web Inspector: remove unused WI.DOMTreeDataGrid
106         https://bugs.webkit.org/show_bug.cgi?id=196958
107         <rdar://problem/49931383>
108
109         Reviewed by Joseph Pecoraro.
110
111         * UserInterface/Views/DOMTreeDataGrid.css: Removed.
112         * UserInterface/Views/DOMTreeDataGrid.js: Removed.
113         * UserInterface/Views/DOMTreeDataGridNode.js: Removed.
114         * UserInterface/Main.html:
115
116 2019-04-16  Devin Rousso  <drousso@apple.com>
117
118         Web Inspector: Storage: values truncated in Local/Session table
119         https://bugs.webkit.org/show_bug.cgi?id=178318
120         <rdar://problem/34998581>
121
122         Reviewed by Joseph Pecoraro.
123
124         * UserInterface/Views/DataGrid.js:
125         (WI.DataGrid):
126         (WI.DataGrid.prototype._copyTextForDataGridNode):
127         * UserInterface/Views/TimelineDataGrid.js:
128         (WI.TimelineDataGrid):
129         Refactor `WI.DataGrid` constructor to allow for more optional arguments.
130         Introduce a new optional argument `copyCallback` that can be used to override the text that
131         would be copied for any `WI.DataGridNode` in any column.
132
133         * UserInterface/Views/DOMStorageContentView.js:
134         (WI.DOMStorageContentView):
135         (WI.DOMStorageContentView.prototype.itemAdded):
136         (WI.DOMStorageContentView.prototype.itemUpdated):
137         (WI.DOMStorageContentView.prototype._populate):
138         (WI.DOMStorageContentView.prototype._dataGridCopy): Added.
139         Save the full non-truncated value as part of the `WI.DataGridNode`'s `data`. When copying,
140         use the full non-truncated value instead of what was shown in the DOM.
141
142 2019-04-15  Joseph Pecoraro  <pecoraro@apple.com>
143
144         Web Inspector: DOM Nodes should not show $0 when selected in Console area
145         https://bugs.webkit.org/show_bug.cgi?id=196953
146
147         Reviewed by Devin Rousso.
148
149         * UserInterface/Views/DOMTreeContentView.js:
150         (WI.DOMTreeContentView):
151         Enable showing the last selected element.
152
153         * UserInterface/Views/DOMTreeOutline.js:
154         Make parameters explicit. Drop "selectable" which was always true.
155         And add a new option for adding a class name.
156
157         * UserInterface/Views/DOMTreeOutline.css:
158         (.tree-outline.dom.show-last-selected li.last-selected > span::after):
159         (.tree-outline.dom.show-last-selected:focus li.last-selected > span::after):
160         Only show the "= $0" for a DOM tree that has enabled showing the last selected element.
161
162         * UserInterface/Views/FormattedValue.css:
163         (.formatted-node > .tree-outline.dom li.selected .selection-area):
164         Don't show the selection-area for a console formatted node.
165
166 2019-04-15  Devin Rousso  <drousso@apple.com>
167
168         Web Inspector: update sheet rect whenever inspector window size changes
169         https://bugs.webkit.org/show_bug.cgi?id=196942
170         <rdar://problem/49920241>
171
172         Reviewed by Joseph Pecoraro.
173
174         * UserInterface/Base/Main.js:
175         (WI.contentLoaded):
176         (WI._windowResized):
177         (WI._updateSheetRect): Added.
178
179 2019-04-15  Nikita Vasilyev  <nvasilyev@apple.com>
180
181         Unreviewed, fix typo in a comment.
182
183         * UserInterface/Views/SearchSidebarPanel.js:
184         (WI.SearchSidebarPanel.prototype.performSearch):
185
186 2019-04-15  Devin Rousso  <drousso@apple.com>
187
188         Web Inspector: Heap: don't use recursion when calculating root paths
189         https://bugs.webkit.org/show_bug.cgi?id=196890
190         <rdar://problem/49870751>
191
192         Reviewed by Joseph Pecoraro.
193
194         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
195         (HeapSnapshot.prototype.shortestGCRootPath):
196         (HeapSnapshot.prototype._determineGCRootPaths):
197         (HeapSnapshot.prototype._gcRootPathes.visitNode): Deleted.
198         (HeapSnapshot.prototype._gcRootPathes): Deleted.
199
200 2019-04-15  Joseph Pecoraro  <pecoraro@apple.com>
201
202         Web Inspector: SameSite parsing should be stricter
203         https://bugs.webkit.org/show_bug.cgi?id=196927
204         <rdar://problem/42291601>
205
206         Reviewed by Devin Rousso.
207
208         * UserInterface/Models/Cookie.js:
209         (WI.Cookie.parseSameSiteAttributeValue):
210
211 2019-04-15  Joseph Pecoraro  <pecoraro@apple.com>
212
213         Web Inspector: CPU Usage Timeline - Energy impact popover flickers
214         https://bugs.webkit.org/show_bug.cgi?id=196931
215         <rdar://problem/49569122>
216
217         Reviewed by Devin Rousso.
218
219         * UserInterface/Views/CPUTimelineView.js:
220         (WI.CPUTimelineView.prototype.initialLayout):
221
222 2019-04-15  Devin Rousso  <drousso@apple.com>
223
224         Web Inspector: REGRESSION(r244268): Canvas: navigation sidebar no longer appears
225         https://bugs.webkit.org/show_bug.cgi?id=196920
226         <rdar://problem/49910618>
227
228         Reviewed by Timothy Hatcher.
229
230         * UserInterface/Views/ContentBrowserTabContentView.js:
231         (WI.ContentBrowserTabContentView.prototype.showNavigationSidebarPanel):
232         Now that we no longer call `addSubview` when adding a sidebar panel, we can't check to see
233         if `parentSidebar` has been set, as that is just an alias for `parentView`.
234
235 2019-04-15  Devin Rousso  <drousso@apple.com>
236
237         Web Inspector: DOMDebugger: move breakpoint storage to use `WI.ObjectStore`
238         https://bugs.webkit.org/show_bug.cgi?id=196231
239         <rdar://problem/49236864>
240
241         Reviewed by Joseph Pecoraro.
242
243         * UserInterface/Controllers/DOMDebuggerManager.js:
244         (WI.DOMDebuggerManager):
245         (WI.DOMDebuggerManager.prototype.addDOMBreakpoint):
246         (WI.DOMDebuggerManager.prototype.removeDOMBreakpoint):
247         (WI.DOMDebuggerManager.prototype.removeDOMBreakpointsForNode):
248         (WI.DOMDebuggerManager.prototype.addEventBreakpoint):
249         (WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
250         (WI.DOMDebuggerManager.prototype.addURLBreakpoint):
251         (WI.DOMDebuggerManager.prototype.removeURLBreakpoint):
252         (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged):
253         (WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
254         (WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged):
255         (WI.DOMDebuggerManager.prototype._saveDOMBreakpoints): Deleted.
256         (WI.DOMDebuggerManager.prototype._saveEventBreakpoints): Deleted.
257         (WI.DOMDebuggerManager.prototype._saveURLBreakpoints): Deleted.
258
259         * UserInterface/Models/DOMBreakpoint.js:
260         (WI.DOMBreakpoint.prototype.saveIdentityToCookie):
261         (WI.DOMBreakpoint.prototype.toJSON): Added.
262         (WI.DOMBreakpoint.prototype.get serializableInfo): Deleted.
263         * UserInterface/Models/EventBreakpoint.js:
264         (WI.EventBreakpoint.prototype.saveIdentityToCookie):
265         (WI.EventBreakpoint.prototype.toJSON): Added.
266         (WI.EventBreakpoint.prototype.get serializableInfo): Deleted.
267         * UserInterface/Models/URLBreakpoint.js:
268         (WI.URLBreakpoint.prototype.saveIdentityToCookie):
269         (WI.URLBreakpoint.prototype.toJSON): Added.
270         (WI.URLBreakpoint.prototype.get serializableInfo): Deleted.
271         Replace `get serializableInfo` with `toJSON` as required by `WI.ObjectStore`.
272
273         * UserInterface/Base/ObjectStore.js:
274         (WI.ObjectStore._open):
275         Increment version.
276
277 2019-04-15  Devin Rousso  <drousso@apple.com>
278
279         Web Inspector: drag/drop over the sidebar should load an imported file in Canvas/Audit tab
280         https://bugs.webkit.org/show_bug.cgi?id=196873
281         <rdar://problem/49858190>
282
283         Reviewed by Timothy Hatcher.
284
285         * UserInterface/Base/Main.js:
286         (WI.contentLoaded):
287         (WI._handleDragOver): Added.
288         (WI._handleDrop): Added.
289         (WI._dragOver): Deleted.
290         * UserInterface/Views/AuditTabContentView.js:
291         (WI.AuditTabContentView):
292         (WI.AuditTabContentView.prototype.async handleFileDrop): Added.
293         (WI.AuditTabContentView.prototype._handleDragOver): Deleted.
294         (WI.AuditTabContentView.prototype._handleDrop): Deleted.
295         * UserInterface/Views/CanvasTabContentView.js:
296         (WI.CanvasTabContentView):
297         (WI.CanvasTabContentView.prototype.async handleFileDrop): Added.
298         (WI.CanvasTabContentView.prototype._handleDragOver): Deleted.
299         (WI.CanvasTabContentView.prototype._handleDrop): Deleted.
300         * UserInterface/Views/TimelineTabContentView.js:
301         (WI.TimelineTabContentView.prototype.async handleFileDrop): Added.
302         Check whether the current tab is able to handle a file drop, and if so, don't prevent the
303         drag from occuring. This now allows the user to drop anywhere on the Web Inspector area to
304         import files, so long as the relevant tab is currently selected.
305
306         * UserInterface/Controllers/CanvasManager.js:
307         (WI.CanvasManager.prototype.async processJSON): Added.
308         (WI.CanvasManager.prototype.processJSON): Deleted.
309         * UserInterface/Controllers/TimelineManager.js:
310         (WI.TimelineManager.prototype.async processJSON): Added.
311         (WI.TimelineManager.prototype.processJSON): Deleted.
312         Make `async` to match other `processJSON` functions.
313
314 2019-04-15  Devin Rousso  <drousso@apple.com>
315
316         Web Inspector: Heap: logging an object from a snapshot shouldn't use the "special" style if the object is reachable
317         https://bugs.webkit.org/show_bug.cgi?id=196889
318         <rdar://problem/49870693>
319
320         Reviewed by Joseph Pecoraro.
321
322         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
323         (WI.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
324
325 2019-04-15  Devin Rousso  <drousso@apple.com>
326
327         Web Inspector: Debugger: deleting a special breakpoint should disable it
328         https://bugs.webkit.org/show_bug.cgi?id=196737
329         <rdar://problem/49740680>
330
331         Reviewed by Timothy Hatcher.
332
333         * UserInterface/Views/BreakpointTreeElement.js:
334         (WI.BreakpointTreeElement.prototype.ondelete):
335
336 2019-04-15  Devin Rousso  <drousso@apple.com>
337
338         Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.selectedTreeElement.reveal')
339         https://bugs.webkit.org/show_bug.cgi?id=196804
340         <rdar://problem/49800708>
341
342         Reviewed by Timothy Hatcher.
343
344         * UserInterface/Views/DOMTreeOutline.js:
345         (WI.DOMTreeOutline.prototype.update):
346
347 2019-04-15  Devin Rousso  <drousso@apple.com>
348
349         Web Inspector: Uncaught Exception: Can't find variable: WebGL2RenderingContext
350         https://bugs.webkit.org/show_bug.cgi?id=196874
351         <rdar://problem/49858912>
352
353         Reviewed by Timothy Hatcher.
354
355         * UserInterface/Models/Recording.js:
356         (WI.Recording.prototype.createContext):
357
358         * UserInterface/Models/RecordingAction.js:
359         (WI.RecordingAction.prototype.process.getContent):
360
361 2019-04-15  Devin Rousso  <drousso@apple.com>
362
363         Web Inspector: sidebar panels shouldn't be added as subviews unless visible
364         https://bugs.webkit.org/show_bug.cgi?id=196888
365         <rdar://problem/49870659>
366
367         Reviewed by Timothy Hatcher.
368
369         * UserInterface/Views/Sidebar.js:
370         (WI.Sidebar.prototype.insertSidebarPanel):
371         (WI.Sidebar.prototype.removeSidebarPanel):
372         (WI.Sidebar.prototype.set selectedSidebarPanel):
373
374 2019-04-15  Devin Rousso  <drousso@apple.com>
375
376         Web Inspector: Elements: event listener change events should only be fired for the selected node and it's ancestors
377         https://bugs.webkit.org/show_bug.cgi?id=196887
378         <rdar://problem/49870627>
379
380         Reviewed by Timothy Hatcher.
381
382         * UserInterface/Models/DOMNode.js:
383         (WI.DOMNode.prototype.getEventListeners):
384
385 2019-04-15  Devin Rousso  <drousso@apple.com>
386
387         Web Inspector: replace all uses of `this` with `WI` in Main.js/Test.js
388         https://bugs.webkit.org/show_bug.cgi?id=196795
389         <rdar://problem/49796618>
390
391         Reviewed by Timothy Hatcher.
392
393         * UserInterface/Base/Main.js:
394         * UserInterface/Test/Test.js:
395
396 2019-04-15  Devin Rousso  <drousso@apple.com>
397
398         Web Inspector: REGRESSION: Heap: snapshots taken manually don't appear in the list
399         https://bugs.webkit.org/show_bug.cgi?id=196900
400         <rdar://problem/49880278>
401
402         Reviewed by Timothy Hatcher.
403
404         * UserInterface/Views/HeapAllocationsTimelineView.js:
405         (WI.HeapAllocationsTimelineView):
406         (WI.HeapAllocationsTimelineView.prototype.layout):
407         (WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
408         (WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
409         Drive-by: only show heap snapshots for the selected range.
410
411         * UserInterface/Views/TimelineView.js:
412         * UserInterface/Views/TimelineRecordingContentView.js:
413         (WI.TimelineRecordingContentView):
414         (WI.TimelineRecordingContentView.prototype._handleTimelineViewNeedsEntireSelectedRange): Added.
415         Drive-by: taking (or importing) a heap snapshot should select the entire range so that the
416         new record will appear in the list of heap snapshots.
417
418 2019-04-15  Devin Rousso  <drousso@apple.com>
419
420         Web Inspector: REGRESSION (r244157): Timelines: ruler size appears wrong on first layout
421         https://bugs.webkit.org/show_bug.cgi?id=196901
422         <rdar://problem/49880539>
423
424         Reviewed by Timothy Hatcher.
425
426         * UserInterface/Views/View.js:
427         (WI.View.prototype._layoutSubtree):
428         Ensure that the forced override of the layout reason during the initial layout doesn't
429         affect subviews.
430
431         * UserInterface/Views/ConsoleDrawer.js:
432         (WI.ConsoleDrawer.prototype.sizeDidChange): Added.
433         (WI.ConsoleDrawer.prototype.layout): Deleted.
434         * UserInterface/Views/ConsolePrompt.js:
435         (WI.ConsolePrompt.prototype.sizeDidChange): Added.
436         (WI.ConsolePrompt.prototype.layout): Deleted.
437         * UserInterface/Views/DOMTreeContentView.js:
438         (WI.DOMTreeContentView.prototype.sizeDidChange): Added.
439         (WI.DOMTreeContentView.prototype.layout):
440         * UserInterface/Views/NavigationBar.js:
441         (WI.NavigationBar.prototype.sizeDidChange): Added.
442         (WI.NavigationBar.prototype.layout):
443         (WI.NavigationBar.prototype._updateContent): Added.
444         (WI.NavigationBar.prototype._updateContent.forceItemHidden): Added.
445         (WI.NavigationBar.prototype._updateContent.isDivider): Added.
446         (WI.NavigationBar.prototype._updateContent.calculateVisibleItemWidth): Added.
447         (WI.NavigationBar.prototype.layout.forceItemHidden): Deleted.
448         (WI.NavigationBar.prototype.layout.isDivider): Deleted.
449         (WI.NavigationBar.prototype.layout.calculateVisibleItemWidth): Deleted.
450         * UserInterface/Views/TabBrowser.js:
451         (WI.TabBrowser.prototype.sizeDidChange): Added.
452         (WI.TabBrowser.prototype.layout): Deleted.
453         Move logic in `layout` to `sizeDidChange` where applicable.
454
455 2019-04-11  Devin Rousso  <drousso@apple.com>
456
457         Web Inspector: REGRESSION(r244195): Timelines: unable to take heap snapshot
458         https://bugs.webkit.org/show_bug.cgi?id=196832
459         <rdar://problem/49828862>
460
461         Reviewed by Simon Fraser.
462
463         * UserInterface/Controllers/TimelineManager.js:
464         (WI.TimelineManager.prototype.heapSnapshotAdded):
465         (WI.TimelineManager.prototype._addRecord):
466         Heap snapshots can be taken outside of a timeline recording, so remove the early return (and
467         assertion) that checks for an active recording before adding the heap snapshot record.
468
469 2019-04-11  Devin Rousso  <drousso@apple.com>
470
471         Web Inspector: Timelines: can't reliably stop/start a recording
472         https://bugs.webkit.org/show_bug.cgi?id=196778
473         <rdar://problem/47606798>
474
475         Reviewed by Timothy Hatcher.
476
477         Rather than have a binary state of capturing/not-capturing, we should use a four state:
478          1. inactive (when the backend has stopped capturing)
479          2. starting (when the frontend requests capturing to start)
480          3. active (when the backend has started capturing)
481          4. stopping (when the frontend requests capturing to stop)
482
483         Capturing is considered "on" when not in an "inactive" state. Prevent the frontend from
484         starting/stopping capturing unless we're in a "stable" ("inactive" or "active") state, not a
485         "transition" ("starting" or "stopping") state.
486
487         One "side effect" of this change is that since the capturing is considered active until the
488         backend has stopped capturing, we will continue to process records in the frontend even if
489         the frontend has requested to stop capturing. <https://webkit.org/b/152904>
490
491         * UserInterface/Controllers/TimelineManager.js:
492         (WI.TimelineManager):
493         (WI.TimelineManager.prototype.get capturingState): Added.
494         (WI.TimelineManager.prototype.reset):
495         (WI.TimelineManager.prototype.get activeRecording):
496         (WI.TimelineManager.prototype.set autoCaptureOnPageLoad):
497         (WI.TimelineManager.prototype.isCapturing):
498         (WI.TimelineManager.prototype.startCapturing):
499         (WI.TimelineManager.prototype.stopCapturing):
500         (WI.TimelineManager.prototype.processJSON):
501         (WI.TimelineManager.prototype.capturingStarted):
502         (WI.TimelineManager.prototype.capturingStopped):
503         (WI.TimelineManager.prototype.autoCaptureStarted):
504         (WI.TimelineManager.prototype.eventRecorded):
505         (WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
506         (WI.TimelineManager.prototype.pageLoadEventFired):
507         (WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
508         (WI.TimelineManager.prototype.cpuProfilerTrackingCompleted):
509         (WI.TimelineManager.prototype.memoryTrackingUpdated):
510         (WI.TimelineManager.prototype.memoryTrackingCompleted):
511         (WI.TimelineManager.prototype.heapTrackingStarted):
512         (WI.TimelineManager.prototype.heapTrackingCompleted):
513         (WI.TimelineManager.prototype.heapSnapshotAdded):
514         (WI.TimelineManager.prototype._updateCapturingState): Added.
515         (WI.TimelineManager.prototype._processRecord):
516         (WI.TimelineManager.prototype._processEvent):
517         (WI.TimelineManager.prototype._loadNewRecording):
518         (WI.TimelineManager.prototype._addRecord):
519         (WI.TimelineManager.prototype._attemptAutoCapturingForFrame):
520         (WI.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
521         (WI.TimelineManager.prototype._stopAutoRecordingSoon):
522         (WI.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
523         (WI.TimelineManager.prototype._resourceWasAdded):
524         (WI.TimelineManager.prototype._garbageCollected):
525         (WI.TimelineManager.prototype._memoryPressure):
526         (WI.TimelineManager.prototype._handleTimelinesAutoStopSettingChanged):
527         (WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
528         (WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
529         (WI.TimelineManager.prototype._handleDOMNodeLowPowerChanged):
530         (WI.TimelineManager.prototype.unloadRecording): Deleted.
531         (WI.TimelineManager.prototype.programmaticCaptureStarted): Deleted.
532         (WI.TimelineManager.prototype.programmaticCaptureStopped): Deleted.
533         (WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted): Deleted.
534         (WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped): Deleted.
535
536         * UserInterface/Protocol/ScriptProfilerObserver.js:
537         (WI.ScriptProfilerObserver.prototype.trackingComplete):
538         (WI.ScriptProfilerObserver.prototype.programmaticCaptureStarted):
539         (WI.ScriptProfilerObserver.prototype.programmaticCaptureStopped):
540         * UserInterface/Protocol/TimelineObserver.js:
541         (WI.TimelineObserver.prototype.programmaticCaptureStarted):
542         (WI.TimelineObserver.prototype.programmaticCaptureStopped):
543         It is possible to determine when programmatic capturing starts/stops in the frontend based
544         on the state when the backend causes the state to change, such as if the state is "inactive"
545         when the frontend is told that the backend has started capturing.
546
547         * UserInterface/Protocol/CPUProfilerObserver.js:
548         (WI.CPUProfilerObserver.prototype.trackingComplete):
549         * UserInterface/Protocol/MemoryObserver.js:
550         (WI.MemoryObserver.prototype.trackingComplete):
551         Send an end timestamp to match other instruments.
552
553         * UserInterface/Controllers/DebuggerManager.js:
554         (WI.DebuggerManager):
555         (WI.DebuggerManager.prototype._handleTimelineCapturingStateChanged): Added.
556         (WI.DebuggerManager.prototype._timelineCapturingWillStart): Deleted.
557         (WI.DebuggerManager.prototype._timelineCapturingStopped): Deleted.
558         * UserInterface/Models/DefaultDashboard.js:
559         (WI.DefaultDashboard):
560         (WI.DefaultDashboard.prototype._handleTimelineCapturingStateChanged): Added.
561         (WI.DefaultDashboard.prototype._capturingStopped): Deleted.
562         * UserInterface/Views/DebuggerSidebarPanel.js:
563         (WI.DebuggerSidebarPanel):
564         (WI.DebuggerSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
565         (WI.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): Deleted.
566         (WI.DebuggerSidebarPanel.prototype._timelineCapturingStopped): Deleted.
567         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
568         (WI.SourcesNavigationSidebarPanel):
569         (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
570         (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingWillStart): Deleted.
571         (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStopped): Deleted.
572         * UserInterface/Views/TimelineOverview.js:
573         (WI.TimelineOverview):
574         (WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged): Added.
575         (WI.TimelineOverview.prototype._capturingStarted): Deleted.
576         (WI.TimelineOverview.prototype._capturingStopped): Deleted.
577         * UserInterface/Views/TimelineRecordingContentView.js:
578         (WI.TimelineRecordingContentView):
579         (WI.TimelineRecordingContentView.prototype._handleTimelineCapturingStateChanged): Added.
580         (WI.TimelineRecordingContentView.prototype._recordingUnloaded):
581         (WI.TimelineRecordingContentView.prototype._capturingStarted): Deleted.
582         (WI.TimelineRecordingContentView.prototype._capturingStopped): Deleted.
583         * UserInterface/Views/TimelineTabContentView.js:
584         (WI.TimelineTabContentView):
585         (WI.TimelineTabContentView.prototype._handleTimelineCapturingStateChanged): Added.
586         (WI.TimelineTabContentView.prototype._capturingStartedOrStopped): Deleted.
587         Use the new single event for all Timelines capture state changes.
588         Prevent the record button from being clicked when capturing is in a transition state.
589
590 2019-04-11  Truitt Savell  <tsavell@apple.com>
591
592         Unreviewed, rolling out r244158.
593
594         Casued 8 inspector/timeline/ test failures.
595
596         Reverted changeset:
597
598         "Web Inspector: Timelines: can't reliably stop/start a
599         recording"
600         https://bugs.webkit.org/show_bug.cgi?id=196778
601         https://trac.webkit.org/changeset/244158
602
603 2019-04-10  Devin Rousso  <drousso@apple.com>
604
605         Web Inspector: save sheet should be anchored underneath the tab bar when detached
606         https://bugs.webkit.org/show_bug.cgi?id=196722
607         <rdar://problem/49613280>
608
609         Reviewed by Timothy Hatcher.
610
611         * UserInterface/Base/Main.js:
612         (WI.contentLoaded):
613
614 2019-04-10  Devin Rousso  <drousso@apple.com>
615
616         Web Inspector: Timelines: can't reliably stop/start a recording
617         https://bugs.webkit.org/show_bug.cgi?id=196778
618         <rdar://problem/47606798>
619
620         Reviewed by Timothy Hatcher.
621
622         Rather than have a binary state of capturing/not-capturing, we should use a four state:
623          1. inactive (when the backend has stopped capturing)
624          2. starting (when the frontend requests capturing to start)
625          3. active (when the backend has started capturing)
626          4. stopping (when the frontend requests capturing to stop)
627
628         Capturing is considered "on" when not in an "inactive" state. Prevent the frontend from
629         starting/stopping capturing unless we're in a "stable" ("inactive" or "active") state, not a
630         "transition" ("starting" or "stopping") state.
631
632         One "side effect" of this change is that since the capturing is considered active until the
633         backend has stopped capturing, we will continue to process records in the frontend even if
634         the frontend has requested to stop capturing. <https://webkit.org/b/152904>
635
636         * UserInterface/Controllers/TimelineManager.js:
637         (WI.TimelineManager):
638         (WI.TimelineManager.prototype.get capturingState): Added.
639         (WI.TimelineManager.prototype.reset):
640         (WI.TimelineManager.prototype.get activeRecording):
641         (WI.TimelineManager.prototype.set autoCaptureOnPageLoad):
642         (WI.TimelineManager.prototype.isCapturing):
643         (WI.TimelineManager.prototype.startCapturing):
644         (WI.TimelineManager.prototype.stopCapturing):
645         (WI.TimelineManager.prototype.processJSON):
646         (WI.TimelineManager.prototype.capturingStarted):
647         (WI.TimelineManager.prototype.capturingStopped):
648         (WI.TimelineManager.prototype.autoCaptureStarted):
649         (WI.TimelineManager.prototype.eventRecorded):
650         (WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
651         (WI.TimelineManager.prototype.pageLoadEventFired):
652         (WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
653         (WI.TimelineManager.prototype.cpuProfilerTrackingCompleted):
654         (WI.TimelineManager.prototype.memoryTrackingUpdated):
655         (WI.TimelineManager.prototype.memoryTrackingCompleted):
656         (WI.TimelineManager.prototype.heapTrackingStarted):
657         (WI.TimelineManager.prototype.heapTrackingCompleted):
658         (WI.TimelineManager.prototype.heapSnapshotAdded):
659         (WI.TimelineManager.prototype._updateCapturingState): Added.
660         (WI.TimelineManager.prototype._processRecord):
661         (WI.TimelineManager.prototype._processEvent):
662         (WI.TimelineManager.prototype._loadNewRecording):
663         (WI.TimelineManager.prototype._addRecord):
664         (WI.TimelineManager.prototype._attemptAutoCapturingForFrame):
665         (WI.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
666         (WI.TimelineManager.prototype._stopAutoRecordingSoon):
667         (WI.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
668         (WI.TimelineManager.prototype._mainResourceDidChange):
669         (WI.TimelineManager.prototype._resourceWasAdded):
670         (WI.TimelineManager.prototype._garbageCollected):
671         (WI.TimelineManager.prototype._memoryPressure):
672         (WI.TimelineManager.prototype._handleTimelinesAutoStopSettingChanged):
673         (WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
674         (WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
675         (WI.TimelineManager.prototype._handleDOMNodeLowPowerChanged):
676         (WI.TimelineManager.prototype.unloadRecording): Deleted.
677         (WI.TimelineManager.prototype.programmaticCaptureStarted): Deleted.
678         (WI.TimelineManager.prototype.programmaticCaptureStopped): Deleted.
679         (WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted): Deleted.
680         (WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped): Deleted.
681
682         * UserInterface/Protocol/ScriptProfilerObserver.js:
683         (WI.ScriptProfilerObserver.prototype.trackingComplete):
684         (WI.ScriptProfilerObserver.prototype.programmaticCaptureStarted):
685         (WI.ScriptProfilerObserver.prototype.programmaticCaptureStopped):
686         * UserInterface/Protocol/TimelineObserver.js:
687         (WI.TimelineObserver.prototype.programmaticCaptureStarted):
688         (WI.TimelineObserver.prototype.programmaticCaptureStopped):
689         It is possible to determine when programmatic capturing starts/stops in the frontend based
690         on the state when the backend causes the state to change, such as if the state is "inactive"
691         when the frontend is told that the backend has started capturing.
692
693         * UserInterface/Protocol/CPUProfilerObserver.js:
694         (WI.CPUProfilerObserver.prototype.trackingComplete):
695         * UserInterface/Protocol/MemoryObserver.js:
696         (WI.MemoryObserver.prototype.trackingComplete):
697         Send an end timestamp to match other instruments.
698
699         * UserInterface/Controllers/DebuggerManager.js:
700         (WI.DebuggerManager):
701         (WI.DebuggerManager.prototype._handleTimelineCapturingStateChanged): Added.
702         (WI.DebuggerManager.prototype._timelineCapturingWillStart): Deleted.
703         (WI.DebuggerManager.prototype._timelineCapturingStopped): Deleted.
704         * UserInterface/Models/DefaultDashboard.js:
705         (WI.DefaultDashboard):
706         (WI.DefaultDashboard.prototype._handleTimelineCapturingStateChanged): Added.
707         (WI.DefaultDashboard.prototype._capturingStopped): Deleted.
708         * UserInterface/Views/DebuggerSidebarPanel.js:
709         (WI.DebuggerSidebarPanel):
710         (WI.DebuggerSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
711         (WI.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): Deleted.
712         (WI.DebuggerSidebarPanel.prototype._timelineCapturingStopped): Deleted.
713         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
714         (WI.SourcesNavigationSidebarPanel):
715         (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
716         (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingWillStart): Deleted.
717         (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStopped): Deleted.
718         * UserInterface/Views/TimelineOverview.js:
719         (WI.TimelineOverview):
720         (WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged): Added.
721         (WI.TimelineOverview.prototype._capturingStarted): Deleted.
722         (WI.TimelineOverview.prototype._capturingStopped): Deleted.
723         * UserInterface/Views/TimelineRecordingContentView.js:
724         (WI.TimelineRecordingContentView):
725         (WI.TimelineRecordingContentView.prototype._handleTimelineCapturingStateChanged): Added.
726         (WI.TimelineRecordingContentView.prototype._recordingUnloaded):
727         (WI.TimelineRecordingContentView.prototype._capturingStarted): Deleted.
728         (WI.TimelineRecordingContentView.prototype._capturingStopped): Deleted.
729         * UserInterface/Views/TimelineTabContentView.js:
730         (WI.TimelineTabContentView):
731         (WI.TimelineTabContentView.prototype._handleTimelineCapturingStateChanged): Added.
732         (WI.TimelineTabContentView.prototype._capturingStartedOrStopped): Deleted.
733         Use the new single event for all Timelines capture state changes.
734         Prevent the record button from being clicked when capturing is in a transition state.
735
736 2019-04-10  Devin Rousso  <drousso@apple.com>
737
738         Web Inspector: REGRESSION: Audit: result UI shown on first open if an audit was previously selected
739         https://bugs.webkit.org/show_bug.cgi?id=196723
740         <rdar://problem/49722252>
741
742         Reviewed by Timothy Hatcher.
743
744         When opening Web Inspector for the first time, we will trigger resize `layout`s on the main
745         content area as Web Inspector is resized to it's old window size.
746
747         Rather than treating this layout as a `View.LayoutReason.Resize`, we should treat the
748         first `layout` (e.g. `initialLayout`) as a `View.LayoutReason.Dirty` instead, as there was
749         previously no content.
750
751         * UserInterface/Views/View.js:
752         (WI.View.prototype._layoutSubtree):
753         (WI.View.prototype._setLayoutReason):
754
755         * UserInterface/Views/AuditTestContentView.js:
756         (WI.AuditTestContentView):
757         Drive-by: ensure that this class is not instantiated directly.
758
759 2019-04-10  Devin Rousso  <drousso@apple.com>
760
761         Web Inspector: Debugger: current call frame indicator is indented when there is more than one thread
762         https://bugs.webkit.org/show_bug.cgi?id=196580
763         <rdar://problem/49582138>
764
765         Reviewed by Timothy Hatcher.
766
767         * UserInterface/Views/CallFrameTreeElement.css:
768         (.tree-outline .item.call-frame .status):
769         (.tree-outline.single-thread .item.call-frame .status): Added.
770
771 2019-04-10  Devin Rousso  <drousso@apple.com>
772
773         Web Inspector: REGRESSION (r238602): Elements: deleting the last child of a collapsed parent selects the parent's next sibling
774         https://bugs.webkit.org/show_bug.cgi?id=192711
775         <rdar://problem/46738990>
776
777         Reviewed by Timothy Hatcher.
778
779         Original patch by Matt Baker <mattbaker@apple.com>.
780
781         * UserInterface/Controllers/SelectionController.js:
782         (WI.SelectionController.prototype.removeSelectedItems):
783         When looking for a new item to select, start with the item preceding the
784         selection, instead of the item following the selection. This matches
785         pre-multiple selection behavior, as well as Mail and Xcode.
786
787         * UserInterface/Views/DOMTreeElement.js:
788         (WI.DOMTreeElement.prototype.onexpand):
789         Drive-by fix: when a hidden node is selected, its selection area is drawn
790         with a height of 0px. Update the selection area once the hidden node's
791         parent is expanded. AFAIK, this has always been broken.
792
793         * UserInterface/Views/DOMTreeOutline.js:
794         (WI.DOMTreeOutline.prototype.ondelete):
795         After a delete the `SelectionController` may have chosen a child of a
796         collapsed parent as the new selected item. If the item isn't the closing tag (e.g. after
797         deleting the last child), reveal it.
798
799         (WI.DOMTreeOutline.prototype.selectionControllerPreviousSelectableItem):
800
801         * UserInterface/Views/TreeElement.js:
802         (WI.TreeElement.prototype.get previousSelectableSibling): Added.
803         (WI.TreeElement.prototype.get nextSelectableSibling): Added.
804
805         * UserInterface/Views/TreeOutline.js:
806         (WI.TreeOutline.prototype.selectionControllerPreviousSelectableItem):
807         (WI.TreeOutline.prototype.selectionControllerNextSelectableItem):
808         Set `skipUnrevealed` to false, so that children of collapsed parent nodes
809         are considered when looking for an item to selected after a delete. Hidden `TreeElement`s
810         are still ignored as they aren't `selectable`.
811
812 2019-04-10  Devin Rousso  <drousso@apple.com>
813
814         Web Inspector: Elements tab: multiple selection lost after navigating to another tab
815         https://bugs.webkit.org/show_bug.cgi?id=192681
816         <rdar://problem/46709392>
817
818         Reviewed by Timothy Hatcher.
819
820         Orginal patch by Matt Baker <mattbaker@apple.com>.
821
822         * UserInterface/Controllers/SelectionController.js:
823         (WI.SelectionController.prototype.selectItem):
824         Simplify internal logic by removing an early return.
825
826         (WI.SelectionController.prototype.selectItems): Added.
827         (WI.SelectionController.prototype.selectAll):
828         Provide a means to select multiple items in a single operation.
829         If `_lastSelectedItem` is not in the items to select, the last
830         item being selected will become the last selected item.
831
832         (WI.SelectionController.prototype._deselectAllAndSelect):
833         Drive-by fix: correct a logic error. If no items are selected, the item
834         passed as an argument should still become selected.
835
836         * UserInterface/Views/TreeOutline.js:
837         (WI.TreeOutline.prototype.selectTreeElements): Added.
838
839         * UserInterface/Views/DOMTreeElement.js:
840         (WI.DOMTreeElement):
841         (WI.DOMTreeElement.prototype.get closeTagTreeElement): Added.
842         (WI.DOMTreeElement.prototype._updateChildren):
843         Make the close tag `TreeElement` available from the open tag `TreeElement`.
844
845         * UserInterface/Views/DOMTreeOutline.js:
846         (WI.DOMTreeOutline.prototype.update):
847         Restore selected `TreeElement`s after updating.
848
849         * UserInterface/Base/Utilities.js:
850         * UserInterface/Test.html:
851
852 2019-04-08  Matt Baker  <mattbaker@apple.com>
853
854         Web Inspector: Elements tab: Classes toggle should use accent color on hover
855         https://bugs.webkit.org/show_bug.cgi?id=196266
856
857         Reviewed by Devin Rousso.
858
859         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
860         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle):
861         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle::before):
862         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle:matches(.selected, :hover)):
863         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle:matches(.selected, :hover)::before):
864         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle:not(.selected):hover::before):
865         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle.selected:active::before):
866         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle.selected): Deleted.
867         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle:not(.selected):hover): Deleted.
868
869 2019-04-08  Devin Rousso  <drousso@apple.com>
870
871         Web Inspector: REGRESSION: Audit: default audits aren't added when an existing audit is present
872         https://bugs.webkit.org/show_bug.cgi?id=196663
873         <rdar://problem/49660757>
874
875         Reviewed by Timothy Hatcher.
876
877         Rather than have a button that allows the user to re-add the default audits, prevent them
878         from being deletable in the first place. "Deleting" a default audit will instead mark it as
879         disabled (and beep if it is already disabled).
880
881         * UserInterface/Controllers/AuditManager.js:
882         (WI.AuditManager.prototype.loadStoredTests):
883         (WI.AuditManager.prototype.removeTest):
884         (WI.AuditManager.prototype._addDefaultTests): Added.
885         (WI.AuditManager.prototype.addDefaultTestsIfNeeded): Deleted.
886
887         * UserInterface/Views/AuditNavigationSidebarPanel.js:
888         (WI.AuditNavigationSidebarPanel.prototype._addTest):
889         (WI.AuditNavigationSidebarPanel.prototype._updateStartStopButtonNavigationItemState):
890         (WI.AuditNavigationSidebarPanel.prototype._updateNoAuditsPlaceholder):
891         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
892         * UserInterface/Views/AuditNavigationSidebarPanel.css:
893         (.sidebar > .panel.navigation.audit.has-results > .content > .message-text-view.no-enabled-audits): Added.
894         (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view): Deleted.
895         (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > .message): Deleted.
896         (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > button): Deleted.
897
898         * Localizations/en.lproj/localizedStrings.js:
899
900 2019-04-06  Nikita Vasilyev  <nvasilyev@apple.com>
901
902         REGRESSION(r237196): Web Inspector: Computed panel shouldn't update when it isn't visible
903         https://bugs.webkit.org/show_bug.cgi?id=196667
904         <rdar://problem/49664912>
905
906         Reviewed by Timothy Hatcher.
907
908         Explicitly define `hidden` and `shown` methods instead of relying on SidebarPanel's `visible` getter.
909
910         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
911         (WI.GeneralStyleDetailsSidebarPanel.prototype.visibilityDidChange): Deleted.
912         (WI.GeneralStyleDetailsSidebarPanel.prototype.hidden): Added.
913         (WI.GeneralStyleDetailsSidebarPanel.prototype.shown): Added.
914
915 2019-04-05  Devin Rousso  <drousso@apple.com>
916
917         Web Inspector: TestSuite test cases should have their own timeout to ensure tests fail with output instead of timeout by test runner
918         https://bugs.webkit.org/show_bug.cgi?id=162814
919         <rdar://problem/28574102>
920
921         Reviewed by Brian Burg.
922
923         A 10s timer is started for every test case added to an async suite. The timer is cleared
924         when the test finishes, but if the timer fires, the test is forcibly ended with an error.
925
926         This timer can be configured by setting a `timeout` value when adding the test case. Values
927         are expected to be in milliseconds. The value `-1` will prevent a timer from being set.
928
929         This change also relaxes the expectation that any individual test case failure will stop the
930         rest of the suite from running. Since timers are set per test case, it is possible to
931         recover from a "bad" test case to still run the remaining test cases.
932
933         NOTE: there may be unexpected behaviour if a test times out, as the timer doesn't actually
934         stop the execution of the test, so it may still run and log information, which may appear
935         "out of nowhere" in the middle of other tests.
936
937         * UserInterface/Test/TestSuite.js:
938         (TestSuite.prototype.get passCount):
939         (AsyncTestSuite.prototype.runTestCases):
940         (SyncTestSuite.prototype.runTestCases):
941
942 2019-04-03  Devin Rousso  <drousso@apple.com>
943
944         Web Inspector: Single click on links in non-read-only TextEditors should not follow links
945         https://bugs.webkit.org/show_bug.cgi?id=123364
946         <rdar://problem/15323913>
947
948         Reviewed by Timothy Hatcher.
949
950         * UserInterface/Base/Main.js:
951         (WI._updateModifierKeys):
952         Add classes to the body whenever alt, shift, or ctrl are pressed.
953
954         * UserInterface/Views/CodeMirrorEditor.js:
955         (WI.CodeMirrorEditor.create):
956         Add a `read-only` class if the `CodeMirror` is readonly.
957
958         * UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
959         (.cm-s-default .cm-link,):
960         (.read-only.cm-s-default .cm-link:hover,):
961         (.cm-s-default .cm-link:hover,): Deleted.
962
963         * UserInterface/Views/TextEditor.js:
964         (WI.TextEditor.prototype.set readOnly):
965         (WI.TextEditor.prototype._openClickedLinks):
966
967 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
968
969         Remove support for -apple-trailing-word
970         https://bugs.webkit.org/show_bug.cgi?id=196525
971
972         Reviewed by Zalan Bujtas.
973
974         This CSS property is nonstandard and not used.
975
976         * UserInterface/Models/CSSKeywordCompletions.js:
977
978 2019-04-03  Nikita Vasilyev  <nvasilyev@apple.com>
979
980         Web Inspector: Uncaught Exception: TypeError: this._computedStyleSection.focus is not a function. (In 'this._computedStyleSection.focus()', 'this._computedStyleSection.focus' is undefined)
981         https://bugs.webkit.org/show_bug.cgi?id=192108
982         <rdar://problem/46685392>
983
984         Reviewed by Devin Rousso.
985
986         This patch fixes the uncaught exception. Tabbing to and from "Properties" section continues
987         working the same way as before the patch.
988
989         * UserInterface/Views/ComputedStyleDetailsPanel.js:
990         (WI.ComputedStyleDetailsPanel.prototype.focusFirstSection): Deleted.
991         (WI.ComputedStyleDetailsPanel.prototype.focusLastSection): Deleted.
992
993 2019-04-02  Devin Rousso  <drousso@apple.com>
994
995         Web Inspector: Elements: DOM breakpoint icon should stroke when hovering selection area
996         https://bugs.webkit.org/show_bug.cgi?id=196516
997         <rdar://problem/49540494>
998
999         Reviewed by Timothy Hatcher.
1000
1001         * UserInterface/Views/DOMTreeContentView.css:
1002         (body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, .hovered) .status-image.breakpoint,): Added.
1003         (body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, .hovered) .status-image.breakpoint.subtree): Added.
1004         (body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, :hover) .status-image.breakpoint): Deleted.
1005         (body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, :hover) .status-image.breakpoint.subtree): Deleted.
1006
1007 2019-04-01  Devin Rousso  <drousso@apple.com>
1008
1009         Web Inspector: Debugger: modernize serialization of breakpoints and the maps that hold them
1010         https://bugs.webkit.org/show_bug.cgi?id=196230
1011         <rdar://problem/49236485>
1012
1013         Reviewed by Joseph Pecoraro.
1014
1015         * UserInterface/Controllers/DebuggerManager.js:
1016         (WI.DebuggerManager):
1017         (WI.DebuggerManager.prototype.breakpointsForSourceCode):
1018         (WI.DebuggerManager.prototype.addBreakpoint):
1019         (WI.DebuggerManager.prototype.removeBreakpoint):
1020         (WI.DebuggerManager.prototype._setBreakpoint):
1021         (WI.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
1022
1023         * UserInterface/Models/Breakpoint.js:
1024         (WI.Breakpoint):
1025         (WI.Breakpoint.fromJSON): Added.
1026         (WI.Breakpoint.prototype.toJSON):
1027         (WI.Breakpoint.prototype.set resolved):
1028         (WI.Breakpoint.prototype.recreateAction):
1029         (WI.Breakpoint.prototype.saveIdentityToCookie):
1030         (WI.Breakpoint.prototype._isSpecial): Added.
1031         (WI.Breakpoint.set resolved.isSpecialBreakpoint): Deleted.
1032         (WI.Breakpoint.serializeOptions): Deleted.
1033
1034         * UserInterface/Models/BreakpointAction.js:
1035         (WI.BreakpointAction):
1036         (WI.BreakpointAction.fromJSON): Added.
1037         (WI.BreakpointAction.prototype.toProtocol): Added.
1038
1039         * UserInterface/Views/DebuggerSidebarPanel.js:
1040         (WI.DebuggerSidebarPanel.prototype._addBreakpointsForSourceCode):
1041
1042         * UserInterface/Views/SourceCodeTextEditor.js:
1043         (WI.SourceCodeTextEditor.prototype._prepareEditorForInitialContent):
1044         (WI.SourceCodeTextEditor.prototype._breakpointsEnabledDidChange):
1045
1046 2019-04-01  Devin Rousso  <drousso@apple.com>
1047
1048         Web Inspector: DOMDebugger: disabling a breakpoint for a specific event listener removes it from the UI
1049         https://bugs.webkit.org/show_bug.cgi?id=196453
1050         <rdar://problem/49489318>
1051
1052         Reviewed by Joseph Pecoraro.
1053
1054         Allow breakpoints for specific event listeners to be disabled, rather than immeditately
1055         removing/deleting them when they are about to become disabled. This preserves the existing
1056         functionality, but now allows for the tree element to stay in the UI in a disabled state.
1057
1058         * UserInterface/Controllers/DOMManager.js:
1059         (WI.DOMManager):
1060         (WI.DOMManager.prototype.setBreakpointForEventListener):
1061         (WI.DOMManager.prototype.removeBreakpointForEventListener):
1062         (WI.DOMManager.prototype.removeEventListenerBreakpointsForNode): Added.
1063         (WI.DOMManager.prototype._updateEventBreakpoint): Added.
1064         (WI.DOMManager.prototype._handleEventBreakpointDisabledStateChanged): Added.
1065
1066         * UserInterface/Controllers/DOMDebuggerManager.js:
1067         (WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
1068
1069         * UserInterface/Views/EventBreakpointTreeElement.js:
1070         (WI.EventBreakpointTreeElement.prototype.populateContextMenu):
1071         (WI.EventBreakpointTreeElement.prototype._toggleBreakpoint):
1072
1073         * UserInterface/Views/ContextMenuUtilities.js:
1074         (WI.appendContextMenuItemsForDOMNodeBreakpoints):
1075
1076         * UserInterface/Views/DOMNodeTreeElement.js:
1077         (WI.DOMNodeTreeElement.prototype.ondelete):
1078
1079 2019-04-01  Devin Rousso  <drousso@apple.com>
1080
1081         Web Inspector: Canvas: auto-record after page load sometimes shows the wrong UI
1082         https://bugs.webkit.org/show_bug.cgi?id=196320
1083         <rdar://problem/49356686>
1084
1085         Reviewed by Joseph Pecoraro.
1086
1087         It was previously possible that the timing of a recording being started and the preview
1088         image being loaded would not always be in the same order.
1089
1090         Utilize the existing `View.prototype.layout` mechanics to ensure that updates are coalesced
1091         and that the changes are always applied in a particular order.
1092
1093         * UserInterface/Views/CanvasContentView.js:
1094         (WI.CanvasContentView):
1095         (WI.CanvasContentView.prototype.refreshPreview): Added.
1096         (WI.CanvasContentView.prototype.initialLayout):
1097         (WI.CanvasContentView.prototype.layout):
1098         (WI.CanvasContentView.prototype.shown):
1099         (WI.CanvasContentView.prototype.attached):
1100         (WI.CanvasContentView.prototype._refreshPixelSize):
1101         (WI.CanvasContentView.prototype.refresh): Deleted.
1102         (WI.CanvasContentView.prototype._recordingStarted): Deleted.
1103         (WI.CanvasContentView.prototype._recordingProgress): Deleted.
1104         (WI.CanvasContentView.prototype._recordingStopped): Deleted.
1105         (WI.CanvasContentView.prototype._shaderProgramAdded): Deleted.
1106         (WI.CanvasContentView.prototype._shaderProgramRemoved): Deleted.
1107
1108         * UserInterface/Views/CanvasOverviewContentView.js:
1109         (WI.CanvasOverviewContentView.prototype._refreshPreviews):
1110
1111 2019-04-01  Devin Rousso  <drousso@apple.com>
1112
1113         Web Inspector: Canvas: add compatibility support for WebMetal
1114         https://bugs.webkit.org/show_bug.cgi?id=196412
1115         <rdar://problem/49439417>
1116
1117         Reviewed by Joseph Pecoraro.
1118
1119         * UserInterface/Models/Canvas.js:
1120         (WI.Canvas.fromPayload):
1121         (WI.Canvas.displayNameForContextType):
1122         * UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
1123         * Versions/Inspector-iOS-12.2.json:
1124
1125 2019-04-01  Devin Rousso  <drousso@apple.com>
1126
1127         Web Inspector: "Copy as HTML" appears twice when showing a context menu for a logged node
1128         https://bugs.webkit.org/show_bug.cgi?id=196271
1129         <rdar://problem/49290676>
1130
1131         Reviewed by Joseph Pecoraro.
1132
1133         * UserInterface/Views/ObjectTreeBaseTreeElement.js:
1134         (WI.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
1135
1136         * Localizations/en.lproj/localizedStrings.js:
1137
1138 2019-04-01  Devin Rousso  <drousso@apple.com>
1139
1140         Web Inspector: Debugger: breakpoints don't populate in inspector2 on first load
1141         https://bugs.webkit.org/show_bug.cgi?id=196063
1142         <rdar://problem/49097787>
1143
1144         Reviewed by Joseph Pecoraro.
1145
1146         In the case that a breakpoint becomes resolved after the resource has finished loaded, there
1147         won't be an already existing `TreeElement` for the breakpoint to replace.
1148
1149         This can realistically only happen if the IndexedDB lookup is super slow, or the resource is
1150         extremely fast (e.g. a `data` url).
1151
1152         * UserInterface/Views/DebuggerSidebarPanel.js:
1153         (WI.DebuggerSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):
1154         (WI.DebuggerSidebarPanel.prototype._addDebuggerObject): Deleted.
1155
1156         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1157         (WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
1158         (WI.SourcesNavigationSidebarPanel.prototype._addBreakpointsForSourceCode):
1159         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):
1160
1161 2019-04-01  Joseph Pecoraro  <pecoraro@apple.com>
1162
1163         Web Inspector: CPU Usage Timeline - Adjust Energy Impact Threshholds
1164         https://bugs.webkit.org/show_bug.cgi?id=196421
1165         <rdar://problem/49125703>
1166
1167         Reviewed by Devin Rousso.
1168
1169         - Low - Keep Below 3% to continue to encourage idle pages stay below 3%
1170           Might want to reduce to 2.5 or 2 after fixing bug 196419.
1171
1172         - High - Make Above 30% instead of 50% to encourage long running interactivity to stay below 30%
1173           Depends on interaction, but sustained (1-2min) at 30%+ will certainly impact battery.
1174
1175         - Very High - Make above 100% instead of 150%
1176           CPU Usage spikes around page load and is quite often still under 100% despite many threads.
1177           Drop this a bit as we dropped High down.
1178
1179         Reduce the size of the Medium section, and increase the High section
1180         Having 70% of the chart be "Medium" is just too much Medium, and
1181         we've now made it more possible to be in the High range.
1182
1183         * UserInterface/Views/CPUTimelineView.js:
1184         (WI.CPUTimelineView.prototype.get mediumEnergyThreshold):
1185         (WI.CPUTimelineView.prototype.get highEnergyThreshold):
1186         (WI.CPUTimelineView.prototype.get lowEnergyGraphBoundary):
1187         (WI.CPUTimelineView.prototype.get mediumEnergyGraphBoundary):
1188         (WI.CPUTimelineView.prototype.get highEnergyGraphBoundary):
1189         (WI.CPUTimelineView.prototype.initialLayout):
1190         (WI.CPUTimelineView.prototype.layout.bestThreadLayoutMax):
1191         (WI.CPUTimelineView.prototype._layoutEnergyChart):
1192
1193 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
1194
1195         Delete WebMetal implementation in favor of WebGPU
1196         https://bugs.webkit.org/show_bug.cgi?id=195418
1197
1198         Reviewed by Dean Jackson.
1199
1200         * UserInterface/Models/Canvas.js:
1201         (WI.Canvas.fromPayload):
1202         (WI.Canvas.displayNameForContextType):
1203         * UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
1204         * Versions/Inspector-iOS-12.2.json:
1205
1206 2019-03-29  Devin Rousso  <drousso@apple.com>
1207
1208         Web Inspector: Storage: some cookie column headers are not localized
1209         https://bugs.webkit.org/show_bug.cgi?id=196406
1210         <rdar://problem/48467422>
1211
1212         Reviewed by Joseph Pecoraro.
1213
1214         * UserInterface/Views/CookieStorageContentView.js:
1215         (WI.CookieStorageContentView.prototype.initialLayout):
1216
1217         * Localizations/en.lproj/localizedStrings.js:
1218
1219 2019-03-28  Joseph Pecoraro  <pecoraro@apple.com>
1220
1221         Web Inspector: Show Resource Initiator in Network Tab detail views
1222         https://bugs.webkit.org/show_bug.cgi?id=196316
1223         <rdar://problem/49352679>
1224
1225         Reviewed by Devin Rousso.
1226
1227         * UserInterface/Controllers/NetworkManager.js:
1228         (WI.NetworkManager.prototype.resourceRequestWillBeSent):
1229         (WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache):
1230         (WI.NetworkManager.prototype._initiatorCallFramesFromPayload):
1231         Initialize call frames from the initiator payload.
1232
1233         * UserInterface/Models/Resource.js:
1234         (WI.Resource.prototype.get initiatorCallFrames):
1235         Initialization and accessor.
1236
1237         * UserInterface/Views/CallFrameTreeElement.js:
1238         (WI.CallFrameTreeElement):
1239         Selecting a native element won't do anything so just don't allow selection.
1240
1241         * UserInterface/Views/ResourceHeadersContentView.css:
1242         (.resource-headers .go-to-link):
1243         (.resource-headers .call-stack):
1244         (.resource-headers .call-stack:hover):
1245         (@media (prefers-color-scheme: dark)):
1246         * UserInterface/Views/ResourceHeadersContentView.js:
1247         (WI.ResourceHeadersContentView):
1248         (WI.ResourceHeadersContentView.prototype.hidden):
1249         (WI.ResourceHeadersContentView.prototype._refreshSummarySection):
1250         Add an "Initiator" line in the summary with a way to view the whole
1251         initiator backtrace if one exists.
1252
1253 2019-03-26  Devin Rousso  <drousso@apple.com>
1254
1255         Web Inspector: Sources: fix typo in CSS selector to always show add breakpoint button
1256         https://bugs.webkit.org/show_bug.cgi?id=196241
1257
1258         Reviewed by Matt Baker.
1259
1260         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
1261         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.paused-reason, .breakpoints).collapsed > .header > .options,):
1262         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.paused-reason, .breakpoins).collapsed > .header > .options,): Deleted.
1263
1264 2019-03-25  Joseph Pecoraro  <pecoraro@apple.com>
1265
1266         Web Inspector: Page Weight indicator clears on pages with zero length resources (macrumors.com)
1267         https://bugs.webkit.org/show_bug.cgi?id=196170
1268
1269         Reviewed by Timothy Hatcher.
1270
1271         * UserInterface/Models/DefaultDashboard.js:
1272         (WI.DefaultDashboard.prototype._resourceSizeDidChange):
1273         Catch NaN earlier.
1274
1275         * UserInterface/Models/Resource.js:
1276         (WI.Resource.prototype.updateWithMetrics):
1277         When we receive exact metrics transition the estimated size to zero,
1278         since we won't receive any more updates for the resource.
1279
1280 2019-03-24  Devin Rousso  <drousso@apple.com>
1281
1282         Web Inspector: Canvas: WebGL action icon shouldn't invert when selected
1283         https://bugs.webkit.org/show_bug.cgi?id=196135
1284
1285         Reviewed by Timothy Hatcher.
1286
1287         * UserInterface/Views/RecordingActionTreeElement.js:
1288         (WI.RecordingActionTreeElement._classNameForAction):
1289         (WI.RecordingActionTreeElement._classNameForAction.classNameForActionName): Deleted.
1290         Remove unnecessary logging and memoization.
1291
1292         * UserInterface/Views/RecordingActionTreeElement.css:
1293         (.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
1294         (@media (prefers-color-scheme: dark)):
1295         (.item.recording-action:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
1296         (.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
1297         (.item.recording-action.has-context-replacer > .icon): Deleted.
1298         (.item.recording-action:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
1299         Simplify styles between light and dark mode.
1300
1301 2019-03-24  Simon Welsh  <simon@welsh-au.com>
1302
1303         Web Inspector: testCellRoleForRequiredChidren accessibility audit checks for rows in cells
1304         https://bugs.webkit.org/show_bug.cgi?id=195988
1305
1306         Reviewed by Timothy Hatcher.
1307
1308         The audit now checks that rows contain cells, allowing any of the four
1309         cell-based roles.
1310
1311         * UserInterface/Controllers/AuditManager.js:
1312         (WI.AuditManager.prototype.addDefaultTestsIfNeeded):
1313         (WI.AuditManager):
1314         (WI.AuditManager.prototype.addDefaultTestsIfNeeded.const.testCellRoleForRequiredChidren): Deleted.
1315
1316 2019-03-24  Devin Rousso  <drousso@apple.com>
1317
1318         Web Inspector: Canvas: missing icons for WebGL2 contexts
1319         https://bugs.webkit.org/show_bug.cgi?id=196136
1320
1321         Reviewed by Timothy Hatcher.
1322
1323         * UserInterface/Views/CanvasSidebarPanel.css:
1324         (.sidebar > .panel.navigation.canvas > .navigation-bar > .item.record-start-stop.disabled > .glyph): Added.
1325         (.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.canvas:matches(.canvas-2d, .bitmaprenderer) .icon): Added.
1326         (.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.canvas:matches(.webgl, .webgl2, .webgpu, .webmetal) .icon): Added.
1327         (@media (prefers-color-scheme: dark)):
1328         (.sidebar > .panel.navigation.canvas > .navigation-bar > .item.record-start-stop.disabled): Deleted.
1329         (.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.canvas.canvas-2d .icon): Deleted.
1330         (.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.casnvas.webgl .icon): Deleted.
1331         Use the 2D icon for BitmapRenderer and the 3D icon for WebGL2, WebMetals, and WebGPU.
1332         Drive-by: the start/stop button text was too dark when disabled in dark mode.
1333
1334         * UserInterface/Models/Canvas.js:
1335         Drive-by: "gpu" => "webgpu", to match the protocol string.
1336
1337 2019-03-22  Devin Rousso  <drousso@apple.com>
1338
1339         Web Inspector: Sources: "Reveal in Resources Tab" still shown when Sources tab is enabled
1340         https://bugs.webkit.org/show_bug.cgi?id=196134
1341
1342         Reviewed by Joseph Pecoraro.
1343
1344         * UserInterface/Views/RecordingActionTreeElement.js:
1345         (WI.RecordingActionTreeElement.prototype.populateContextMenu):
1346         Drive-by: find the first call frame that has a source code location, rather than naively
1347         always using the top call frame.
1348
1349         * UserInterface/Views/SearchResultTreeElement.js:
1350         (WI.SearchResultTreeElement.prototype.populateContextMenu):
1351
1352 2019-03-22  Keith Rollin  <krollin@apple.com>
1353
1354         Enable ThinLTO support in Production builds
1355         https://bugs.webkit.org/show_bug.cgi?id=190758
1356         <rdar://problem/45413233>
1357
1358         Reviewed by Daniel Bates.
1359
1360         Enable building with Thin LTO in Production when using Xcode 10.2 or
1361         later. This change results in a 1.45% progression in PLT5. Full
1362         Production build times increase about 2-3%. Incremental build times
1363         are more severely affected, and so LTO is not enabled for local
1364         engineering builds.
1365
1366         LTO is enabled only on macOS for now, until rdar://problem/49013399,
1367         which affects ARM builds, is fixed.
1368
1369         To change the LTO setting when building locally:
1370
1371         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
1372           command line.
1373         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
1374           on the command line.
1375         - If building with `build-root`, specify --lto={none,thin,full} on the
1376           command line.
1377         - If building with Xcode, create a LocalOverrides.xcconfig file at the
1378           top level of your repository directory (if needed) and define
1379           WK_LTO_MODE to full, thin, or none.
1380
1381         * Configurations/Base.xcconfig:
1382
1383 2019-03-21  Joseph Pecoraro  <pecoraro@apple.com>
1384
1385         Web Inspector: Timelines - Cannot export on about:blank - suggested filename containing a colon silently fails
1386         https://bugs.webkit.org/show_bug.cgi?id=196109
1387
1388         Reviewed by Timothy Hatcher.
1389
1390         * UserInterface/Base/FileUtilities.js:
1391         (WI.FileUtilities.sanitizeFilename):
1392         (WI.FileUtilities.inspectorURLForFilename):
1393         New utility functions.
1394
1395         * UserInterface/Test.html:
1396         Include FileUtilities.
1397
1398         * UserInterface/Base/Main.js:
1399         * UserInterface/Controllers/AuditManager.js:
1400         (WI.AuditManager.prototype.export):
1401         * UserInterface/Debug/ProtocolTrace.js:
1402         (WI.ProtocolTrace.prototype.get saveData):
1403         (WI.ProtocolTrace):
1404         * UserInterface/Views/ConsoleMessageView.js:
1405         (WI.ConsoleMessageView.prototype._handleContextMenu):
1406         (WI.ConsoleMessageView):
1407         * UserInterface/Views/ContextMenuUtilities.js:
1408         * UserInterface/Views/HeapSnapshotContentView.js:
1409         (WI.HeapSnapshotContentView.prototype._exportSnapshot):
1410         * UserInterface/Views/LogContentView.js:
1411         (WI.LogContentView.prototype.get saveData):
1412         (WI.LogContentView.prototype._handleContextMenuEvent):
1413         * UserInterface/Views/NetworkTableContentView.js:
1414         (WI.NetworkTableContentView.prototype._exportHAR):
1415         * UserInterface/Views/RecordingContentView.js:
1416         (WI.RecordingContentView.prototype._exportRecording):
1417         (WI.RecordingContentView.prototype._exportReduction):
1418         * UserInterface/Views/ScriptContentView.js:
1419         (WI.ScriptContentView.prototype.get saveData):
1420         * UserInterface/Views/ShaderProgramContentView.js:
1421         (WI.ShaderProgramContentView.prototype.get saveData):
1422         * UserInterface/Views/TextContentView.js:
1423         (WI.TextContentView.prototype.get saveData):
1424         * UserInterface/Views/TextResourceContentView.js:
1425         (WI.TextResourceContentView.prototype.get saveData):
1426         * UserInterface/Views/TimelineRecordingContentView.js:
1427         (WI.TimelineRecordingContentView.prototype._exportTimelineRecording):
1428         Update "web-inspector:///" URL building code to use the utility.
1429
1430 2019-03-21  Nikita Vasilyev  <nvasilyev@apple.com>
1431
1432         Web Inspector: Use CSS variables for text color in Computed panel
1433         https://bugs.webkit.org/show_bug.cgi?id=196117
1434
1435         Reviewed by Timothy Hatcher.
1436
1437         * UserInterface/Views/ComputedStyleSection.css:
1438         (.computed-style-section):
1439         (.computed-style-section .computed-property-item .property-trace-item .selector):
1440         (.computed-style-section .computed-property-item .go-to-link):
1441
1442 2019-03-21  Devin Rousso  <drousso@apple.com>
1443
1444         Web Inspector: Timelines: flatten the overview to show all records, one per line
1445         https://bugs.webkit.org/show_bug.cgi?id=191901
1446         <rdar://problem/46423618>
1447
1448         Reviewed by Timothy Hatcher.
1449
1450         * UserInterface/Views/OverviewTimelineView.js:
1451         (WI.OverviewTimelineView):
1452         (WI.OverviewTimelineView.prototype.closed):
1453         (WI.OverviewTimelineView.prototype.get navigationItems): Added.
1454         (WI.OverviewTimelineView.prototype.reset):
1455         (WI.OverviewTimelineView.prototype.layout):
1456         (WI.OverviewTimelineView.prototype.get _relevantTimelines): Added.
1457         (WI.OverviewTimelineView.prototype.get _shouldGroupBySourceCode): Added.
1458         (WI.OverviewTimelineView.prototype._loadExistingRecords): Added.
1459         (WI.OverviewTimelineView.prototype._insertDataGridNode):
1460         (WI.OverviewTimelineView.prototype._addResourceToDataGridIfNeeded):
1461         (WI.OverviewTimelineView.prototype._addSourceCodeTimeline):
1462         (WI.OverviewTimelineView.prototype._processPendingRepresentedObjects):
1463         (WI.OverviewTimelineView.prototype._handleGroupBySourceCodeSettingChanged): Added.
1464         (WI.OverviewTimelineView.prototype._handleGroupBySourceCodeNavigationItemCheckedDidChange): Added.
1465         (WI.OverviewTimelineView.prototype._handleTimelineRecordAdded): Added.
1466         (WI.OverviewTimelineView.prototype._sourceCodeTimelineAdded):
1467         (WI.OverviewTimelineView.prototype._networkTimelineRecordAdded): Deleted.
1468         Listen for new records on all timelines. Add each record as a new line. Since each timeline
1469         has different data to display, only show the "name" and "graph" for all records.
1470
1471         * UserInterface/Views/TimelineRecordingContentView.js:
1472         (WI.TimelineRecordingContentView):
1473         (WI.TimelineRecordingContentView.prototype._currentContentViewDidChange):
1474         (WI.TimelineRecordingContentView.prototype._updateImportedView): Deleted.
1475         When viewing the overview of an imported recording, show the non-grouped overview.
1476
1477         * UserInterface/Models/TimelineRecording.js:
1478         (WI.TimelineRecording.prototype.addRecord):
1479         (WI.TimelineRecording.prototype._keyForRecord):
1480         Drive-by: show Media timeline events under the owner frame's resource when grouped.
1481
1482         * UserInterface/Views/TimelineRecordBar.css:
1483         (.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment, .timeline-record-bar.timeline-record-type-heap-allocations > .segment): Added.
1484         (.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment): Deleted.
1485
1486         * UserInterface/Base/Setting.js:
1487         Add setting for controlling the Timeline overview grouping.
1488
1489         * UserInterface/Main.html:
1490         * UserInterface/Views/SourceCodeTimelineTreeElement.js: Removed.
1491         * UserInterface/Views/TimelineRecordingImportedView.js: Removed.
1492         * UserInterface/Views/TimelineRecordingImportedView.css: Removed.
1493         Remove unused files.
1494
1495         * Localizations/en.lproj/localizedStrings.js:
1496
1497 2019-03-21  Devin Rousso  <drousso@apple.com>
1498
1499         Web Inspector: Sources: the name of the file should not be used as a folder
1500         https://bugs.webkit.org/show_bug.cgi?id=196064
1501         <rdar://problem/49097710>
1502
1503         Reviewed by Timothy Hatcher.
1504
1505         * UserInterface/Views/GeneralTreeElement.js:
1506         (WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath):
1507
1508         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1509         (WI.SourcesNavigationSidebarPanel.prototype._addResource):
1510         Drive-by: sort resources in each folder by name when grouping by path.
1511
1512 2019-03-20  Devin Rousso  <drousso@apple.com>
1513
1514         Web Inspector: Canvas: rework how Canvas.enable/Canvas.disable is used so that events are not sent when the Canvas tab isn't enabled
1515         https://bugs.webkit.org/show_bug.cgi?id=195828
1516         <rdar://problem/48941756>
1517
1518         Reviewed by Timothy Hatcher.
1519
1520         * UserInterface/Controllers/CanvasManager.js:
1521         (WI.CanvasManager):
1522         (WI.CanvasManager.prototype.initializeTarget):
1523         (WI.CanvasManager.prototype.enable): Added.
1524         (WI.CanvasManager.prototype.disable): Added.
1525
1526         * UserInterface/Views/CanvasTabContentView.js:
1527         (WI.CanvasTabContentView):
1528         (WI.CanvasTabContentView.prototype.closed): Added.
1529
1530         * UserInterface/Base/Test.js:
1531         (WI.contentLoaded):
1532
1533 2019-03-20  Devin Rousso  <drousso@apple.com>
1534
1535         Web Inspector: Sources: collapsing a section doesn't shrink the space used by that section
1536         https://bugs.webkit.org/show_bug.cgi?id=196045
1537
1538         Reviewed by Timothy Hatcher.
1539
1540         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1541         (WI.SourcesNavigationSidebarPanel):
1542         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
1543         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
1544         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
1545         (.sidebar > .panel.navigation.sources > .content > .details-section):
1546         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.paused-reason, .breakpoins).collapsed > .header > .options,):
1547         (.sidebar > .panel.navigation.sources > .content > .details-section.collapsed > .content):
1548         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint):
1549         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.pause-reason, .call-stack, .breakpoints) > .content,):
1550         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints) > .content):
1551         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content):
1552         (.sidebar > .panel.navigation.sources > .content > .details-section.call-stack):
1553         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints):
1554         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .create-breakpoint):
1555         (.sidebar > .panel.navigation.sources > .content > .pause-reason):
1556         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content,):
1557         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .tree-outline .item.event-target-window .icon):
1558         (.sidebar > .panel.navigation.sources > .content .details-section): Deleted.
1559         (.sidebar > .panel.navigation.sources > .content .details-section:matches(.paused-reason, .breakpoins).collapsed > .header > .options,): Deleted.
1560         (.sidebar > .panel.navigation.sources > .content .details-section.collapsed > .content): Deleted.
1561         (.sidebar > .panel.navigation.sources > .content .details-section.breakpoints > .header > .options .create-breakpoint): Deleted.
1562         (.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Deleted.
1563         (.sidebar > .panel.navigation.sources > .content > .call-stack-container): Deleted.
1564         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container): Deleted.
1565         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container .create-breakpoint): Deleted.
1566         (.sidebar > .panel.navigation.sources > .content > .resources-container): Deleted.
1567         (.sidebar > .panel.navigation.sources > .content > .pause-reason-container): Deleted.
1568         (.sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container)): Deleted.
1569         (.sidebar > .panel.navigation.sources > .content > .breakpoints .tree-outline .item.event-target-window .icon): Deleted.
1570          - Apply the overflow scrolling to the content element of each `WI.DetailsSection`.
1571          - Ensure that there is a maximum height for each section.
1572          - When `.collapsed`, don't try to grow/shrink the section based on its contents.
1573
1574         * UserInterface/Views/CallFrameTreeElement.css:
1575         (.tree-outline .item.call-frame):
1576         (.tree-outline .item.call-frame .status):
1577         Make the container of the active call frame status indicator relatively positioned so that
1578         the active call frame status indicator will follow the container when scrolling.
1579
1580 2019-03-20  Devin Rousso  <drousso@apple.com>
1581
1582         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
1583         https://bugs.webkit.org/show_bug.cgi?id=176824
1584         <rdar://problem/34290931>
1585
1586         Reviewed by Timothy Hatcher.
1587
1588         Original patch by Joseph Pecoraro <pecoraro@apple.com>.
1589
1590         * Localizations/en.lproj/localizedStrings.js:
1591         New string.
1592
1593         * UserInterface/Controllers/TimelineManager.js:
1594         (WI.TimelineManager.prototype._processRecord):
1595         Include the whole data object as extra details.
1596
1597         * UserInterface/Models/ScriptTimelineRecord.js:
1598         (WI.ScriptTimelineRecord):
1599         (WI.ScriptTimelineRecord.prototype.get eventType):
1600         Wholesale copy of the extra data instead of just a single property.
1601
1602         * UserInterface/Views/ScriptDetailsTimelineView.js:
1603         (WI.ScriptDetailsTimelineView):
1604         Give the name column more initial space, there is still extra space
1605         after this adjustment but name is comfortably larger (and the most
1606         likely to be expanded).
1607
1608         * UserInterface/Views/ScriptTimelineDataGridNode.js:
1609         (WI.ScriptTimelineDataGridNode.prototype.get subtitle):
1610         Include "default prevented" as the event's subtitle if it was prevented.
1611
1612 2019-03-20  Devin Rousso  <drousso@apple.com>
1613
1614         Web Inspector: Styles Redesign: Editing selector should not hide the rule
1615         https://bugs.webkit.org/show_bug.cgi?id=178489
1616         <rdar://problem/35062434>
1617
1618         Reviewed by Timothy Hatcher.
1619
1620         Extracts the selector payload parsing logic inside `WI.DOMNodeStyles` into static functions
1621         so that when the user changes the selector of a `WI.CSSRule`, it's able to process and
1622         update itself with the new selector. This is mainly useful in the case where the `WI.CSSRule`
1623         no longer applies to the selected node (meaning it won't be part of that node's
1624         `WI.DOMNodeStyles`) in that it allows the `WI.SpreadsheetCSSStyleDeclarationSection` to
1625         display the new selector text and the owner `WI.SpreadsheetRulesStyleDetailsPanel` to keep
1626         that section visible even though it isn't applicable to the current node anymore.
1627
1628         * UserInterface/Models/DOMNodeStyles.js:
1629         (WI.DOMNodeStyles):
1630         (WI.DOMNodeStyles.parseSelectorListPayload): Added.
1631         (WI.DOMNodeStyles.createSourceCodeLocation): Added.
1632         (WI.DOMNodeStyles.prototype.refresh):
1633         (WI.DOMNodeStyles.prototype.refresh.fetchedMatchedStyles):
1634         (WI.DOMNodeStyles.prototype.refresh.fetchedInlineStyles):
1635         (WI.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
1636         (WI.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
1637         (WI.DOMNodeStyles.prototype._parseRulePayload):
1638         (WI.DOMNodeStyles.prototype._styleSheetContentDidChange):
1639         (WI.DOMNodeStyles.prototype.refresh.parseRuleMatchArrayPayload): Deleted.
1640         (WI.DOMNodeStyles.prototype._createSourceCodeLocation): Deleted.
1641         (WI.DOMNodeStyles.prototype._parseSelectorListPayload): Deleted.
1642         Keep track of all `WI.CSSRule` and `WI.CSSStyleDeclaration` that have ever been associated
1643         with this object, so that if a rule's selector is changed to no longer match, and then is
1644         changed back to match again, we are able to update that rule instead of creating a new one.
1645
1646         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
1647         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
1648         (WI.SpreadsheetRulesStyleDetailsPanel.prototype._handleSectionFilterApplied):
1649         (WI.SpreadsheetRulesStyleDetailsPanel.prototype._handleSectionSelectorWillChange): Added.
1650         Attempt to preserve the position of any sections that are changed and no longer apply to the
1651         current node.
1652
1653         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
1654         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidChange):
1655         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
1656         Drive-by: remove unused CSS classes.
1657
1658         * UserInterface/Models/CSSRule.js:
1659         (WI.CSSRule.prototype.update):
1660         (WI.CSSRule.prototype._selectorResolved):
1661         Drive-by: remove unused event.
1662
1663         * UserInterface/Base/Multimap.js:
1664         (Multimap.prototype.has): Added.
1665         (Multimap.prototype.sets): Added.
1666         (Multimap.prototype.copy): Added.
1667
1668 2019-03-20  Devin Rousso  <drousso@apple.com>
1669
1670         Web Inspector: no way to filter out all console messages or all evaluations/results
1671         https://bugs.webkit.org/show_bug.cgi?id=167035
1672         <rdar://problem/30023523>
1673
1674         Reviewed by Timothy Hatcher.
1675
1676         * UserInterface/Views/LogContentView.js:
1677         (WI.LogContentView):
1678         (WI.LogContentView.prototype.didAppendConsoleMessageView):
1679         (WI.LogContentView.prototype._markScopeBarItemUnread):
1680         (WI.LogContentView.prototype._markScopeBarItemForMessageLevelUnread): Added.
1681         (WI.LogContentView.prototype._previousMessageRepeatCountUpdated):
1682         (WI.LogContentView.prototype._messageSourceBarSelectionDidChange):
1683         (WI.LogContentView.prototype._scopeBarSelectionDidChange):
1684         (WI.LogContentView.prototype._filterMessageElements):
1685         (WI.LogContentView.prototype.performSearch):
1686         * UserInterface/Views/LogContentView.css:
1687         (.log-scope-bar > li.unread.evaluations::before): Added.
1688
1689         * UserInterface/Views/ConsoleCommandView.js:
1690         (WI.ConsoleCommandView):
1691         Drive-by: remove unnecessary super-class extends.
1692
1693         * Localizations/en.lproj/localizedStrings.js:
1694
1695 2019-03-20  Nikita Vasilyev  <nvasilyev@apple.com>
1696
1697         Web Inspector: Styles: enabledProperties don't get invalidated after removing property
1698         https://bugs.webkit.org/show_bug.cgi?id=196038
1699
1700         Reviewed by Timothy Hatcher.
1701
1702         * UserInterface/Models/CSSStyleDeclaration.js:
1703         (WI.CSSStyleDeclaration.prototype.shiftPropertiesAfter):
1704
1705 2019-03-20  Devin Rousso  <drousso@apple.com>
1706
1707         Web Inspector: DOM: include window as part of any event listener chain
1708         https://bugs.webkit.org/show_bug.cgi?id=195730
1709         <rdar://problem/48916872>
1710
1711         Reviewed by Timothy Hatcher.
1712
1713         Allow non-nodes (e.g. `window`) to be listed as the target of an event listener.
1714         Add support for the same concept when showing breakpoint details after pausing on a specific
1715         event listener in the Debugger/Sources navigation sidebar.
1716
1717         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
1718         (WI.DOMNodeDetailsSidebarPanel.prototype.initialLayout):
1719         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByEvent):
1720         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByTarget): Added.
1721         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.eventListenersCallback):
1722         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners):
1723         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByNode): Deleted.
1724
1725         * UserInterface/Views/EventListenerSectionGroup.js:
1726         (WI.EventListenerSectionGroup.prototype._targetTextOrLink): Added.
1727         (WI.EventListenerSectionGroup.prototype._nodeTextOrLink): Deleted.
1728
1729         * UserInterface/Views/DebuggerSidebarPanel.js:
1730         (WI.DebuggerSidebarPanel.prototype._addBreakpoint):
1731         (WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
1732         (WI.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
1733         (WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
1734         * UserInterface/Views/DebuggerSidebarPanel.css:
1735         (.sidebar > .panel.navigation.debugger > .content > .breakpoints .tree-outline .item.event-target-window .icon): Added.
1736
1737         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1738         (WI.SourcesNavigationSidebarPanel):
1739         (WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
1740         (WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
1741         (WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
1742         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
1743         (.sidebar > .panel.navigation.sources > .content > .breakpoints .tree-outline .item.event-target-window .icon): Added.
1744
1745         * Localizations/en.lproj/localizedStrings.js:
1746
1747 2019-03-20  Devin Rousso  <drousso@apple.com>
1748
1749         Web Inspector: Debugger: virtualize the list of variables in the Scope sidebar
1750         https://bugs.webkit.org/show_bug.cgi?id=192648
1751         <rdar://problem/46800949>
1752
1753         Reviewed by Joseph Pecoraro.
1754
1755         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
1756         (WI.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
1757
1758         * UserInterface/Views/TreeElement.js:
1759         (WI.TreeElement.prototype.set hidden):
1760         (WI.TreeElement.prototype._attach):
1761         (WI.TreeElement.prototype._detach):
1762         (WI.TreeElement.prototype.collapse):
1763         (WI.TreeElement.prototype.expand):
1764         Move `updateVirtualizedElements` calls to the owner `WI.TreeOutline` to ensure that they get
1765         called. Make the remaining calls use rAF debouncing to better coalesce updates.
1766
1767         * UserInterface/Views/TreeOutline.js:
1768         (WI.TreeOutline.prototype._rememberTreeElement):
1769         (WI.TreeOutline.prototype._forgetTreeElement):
1770         (WI.TreeOutline.prototype.registerScrollVirtualizer):
1771         (WI.TreeOutline.prototype._updateVirtualizedElements.calculateOffsetFromContainer): Added.
1772         (WI.TreeOutline.prototype._updateVirtualizedElements):
1773         (WI.TreeOutline.prototype._calculateVirtualizedValues): Deleted.
1774         Calculate the `WI.TreeOutline`'s top offset within the scroll container so that it will only
1775         update when it's within the visual area.
1776
1777         * UserInterface/Views/Utilities.js:
1778         (Array.prototype.remove):
1779         Return whether the item was actually removed from the array.
1780
1781 2019-03-20  Joseph Pecoraro  <pecoraro@apple.com>
1782
1783         Web Inspector: Timelines - Export fails for MediaTimelineRecords with originator DOM Node - Cannot serialize cyclic structure
1784         https://bugs.webkit.org/show_bug.cgi?id=196027
1785
1786         Reviewed by Timothy Hatcher.
1787
1788         * UserInterface/Models/MediaTimelineRecord.js:
1789         (WI.MediaTimelineRecord.prototype.toJSON):
1790         Remove the originator since that is a WI.DOMNode and cannot
1791         be JSON serialized.
1792
1793 2019-03-20  Devin Rousso  <drousso@apple.com>
1794
1795         Web Inspector: Debugger: move breakpoint storage to use `WI.ObjectStore`
1796         https://bugs.webkit.org/show_bug.cgi?id=192719
1797         <rdar://problem/46746857>
1798
1799         Reviewed by Timothy Hatcher.
1800
1801         * UserInterface/Controllers/DebuggerManager.js:
1802         (WI.DebuggerManager):
1803         (WI.DebuggerManager.prototype.addBreakpoint):
1804         (WI.DebuggerManager.prototype.removeBreakpoint):
1805         (WI.DebuggerManager.prototype._debuggerBreakpointOptions):
1806         (WI.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
1807         (WI.DebuggerManager.prototype._setBreakpoint):
1808         (WI.DebuggerManager.prototype._breakpointDisabledStateDidChange):
1809         (WI.DebuggerManager.prototype._breakpointEditablePropertyDidChange):
1810         (WI.DebuggerManager.prototype._saveBreakpoints): Deleted.
1811
1812         * UserInterface/Models/Breakpoint.js:
1813         (WI.Breakpoint.prototype.saveIdentityToCookie):
1814         (WI.Breakpoint.prototype.serializeOptions): Added.
1815         (WI.Breakpoint.prototype.toJSON): Added.
1816         (WI.Breakpoint.prototype.get options): Deleted.
1817         (WI.Breakpoint.prototype.get info): Deleted.
1818         (WI.Breakpoint.prototype._serializableActions): Deleted.
1819         * UserInterface/Models/BreakpointAction.js:
1820         (WI.BreakpointAction.prototype.toJSON): Added.
1821         (WI.BreakpointAction.prototype.get info): Deleted.
1822
1823         * UserInterface/Base/ObjectStore.js:
1824         (WI.ObjectStore.async reset): Added.
1825         (WI.ObjectStore._open):
1826         (WI.ObjectStore.prototype.get keyPath): Added.
1827         (WI.ObjectStore.prototype.async.getAll):
1828         (WI.ObjectStore.prototype.async.put): Added.
1829         (WI.ObjectStore.prototype.async.putObject): Added.
1830         (WI.ObjectStore.prototype.async.add): Deleted.
1831         (WI.ObjectStore.prototype.async.addObject): Deleted.
1832         Replace `add` with `put` so that if a key already exists, it is overridden.
1833
1834         * UserInterface/Controllers/AuditManager.js:
1835         (WI.AuditManager.prototype.set editing):
1836         (WI.AuditManager.prototype.async processJSON):
1837
1838         * UserInterface/Controllers/BreakpointPopoverController.js:
1839         (WI.BreakpointPopoverController.prototype._popoverActionsAddActionButtonClicked):
1840         Inline some `WI.Breakpoint` static values.
1841
1842 2019-03-20  Devin Rousso  <drousso@apple.com>
1843
1844         Web Inspector: Sources: disabled breakpoints banner should be sticky
1845         https://bugs.webkit.org/show_bug.cgi?id=195104
1846         <rdar://problem/48442259>
1847
1848         Reviewed by Timothy Hatcher.
1849
1850         Allow each of the individual sections to be scrolled separately from the entire sidebar.
1851
1852         Leverage CSS variables set via JavaScript to be able to calculate the maximum height of each
1853         `WI.TreeOutline` section based on the number of items.
1854
1855         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1856         (WI.SourcesNavigationSidebarPanel):
1857         (WI.SourcesNavigationSidebarPanel.prototype._handleCallStackElementAddedOrRemoved): Added.
1858         (WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
1859         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
1860         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
1861         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
1862         (.sidebar > .panel.navigation.sources > .content):
1863         (.sidebar > .panel.navigation.sources > .content .details-section): Added.
1864         (.sidebar > .panel.navigation.sources > .content .details-section.paused-reason.collapsed > .header > .options,): Added.
1865         (.sidebar > .panel.navigation.sources > .content .details-section.collapsed > .content): Added.
1866         (.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Added.
1867         (.sidebar > .panel.navigation.sources > .content > .call-stack-container): Added.
1868         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container): Added.
1869         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container .create-breakpoint): Added.
1870         (.sidebar > .panel.navigation.sources > .content > .resources-container): Added.
1871         (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread): Added.
1872         (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread > .item.thread): Added.
1873         (@media (min-height: 600px) .sidebar > .panel.navigation.sources > .content): Added.
1874         (@media (min-height: 600px) .sidebar > .panel.navigation.sources > .content > .pause-reason-container): Added.
1875         (@media (min-height: 600px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container)): Added.
1876         (.sidebar > .panel.navigation.sources > .content > .details-section): Deleted.
1877         (.sidebar > .panel.navigation.sources > .content > .details-section.paused-reason.collapsed > .header > .options,): Deleted.
1878         (.sidebar > .panel.navigation.sources > .content > .details-section.collapsed > .content): Deleted.
1879         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint): Deleted.
1880         (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread): Deleted.
1881         (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread > .item.thread): Deleted.
1882         (.sidebar > .panel.navigation.sources > .content > .resources): Deleted.
1883
1884 2019-03-20  Devin Rousso  <drousso@apple.com>
1885
1886         "Reveal in Layers Tab" context menu option should not be available if the Layers Tab has not been enabled
1887         https://bugs.webkit.org/show_bug.cgi?id=196009
1888
1889         Reviewed by Joseph Pecoraro.
1890
1891         * UserInterface/Views/ContextMenuUtilities.js:
1892         (WI.appendContextMenuItemsForDOMNode):
1893
1894 2019-03-20  Devin Rousso  <drousso@apple.com>
1895
1896         Web Inspector: Console: add a setting for controlling auto-expansion of Trace messages
1897         https://bugs.webkit.org/show_bug.cgi?id=195690
1898
1899         Reviewed by Timothy Hatcher.
1900
1901         * UserInterface/Views/ConsoleMessageView.js:
1902         (WI.ConsoleMessageView.prototype._appendStackTrace):
1903
1904         * UserInterface/Base/Setting.js:
1905         * UserInterface/Views/SettingsTabContentView.js:
1906         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
1907
1908         * Localizations/en.lproj/localizedStrings.js:
1909
1910 2019-03-20  Devin Rousso  <drousso@apple.com>
1911
1912         Web Inspector: DOM: selecting a node in a different frame should automatically switch the console prompt's execution context
1913         https://bugs.webkit.org/show_bug.cgi?id=195805
1914         <rdar://problem/48930866>
1915
1916         Reviewed by Timothy Hatcher.
1917
1918         Add an "Auto" execution context item that is selected by default and will update the
1919         selected execution context whenever the inspected node changes. It will also display the
1920         preferred name for whatever execution context is currently active.
1921
1922         * UserInterface/Views/QuickConsole.js:
1923         (WI.QuickConsole):
1924         (WI.QuickConsole.prototype.initializeMainExecutionContextPathComponent):
1925         (WI.QuickConsole.prototype._preferredNameForFrame): Added.
1926         (WI.QuickConsole.prototype._selectExecutionContext): Added.
1927         (WI.QuickConsole.prototype._executionContextPathComponentsToDisplay):
1928         (WI.QuickConsole.prototype._rebuildExecutionContextPathComponents):
1929         (WI.QuickConsole.prototype._framePageExecutionContextsChanged):
1930         (WI.QuickConsole.prototype._frameExecutionContextsCleared):
1931         (WI.QuickConsole.prototype._activeExecutionContextChanged):
1932         (WI.QuickConsole.prototype._createExecutionContextPathComponent):
1933         (WI.QuickConsole.prototype._insertOtherExecutionContextPathComponent):
1934         (WI.QuickConsole.prototype._removeOtherExecutionContextPathComponent):
1935         (WI.QuickConsole.prototype._insertExecutionContextPathComponentForFrame):
1936         (WI.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
1937         (WI.QuickConsole.prototype._targetRemoved):
1938         (WI.QuickConsole.prototype._pathComponentSelected):
1939         (WI.QuickConsole.prototype._handleInspectedNodeChanged): Added.
1940         (WI.QuickConsole.prototype.get selectedExecutionContext): Deleted.
1941         (WI.QuickConsole.prototype.set selectedExecutionContext): Deleted.
1942         (WI.QuickConsole.prototype._createExecutionContextPathComponentFromFrame): Deleted.
1943         * UserInterface/Views/QuickConsole.css:
1944         (.quick-console > .navigation-bar > .hierarchical-path:not(.automatic-execution-context)): Added.
1945         (.quick-console > .navigation-bar > .hierarchical-path:not(.automatic-execution-context) .execution-context): Added.
1946         (.quick-console > .navigation-bar > .hierarchical-path:not(.automatic-execution-context) .execution-context .selector-arrows): Added.
1947         (.quick-console > .navigation-bar > .hierarchical-path.non-default-execution-context .execution-context): Deleted.
1948         (.quick-console > .navigation-bar > .hierarchical-path.non-default-execution-context .execution-context .selector-arrows): Deleted.
1949
1950         * UserInterface/Controllers/DOMManager.js:
1951         (WI.DOMManager.prototype.get inspectedNode): Added.
1952         (WI.DOMManager.prototype.setInspectedNode):
1953         Broadcast when the inspected node changes.
1954
1955         * UserInterface/Views/NavigationBar.js:
1956         (WI.NavigationBar.prototype.layout):
1957         When `sizesToFit` is enabled, don't force any items to be hidden.
1958
1959         * Localizations/en.lproj/localizedStrings.js:
1960
1961 2019-03-20  Devin Rousso  <drousso@apple.com>
1962
1963         Web Inspector: refactor WI.TimelineDataGridNode and its subclasses to unify the API surface
1964         https://bugs.webkit.org/show_bug.cgi?id=195959
1965         <rdar://problem/49028896>
1966
1967         Reviewed by Timothy Hatcher.
1968
1969         * UserInterface/Views/TimelineDataGridNode.js:
1970         (WI.TimelineDataGridNode.prototype.get records):
1971         (WI.TimelineDataGridNode.prototype.get data):
1972         (WI.TimelineDataGridNode.prototype.refresh):
1973
1974         * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
1975         (WI.HeapAllocationsTimelineDataGridNode):
1976         (WI.HeapAllocationsTimelineDataGridNode.prototype.get heapSnapshot): Added.
1977         (WI.HeapAllocationsTimelineDataGridNode.prototype.get data):
1978         (WI.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
1979         (WI.HeapAllocationsTimelineDataGridNode.prototype.createCells):
1980         (WI.HeapAllocationsTimelineDataGridNode.prototype._handleHeapSnapshotCollectedNodes):
1981         (WI.HeapAllocationsTimelineDataGridNode.prototype._handleHeapSnapshotInvalidated):
1982         (WI.HeapAllocationsTimelineDataGridNode.prototype.get record): Deleted.
1983         (WI.HeapAllocationsTimelineDataGridNode.prototype.updateTimestamp): Deleted.
1984         (WI.HeapAllocationsTimelineDataGridNode.prototype._heapSnapshotCollectedNodes): Deleted.
1985         (WI.HeapAllocationsTimelineDataGridNode.prototype._heapSnapshotInvalidated): Deleted.
1986
1987         * UserInterface/Views/LayoutTimelineDataGridNode.js:
1988         (WI.LayoutTimelineDataGridNode):
1989         (WI.LayoutTimelineDataGridNode.prototype.get data):
1990         (WI.LayoutTimelineDataGridNode.prototype.createCellContent):
1991         (WI.LayoutTimelineDataGridNode.prototype.get records): Deleted.
1992
1993         * UserInterface/Views/MediaTimelineDataGridNode.js:
1994         (WI.MediaTimelineDataGridNode):
1995         (WI.MediaTimelineDataGridNode.prototype.get records): Deleted.
1996
1997         * UserInterface/Views/ProfileNodeDataGridNode.js:
1998         (WI.ProfileNodeDataGridNode):
1999         (WI.ProfileNodeDataGridNode.prototype.get profileNode):
2000         (WI.ProfileNodeDataGridNode.prototype.get data):
2001         (WI.ProfileNodeDataGridNode.prototype.createCellContent):
2002         (WI.ProfileNodeDataGridNode.prototype._populate):
2003         (WI.ProfileNodeDataGridNode.prototype.get records): Deleted.
2004         (WI.ProfileNodeDataGridNode.prototype.get baseStartTime): Deleted.
2005         (WI.ProfileNodeDataGridNode.prototype.get rangeStartTime): Deleted.
2006         (WI.ProfileNodeDataGridNode.prototype.get rangeEndTime): Deleted.
2007         (WI.ProfileNodeDataGridNode.prototype.updateRangeTimes): Deleted.
2008         (WI.ProfileNodeDataGridNode.prototype.refresh): Deleted.
2009
2010         * UserInterface/Views/RenderingFrameTimelineDataGridNode.js:
2011         (WI.RenderingFrameTimelineDataGridNode):
2012         (WI.RenderingFrameTimelineDataGridNode.prototype.get data):
2013         (WI.RenderingFrameTimelineDataGridNode.prototype.createCellContent):
2014         (WI.RenderingFrameTimelineDataGridNode.prototype.get records): Deleted.
2015
2016         * UserInterface/Views/ResourceTimelineDataGridNode.js:
2017         (WI.ResourceTimelineDataGridNode):
2018         (WI.ResourceTimelineDataGridNode.prototype.get resource):
2019         (WI.ResourceTimelineDataGridNode.prototype.get data):
2020         (WI.ResourceTimelineDataGridNode.prototype.createCellContent):
2021         (WI.ResourceTimelineDataGridNode.prototype.appendContextMenuItems):
2022         (WI.ResourceTimelineDataGridNode.prototype.filterableDataForColumn):
2023         (WI.ResourceTimelineDataGridNode.prototype._createNameCellDocumentFragment):
2024         (WI.ResourceTimelineDataGridNode.prototype._cachedCellContent):
2025         (WI.ResourceTimelineDataGridNode.prototype._timelineRecordUpdated):
2026         (WI.ResourceTimelineDataGridNode.prototype._dataGridNodeGoToArrowClicked):
2027         (WI.ResourceTimelineDataGridNode.prototype._updateStatus):
2028         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar.else.let.graphDataSource.get startTime):
2029         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar.else.let.graphDataSource.get currentTime):
2030         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar.else.let.graphDataSource.get endTime):
2031         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar.else.let.graphDataSource.get _extraTimePadding):
2032         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar):
2033         (WI.ResourceTimelineDataGridNode.prototype.get records): Deleted.
2034
2035         * UserInterface/Views/ResourceTimingPopoverDataGridNode.js:
2036         (WI.ResourceTimingPopoverDataGridNode):
2037         (WI.ResourceTimingPopoverDataGridNode.prototype.get records): Deleted.
2038
2039         * UserInterface/Views/ScriptTimelineDataGridNode.js:
2040         (WI.ScriptTimelineDataGridNode.prototype.get data):
2041         (WI.ScriptTimelineDataGridNode.prototype.get subtitle):
2042         (WI.ScriptTimelineDataGridNode.prototype.createCellContent):
2043         (WI.ScriptTimelineDataGridNode.prototype.get records): Deleted.
2044         (WI.ScriptTimelineDataGridNode.prototype.get baseStartTime): Deleted.
2045         (WI.ScriptTimelineDataGridNode.prototype.get rangeStartTime): Deleted.
2046         (WI.ScriptTimelineDataGridNode.prototype.get rangeEndTime): Deleted.
2047         (WI.ScriptTimelineDataGridNode.prototype.updateRangeTimes): Deleted.
2048
2049         * UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js:
2050         (WI.SourceCodeTimelineTimelineDataGridNode.prototype.get data):
2051
2052         * UserInterface/Views/HeapAllocationsTimelineView.js:
2053         (WI.HeapAllocationsTimelineView):
2054         (WI.HeapAllocationsTimelineView.prototype.layout):
2055         (WI.HeapAllocationsTimelineView.prototype.reset):
2056         * UserInterface/Views/LayoutTimelineView.js:
2057         (WI.LayoutTimelineView.prototype._processPendingRecords):
2058         * UserInterface/Views/MediaTimelineView.js:
2059         (WI.MediaTimelineView.prototype._processPendingRecords):
2060         * UserInterface/Views/NetworkTimelineView.js:
2061         (WI.NetworkTimelineView.prototype._processPendingRecords):
2062         * UserInterface/Views/OverviewTimelineView.js:
2063         (WI.OverviewTimelineView.prototype._addResourceToDataGridIfNeeded):
2064         (WI.OverviewTimelineView.prototype._addSourceCodeTimeline):
2065         * UserInterface/Views/RenderingFrameTimelineView.js:
2066         (WI.RenderingFrameTimelineView.prototype._processPendingRecords):
2067         * UserInterface/Views/ScriptDetailsTimelineView.js:
2068         (WI.ScriptDetailsTimelineView.prototype.layout):
2069         (WI.ScriptDetailsTimelineView.prototype._processPendingRecords):
2070         Update Timeline `WI.DataGrid` views to use the new constructor format.
2071
2072         * UserInterface/Views/ResourceTimelineDataGridNode.css:
2073         (.resource-timing-popover-content .data-grid td.graph-column):
2074         Drive-by: add extra padding before/after resource timing bars shown when hovering.
2075
2076 2019-03-20  Devin Rousso  <drousso@apple.com>
2077
2078         Web Inspector: changes to CSS resources only take affect once editing stops
2079         https://bugs.webkit.org/show_bug.cgi?id=195774
2080         <rdar://problem/48905413>
2081
2082         Reviewed by Timothy Hatcher.
2083
2084         * UserInterface/Controllers/CSSManager.js:
2085         (WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
2086         (WI.CSSManager.prototype._resourceContentDidChange):
2087         (WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
2088         (WI.CSSManager.prototype._updateResourceContent):
2089         Use a `Throttler` instead of a 500ms debounce.
2090
2091 2019-03-20  Devin Rousso  <drousso@apple.com>
2092
2093         Web Inspector: Search: allow DOM searches to be case sensitive
2094         https://bugs.webkit.org/show_bug.cgi?id=194673
2095         <rdar://problem/48087577>
2096
2097         Reviewed by Timothy Hatcher.
2098
2099         * UserInterface/Views/SearchSidebarPanel.js:
2100         (WI.SearchSidebarPanel.prototype.performSearch):
2101
2102         * UserInterface/Views/DOMTreeContentView.js:
2103         (WI.DOMTreeContentView.prototype.performSearch.contextNodesReady):
2104
2105         * UserInterface/Controllers/DOMManager.js:
2106         (WI.DOMManager.prototype.performSearch.callback): Deleted.
2107         (WI.DOMManager.prototype.performSearch): Deleted.
2108         (WI.DOMManager.prototype.searchResult.mycallback): Deleted.
2109         (WI.DOMManager.prototype.searchResult): Deleted.
2110         (WI.DOMManager.prototype.cancelSearch): Deleted.
2111         Drive-by: remove unused code.
2112
2113 2019-03-19  Devin Rousso  <drousso@apple.com>
2114
2115         Web Inspector: Sources: provide option to group by path
2116         https://bugs.webkit.org/show_bug.cgi?id=195203
2117         <rdar://problem/27340680>
2118
2119         Reviewed by Timothy Hatcher.
2120
2121         Create top-level folders for each origin and nest all resources (in a folder chain) underneath.
2122
2123         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
2124         (WI.SourcesNavigationSidebarPanel):
2125         (WI.SourcesNavigationSidebarPanel.prototype.closed):
2126         (WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject.searchTreeOutline): Added.
2127         (WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject):
2128         (WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
2129         (WI.SourcesNavigationSidebarPanel.prototype._updateMainFrameTreeElement):
2130         (WI.SourcesNavigationSidebarPanel.prototype._addResource):
2131         (WI.SourcesNavigationSidebarPanel.prototype._addScript):
2132         (WI.SourcesNavigationSidebarPanel.prototype._addWorkerTargetWithMainResource):
2133         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeMouseDown.addOption): Added.
2134         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeMouseDown): Added.
2135         (WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
2136         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
2137         (WI.SourcesNavigationSidebarPanel.prototype._handleFrameMainResourceDidChange):
2138         (WI.SourcesNavigationSidebarPanel.prototype._handleMainFrameDidChange):
2139         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
2140         (.sidebar > .panel.navigation.sources > .content):
2141         (.sidebar > .panel.navigation.sources > .content > .details-section.paused-reason.collapsed > .header > .options,):
2142         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint): Added.
2143         (.sidebar > .panel.navigation.sources > .content > .resources): Added.
2144         (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread): Added.
2145         (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread > .item.thread): Added.
2146         (.sidebar > .panel.navigation.sources > .content > .details-section.scripts:not(.collapsed)): Deleted.
2147         (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread): Deleted.
2148         (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread > .item.thread): Deleted.
2149         Drive-by: fix "No Filter Results" message view to not overlap eachother.
2150         Drive-by: try to be more smart about what tree we focus when selecting a represented object.
2151
2152         * UserInterface/Views/ResourceTreeElement.js:
2153         (WI.ResourceTreeElement):
2154         (WI.ResourceTreeElement.prototype.get mainTitleText):
2155         (WI.ResourceTreeElement.prototype._updateTitles):
2156         * UserInterface/Base/URLUtilities.js:
2157         (WI.displayNameForURL):
2158         Provide a way for the display name to use a directory "/" instead of the last path component.
2159         This is needed in cases where the loaded resource is an implicit "index.*".
2160
2161         * UserInterface/Views/GeneralTreeElement.js:
2162         (WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath): Added.
2163         * UserInterface/Views/SourceCodeTreeElement.js:
2164         (WI.SourceCodeTreeElement.prototype.createFoldersAsNeededForSubpath): Deleted.
2165
2166         * Localizations/en.lproj/localizedStrings.js:
2167         * UserInterface/Models/Resource.js:
2168
2169         * UserInterface/Views/DetailsSection.css:
2170         (.details-section > .header .go-to-arrow):
2171         Drive-by: vertically center go-to-arrow.
2172
2173         * UserInterface/Protocol/InspectorFrontendAPI.js:
2174         (InspectorFrontendAPI.contextMenuItemSelected):
2175
2176         * UserInterface/Base/Setting.js:
2177         * UserInterface/Views/NetworkTableContentView.js:
2178         (WI.NetworkTableContentView):
2179         (WI.NetworkTableContentView.prototype.get filterNavigationItems):
2180         (WI.NetworkTableContentView.prototype._populateNameCell):
2181         (WI.NetworkTableContentView.prototype._generateSortComparator):
2182         (WI.NetworkTableContentView.prototype._insertResourceAndReloadTable):
2183         (WI.NetworkTableContentView.prototype._updateFilteredEntries):
2184         (WI.NetworkTableContentView.prototype._handleGroupMediaRequestsByDOMNodeCheckedDidChange): Added.
2185         (WI.NetworkTableContentView.prototype._handleGroupByDOMNodeCheckedDidChange): Deleted.
2186         Rename the `groupByNode` setting to be more specific.
2187
2188 2019-03-19  Devin Rousso  <drousso@apple.com>
2189
2190         Web Inspector: CPU Usage Timeline - the right edge of each column should align with a CPU measurement
2191         https://bugs.webkit.org/show_bug.cgi?id=195789
2192         <rdar://problem/48915271>
2193
2194         Reviewed by Joseph Pecoraro.
2195
2196         Right now, each column is rendered such that the middle of the column is aligned with the
2197         time of the CPU measurement. This could potentially be misleading, as the width/position of
2198         the bar implies that there was a period of time after the actual time of the CPU measurement
2199         that should be "attributed" to that same CPU measurement.
2200
2201            1      2      3
2202                _______
2203                [  *  ]
2204                [  *  ]_______
2205                [  *  ][  *  ]
2206         _______[  *  ][  *  ]
2207         [  *  ][  *  ][  *  ]
2208         [__*__][__*__][__*__]
2209          A   B  C   D  E   F
2210
2211         In this example, one might "attribute" any work done at time B to record 1, when in reality,
2212         it should be "attributed" to record 2, since the CPU measurement had already been taken by
2213         the time B was captured, meaning that the work for B hadn't yet been done and could
2214         therefore not have affected the CPU measurement for record 1.
2215
2216         We should be rendering the columns such that the CPU measurement aligns with the trailing
2217         edge of the column, so that all of the work that could be "attributed" to a given CPU
2218         measurement comes before it.
2219
2220           1      2      3
2221             _______       ___
2222             [    *]       [
2223             [    *]_______[
2224             [    *][    *][
2225         ____[    *][    *][
2226           *][    *][    *][
2227         __*][____*][____*][__
2228          A   B  C   D  E   F
2229
2230                 NOTE: this "rendering" isn't exactly accurate, as the `*` should overlap the `]`.
2231
2232         Legend:
2233          - `[     ]` represents a column for a CPU measurement
2234          - `*` represents the time when the measurement actually takes place
2235
2236         * UserInterface/Views/CPUTimelineOverviewGraph.js:
2237         (WI.CPUTimelineOverviewGraph.prototype.layout):
2238         (WI.CPUTimelineOverviewGraph.prototype._handleChartClick):
2239         * UserInterface/Views/TimelineOverview.js:
2240         (WI.TimelineOverview.prototype._recordSelected):
2241
2242 2019-03-19  Devin Rousso  <drousso@apple.com>
2243
2244         Web Inspector: Provide $event in the console when paused on an event listener
2245         https://bugs.webkit.org/show_bug.cgi?id=188672
2246
2247         Reviewed by Timothy Hatcher.
2248
2249         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2250         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNames):
2251
2252 2019-03-19  Devin Rousso  <drousso@apple.com>
2253
2254         Web Inspector: DOM: "Capture Screenshot" should only be shown if the node is attached
2255         https://bugs.webkit.org/show_bug.cgi?id=195793
2256         <rdar://problem/48916594>
2257
2258         Reviewed by Joseph Pecoraro.
2259
2260         * UserInterface/Models/DOMNode.js:
2261         (WI.DOMNode.prototype.get attached): Added.
2262
2263         * UserInterface/Views/ContextMenuUtilities.js:
2264         (WI.appendContextMenuItemsForDOMNode):
2265         * UserInterface/Views/DOMTreeElement.js:
2266         (WI.DOMTreeElement.prototype._populateTagContextMenu):
2267
2268 2019-03-18  Joseph Pecoraro  <pecoraro@apple.com>
2269
2270         Web Inspector: HAR Extension for `serverIPAddress` port number
2271         https://bugs.webkit.org/show_bug.cgi?id=195695
2272
2273         Reviewed by Matt Baker.
2274
2275         * UserInterface/Controllers/HARBuilder.js:
2276         (WI.HARBuilder.entry):
2277         (WI.HARBuilder.port):
2278         * UserInterface/Models/LocalResource.js:
2279         (WI.LocalResource.fromHAREntry):
2280
2281 2019-03-16  Nikita Vasilyev  <nvasilyev@apple.com>
2282
2283         Web Inspector: Changes: style attribute changes aren't being tracked
2284         https://bugs.webkit.org/show_bug.cgi?id=193859
2285         <rdar://problem/47568977>
2286
2287         Reviewed by Devin Rousso.
2288
2289         * UserInterface/Controllers/CSSManager.js:
2290         (WI.CSSManager):
2291         (WI.CSSManager.prototype.get modifiedStyles):
2292         (WI.CSSManager.prototype.addModifiedStyle):
2293         (WI.CSSManager.prototype._mainResourceDidChange):
2294         (WI.CSSManager.prototype.get modifiedCSSRules): Deleted.
2295         (WI.CSSManager.prototype.addModifiedCSSRule): Deleted.
2296         (WI.CSSManager.prototype.removeModifiedCSSRule): Deleted.
2297         * UserInterface/Models/CSSRule.js:
2298         (WI.CSSRule.prototype.get stringId): Deleted.
2299         (WI.CSSRule.prototype.markModified): Deleted.
2300         * UserInterface/Models/CSSStyleDeclaration.js:
2301         (WI.CSSStyleDeclaration.prototype.get stringId):
2302         (WI.CSSStyleDeclaration.prototype.markModified):
2303         Inline styles weren't tracked because they didn't have owner rules.
2304         Track style declarations instead of CSS rules.
2305
2306         * UserInterface/Views/ChangesDetailsSidebarPanel.css:
2307         (.sidebar > .panel.changes-panel .css-rule):
2308         (.sidebar > .panel.changes-panel .css-rule + .css-rule):
2309         (.changes-panel .selector.style-attribute):
2310         (.changes-panel .selector:not(.style-attribute)):
2311         (.changes-panel .css-property-line > .property):
2312         (.changes-panel .css-property-line.unchanged): Deleted.
2313         Drive-by: use text-color-secondary for unchanged properties instead of altering opacity.
2314
2315         * UserInterface/Views/ChangesDetailsSidebarPanel.js:
2316         (WI.ChangesDetailsSidebarPanel.prototype.layout):
2317         (WI.ChangesDetailsSidebarPanel.prototype._createRuleElement):
2318         For an inline style declaration, instead of showing a CSS source file location show an appropriate selector for its DOM node.
2319
2320 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
2321
2322         Web Inspector: HAR Extension for Resource Priority
2323         https://bugs.webkit.org/show_bug.cgi?id=195693
2324
2325         Reviewed by Devin Rousso.
2326
2327         * UserInterface/Controllers/HARBuilder.js:
2328         (WI.HARBuilder.entry):
2329         (WI.HARBuilder.priority):
2330         (WI.HARBuilder.networkPriorityFromHARPriority):
2331         Include priority custom extension.
2332
2333         * UserInterface/Models/LocalResource.js:
2334         (WI.LocalResource.fromHAREntry):
2335         Import priority.
2336
2337 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
2338
2339         Web Inspector: CPU Usage Timeline - Give long thread names a tooltip if they could be ellipsized
2340         https://bugs.webkit.org/show_bug.cgi?id=195314
2341
2342         Reviewed by Devin Rousso.
2343
2344         * UserInterface/Views/CPUUsageView.js:
2345         (WI.CPUUsageView):
2346
2347 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
2348
2349         Web Inspector: CPU Usage Timeline - Reduce the intensity of the orange overlay color in dark mode
2350         https://bugs.webkit.org/show_bug.cgi?id=195772
2351
2352         Reviewed by Devin Rousso.
2353
2354         * UserInterface/Views/Variables.css:
2355         (@media (prefers-color-scheme: dark)):
2356         (:root):
2357
2358 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
2359
2360         Web Inspector: Timelines - Import / Export Timeline Recordings
2361         https://bugs.webkit.org/show_bug.cgi?id=195709
2362         <rdar://problem/23188921>
2363
2364         Reviewed by Devin Rousso.
2365
2366         Timeline exporting saves TimelineRecording and TimelineOverview state.
2367         The TimelineRecording includes all kinds of model objects, such as
2368         records, markers, memory pressure events, etc. It also includes raw
2369         protocol data, such as script profiler samples. TimelineOverview
2370         includes some of the view state to restore, such as the selected
2371         time range, zoom level, and selected timeline.
2372
2373         Timeline importing constructs a new TimelineRecording by replaying
2374         the records, markers, and other events, as well as re-initializing
2375         more state. To finally display the imported recording, the content
2376         view will immediately initialize start/current/end times and the
2377         overview will restore the view state.
2378
2379         * Localizations/en.lproj/localizedStrings.js:
2380         New strings.
2381
2382         * UserInterface/Controllers/TimelineManager.js:
2383         (WI.TimelineManager.synthesizeImportError):
2384         (WI.TimelineManager.prototype.importRecording):
2385         Import API.
2386
2387         (WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
2388         Initialize the samples on the recording via a different path
2389         so that the data can be saved for exporting.
2390
2391         * UserInterface/Models/TimelineRecording.js:
2392         (WI.TimelineRecording):
2393         (WI.TimelineRecording.import):
2394         (WI.TimelineRecording.prototype.exportData):
2395         (WI.TimelineRecording.prototype.get capturing):
2396         (WI.TimelineRecording.prototype.get imported):
2397         (WI.TimelineRecording.prototype.unloaded):
2398         (WI.TimelineRecording.prototype.reset):
2399         (WI.TimelineRecording.prototype.addEventMarker):
2400         (WI.TimelineRecording.prototype.addRecord):
2401         (WI.TimelineRecording.prototype.addMemoryPressureEvent):
2402         (WI.TimelineRecording.prototype.initializeCallingContextTrees):
2403         (WI.TimelineRecording.prototype.canExport):
2404         Save data at the TimelineRecording level that can be used for export.
2405         We only allow exporting a TimelineRecording that has started/stopped
2406         at least once and is not currently capturing.
2407
2408         * UserInterface/Views/TimelineRecordingContentView.js:
2409         (WI.TimelineRecordingContentView):
2410         (WI.TimelineRecordingContentView.prototype.get navigationItems):
2411         (WI.TimelineRecordingContentView.prototype.get supportsSave):
2412         (WI.TimelineRecordingContentView.prototype.get saveData):
2413         (WI.TimelineRecordingContentView.prototype.shown):
2414         (WI.TimelineRecordingContentView.prototype._capturingStarted):
2415         (WI.TimelineRecordingContentView.prototype._capturingStopped):
2416         (WI.TimelineRecordingContentView.prototype._initializeImportedRecording):
2417         (WI.TimelineRecordingContentView.prototype._exportTimelineRecording):
2418         (WI.TimelineRecordingContentView.prototype._importButtonNavigationItemClicked):
2419         (WI.TimelineRecordingContentView.prototype._recordingReset):
2420         Add Import and Export buttons in the Timeline navigation bar.
2421
2422         * UserInterface/Views/TimelineOverview.js:
2423         (WI.TimelineOverview):
2424         (WI.TimelineOverview.prototype.exportData):
2425         (WI.TimelineOverview.prototype._instrumentAdded):
2426         (WI.TimelineOverview.prototype._recordingImported):
2427         When importing a recording update the TimelineOverview state
2428         soon afterwards.
2429
2430         * UserInterface/Models/CPUTimelineRecord.js:
2431         (WI.CPUTimelineRecord.fromJSON):
2432         (WI.CPUTimelineRecord.prototype.toJSON):
2433         * UserInterface/Models/GarbageCollection.js:
2434         (WI.GarbageCollection.fromJSON):
2435         (WI.GarbageCollection.prototype.toJSON):
2436         * UserInterface/Models/Geometry.js:
2437         (WI.Quad.fromJSON):
2438         (WI.Quad.prototype.toJSON):
2439         * UserInterface/Models/HeapAllocationsTimelineRecord.js:
2440         (WI.HeapAllocationsTimelineRecord.fromJSON):
2441         (WI.HeapAllocationsTimelineRecord.prototype.toJSON):
2442         * UserInterface/Models/LayoutTimelineRecord.js:
2443         (WI.LayoutTimelineRecord.fromJSON):
2444         (WI.LayoutTimelineRecord.prototype.toJSON):
2445         * UserInterface/Models/MediaTimelineRecord.js:
2446         (WI.MediaTimelineRecord.fromJSON):
2447         (WI.MediaTimelineRecord.prototype.toJSON):
2448         * UserInterface/Models/MemoryPressureEvent.js:
2449         (WI.MemoryPressureEvent.fromJSON):
2450         (WI.MemoryPressureEvent.prototype.toJSON):
2451         * UserInterface/Models/MemoryTimelineRecord.js:
2452         (WI.MemoryTimelineRecord):
2453         (WI.MemoryTimelineRecord.fromJSON):
2454         (WI.MemoryTimelineRecord.prototype.toJSON):
2455         * UserInterface/Models/RenderingFrameTimelineRecord.js:
2456         (WI.RenderingFrameTimelineRecord.fromJSON):
2457         (WI.RenderingFrameTimelineRecord.prototype.toJSON):
2458         * UserInterface/Models/ResourceTimelineRecord.js:
2459         (WI.ResourceTimelineRecord.fromJSON):
2460         (WI.ResourceTimelineRecord.prototype.toJSON):
2461         * UserInterface/Models/ScriptTimelineRecord.js:
2462         (WI.ScriptTimelineRecord.fromJSON):
2463         (WI.ScriptTimelineRecord.prototype.toJSON):
2464         * UserInterface/Models/TimelineMarker.js:
2465         (WI.TimelineMarker.fromJSON):
2466         (WI.TimelineMarker.prototype.toJSON):
2467         (WI.TimelineMarker.prototype.get type):
2468         (WI.TimelineMarker.prototype.get details):
2469         (WI.TimelineMarker.prototype.set time):
2470         (WI.TimelineMarker):
2471         * UserInterface/Models/TimelineRecord.js:
2472         (WI.TimelineRecord.fromJSON):
2473         (WI.TimelineRecord.prototype.toJSON):
2474         Import / Export toJSON / fromJSON implementations.
2475         
2476         * UserInterface/Views/CPUTimelineOverviewGraph.js:
2477         (WI.CPUTimelineOverviewGraph):
2478         (WI.CPUTimelineOverviewGraph.prototype._cpuTimelineRecordAdded):
2479         (WI.CPUTimelineOverviewGraph.prototype._processRecord):
2480         * UserInterface/Views/LayoutTimelineOverviewGraph.js:
2481         (WI.LayoutTimelineOverviewGraph):
2482         (WI.LayoutTimelineOverviewGraph.prototype._layoutTimelineRecordAdded):
2483         (WI.LayoutTimelineOverviewGraph.prototype._processRecord):
2484         * UserInterface/Views/LayoutTimelineView.js:
2485         (WI.LayoutTimelineView):
2486         (WI.LayoutTimelineView.prototype._layoutTimelineRecordAdded):
2487         (WI.LayoutTimelineView.prototype._processRecord):
2488         * UserInterface/Views/MediaTimelineView.js:
2489         (WI.MediaTimelineView):
2490         (WI.MediaTimelineView.prototype._handleRecordAdded):
2491         (WI.MediaTimelineView.prototype._processRecord):
2492         * UserInterface/Views/MemoryTimelineOverviewGraph.js:
2493         (WI.MemoryTimelineOverviewGraph):
2494         (WI.MemoryTimelineOverviewGraph.prototype._memoryTimelineRecordAdded):
2495         (WI.MemoryTimelineOverviewGraph.prototype._processRecord):
2496         * UserInterface/Views/MemoryTimelineView.js:
2497         (WI.MemoryTimelineView):
2498         (WI.MemoryTimelineView.prototype._memoryTimelineRecordAdded):
2499         (WI.MemoryTimelineView.prototype._processRecord):
2500         * UserInterface/Views/NetworkTimelineOverviewGraph.js:
2501         (WI.NetworkTimelineOverviewGraph):
2502         (WI.NetworkTimelineOverviewGraph.prototype.reset):
2503         (WI.NetworkTimelineOverviewGraph.prototype._networkTimelineRecordAdded):
2504         (WI.NetworkTimelineOverviewGraph.prototype._processRecord):
2505         (WI.NetworkTimelineOverviewGraph.prototype._networkTimelineRecordAdded.compareByStartTime): Deleted.
2506         * UserInterface/Views/NetworkTimelineView.js:
2507         (WI.NetworkTimelineView):
2508         (WI.NetworkTimelineView.prototype._networkTimelineRecordAdded):
2509         (WI.NetworkTimelineView.prototype._processRecord):
2510         * UserInterface/Views/RenderingFrameTimelineView.js:
2511         (WI.RenderingFrameTimelineView):
2512         (WI.RenderingFrameTimelineView.prototype._renderingFrameTimelineRecordAdded):
2513         (WI.RenderingFrameTimelineView.prototype._processRecord):
2514         * UserInterface/Views/ScriptDetailsTimelineView.js:
2515         (WI.ScriptDetailsTimelineView):
2516         (WI.ScriptDetailsTimelineView.prototype._scriptTimelineRecordAdded):
2517         (WI.ScriptDetailsTimelineView.prototype._processRecord):
2518         Add common _processRecord path to each timeline OverviewGraph and TimelineView.
2519         By calling this in construction we populate graphs with TimelineRecords that
2520         may have already existed. This is necessary for imports, but this also fixes
2521         the case where you enable a timeline that had data and it didn't show data.
2522
2523         * UserInterface/Views/LayoutTimelineOverviewGraph.css:
2524         (.timeline-overview-graph.layout-overview > .graph-row):
2525         (.timeline-overview-graph.layout-overview > .graph-row > .timeline-record-bar):
2526         (.timeline-overview-graph.layout-overview > .graph-row > .timeline-record-bar > .segment):
2527         (.timeline-overview-graph.layout > .graph-row): Deleted.
2528         (.timeline-overview-graph.layout > .graph-row > .timeline-record-bar): Deleted.
2529         (.timeline-overview-graph.layout > .graph-row > .timeline-record-bar > .segment): Deleted.
2530         * UserInterface/Views/TimelineRecordBar.css:
2531         (.timeline-record-bar.timeline-record-type-layout.paint > .segment,):
2532         (.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-paint > .segment,): Deleted.
2533         We simplified some of the sub-record type enum strings. To do this we needed to change
2534         "layout" to "layout-overview" to avoid a conflict.
2535
2536 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
2537
2538         Web Inspector: Network - Toggle Between Live Activity and Imported HAR resource collections
2539         https://bugs.webkit.org/show_bug.cgi?id=195734
2540
2541         Reviewed by Devin Rousso.
2542
2543         * Localizations/en.lproj/localizedStrings.js:
2544         * UserInterface/Images/NetworkHAR.svg: Added.
2545         * UserInterface/Images/NetworkOverview.svg: Added.
2546         * UserInterface/Views/NetworkTableContentView.css:
2547         (.content-view.tab.network > .content-browser > .navigation-bar .hierarchical-path .icon):
2548         (.network-overview-icon > .icon):
2549         (.network-har-icon > .icon):
2550         (@media (prefers-color-scheme: dark)):
2551
2552         * UserInterface/Views/NetworkTableContentView.js:
2553         (WI.NetworkTableContentView):
2554         (WI.NetworkTableContentView.prototype.get navigationItems):
2555         (WI.NetworkTableContentView.prototype.reset):
2556         (WI.NetworkTableContentView.prototype.tableIndexForRepresentedObject):
2557         (WI.NetworkTableContentView.prototype.tableRepresentedObjectForIndex):
2558         (WI.NetworkTableContentView.prototype.tableNumberOfRows):
2559         (WI.NetworkTableContentView.prototype.tableCellContextMenuClicked):
2560         (WI.NetworkTableContentView.prototype.tableSelectionDidChange):
2561         (WI.NetworkTableContentView.prototype.tablePopulateCell):
2562         (WI.NetworkTableContentView.prototype._addCollection):
2563         (WI.NetworkTableContentView.prototype._setActiveCollection):
2564         (WI.NetworkTableContentView.prototype._addCollectionPathComponent):
2565         (WI.NetworkTableContentView.prototype._collectionsHierarchicalPathComponentWasSelected):
2566         (WI.NetworkTableContentView.prototype._changeCollection):
2567         (WI.NetworkTableContentView.prototype.handleClearShortcut):
2568         (WI.NetworkTableContentView.prototype._updateWaterfallTimeRange):
2569         (WI.NetworkTableContentView.prototype._updateWaterfallTimelineRuler):
2570         (WI.NetworkTableContentView.prototype._canExportHAR):
2571         (WI.NetworkTableContentView.prototype._processPendingEntries):
2572         (WI.NetworkTableContentView.prototype._populateWithInitialResourcesIfNeeded):
2573         (WI.NetworkTableContentView.prototype._rowIndexForRepresentedObject):
2574         (WI.NetworkTableContentView.prototype._updateEntryForResource):
2575         (WI.NetworkTableContentView.prototype._updateEmptyFilterResultsMessage):
2576         (WI.NetworkTableContentView.prototype._mainResourceDidChange):
2577         (WI.NetworkTableContentView.prototype._mainFrameDidChange):
2578         (WI.NetworkTableContentView.prototype._resourceLoadingDidFinish):
2579         (WI.NetworkTableContentView.prototype._resourceLoadingDidFail):
2580         (WI.NetworkTableContentView.prototype._resourceTransferSizeDidChange):
2581         (WI.NetworkTableContentView.prototype._handleResourceAdded):
2582         (WI.NetworkTableContentView.prototype._runForMainCollection):
2583         (WI.NetworkTableContentView.prototype._isShowingMainCollection):
2584         (WI.NetworkTableContentView.prototype._insertResourceAndReloadTable):
2585         (WI.NetworkTableContentView.prototype._handleNodeDidFireEvent):
2586         (WI.NetworkTableContentView.prototype._handleNodeLowPowerChanged):
2587         (WI.NetworkTableContentView.prototype._updateSort):
2588         (WI.NetworkTableContentView.prototype._updateFilteredEntries):
2589         (WI.NetworkTableContentView.prototype._urlFilterDidChange):
2590         (WI.NetworkTableContentView.prototype._HARResources):
2591         (WI.NetworkTableContentView.prototype._importHAR):
2592         Introduce the concept of collections that can be swapped in/out
2593         to re-render the Network Table with different contents.
2594
2595 2019-03-15  Devin Rousso  <drousso@apple.com>
2596
2597         Web Inspector: provide a way to capture a screenshot of a node from within the page
2598         https://bugs.webkit.org/show_bug.cgi?id=194279
2599         <rdar://problem/10731573>
2600
2601         Reviewed by Joseph Pecoraro.
2602
2603         Add `console.screenshot` functionality, which displays a screenshot of a given object (if
2604         able) within Web Inspector's Console tab. From there, it can be viewed and saved.
2605
2606         Currently, `console.screenshot` will
2607          - capture an image of a `Node` (if provided)
2608          - capture an image of the viewport if nothing is provided
2609
2610         * UserInterface/Models/ConsoleMessage.js:
2611         (WI.ConsoleMessage):
2612         * UserInterface/Views/ConsoleCommandView.js:
2613         (WI.ConsoleCommandView.prototype.render):
2614         * UserInterface/Views/ConsoleMessageView.js:
2615         (WI.ConsoleMessageView.prototype.render):
2616         (WI.ConsoleMessageView.prototype.toClipboardString):
2617         (WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
2618         (WI.ConsoleMessageView.prototype._appendSavedResultIndex):
2619         (WI.ConsoleMessageView.prototype._appendStackTrace):
2620         (WI.ConsoleMessageView.prototype._makeExpandable):
2621         (WI.ConsoleMessageView.prototype._handleContextMenu): Added.
2622         * UserInterface/Views/ConsoleMessageView.css:
2623         (.console-user-command.special-user-log > .console-message-body): Added.
2624         (.console-message-body): Added.
2625         (.console-message-body > span): Added.
2626         (.console-message-body > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider)): Added.
2627         (.console-message-body > .console-image): Added.
2628         (.console-message-body > .show-grid): Added.
2629         (.console-error-level .console-message-body): Added.
2630         (.console-warning-level .console-message-body): Added.
2631         (.console-log-level.console-image-container::before): Added.
2632         (.console-user-command > .console-message-body): Added.
2633         (.console-warning-level .console-message-body): Added.
2634         (.console-error-level .console-message-body): Added.
2635         (.console-user-command > .console-message-body): Added.
2636         (.console-user-command.special-user-log > .console-message-text): Deleted.
2637         (.console-message-text): Deleted.
2638         (.console-message-text > span): Deleted.
2639         (.console-message-text > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider)): Deleted.
2640         (.console-error-level .console-message-text): Deleted.
2641         (.console-warning-level .console-message-text): Deleted.
2642         (.console-user-command > .console-message-text): Deleted.
2643         (.console-warning-level .console-message-text): Deleted.
2644         (.console-error-level .console-message-text): Deleted.
2645         (.console-user-command > .console-message-text): Deleted.
2646         * UserInterface/Views/LogContentView.css:
2647         (.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-text .highlighted): Added.
2648         (.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-body .highlighted): Deleted.
2649         Renamed variables/classes to be more semantically correct when the content is an image.
2650          - `_messageTextElement` to `_messageBodyElement` (JS)
2651          - `.console-message-text` to `.console-message-body` (CSS)
2652
2653         * UserInterface/Controllers/JavaScriptLogViewController.js:
2654         (WI.JavaScriptLogViewController.prototype.renderPendingMessages):
2655
2656         * UserInterface/Views/Main.css:
2657         (:matches(img, canvas).show-grid):
2658         (@media (prefers-color-scheme: dark) :matches(img, canvas).show-grid):
2659
2660         * UserInterface/Base/FileUtilities.js:
2661         (WI.FileUtilities.screenshotString): Added.
2662
2663         * UserInterface/Models/NativeFunctionParameters.js:
2664         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2665
2666         * UserInterface/Images/ConsoleImage.svg: Copied from UserInterface/Images/Canvas.svg.
2667         * Localizations/en.lproj/localizedStrings.js:
2668
2669 2019-03-14  Nikita Vasilyev  <nvasilyev@apple.com>
2670
2671         Web Inspector: Styles: Jump to effective property button doesn't hide after overridden property become effective
2672         https://bugs.webkit.org/show_bug.cgi?id=195770
2673         <rdar://problem/48903634>
2674
2675         Reviewed by Matt Baker.
2676
2677         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
2678         (.spreadsheet-style-declaration-editor .property .select-effective-property): Added.
2679         (.spreadsheet-style-declaration-editor .property.overridden .select-effective-property): Deleted.
2680         Hide `.select-effective-property` element for properties that aren't overridden.
2681
2682 2019-03-14  Devin Rousso  <drousso@apple.com>
2683
2684         Web Inspector: REGRESSION: Canvas: the first processed action should be selected as soon as it's available if no previous selected action exists
2685         https://bugs.webkit.org/show_bug.cgi?id=195732
2686         <rdar://problem/48875214>
2687
2688         Reviewed by Matt Baker.
2689
2690         * UserInterface/Views/CanvasSidebarPanel.js:
2691         (WI.CanvasSidebarPanel.prototype._handleRecordingProcessedAction):
2692         Rather than wait until the entire recording is ready, set the selected action as soon as the
2693         first action is ready (assuming there isn't already a selected action).
2694
2695 2019-03-14  Joseph Pecoraro  <pecoraro@apple.com>
2696
2697         Web Inspector: Network - HAR Import
2698         https://bugs.webkit.org/show_bug.cgi?id=195642
2699         <rdar://problem/34820974>
2700
2701         Reviewed by Devin Rousso.
2702
2703         * Localizations/en.lproj/localizedStrings.js
2704         * UserInterface/Test.html:
2705         * UserInterface/Test.html:
2706         New strings and resources.
2707
2708         * UserInterface/Controllers/HARBuilder.js:
2709         (WI.HARBuilder.dateFromHARDate):
2710         (WI.HARBuilder.protocolFromHARProtocol):
2711         (WI.HARBuilder.responseSourceFromHARFetchType):
2712         Reverse parsers from HAR to WI.Resource types.
2713
2714         * UserInterface/Models/LocalResource.js: Added.
2715         (WI.LocalResource):
2716         (WI.LocalResource.headersArrayToHeadersObject):
2717         (WI.LocalResource.fromHAREntry):
2718         (WI.LocalResource.prototype.hasContent):
2719         (WI.LocalResource.prototype.setContent):
2720         (WI.LocalResource.prototype.requestContentFromBackend):
2721         A Resource subclass with data fully supplied in the frontend.
2722
2723         * UserInterface/Controllers/NetworkManager.js:
2724         (WI.NetworkManager):
2725         (WI.NetworkManager.synthesizeImportError):
2726         (WI.NetworkManager.prototype.localResourceForURL):
2727         (WI.NetworkManager.prototype.processHAR):
2728         Process a HAR and extract local resources.
2729
2730         * UserInterface/Views/NetworkTableContentView.js:
2731         (WI.NetworkTableContentView):
2732         (WI.NetworkTableContentView.prototype.reset):
2733         (WI.NetworkTableContentView.prototype._handleResourceAdded):
2734         (WI.NetworkTableContentView.prototype._importHAR):
2735         Add an import button. When an import succeeds reset the
2736         table and only show imported resources (ignoring page
2737         loaded resources).
2738
2739 2019-03-14  Devin Rousso  <drousso@apple.com>
2740
2741         Web Inspector: Console: getEventListeners should work for any EventTarget
2742         https://bugs.webkit.org/show_bug.cgi?id=195713
2743
2744         Reviewed by Joseph Pecoraro.
2745
2746         * UserInterface/Models/NativeFunctionParameters.js:
2747
2748 2019-03-14  Devin Rousso  <drousso@apple.com>
2749
2750         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
2751         https://bugs.webkit.org/show_bug.cgi?id=195123
2752         <rdar://problem/48450148>
2753
2754         Reviewed by Joseph Pecoraro.
2755
2756         * UserInterface/Controllers/CSSManager.js:
2757         (WI.CSSManager.displayNameForPseudoId): Added.
2758
2759         * UserInterface/Models/DOMNodeStyles.js:
2760         (WI.DOMNodeStyles.static uniqueOrderedStyles): Added.
2761         (WI.DOMNodeStyles.prototype.get uniqueOrderedStyles):
2762
2763         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
2764         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
2765         (WI.SpreadsheetRulesStyleDetailsPanel.prototype._handleSectionFilterApplied):
2766         Rather than iterate over the `WI.DOMNode`'s list of pseudo-elements (which is only ::before
2767         and ::after), we iterate over the `WI.DOMNodeStyle`'s list of pseudo-element rules. This is
2768         an object where the key is a `CSS.PseudoId` and the value is an object containing all the
2769         matched rules and ordered styles for that pseudo-type. We can preserve the current
2770         functionality by using the ::before/::after `WI.DOMNode` when we encounter one of those
2771         pseudo-ids.
2772
2773         An additional benefit of this change is that `::before`/`::after` styles will still appear
2774         in the Rules panel even if they don't have a `content` property set (e.g. when the
2775         `::before`/`::after` pseudo-element doesn't exist). This is because the styles are no longer
2776         fetched from those pseudo-element nodes directly, but rather as a matched style for the
2777         parent node. As such, editing a `content` property to become invalid/disablde in a
2778         `::before`/`::after` rule won't make the entire rule disappeaer.
2779
2780 2019-03-14  Devin Rousso  <drousso@apple.com>
2781
2782         Web Inspector: we should show artificial context menus on mousedown instead of click
2783         https://bugs.webkit.org/show_bug.cgi?id=195494
2784
2785         Reviewed by Joseph Pecoraro.
2786
2787         * UserInterface/Views/ContextMenu.js:
2788         (WI.ContextMenu):
2789         (WI.ContextMenu.prototype.show):
2790         (WI.ContextMenu.prototype.addBeforeShowCallback): Added.
2791         (WI.ContextMenu.prototype.handleEvent):
2792         Provide a way to register a callback that will be called right as the "contextmenu" event is
2793         handled, but before the context menu is actually shown. Since "mousedown" events are also
2794         fired when/before a "contextmenu" event is fired, each of the below callers has to maintain
2795         some state indicating "we are about to show a context menu, so ignore all "mousedown" events
2796         until that time". Without this, the below callers wouldn't be able to tell when the context
2797         menu is finally shown.
2798
2799         * UserInterface/Base/SearchUtilities.js:
2800         (WI.SearchUtilities.createSettingsButton):
2801         * UserInterface/Views/CanvasContentView.js:
2802         (WI.CanvasContentView):
2803         (WI.CanvasContentView.prototype.initialLayout):
2804         (WI.CanvasContentView.prototype._handleCanvasElementButtonMouseDown): Added.
2805         (WI.CanvasContentView.prototype._handleViewShaderButtonMouseDown): Added.
2806         (WI.CanvasContentView.prototype._handleViewRecordingButtonMouseDown): Added.
2807         (WI.CanvasContentView.prototype._canvasElementButtonClicked): Deleted.
2808         (WI.CanvasContentView.prototype._handleViewShaderButtonClicked): Deleted.
2809         (WI.CanvasContentView.prototype._handleViewRecordingButtonClicked): Deleted.
2810         * UserInterface/Views/DebuggerSidebarPanel.js:
2811         (WI.DebuggerSidebarPanel):
2812         (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointMouseDown): Added.
2813         (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointClicked): Deleted.
2814         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
2815         (WI.SourcesNavigationSidebarPanel):
2816         (WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointMouseDown): Added.
2817         (WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointClicked): Deleted.
2818         * UserInterface/Views/TabBar.js:
2819         (WI.TabBar.prototype._handleMouseDown):
2820         * UserInterface/Views/LegacyTabBar.js:
2821         (WI.LegacyTabBar.prototype._handleMouseDown):
2822
2823 2019-03-13  Devin Rousso  <drousso@apple.com>
2824
2825         Web Inspector: Debugger: pausing in an inline script on a page with a URL query creates an Extra Script
2826         https://bugs.webkit.org/show_bug.cgi?id=195705
2827         <rdar://problem/48853820>
2828
2829         Reviewed by Antoine Quint.
2830
2831         * UserInterface/Models/Script.js:
2832         (WI.Script.prototype._resolveResource):
2833         If the page's URL has a query parameter, the payload we receive for any inline <script>s
2834         doesn't include the query parameter as part of its URL. As such, if there isn't an existing
2835         resource with a URL that exactly matches the URL of the script and if the URL of the main
2836         resource for the script's target starts with the URL of the script, we assume that the
2837         script "belongs" to the target's main resource and associate the script with it as such.
2838
2839 2019-03-13  Keith Rollin  <krollin@apple.com>
2840
2841         Add support for new StagedFrameworks layout
2842         https://bugs.webkit.org/show_bug.cgi?id=195543
2843
2844         Reviewed by Alexey Proskuryakov.
2845
2846         When creating the WebKit layout for out-of-band Safari/WebKit updates,
2847         use an optional path prefix when called for.
2848
2849         Opportunistic cleanup: remove unused
2850         OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH variable, which otherwise would
2851         have needlessly been updated to also incorporate the new prefix.
2852
2853         * Configurations/Base.xcconfig:
2854         * Configurations/WebKitTargetConditionals.xcconfig: Added.
2855
2856 2019-03-13  Nikita Vasilyev  <nvasilyev@apple.com>
2857
2858         REGRESSION(r240946): Web Inspector: Styles: removing selected property doesn't update overridden status
2859         https://bugs.webkit.org/show_bug.cgi?id=195389
2860         <rdar://problem/48658929>
2861
2862         Reviewed by Matt Baker.
2863
2864         * UserInterface/Models/DOMNodeStyles.js:
2865         (WI.DOMNodeStyles.prototype.changeStyleText):
2866         Call DOMNodeStyles.prototype.refresh after the callback. No updates
2867         to CSSStyleDeclaration happen until the callback is called.
2868
2869 2019-03-13  Devin Rousso  <drousso@apple.com>
2870
2871         Web Inspector: Protocol Logging: log messages with backtrace if inspector^2 is open
2872         https://bugs.webkit.org/show_bug.cgi?id=195687
2873
2874         Reviewed by Joseph Pecoraro.
2875
2876         * UserInterface/Protocol/LoggingProtocolTracer.js:
2877         (WI.LoggingProtocolTracer.prototype._processEntry):
2878
2879 2019-03-13  Devin Rousso  <drousso@apple.com>
2880
2881         Web Inspector: REGRESSION(r242737): unnecessary semicolon added when populating WI.TreeOutline stylesheet
2882         https://bugs.webkit.org/show_bug.cgi?id=195689
2883
2884         Reviewed by Joseph Pecoraro.
2885
2886         * UserInterface/Views/TreeOutline.js:
2887         (WI.TreeOutline._generateStyleRulesIfNeeded):
2888
2889 2019-03-13  Joseph Pecoraro  <pecoraro@apple.com>
2890
2891         Web Inspector: Network - HAR Export duplicates blocked/send time if there was no dns/connect block
2892         https://bugs.webkit.org/show_bug.cgi?id=195655
2893         <rdar://problem/48831152>
2894
2895         Reviewed by Devin Rousso.
2896
2897         * UserInterface/Controllers/HARBuilder.js:
2898         (WI.HARBuilder.timings):
2899
2900 2019-03-12  Devin Rousso  <drousso@apple.com>
2901
2902         Web Inspector: Sources: allow image collections to be filtered by type
2903         https://bugs.webkit.org/show_bug.cgi?id=195630
2904
2905         Reviewed by Matt Baker.
2906
2907         * UserInterface/Views/ResourceCollectionContentView.js:
2908         (WI.ResourceCollectionContentView):
2909         (WI.ResourceCollectionContentView.prototype.get navigationItems): Added.
2910         (WI.ResourceCollectionContentView.prototype.contentViewAdded):
2911         (WI.ResourceCollectionContentView.prototype.contentViewRemoved): Added.
2912         (WI.ResourceCollectionContentView.prototype._updateImageTypeScopeBar): Added.
2913         (WI.ResourceCollectionContentView.prototype._handleImageTypeSelectionChanged): Added.
2914         * UserInterface/Views/ResourceCollectionContentView.css: Asdded.
2915         (.resource-collection-image-type-scope-bar.default-item-selected):
2916
2917         * UserInterface/Views/CollectionContentView.css:
2918         (.content-view.collection > .content-view[hidden]): Added.
2919
2920         * UserInterface/Views/ScopeBarItem.js:
2921         (WI.ScopeBarItem.prototype.set hidden):
2922         * UserInterface/Views/MultipleScopeBarItem.js:
2923         (WI.MultipleScopeBarItem.prototype.set scopeBarItems):
2924         (WI.MultipleScopeBarItem.prototype.set selectedScopeBarItem):
2925         (WI.MultipleScopeBarItem.prototype.get _visibleScopeBarItems): Added.
2926         (WI.MultipleScopeBarItem.prototype._selectElementSelectionChanged):
2927         (WI.MultipleScopeBarItem.prototype._handleItemHiddenChanged): Added.
2928         Dispatch an event when an item is hidden so that any owner `WI.MultipleScopeBarItem` can
2929         rerender it's <select> without that item.
2930
2931         * Localizations/en.lproj/localizedStrings.js:
2932         * UserInterface/Main.html:
2933
2934 2019-03-12  Nikita Vasilyev  <nvasilyev@apple.com>
2935
2936         Web Inspector: Keyboard shortcut for settings tab too greedy on non-US keyboards
2937         https://bugs.webkit.org/show_bug.cgi?id=192947
2938         <rdar://problem/46886779>
2939
2940         Reviewed by Devin Rousso.
2941
2942         * UserInterface/Base/Main.js:
2943         (WI._showSettingsTab):
2944
2945 2019-03-12  Devin Rousso  <drousso@apple.com>
2946
2947         Web Inspector: Elements: provide node context menu items for event listeners sorted by node
2948         https://bugs.webkit.org/show_bug.cgi?id=195633
2949
2950         Reviewed by Matt Baker.
2951
2952         * UserInterface/Base/DOMUtilities.js:
2953         (WI.linkifyNodeReferenceElement):
2954         (WI.bindInteractionsForNodeToElement): Added.
2955         Split logic for adding event listeners into a separate function so it can be used on
2956         existing DOM without modifying it.
2957
2958         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
2959         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByNode):
2960
2961 2019-03-12  Devin Rousso  <drousso@apple.com>
2962
2963         Web Inspector: DOM Debugger: remove left padding when the last DOM breakpoint is removed
2964         https://bugs.webkit.org/show_bug.cgi?id=195522
2965
2966         Reviewed by Matt Baker.
2967
2968         * UserInterface/Views/DOMTreeContentView.js:
2969         (WI.DOMTreeContentView.prototype._updateBreakpointStatus):
2970         * UserInterface/Views/DOMTreeElement.js:
2971         (WI.DOMTreeElement.prototype.get hasBreakpoint): Added.
2972
2973 2019-03-12  Devin Rousso  <drousso@apple.com>
2974
2975         Web Inspector: Canvas: export recording as HTML
2976         https://bugs.webkit.org/show_bug.cgi?id=195311
2977         <rdar://problem/48588673>
2978
2979         Reviewed by Joseph Pecoraro.
2980
2981         * UserInterface/Models/Recording.js:
2982         (WI.Recording.prototype.async swizzle):
2983         (WI.Recording.prototype.toHTML): Added.
2984         (WI.Recording.prototype.toHTML.escapeHTML): Added.
2985         (WI.Recording.prototype.toHTML.processObject): Added.
2986         (WI.Recording.prototype.toHTML.processValue): Added.
2987
2988         * UserInterface/Views/RecordingContentView.js:
2989         (WI.RecordingContentView):
2990         (WI.RecordingContentView.prototype._exportRecording):
2991         (WI.RecordingContentView.prototype._exportReduction): Added.
2992         (WI.RecordingContentView.prototype._updateExportButton): Added.
2993         (WI.RecordingContentView.prototype._handleExportNavigationItemClicked): Added.
2994         (WI.RecordingContentView.prototype._handleRecordingProcessedAction):
2995
2996         * UserInterface/Views/CanvasOverviewContentView.js:
2997         (WI.CanvasOverviewContentView):
2998         * UserInterface/Views/HeapAllocationsTimelineView.js:
2999         (WI.HeapAllocationsTimelineView):
3000         * UserInterface/Views/HeapSnapshotContentView.js:
3001         (WI.HeapSnapshotContentView):
3002         Drive-by: s/`toolTip`/`tooltip`.
3003
3004         * Localizations/en.lproj/localizedStrings.js:
3005
3006 2019-03-12  Devin Rousso  <drousso@apple.com>
3007
3008         Web Inspector: Audit: there should be a centralized place for reusable code
3009         https://bugs.webkit.org/show_bug.cgi?id=195265
3010         <rdar://problem/47040673>
3011
3012         Reviewed by Joseph Pecoraro.
3013
3014         * UserInterface/Controllers/AuditManager.js:
3015         (WI.AuditManager.prototype.async start):
3016         (WI.AuditManager.prototype._topLevelTestForTest): Added.
3017         (WI.AuditManager.prototype._topLevelTestForTest.walk): Added.
3018
3019         * UserInterface/Models/AuditTestBase.js:
3020         (WI.AuditTestBase):
3021         (WI.AuditTestBase.prototype.async setup): Added.
3022         (WI.AuditTestBase.toJSON):
3023
3024         * UserInterface/Models/AuditTestCase.js:
3025         (WI.AuditTestCase.async.fromPayload):
3026         (WI.AuditTestCase.prototype.async run.async parseResponse):
3027         Allow additional data to be passed back to the result's `data` for testing.
3028
3029         * UserInterface/Models/AuditTestGroup.js:
3030         (WI.AuditTestGroup.async.fromPayload):
3031
3032 2019-03-12  Joseph Pecoraro  <pecoraro@apple.com>
3033
3034         Web Inspector: Timelines - Improve handling of past recordings (readonly)
3035         https://bugs.webkit.org/show_bug.cgi?id=195594
3036
3037         Reviewed by Devin Rousso.
3038
3039         * UserInterface/Views/TimelineRecordingContentView.js:
3040         (WI.TimelineRecordingContentView.prototype._clearTimeline):
3041         Don't allow clearing of a readonly recording.
3042
3043         * UserInterface/Views/TimelineTabContentView.js:
3044         (WI.TimelineTabContentView.prototype._toggleRecordingOnSpacebar):
3045         Don't do anything when viewing a readonly recording.
3046
3047         (WI.TimelineTabContentView.prototype._recordButtonClicked):
3048         Start a new recording if viewing a readonly recording.
3049
3050 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
3051
3052         Web Inspector: REGRESSION: Network Cookies Table does not load
3053         https://bugs.webkit.org/show_bug.cgi?id=195599
3054
3055         Reviewed by Devin Rousso.
3056
3057         * UserInterface/Views/ResourceCookiesContentView.js:
3058         (WI.ResourceCookiesContentView.prototype.tableIndexForRepresentedObject):
3059         (WI.ResourceCookiesContentView.prototype.tableRepresentedObjectForIndex):
3060         Include needed delegate methods.
3061
3062 2019-03-11  Devin Rousso  <drousso@apple.com>
3063
3064         Web Inspector: use -webkit-{margin,padding}-{start,end} instead of [dir={ltr/rtl}] rules
3065         https://bugs.webkit.org/show_bug.cgi?id=195569
3066         <rdar://problem/48778727>
3067
3068         Reviewed by Matt Baker.
3069
3070         * UserInterface/Debug/UncaughtExceptionReporter.css:
3071         * UserInterface/Views/BoxModelDetailsSectionRow.css:
3072         * UserInterface/Views/BreakpointActionView.css:
3073         * UserInterface/Views/BreakpointPopoverController.css:
3074         * UserInterface/Views/CPUTimelineView.css:
3075         * UserInterface/Views/CallFrameTreeElement.css:
3076         * UserInterface/Views/CallFrameView.css:
3077         * UserInterface/Views/DOMTreeContentView.css:
3078         * UserInterface/Views/DOMTreeOutline.css:
3079         * UserInterface/Views/DashboardContainerView.css:
3080         * UserInterface/Views/DataGrid.css:
3081         * UserInterface/Views/DebuggerDashboardView.css:
3082         * UserInterface/Views/DebuggerSidebarPanel.css:
3083         * UserInterface/Views/DefaultDashboardView.css:
3084         * UserInterface/Views/DetailsSection.css:
3085         * UserInterface/Views/FilterBar.css:
3086         * UserInterface/Views/FindBanner.css:
3087         * UserInterface/Views/FontResourceContentView.css:
3088         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
3089         * UserInterface/Views/HierarchicalPathComponent.css:
3090         * UserInterface/Views/LayerTreeDetailsSidebarPanel.css:
3091         * UserInterface/Views/Main.css:
3092         * UserInterface/Views/NetworkTableContentView.css:
3093         * UserInterface/Views/OpenResourceDialog.css:
3094         * UserInterface/Views/RecordingActionTreeElement.css:
3095         * UserInterface/Views/ScopeRadioButtonNavigationItem.css:
3096         * UserInterface/Views/SettingsTabContentView.css:
3097         * UserInterface/Views/ThreadTreeElement.css:
3098         * UserInterface/Views/Toolbar.css:
3099         * UserInterface/Views/TreeOutline.css:
3100         * UserInterface/Views/TypeTreeElement.css:
3101         * UserInterface/Views/TypeTreeView.css:
3102         * UserInterface/Views/URLBreakpointPopover.css:
3103         * UserInterface/Views/WebSocketContentView.css:
3104
3105         * UserInterface/Views/RecordingActionTreeElement.js:
3106         (WI.RecordingActionTreeElement.static _getClassNames):
3107         Replace class `.action` with `.recording-action` for better uniqueness/clarity.
3108
3109 2019-03-11  Devin Rousso  <drousso@apple.com>
3110
3111         Web Inspector: DOMDebugger: protocol error on first open
3112         https://bugs.webkit.org/show_bug.cgi?id=195248
3113         <rdar://problem/48538465>
3114
3115         Unreviewed followup of r242743 to fix test inspector/dom-debugger/dom-breakpoints.html.
3116
3117         * UserInterface/Controllers/DOMDebuggerManager.js:
3118         (WI.DOMDebuggerManager.prototype.addDOMBreakpoint):
3119         (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
3120         Still attempt to resolve the DOM breakpoint if it already has a `domNodeIdentifier` so that
3121         it will get added to the node's frame's DOM breakpoint map. Without this, some breakpoints
3122         might get "missed" when calling `WI.domDebuggerManager.removeDOMBreakpointsForNode`.
3123
3124 2019-03-11  Justin Fan  <justin_fan@apple.com>
3125
3126         [Web GPU] Update GPUSwapChainDescriptor, GPUSwapChain and implement GPUCanvasContext
3127         https://bugs.webkit.org/show_bug.cgi?id=194406
3128         <rdar://problem/47892466>
3129
3130         Reviewed by Myles C. Maxfield.
3131
3132         Name updates for Web GPU renaming in inspector.
3133
3134         * UserInterface/Models/Canvas.js:
3135         (WI.Canvas.displayNameForContextType):
3136
3137 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
3138
3139         Web Inspector: Editing Timelines shows two CPU Timelines
3140         https://bugs.webkit.org/show_bug.cgi?id=195578
3141
3142         Reviewed by Devin Rousso.
3143
3144         * UserInterface/Controllers/TimelineManager.js:
3145         (WI.TimelineManager.availableTimelineTypes):
3146         The CPU Instrument is already in the default list.
3147
3148 2019-03-11  Devin Rousso  <drousso@apple.com>
3149
3150         Web Inspector: DOMDebugger: protocol error on first open
3151         https://bugs.webkit.org/show_bug.cgi?id=195248
3152         <rdar://problem/48538465>
3153
3154         Reviewed by Joseph Pecoraro.
3155
3156         Don't try to call `DOMDebugger` commands until a target has been initialized.
3157         Still attempt to resolve DOM breakpoints whenever the main resource/frame changes.
3158
3159         * UserInterface/Controllers/DOMDebuggerManager.js:
3160         (WI.DOMDebuggerManager):
3161         (WI.DOMDebuggerManager.prototype.initializeTarget): Added.
3162         (WI.DOMDebuggerManager.supportsEventBreakpoints):
3163         (WI.DOMDebuggerManager.prototype.get supported):
3164         (WI.DOMDebuggerManager.prototype.addDOMBreakpoint):
3165         (WI.DOMDebuggerManager.prototype.removeDOMBreakpoint):
3166         (WI.DOMDebuggerManager.prototype.addEventBreakpoint):
3167         (WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
3168         (WI.DOMDebuggerManager.prototype.addURLBreakpoint):
3169         (WI.DOMDebuggerManager.prototype.removeURLBreakpoint):
3170         (WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL): Added.
3171         (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
3172         (WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
3173         (WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
3174         (WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
3175         (WI.DOMDebuggerManager.prototype._saveDOMBreakpoints):
3176         (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged):
3177         (WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
3178         (WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged):
3179         (WI.DOMDebuggerManager.prototype._mainFrameDidChange):
3180         (WI.DOMDebuggerManager.prototype._mainResourceDidChange):
3181         (WI.DOMDebuggerManager.prototype.removeEventBreakpoint.breakpointRemoved): Deleted.
3182         (WI.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints): Deleted.
3183         (WI.DOMDebuggerManager.prototype._updateDOMBreakpoint.breakpointUpdated): Deleted.
3184         (WI.DOMDebuggerManager.prototype._resolveEventBreakpoint): Deleted.
3185         (WI.DOMDebuggerManager.prototype._resolveURLBreakpoint): Deleted.
3186
3187         * UserInterface/Base/Multimap.js: Added.
3188         (Multimap):
3189         (Multimap.prototype.get):
3190         (Multimap.prototype.add):
3191         (Multimap.prototype.delete):
3192         (Multimap.prototype.clear):
3193         (Multimap.prototype.keys):
3194         (Multimap.prototype.*values):
3195         (Multimap.prototype.*[Symbol.iterator]):
3196         (Multimap.prototype.toJSON):
3197         * .eslintrc:
3198         * UserInterface/Main.html:
3199         * UserInterface/Test.html:
3200         Helper data structure for managing Maps of Sets (e.g. all DOM breakpoints for a URL).
3201
3202 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
3203
3204         Web Inspector: CPU Usage Timeline - Enable by default
3205         https://bugs.webkit.org/show_bug.cgi?id=195471
3206
3207         Reviewed by Devin Rousso.
3208
3209         Remove experimental setting and include the CPU timeline in the
3210         default set of timelines.
3211
3212         * UserInterface/Base/Setting.js:
3213         * UserInterface/Controllers/TimelineManager.js:
3214         (WI.TimelineManager.defaultTimelineTypes):
3215         * UserInterface/Main.html:
3216         * UserInterface/Views/CPUTimelineOverviewGraph.css:
3217         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.selected):
3218         (.timeline-overview-graph.cpu > .column-chart > svg > rect): Deleted.
3219         (body[dir=rtl] .timeline-overview-graph.cpu > .column-chart): Deleted.
3220         * UserInterface/Views/CPUTimelineOverviewGraph.js:
3221         (WI.CPUTimelineOverviewGraph):
3222         (WI.CPUTimelineOverviewGraph.prototype.layout):
3223         * UserInterface/Views/ContentView.js:
3224         (WI.ContentView.createFromRepresentedObject):
3225         * UserInterface/Views/LegacyCPUTimelineView.css: Removed.
3226         * UserInterface/Views/LegacyCPUTimelineView.js: Removed.
3227         * UserInterface/Views/SettingsTabContentView.js:
3228         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
3229         * UserInterface/Views/Variables.css:
3230         (:root):
3231
3232 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
3233
3234         Web Inspector: CPU Usage Timeline - Better Thread chart layout values
3235         https://bugs.webkit.org/show_bug.cgi?id=195547
3236
3237         Reviewed by Devin Rousso.
3238
3239         * UserInterface/Views/CPUTimelineView.js:
3240         (WI.CPUTimelineView.prototype.layout.bestThreadLayoutMax):
3241         (WI.CPUTimelineView.prototype.layout.layoutView):
3242         (WI.CPUTimelineView.prototype._showGraphOverlay):
3243         Include a separate layoutMax for the combined view and a thread layoutMax
3244         for the thread groups.
3245
3246 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
3247
3248         Web Inspector: CPU Usage Timeline - Add legend and graph hover effects
3249         https://bugs.webkit.org/show_bug.cgi?id=195390
3250
3251         Reviewed by Devin Rousso.
3252
3253         * Localizations/en.lproj/localizedStrings.js:
3254         New strings for the legends.
3255
3256         * UserInterface/Main.html:
3257         Combined files.
3258
3259         * UserInterface/Views/Variables.css:
3260         (:root):
3261         (@media (prefers-color-scheme: dark)):
3262         Tweaked colors, including individual stroke and fill colors for each CPU section.
3263
3264         * UserInterface/Views/CPUTimelineOverviewGraph.css:
3265         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.total-usage):
3266         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.main-thread-usage):
3267         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.worker-thread-usage):
3268         Updated colors.
3269
3270         * UserInterface/Views/CPUUsageCombinedView.css: Renamed from Source/WebInspectorUI/UserInterface/Views/CPUUsageStackedView.css.
3271         (.cpu-usage-combined-view > .details > .legend-container):
3272         (.cpu-usage-combined-view > .details > .legend-container > .row):
3273         (.cpu-usage-combined-view > .details > .legend-container > .row + .row):
3274         (.cpu-usage-combined-view > .details > .legend-container > .row > .swatch):
3275         * UserInterface/Views/CPUUsageCombinedView.js: Renamed from Source/WebInspectorUI/UserInterface/Views/CPUUsageStackedView.js.
3276         (WI.CPUUsageCombinedView.appendLegendRow):
3277         (WI.CPUUsageCombinedView):
3278         (WI.CPUUsageCombinedView.prototype.get graphElement):
3279         (WI.CPUUsageCombinedView.prototype.get chart):
3280         (WI.CPUUsageCombinedView.prototype.get rangeChart):
3281         (WI.CPUUsageCombinedView.prototype.clear):
3282         (WI.CPUUsageCombinedView.prototype.updateChart):
3283         (WI.CPUUsageCombinedView.prototype.updateMainThreadIndicator):
3284         (WI.CPUUsageCombinedView.prototype.clearLegend):
3285         (WI.CPUUsageCombinedView.prototype.updateLegend):
3286         (WI.CPUUsageCombinedView.prototype._updateDetails):
3287         * UserInterface/Views/CPUUsageIndicatorView.css: Removed.
3288         * UserInterface/Views/CPUUsageIndicatorView.js: Removed.
3289         Combined the Indicator and StackedAreaChart into a single view
3290         that share a left details section.
3291
3292         * UserInterface/Views/CPUUsageView.js:
3293         (WI.CPUUsageView):
3294         (WI.CPUUsageView.prototype.get graphElement):
3295         (WI.CPUUsageView.prototype.clear):
3296         (WI.CPUUsageView.prototype.updateChart):
3297         (WI.CPUUsageView.prototype.clearLegend):
3298         (WI.CPUUsageView.prototype.updateLegend):
3299         (WI.CPUUsageView.prototype._updateDetails):
3300         Include a legend in the left details section.
3301
3302         * UserInterface/Views/AreaChart.js:
3303         (WI.AreaChart):
3304         (WI.AreaChart.prototype.addPointMarker):
3305         (WI.AreaChart.prototype.clearPointMarkers):
3306         (WI.AreaChart.prototype.clear):
3307         (WI.AreaChart.prototype.layout):
3308         * UserInterface/Views/StackedAreaChart.js:
3309         (WI.StackedAreaChart):
3310         (WI.StackedAreaChart.prototype.addPointMarker):
3311         (WI.StackedAreaChart.prototype.clearPointMarkers):
3312         (WI.StackedAreaChart.prototype.clear):
3313         (WI.StackedAreaChart.prototype.layout):
3314         Add point markers for the area charts.
3315
3316         * UserInterface/Views/CPUTimelineView.css:
3317         * UserInterface/Views/CPUTimelineView.js:
3318         (WI.CPUTimelineView):
3319         (WI.CPUTimelineView.prototype.get cpuUsageViewHeight):
3320         (WI.CPUTimelineView.prototype.clear):
3321         (WI.CPUTimelineView.prototype.initialLayout.appendLegendRow):
3322         (WI.CPUTimelineView.prototype.initialLayout):
3323         (WI.CPUTimelineView.prototype.layout):
3324         (WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
3325         (WI.CPUTimelineView.prototype._handleMouseClick):
3326         (WI.CPUTimelineView.prototype._handleGraphMouseMove):
3327         (WI.CPUTimelineView.prototype._showGraphOverlayNearTo):
3328         (WI.CPUTimelineView.prototype._updateGraphOverlay):
3329         (WI.CPUTimelineView.prototype._showGraphOverlay.xScale):
3330         (WI.CPUTimelineView.prototype._showGraphOverlay.yScale):
3331         (WI.CPUTimelineView.prototype._showGraphOverlay.addOverlayPoint):
3332         (WI.CPUTimelineView.prototype._showGraphOverlay):
3333         (WI.CPUTimelineView.prototype._clearOverlayMarkers.clearGraphOverlayElement):
3334         (WI.CPUTimelineView.prototype._clearOverlayMarkers):
3335         (WI.CPUTimelineView.prototype._hideGraphOverlay):
3336         Include graph overlay markers.
3337
3338 2019-03-11  Devin Rousso  <drousso@apple.com>
3339
3340         Web Inspector: eliminate manual syncing of numeric constants used by JavaScript and CSS
3341         https://bugs.webkit.org/show_bug.cgi?id=194883
3342         <rdar://problem/48257785>
3343
3344         Reviewed by Joseph Pecoraro.
3345
3346         * UserInterface/Views/CanvasOverviewContentView.js:
3347         (WI.CanvasOverviewContentView):
3348         (WI.CanvasOverviewContentView.static get recordingAutoCaptureInputMargin): Added.
3349         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize):
3350         * UserInterface/Views/CanvasOverviewContentView.css:
3351         (.navigation-bar > .item.canvas-recording-auto-capture > label > input):
3352
3353         * UserInterface/Views/MemoryTimelineView.js:
3354         (WI.MemoryTimelineView.static get memoryCategoryViewHeight): Added.
3355         (WI.MemoryTimelineView.prototype.initialLayout): Added.
3356         (WI.MemoryTimelineView.prototype.layout):
3357         * UserInterface/Views/MemoryCategoryView.css:
3358         (.memory-category-view):
3359
3360         * UserInterface/Views/NetworkTableContentView.js:
3361         (WI.NetworkTableContentView.static get nodeWaterfallDOMEventSize): Added.
3362         (WI.NetworkTableContentView.prototype.initialLayout):
3363         * UserInterface/Views/NetworkTableContentView.css:
3364         (.content-view.network .network-table): Deleted.
3365
3366         * UserInterface/Views/TreeOutline.js:
3367         (WI.TreeOutline._generateStyleRulesIfNeeded):
3368         * UserInterface/Views/TreeOutline.css:
3369         (.tree-outline, .tree-outline .children):
3370         (.tree-outline .item):
3371
3372         * UserInterface/Controllers/CanvasManager.js:
3373         (WI.CanvasManager.supportsRecordingAutoCapture):
3374         Drive-by: fix usage of InspectorBackend.domains.{CanvasAgent => Canvas}
3375
3376 2019-03-11  Nikita Vasilyev  <nvasilyev@apple.com>
3377
3378         REGRESSION(r242622): Web Inspector: Fix asserts "Overridden property is missing overridingProperty"
3379         https://bugs.webkit.org/show_bug.cgi?id=195515
3380         <rdar://problem/48737315>
3381
3382         Reviewed by Matt Baker.
3383
3384         * UserInterface/Views/SpreadsheetStyleProperty.js:
3385         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
3386
3387 2019-03-07  Nikita Vasilyev  <nvasilyev@apple.com>
3388
3389         Web Inspector: Styles: overridden CSS property should have go-to button to jump to effective property
3390         https://bugs.webkit.org/show_bug.cgi?id=185930
3391         <rdar://problem/40506252>
3392
3393         Reviewed by Matt Baker.
3394
3395         Introduce a new experimental jump to effective property button. The button is a small arrow button
3396         next to an overridden CSS property. Clicking the button scrolls to the effective CSS property and
3397         selects it.
3398
3399         * Localizations/en.lproj/localizedStrings.js:
3400         * UserInterface/Base/Setting.js:
3401         * UserInterface/Models/CSSProperty.js:
3402         (WI.CSSProperty):
3403         (WI.CSSProperty.prototype.update):
3404         (WI.CSSProperty.prototype.get overridingProperty):
3405         (WI.CSSProperty.prototype.set overridingProperty):
3406         * UserInterface/Models/DOMNodeStyles.js:
3407         (WI.DOMNodeStyles.prototype._markOverriddenProperties):
3408         * UserInterface/Views/SettingsTabContentView.js:
3409         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
3410         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
3411         (.spreadsheet-style-declaration-editor .property.overridden .select-effective-property):
3412         (.spreadsheet-style-declaration-editor .property.overridden:hover .select-effective-property,):
3413         (.spreadsheet-style-declaration-editor .property.overridden:hover .select-effective-property::after,):
3414         (@media (prefers-color-scheme: dark)):
3415         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
3416         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertySelectByProperty):
3417         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
3418         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorSelectProperty):
3419         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
3420         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.spreadsheetCSSStyleDeclarationSectionSelectProperty):
3421         * UserInterface/Views/SpreadsheetStyleProperty.js:
3422         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
3423
3424 2019-03-07  Devin Rousso  <drousso@apple.com>
3425
3426         Web Inspector: Protocol: add type checking when commands are called via invoke
3427         https://bugs.webkit.org/show_bug.cgi?id=195310
3428         <rdar://problem/48588679>
3429
3430         Reviewed by Joseph Pecoraro.
3431
3432         * UserInterface/Protocol/InspectorBackend.js:
3433         (InspectorBackend.Command.prototype.invoke.deliverFailure): Added.
3434         (InspectorBackend.Command.prototype.invoke):
3435         (InspectorBackend.Command.prototype._invokeWithArguments):
3436
3437 2019-03-07  Devin Rousso  <drousso@apple.com>
3438
3439         Web Inspector: REGRESSION(r242118): WI.ScopeBar missing background
3440         https://bugs.webkit.org/show_bug.cgi?id=195299
3441
3442         Reviewed by Joseph Pecoraro.
3443
3444         Rework the way `color`, `background-color`, and `border-color` are set for `WI.ScopeBar` to
3445         use CSS variables instead. Divides the variables into three categories:
3446          - default: these are the values that the `WI.ScopeBar` would use normally
3447          - override: these are values that take precidence over the default (e.g. set by other elements)
3448             - falls back to default when no value is set
3449          - actual: this is the resulting value that will be used when displaying
3450             - this way, other elements can "mirror" the styling of the `WI.ScopeBar`
3451
3452         * UserInterface/Views/ScopeBar.css:
3453         (.scope-bar):
3454         (.scope-bar > li):
3455         (.scope-bar > li::before):
3456         (.scope-bar > li:matches(.selected, :hover)):
3457         (.scope-bar > li:not(.selected):hover::after):
3458         (.scope-bar > li.selected:active::after):
3459         (.scope-bar > li.multiple > select):
3460         (body[dir=ltr] .scope-bar > li.multiple > select):
3461         (body[dir=rtl] .scope-bar > li.multiple > select):
3462         (.scope-bar > li.multiple:not(.selected) > select): Added.
3463         (.scope-bar > li.multiple > .arrows):
3464         (.scope-bar > li::before): Deleted.
3465         (.scope-bar.default-item-selected > li.multiple.selected::before): Deleted.
3466         (.scope-bar > li:matches(.selected, :hover)::before): Deleted.
3467         (.scope-bar > li.selected:active::before): Deleted.
3468         (.scope-bar > li.multiple.selected > select): Deleted.
3469         (body[dir=ltr] .scope-bar > li.multiple > .arrows): Deleted.
3470         (body[dir=rtl] .scope-bar > li.multiple > .arrows): Deleted.
3471         (.scope-bar > li.multiple:matches(.selected, :hover, :active) > .arrows): Deleted.
3472         (.scope-bar > li:matches(.selected, :active)): Deleted.
3473         (@media (prefers-color-scheme: dark)): Deleted.
3474         Switch to using `::after` since `::before` is more commonly used.
3475
3476         * UserInterface/Views/MultipleScopeBarItem.js:
3477         (WI.MultipleScopeBarItem.prototype._handleMouseDown):
3478         Drive-by: fix the <select> alignment by re-firing the "mousedown" event on it.
3479
3480         * UserInterface/Views/AuditTestGroupContentView.js:
3481         (WI.AuditTestGroupContentView.prototype.layout):
3482         * UserInterface/Views/AuditTestGroupContentView.css:
3483         (.content-view.audit-test-group > header > nav > .scope-bar > li):
3484         (.content-view.audit-test-group > header > nav > .scope-bar > li:not(:hover, .selected)):
3485         (.content-view.audit-test-group > header > nav > .scope-bar > li > img): Added.
3486         (.content-view.audit-test-group > header > nav > .scope-bar > li.pass > img): Added.
3487         (.content-view.audit-test-group > header > nav > .scope-bar > li.warn > img): Added.
3488         (.content-view.audit-test-group > header > nav > .scope-bar > li.fail > img): Added.
3489         (.content-view.audit-test-group > header > nav > .scope-bar > li.error > img): Added.
3490         (.content-view.audit-test-group > header > nav > .scope-bar > li.unsupported > img): Added.
3491         (.content-view.audit-test-group > section > .audit-test-case:first-child, .content-view.audit-test-group > section > .audit-test-case.filtered ~ .audit-test-case:not(.filtered), .content-view.audit-test-group > section > .audit-test-group + .audit-test-case, .content-view.audit-test-group > section > .audit-test-case + .audit-test-group): Added.
3492         (.content-view.audit-test-group > section > .audit-test-case:not(.filtered) ~ .audit-test-case:not(.filtered)): Added.
3493         (.content-view.audit-test-group > header > nav > .scope-bar > li::before): Deleted.
3494         (.content-view.audit-test-group > header > nav > .scope-bar > li.pass::before): Deleted.
3495         (.content-view.audit-test-group > header > nav > .scope-bar > li.warn::before): Deleted.
3496         (.content-view.audit-test-group > header > nav > .scope-bar > li.fail::before): Deleted.
3497         (.content-view.audit-test-group > header > nav > .scope-bar > li.error::before): Deleted.
3498         (.content-view.audit-test-group > header > nav > .scope-bar > li.unsupported::before): Deleted.
3499         (.content-view.audit-test-group > section > .audit-test-case:first-child, .content-view.audit-test-group > section > .audit-test-group + .audit-test-case, .content-view.audit-test-group > section > .audit-test-case + .audit-test-group): Deleted.
3500         Replace the `::before` image with an actual `<img>` now that the `WI.ScopeBar` itself uses
3501         a pseudo-element for the background styling.
3502
3503         * UserInterface/Views/LogContentView.js:
3504         (WI.LogContentView):
3505         * UserInterface/Views/LogContentView.css:
3506         (.log-scope-bar > li:not(.unread) > .indicator): Added.
3507         (.log-scope-bar > li.unread > .indicator): Added.
3508         (.log-scope-bar > li.unread:hover > .indicator): Added.
3509         (.log-scope-bar > li.unread.errors > .indicator): Added.
3510         (.log-scope-bar > li.unread.warnings > .indicator): Added.
3511         (.log-scope-bar > li.unread.logs > .indicator): Added.
3512         (.log-scope-bar > li.unread::before): Deleted.
3513         (body[dir=ltr] .log-scope-bar > li.unread::before): Deleted.
3514         (body[dir=rtl] .log-scope-bar > li.unread::before): Deleted.
3515         (.log-scope-bar > li.unread:hover::before): Deleted.
3516         (.log-scope-bar > li.unread.errors::before): Deleted.
3517         (.log-scope-bar > li.unread.warnings::before): Deleted.
3518         (.log-scope-bar > li.unread.logs::before): Deleted.
3519         Replace the `::before` unread indicator with an actual `<div>` now that the `WI.ScopeBar`
3520         itself uses a pseudo-element for the background styling.
3521
3522         * UserInterface/Views/TimelineRecordingContentView.css:
3523         (.content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected):
3524         (.content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected > .multiple): Deleted.
3525         (.content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected > .multiple .arrows): Deleted.
3526
3527         * UserInterface/Views/CanvasSidebarPanel.js:
3528         (WI.CanvasSidebarPanel.prototype._updateRecordingScopeBar):
3529         Drive-by: fix typo.
3530
3531 2019-03-07  Devin Rousso  <drousso@apple.com>
3532
3533         Web Inspector: CSS: there should be a way to inline-replace a variable with it's value
3534         https://bugs.webkit.org/show_bug.cgi?id=195335
3535
3536         Reviewed by Joseph Pecoraro.
3537
3538         * UserInterface/Views/InlineSwatch.js:
3539         (WI.InlineSwatch):
3540         (WI.InlineSwatch.prototype.didDismissPopover):
3541         (WI.InlineSwatch.prototype._swatchElementClicked):
3542         (WI.InlineSwatch.prototype._swatchElementClicked.optionsForType): Added.
3543         Shift-clicking a variable swatch replaces the text with the variable's value.
3544         Drive-by: try to create a readonly swatch for the variable's value (e.g. a color indicator).
3545
3546         * UserInterface/Views/SpreadsheetStyleProperty.js:
3547         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
3548         If the value of a variable swatch changes, re-render the value.
3549
3550         * UserInterface/Views/CodeMirrorTextMarkers.js:
3551         (createCodeMirrorTextMarkers):
3552         (createCodeMirrorColorTextMarkers):
3553         (createCodeMirrorGradientTextMarkers):
3554         (createCodeMirrorBezierTextMarkers):
3555         (createCodeMirrorSpringTextMarkers):
3556         Refactor function parameters for more flexibility.
3557
3558         * Localizations/en.lproj/localizedStrings.js:
3559
3560 2019-03-06  Devin Rousso  <drousso@apple.com>
3561
3562         Web Inspector: Elements: highlight the node when hovering event listeners sorted by node
3563         https://bugs.webkit.org/show_bug.cgi?id=195368
3564
3565         Reviewed by Joseph Pecoraro.
3566
3567         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
3568         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByNode):
3569
3570 2019-03-06  Matt Baker  <mattbaker@apple.com>
3571
3572         Web Inspector: system accent color follow-ups
3573         https://bugs.webkit.org/show_bug.cgi?id=195190
3574
3575         Reviewed by Devin Rousso.
3576
3577         * UserInterface/Views/ButtonToolbarItem.css:
3578         (.toolbar .item.button:not(.disabled):matches(:focus, .activate.activated)):
3579         (@media (prefers-color-scheme: dark)):
3580         (.toolbar .item.button:not(.disabled):active:matches(:focus, .activate.activated)): Deleted.
3581         Drop pressed toolbar button style. It's extremely subtle and not worth the hassle.
3582
3583         * UserInterface/Views/LogContentView.css:
3584         (.console-messages:focus .console-item.selected::after):
3585         (@media (prefers-color-scheme: dark)):
3586
3587         * UserInterface/Views/ScopeBar.css:
3588         (.scope-bar > li.selected:active::before):
3589
3590         * UserInterface/Views/TimelineRecordBar.css:
3591         (.timeline-record-bar.selected > .segment):
3592
3593 2019-03-06  Matt Baker  <mattbaker@apple.com>
3594
3595         REGRESSION: Elements tab: Uncaught Exception: No node with given id found
3596         https://bugs.webkit.org/show_bug.cgi?id=194299
3597         <rdar://problem/47828647>
3598
3599         Reviewed by Devin Rousso.
3600
3601         When removing the selection, TreeOutline subclasses should have more
3602         control over which item becomes selected after the selection is removed.
3603         DOMTreeOutline should track the items that are being removed, and prevent
3604         them or their descendants from becoming selected.
3605
3606         * UserInterface/Views/DOMTreeOutline.js:
3607         (WI.DOMTreeOutline):
3608         (WI.DOMTreeOutline.prototype.ondelete):
3609         (WI.DOMTreeOutline.prototype.canSelectTreeElement):
3610
3611         * UserInterface/Views/TreeOutline.js:
3612         (WI.TreeOutline.prototype.selectionControllerLastSelectableItem):
3613         (WI.TreeOutline.prototype.selectionControllerPreviousSelectableItem):
3614         (WI.TreeOutline.prototype.selectionControllerNextSelectableItem):
3615         (WI.TreeOutline.prototype.canSelectTreeElement):
3616
3617 2019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
3618
3619         Web Inspector: CPU Usage Timeline - Allow clicking a bar in the overview to select a tight time range around it
3620         https://bugs.webkit.org/show_bug.cgi?id=195321
3621
3622         Reviewed by Devin Rousso.
3623
3624         * UserInterface/Models/Timeline.js:
3625         (WI.Timeline.prototype.closestRecordTo):
3626         Helper to get the closest record to a timestamp.
3627
3628         * UserInterface/Views/CPUTimelineOverviewGraph.css:
3629         (.timeline-overview-graph.cpu > .stacked-column-chart):
3630         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.selected):
3631         Style a selected record with the active color.
3632
3633         * UserInterface/Views/CPUTimelineOverviewGraph.js:
3634         (WI.CPUTimelineOverviewGraph):
3635         (WI.CPUTimelineOverviewGraph.prototype.get samplingRatePerSecond):
3636         (WI.CPUTimelineOverviewGraph.prototype.reset):
3637         (WI.CPUTimelineOverviewGraph.prototype.layout):
3638         (WI.CPUTimelineOverviewGraph.prototype.updateSelectedRecord):
3639         (WI.CPUTimelineOverviewGraph.prototype._graphPositionForMouseEvent):
3640         (WI.CPUTimelineOverviewGraph.prototype._handleGraphMouseClick):
3641         A click in the overview which hits a rect triggers a selection of
3642         the associated timeline record.
3643
3644         * UserInterface/Views/StackedColumnChart.js:
3645         (WI.StackedColumnChart.prototype.addColumnSet):
3646         (WI.StackedColumnChart.prototype.layout):
3647         Allow setting an additional class name with a column set.
3648         It will set the class name on each rect in that column.
3649
3650         * UserInterface/Views/TimelineOverview.js:
3651         (WI.TimelineOverview.prototype._recordSelected):
3652         When selecting a CPU record, make a selection range of 2 neighboring
3653         columns in each direction.
3654
3655         * UserInterface/Views/TimelineRuler.js:
3656         (WI.TimelineRuler.prototype._handleClick):
3657         When a sub-element has handled the click stop further event propagation.
3658
3659         * UserInterface/Views/TimelineOverviewGraph.js:
3660         (WI.TimelineOverviewGraph.prototype.get selected):
3661         Drive-by style fix.
3662
3663 2019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
3664
3665         Web Inspector: TimelineOverview clicks do not always behave as expected
3666         https://bugs.webkit.org/show_bug.cgi?id=195319
3667
3668         Reviewed by Devin Rousso.
3669
3670         * UserInterface/Views/TimelineRuler.js:
3671         (WI.TimelineRuler.prototype._shouldIgnoreMicroMovement):
3672         (WI.TimelineRuler.prototype._handleMouseDown):
3673         (WI.TimelineRuler.prototype._handleMouseMove):
3674         Ignore moves that haven't gone more than 4px. Once the threshold is
3675         passed allow all moves. This improves the click behavior since
3676         previously click would never re-dispatch if there was any movement.
3677
3678 2019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
3679
3680         Web Inspector: CPU Usage Timeline - Statistics and Sources sections
3681         https://bugs.webkit.org/show_bug.cgi?id=195202
3682
3683         Reviewed by Devin Rousso.
3684
3685         * Localizations/en.lproj/localizedStrings.js:
3686         New strings.
3687
3688         * UserInterface/Base/Utilities.js:
3689         (Map.prototype.getOrInitialize):
3690         Helper to get and if not found initialize with a value.
3691
3692         * UserInterface/Views/CPUTimelineView.css:
3693         (.timeline-view.cpu > .content > .overview > .chart > .container.stats):
3694         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table):
3695         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table > tr > th):
3696         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table > tr > td.number):
3697         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table > tr > td.label):
3698         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .show-more):
3699         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .filter):
3700         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .filter:hover):
3701         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .active):
3702         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .active + .active):
3703         (@media (prefers-color-scheme: dark)):
3704         Colors for the statistics sections.
3705
3706         * UserInterface/Views/CPUTimelineView.js:
3707         (WI.CPUTimelineView):
3708         (WI.CPUTimelineView.prototype.reset):
3709         (WI.CPUTimelineView.prototype.clear):
3710         (WI.CPUTimelineView.prototype._clearStatistics):
3711         (WI.CPUTimelineView.prototype._clearSources):
3712         Updates for additional sections.
3713         Include a cache of the statisiticsData so we can relayout parts of the UI and
3714         avoid an entire UI update.
3715
3716         (WI.CPUTimelineView.prototype.initialLayout):
3717         (WI.CPUTimelineView.prototype._layoutBreakdownChart):
3718         (WI.CPUTimelineView.prototype._layoutStatisticsAndSources):
3719         (WI.CPUTimelineView.prototype._layoutStatisticsSection.createEllipsisElement):
3720         (WI.CPUTimelineView.prototype._layoutStatisticsSection):
3721         (WI.CPUTimelineView.prototype._layoutSourcesSection.firstNonNativeCallFrame):
3722         (WI.CPUTimelineView.prototype._layoutSourcesSection.keyForSourceCodeLocation):
3723         (WI.CPUTimelineView.prototype._layoutSourcesSection.labelForLocation):
3724         (WI.CPUTimelineView.prototype._layoutSourcesSection.createEllipsisElement):
3725         (WI.CPUTimelineView.prototype._layoutSourcesSection):
3726         Extract layouts into helper methods to avoid an enormous layout method.
3727
3728         (WI.CPUTimelineView.prototype._computeSamplingData.incrementTypeCount):
3729         (WI.CPUTimelineView.prototype._computeSamplingData):
3730         Compute additional data when going through script events.
3731
3732         (WI.CPUTimelineView.prototype._resetSourcesFilters):
3733         (WI.CPUTimelineView.prototype._addSourcesFilter):
3734         (WI.CPUTimelineView.prototype._removeSourcesFilter):
3735         (WI.CPUTimelineView.prototype._updateSourcesFilters):
3736         Helpers for updating the source filters.
3737
3738         (WI.CPUTimelineView.prototype._createTableRow):
3739         (WI.CPUTimelineView.prototype._insertTableRow):
3740         Helpers for creating rows in the statistics / sources tables.
3741
3742 2019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
3743
3744         Web Inspector: Simplify chart <rect>s with x/y attributes instead of transform(x, y)
3745         https://bugs.webkit.org/show_bug.cgi?id=195352
3746
3747         Reviewed by Matt Baker.
3748
3749         * UserInterface/Views/ColumnChart.js:
3750         (WI.ColumnChart.prototype.layout):
3751         (WI.ColumnChart):
3752         * UserInterface/Views/RangeChart.js:
3753         (WI.RangeChart.prototype.layout):
3754         (WI.RangeChart):
3755         * UserInterface/Views/StackedColumnChart.js:
3756         (WI.StackedColumnChart.prototype.layout):
3757         (WI.StackedColumnChart):
3758
3759 2019-03-06  Devin Rousso  <drousso@apple.com>
3760
3761         Web Inspector: CSS Changes: only show changes for the given node
3762         https://bugs.webkit.org/show_bug.cgi?id=194608
3763         <rdar://problem/48050206>
3764
3765         Reviewed by Timothy Hatcher.
3766
3767         * UserInterface/Views/ChangesDetailsSidebarPanel.js:
3768         (WI.ChangesDetailsSidebarPanel.prototype.inspect):
3769         (WI.ChangesDetailsSidebarPanel.prototype.supportsDOMNode):
3770         (WI.ChangesDetailsSidebarPanel.prototype.layout):
3771         Make this panel a subclass of `WI.DOMDetailsSidebarPanel` so it has access to the selected
3772         DOM node in the Elements tab.
3773
3774         * UserInterface/Base/Setting.js:
3775         * UserInterface/Views/SettingsTabContentView.js:
3776         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
3777         Create new general setting for controlling this change.
3778
3779         * Localizations/en.lproj/localizedStrings.js:
3780
3781 2019-03-06  Devin Rousso  <drousso@apple.com>
3782
3783         Web Inspector: Canvas: color swatches aren't shown for valid inputs with leading/trailing whitespace
3784         https://bugs.webkit.org/show_bug.cgi?id=195298
3785
3786         Reviewed by Timothy Hatcher.
3787
3788         * UserInterface/Views/RecordingActionTreeElement.js:
3789         (WI.RecordingActionTreeElement._generateDOM):
3790         (WI.RecordingActionTreeElement._createSwatchForColorParameters):
3791         Trim the color string since it can be an arbitrary string, seeing as it is captured before
3792         the <canvas> has a chance to parse/fix it.
3793
3794 2019-03-05  Joseph Pecoraro  <pecoraro@apple.com>
3795
3796         Web Inspector: recordsInTimeRange sometimes does not get the expected record when includeRecordBeforeStart
3797         https://bugs.webkit.org/show_bug.cgi?id=195317
3798
3799         Reviewed by Devin Rousso.
3800
3801         * UserInterface/Models/Timeline.js:
3802         (WI.Timeline.prototype.recordsOverlappingTimeRange):
3803
3804 2019-03-05  Devin Rousso  <drousso@apple.com>
3805
3806         Web Inspector: Canvas: remove event listeners once a recording is ready
3807         https://bugs.webkit.org/show_bug.cgi?id=195324
3808
3809         Reviewed by Matt Baker.
3810
3811         * UserInterface/Models/Recording.js:
3812         (WI.Recording):
3813         (WI.Recording.prototype.async swizzle):
3814         (WI.Recording.prototype.async _process):
3815
3816         * UserInterface/Views/RecordingActionTreeElement.js:
3817         (WI.RecordingActionTreeElement):
3818         (WI.RecordingActionTreeElement.prototype._handleValidityChanged):
3819
3820         * UserInterface/Views/CanvasSidebarPanel.js:
3821         (WI.CanvasSidebarPanel.prototype.set recording):
3822         (WI.CanvasSidebarPanel.prototype._handleRecordingProcessedAction):
3823
3824         * UserInterface/Views/RecordingContentView.js:
3825         (WI.RecordingContentView.prototype.initialLayout):
3826         (WI.RecordingContentView.prototype._handleRecordingProcessedAction):
3827
3828 2019-03-05  Joseph Pecoraro  <pecoraro@apple.com>
3829
3830         Web Inspector: Attempting to select records in the bottom 16px of the timeline overview graph fails
3831         https://bugs.webkit.org/show_bug.cgi?id=195318
3832