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