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