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