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