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