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