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