c14399d0ae121598bd04b66147644a6c4e7664f5
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2018-11-16  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: Audit: minor style improvements
4         https://bugs.webkit.org/show_bug.cgi?id=191727
5
6         Reviewed by Joseph Pecoraro.
7
8         * UserInterface/Controllers/AuditManager.js:
9         (WI.AuditManager):
10         (WI.AuditManager.prototype._handleFrameMainResourceDidChange): Added.
11         Clear test results when the main frame navigates, but don't clear the saved results.
12
13         * UserInterface/Models/AuditTestCase.js:
14         (WI.AuditTestCase.prototype.async run):
15         * UserInterface/Models/AuditTestCaseResult.js:
16         (WI.AuditTestCaseResult):
17         (WI.AuditTestCaseResult.async fromPayload):
18         (WI.AuditTestCaseResult.prototype.get resolvedDOMNodes): Added.
19         (WI.AuditTestCaseResult.prototype.toJSON):
20         Capture the full CSS path for any returned DOM nodes when the test finishes running, so that
21         if the node moves around the path isn't modified as well.
22
23         * UserInterface/Views/AuditTestCaseContentView.js:
24         (WI.AuditTestCaseContentView.prototype.layout):
25         Always show the URL for the test when viewing a saved result.
26
27         * UserInterface/Views/AuditTestContentView.css:
28         (.content-view-container > .content-view.audit-test > header p):
29         (.content-view.audit-test > header):
30         * UserInterface/Views/AuditTestCaseContentView.css:
31         (.content-view.audit-test-case > header): Added.
32         (.content-view.audit-test-case > header h1 > img):
33         (.content-view.audit-test-case > header > .metadata > .source): Added.
34         (.content-view.audit-test-case > header > .metadata > .duration):
35         (.content-view.audit-test-case > section table > tr > td:first-child):
36         * UserInterface/Views/AuditTestGroupContentView.css:
37         (.content-view.audit-test-group > header):
38         Horizontally align items in the header for visual consistency.
39
40 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
41
42         Web Inspector: Include default filtering of InspectorBackend.dumpInspectorProtocolMessages with multi target backend
43         https://bugs.webkit.org/show_bug.cgi?id=191785
44
45         Reviewed by Matt Baker.
46
47         * UserInterface/Debug/Bootstrap.js:
48         (dumpMessagesCurrentState):
49         (applyDumpMessagesState):
50         (WI.runBootstrapOperations):
51         Include tri-state for the logs button.
52
53         * UserInterface/Protocol/InspectorBackend.js:
54         (InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages):
55         (InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages):
56         (InspectorBackendClass.prototype._startOrStopAutomaticTracing):
57         Add new filtering state (the Setting already got added in the past).
58
59         * UserInterface/Protocol/LoggingProtocolTracer.js:
60         (WI.LoggingProtocolTracer):
61         (WI.LoggingProtocolTracer.prototype.set filterMultiplexingBackend):
62         (WI.LoggingProtocolTracer.prototype.get filterMultiplexingBackend):
63         (WI.LoggingProtocolTracer.prototype._processEntry):
64         Perform new filtering.
65
66 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
67
68         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local Inspector)
69         https://bugs.webkit.org/show_bug.cgi?id=191740
70         <rdar://problem/45470897>
71
72         Reviewed by Timothy Hatcher.
73
74         * UserInterface/Protocol/Connection.js:
75         (InspectorBackend.Connection.prototype._dispatchResponse):
76         Hide the TargetAgent does not exist message. This is necessary so that WebKitLegacy
77         tests don't include this line in output each test.
78
79         * UserInterface/Test.html:
80         * UserInterface/Test/Test.js:
81         (WI.loaded):
82         (WI.resetMainExecutionContext):
83         (WI.performOneTimeFrontendInitializationsUsingTarget):
84         Behave more like Main.js and initialize a MultiplexingBackendTarget when the
85         TargetAgent is available.
86
87         * UserInterface/Protocol/InspectorBackend.js:
88         (InspectorBackendClass.prototype.runAfterPendingDispatches):
89         Use the main target, a.k.a. the page connection. The backend target's
90         messages don't have any responses, so this was effectively not waiting
91         at all.
92
93 2018-11-16  Matt Baker  <mattbaker@apple.com>
94
95         Web Inspector: TreeOutline shouldn't select first child of an expanded element on right arrow key
96         https://bugs.webkit.org/show_bug.cgi?id=191766
97
98         Reviewed by Devin Rousso.
99
100         * UserInterface/Views/TreeOutline.js:
101         (WI.TreeOutline.prototype._treeKeyDown):
102
103 2018-11-14  Matt Baker  <mattbaker@apple.com>
104
105         Web Inspector: Table should recalculate scrollable height when resized
106         https://bugs.webkit.org/show_bug.cgi?id=191328
107         <rdar://problem/45854412>
108
109         Reviewed by Devin Rousso.
110
111         * UserInterface/Views/NetworkTableContentView.js:
112         (WI.NetworkTableContentView.prototype._hideDetailView):
113         Force table columns to layout after hiding the detail view.
114
115         * UserInterface/Views/Table.js:
116         (WI.Table):
117         (WI.Table.prototype.showColumn):
118         Call `_resizeColumnsAndFiller` instead of `resize`. The latter also cleared
119         `_cachedWidth`, which isn't unnecessary since the width hasn't changed.
120
121         (WI.Table.prototype.layout):
122         previously `_resizeColumnsAndFiller` always occurred after `_updateVisibleRows`,
123         it was just a matter of whether the cached width and height were cleared first.
124         That now happens in `sizeDidChange`.
125
126         (WI.Table.prototype.sizeDidChange):
127         (WI.Table.prototype._updateVisibleRows):
128         (WI.Table.prototype.resize): Deleted.
129         Internally this cleared the cached width and height, which moved to `sizeDidChange`.
130         Externally this was used by NetworkTableContentView to force columns to
131         layout after hiding the details view. Calling `updateLayout` on the table
132         accomplishes the same thing using the standard View API.
133
134         (WI.Table.prototype._resizeColumnsAndFiller):
135         Only update the cached width, since the height will already have been
136         updated. The number of rows doesn't change during this method, so that
137         check was removed.
138
139 2018-11-14  Devin Rousso  <drousso@apple.com>
140
141         Web Inspector: REGRESSION(r236540): Debugger: breakpoints are sorted alphabetically instead of numerically
142         https://bugs.webkit.org/show_bug.cgi?id=191560
143
144         Reviewed by Joseph Pecoraro.
145
146         When sorting breakpoints, if the `WI.TreeElement`s being compared both contain instances of
147         `WI.Breakpoint`, sort by `WI.SourceCodeLocation` instead of title.
148
149         We only do this for `WI.Breakpoint` because they are the only debuggable item that has a
150         `WI.SourceCodeLocation` (e.g. `WI.EventBreakpoint` is just an event name string).
151
152         * UserInterface/Views/DebuggerSidebarPanel.js:
153         (WI.DebuggerSidebarPanel.prototype._addTreeElement):
154         (WI.DebuggerSidebarPanel.prototype._compareBreakpointTreeElements): Added.
155         (WI.DebuggerSidebarPanel.prototype._addIssue):
156         (WI.DebuggerSidebarPanel.prototype._addTreeElement.comparator): Deleted.
157         (WI.DebuggerSidebarPanel.prototype._compareTreeElements): Deleted.
158
159 2018-11-14  Nikita Vasilyev  <nvasilyev@apple.com>
160
161         Web Inspector: Styles: shift-clicking on a property should extend selection
162         https://bugs.webkit.org/show_bug.cgi?id=191575
163         <rdar://problem/46012855>
164
165         Reviewed by Devin Rousso.
166
167         When there's at least one property is selected, Shift-clicking another property should extend the selection.
168         Pressing Up or Down keys while holding Shift also extends the selection.
169
170         Remove unnecessary `_startedSelection`. Use `hasSelectedProperties` and `_isMousePressed` instead.
171
172         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
173         `_isMousePressed` was set to `true` by mistake, causing numerous assertion fails.
174
175         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.set focusIndex):
176         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.hasSelectedProperties): Renamed from _hasSelectedProperties.
177         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.extendSelectedProperties): Added.
178         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseLeave): Removed.
179         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy):
180
181         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
182         Implement Shift-ArrowUp/ArrowDown keys.
183
184         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
185         (WI.SpreadsheetCSSStyleDeclarationSection):
186         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyBlur):
187         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseLeave): Removed.
188         This was only used to set _startedSelection.
189
190         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
191         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowClick):
192         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
193         Remove _startedSelection and use hasSelectedProperties method instead.
194
195         * UserInterface/Views/SpreadsheetStyleProperty.js:
196         (WI.SpreadsheetStyleProperty):
197         Remove spreadsheetStylePropertyMouseLeave since it is no longer used.
198
199 2018-11-14  Devin Rousso  <drousso@apple.com>
200
201         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
202         https://bugs.webkit.org/show_bug.cgi?id=191628
203
204         Reviewed by Dean Jackson.
205
206         * UserInterface/Models/Recording.js:
207         (WI.Recording.prototype.async swizzle):
208
209         * UserInterface/Models/RecordingAction.js:
210         (WI.RecordingAction.fromPayload):
211         (WI.RecordingAction.prototype.async swizzle):
212
213 2018-11-14  Devin Rousso  <drousso@apple.com>
214
215         Web Inspector: add drag+drop for importing Audits and Recordings
216         https://bugs.webkit.org/show_bug.cgi?id=191566
217
218         Reviewed by Joseph Pecoraro.
219
220         Reorganize the file loading logic for the Audit and Canvas tabs/managers. Add "drop" event
221         handlers to the tabs that add and show the corresponding object for the imported data.
222
223         * UserInterface/Views/AuditTabContentView.js:
224         (WI.AuditTabContentView):
225         (WI.AuditTabContentView.prototype._handleDragOver): Added.
226         (WI.AuditTabContentView.prototype._handleDrop): Added.
227         * UserInterface/Views/CanvasTabContentView.js:
228         (WI.CanvasTabContentView):
229         (WI.CanvasTabContentView.prototype._addCanvas):
230         (WI.CanvasTabContentView.prototype._recordingImportedOrStopped):
231         (WI.CanvasTabContentView.prototype._handleDragOver): Added.
232         (WI.CanvasTabContentView.prototype._handleDrop): Added.
233
234         * UserInterface/Controllers/AuditManager.js:
235         (WI.AuditManager.prototype.async processJSON): Added.
236         (WI.AuditManager.prototype.export):
237         (WI.AuditManager.prototype.import): Deleted.
238         * UserInterface/Controllers/CanvasManager.js:
239         (WI.CanvasManager.prototype.processJSON): Added.
240         (WI.CanvasManager.prototype.importRecording): Deleted.
241
242         * UserInterface/Views/AuditNavigationSidebarPanel.js:
243         (WI.AuditNavigationSidebarPanel):
244         (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
245         (WI.AuditNavigationSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
246         * UserInterface/Views/CanvasSidebarPanel.js:
247         (WI.CanvasSidebarPanel):
248         (WI.CanvasSidebarPanel.prototype._handleImportButtonNavigationItemClicked): Added.
249         (WI.CanvasSidebarPanel.prototype._recordingChanged):
250         (WI.CanvasSidebarPanel.prototype._updateRecordNavigationItem):
251
252         * UserInterface/Views/CanvasOverviewContentView.js:
253         (WI.CanvasOverviewContentView):
254         (WI.CanvasOverviewContentView.prototype._handleImportButtonNavigationItemClicked): Added.
255
256         * UserInterface/Base/FileUtilities.js:
257         (WI.FileUtilities.save): Added.
258         (WI.FileUtilities.importText): Added.
259         (WI.FileUtilities.importJSON): Added.
260         (WI.FileUtilities.async readText): Added.
261         (WI.FileUtilities.async readJSON): Added.
262         (WI.saveDataToFile): Deleted.
263         (WI.loadDataFromFile): Deleted.
264         * UserInterface/Base/Main.js:
265         (WI._contextMenuRequested):
266         (WI._save):
267         (WI._saveAs):
268         * UserInterface/Views/ContextMenuUtilities.js:
269         (WI.appendContextMenuItemsForSourceCode):
270         * UserInterface/Views/LogContentView.js:
271         (WI.LogContentView.prototype._handleContextMenuEvent):
272         * UserInterface/Views/NetworkTableContentView.js:
273         (WI.NetworkTableContentView.prototype._exportHAR):
274         * UserInterface/Views/RecordingContentView.js:
275         (WI.RecordingContentView.prototype._exportRecording):
276         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
277         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._save):
278         Move file related functions into a static class container.
279
280         * Localizations/en.lproj/localizedStrings.js:
281
282 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
283
284         Web Inspector: Include target identifier in protocol logging
285         https://bugs.webkit.org/show_bug.cgi?id=191478
286
287         Reviewed by Devin Rousso.
288
289         * UserInterface/Protocol/Connection.js:
290         (InspectorBackend.Connection.prototype._dispatchResponse):
291         (InspectorBackend.Connection.prototype._dispatchEvent):
292         (InspectorBackend.Connection.prototype._sendMessageToBackend):
293         Call tracer log methods with the connection.
294
295         * UserInterface/Debug/CapturingProtocolTracer.js:
296         * UserInterface/Protocol/ProtocolTracer.js:
297         * UserInterface/Protocol/LoggingProtocolTracer.js:
298         (WI.LoggingProtocolTracer):
299         (WI.LoggingProtocolTracer.prototype.logFrontendException):
300         (WI.LoggingProtocolTracer.prototype.logFrontendRequest):
301         (WI.LoggingProtocolTracer.prototype.logWillHandleResponse):
302         (WI.LoggingProtocolTracer.prototype.logDidHandleResponse):
303         (WI.LoggingProtocolTracer.prototype.logDidHandleEvent):
304         Include the connection in log methods.
305
306         (WI.LoggingProtocolTracer.prototype.logProtocolError):
307         Removed, this is never called.
308                 
309         (WI.LoggingProtocolTracer.prototype._processEntry):
310         Include the target identifier in entry messages.
311
312 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
313
314         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
315         https://bugs.webkit.org/show_bug.cgi?id=191494
316         <rdar://problem/45469854>
317
318         Reviewed by Devin Rousso.
319
320         This starts introducing multi-target support into the Web Inspector frontend.
321         Specifically a backend connection that is persistent, but has the ability to
322         connect to and transition between Page targets received through that backend
323         connection.
324
325         This patch introduces the concept of a "Backend Target" which is the single
326         connection that the frontend contains to a backend. The old way of connecting
327         directly to a target is still supported. In that case the frontend constructs
328         a DirectBackendTarget for the debuggable type the frontend was spawns for.
329         However, if the frontend opens and has a TargetAgent, then it is likely
330         connected to a multi-target supporting backend and instead constructs a
331         MultiplexingBackendTarget, and will receive further information about
332         sub-targets to connect to. The only sub-target at the moment is a Page
333         sub-target.
334
335         As part of bringing up multi-target support this adds a few measures to
336         handle situations where the frontend is playing fast and loose with agents.
337         When the frontend does `FooAgent.method` it intends that to be performed
338         on the "main" target being debugged. Likewise when the frontend loops
339         over targets it expects them to be the debuggable targets. This patch
340         profiles a new implementation of `WI.mainTarget` and `WI.targets` to
341         match the assumptions being made by the frontend.
342
343           - In a direct-target world, there is a single target which
344             should be used for global agents and in WI.targets.
345
346           - In a multi-target world, the page target is the one that
347             should be used for global agents and WI.targets is the list
348             of sub-targets (excluding the MultiplexingBackendTarget).
349
350         In a multi-target world, there are now commonly two Targets. The
351         MultiplexingBackendTarget and a PageTarget sub-target. In the future
352         this may include more targets, such as ServiceWorkers, DedicatedWorkers,
353         and perhaps even frames.
354
355         In a multi-target world, the frontend is immediately told about targets
356         as soon as it opens (via Target.targetCreated). In order to support
357         this, frontend initialization happens without a main target being available.
358         So this makes a few small changes to frontend initialization to perform
359         a bit of work once we know what the main target is.
360
361         During a page transition the frontend is told to destroy existing targets
362         and is soon after told about any new page targets (via Target.targetDestroyed
363         and Target.targetCreated). The frontend special cases this page transition.
364         It expects only one Page target to be alive at any time, accessible through
365         WI.pageTarget. When a page transition happens the WI.pageTarget changes, and
366         the frontend performs a bit of work to prepare the UI to handle the transition:
367         `<Manager>.transitionPageTarget` / WI.Notification.TransitionPageTarget.
368         For the most part the UI behaves fine as long once there are main frame
369         change and main resource change events, but those other events allow
370         the frontend to respond to the specific page transition cases.
371
372         * UserInterface/Base/Main.js:
373         (WI.loaded):
374         (WI.initializeBackendTarget):
375         (WI.initializePageTarget):
376         (WI.transitionPageTarget):
377         (WI.terminatePageTarget):
378         (WI.resetMainExecutionContext):
379         (WI.redirectGlobalAgentsToConnection):
380         (WI.contentLoaded):
381         New global functions for target initialization
382         and page transitioning.
383
384         * UserInterface/Test/Test.js:
385         (WI.loaded):
386         (WI.initializeBackendTarget):
387         (WI.initializePageTarget):
388         (WI.transitionPageTarget):
389         (WI.terminatePageTarget):
390         (WI.resetMainExecutionContext):
391         (WI.redirectGlobalAgentsToConnection):
392         New global functions for target initialization.
393         Tests continue to be a direct connection to the Page.
394
395         * UserInterface/Protocol/TargetObserver.js:
396         (WI.TargetObserver.prototype.targetCreated):
397         (WI.TargetObserver.prototype.targetDestroyed):
398         (WI.TargetObserver.prototype.dispatchMessageFromTarget):
399         New observer goes to the manager.
400
401         * UserInterface/Controllers/TargetManager.js:
402         (WI.TargetManager):
403         (WI.TargetManager.prototype.get targets):
404         (WI.TargetManager.prototype.get allTargets):
405         (WI.TargetManager.prototype.targetForIdentifier):
406         (WI.TargetManager.prototype.targetCreated):
407         (WI.TargetManager.prototype.targetDestroyed):
408         (WI.TargetManager.prototype.dispatchMessageFromTarget):
409         (WI.TargetManager.prototype.createMultiplexingBackendTarget):
410         (WI.TargetManager.prototype.createDirectBackendTarget):
411         (WI.TargetManager.prototype._addTarget):
412         (WI.TargetManager.prototype._removeTarget):
413         (WI.TargetManager.prototype._createTarget):
414         (WI.TargetManager.prototype._checkAndHandlePageTargetTransition):
415         (WI.TargetManager.prototype._checkAndHandlePageTargetTermination):
416         (WI.TargetManager.prototype.addTarget): Deleted.
417         (WI.TargetManager.prototype.removeTarget): Deleted.
418         (WI.TargetManager.prototype.initializeMainTarget): Deleted.
419         TargetManager is where we handle creating and destroying targets
420         and their connections. In order to simplify things a bit we make
421         `WI.targets`, which goes through `get targets()` an array instead
422         of a Set. And this includes only the sub-targets.
423
424         * UserInterface/Controllers/WorkerManager.js:
425         (WI.WorkerManager.prototype.workerCreated):
426         (WI.WorkerManager.prototype.workerTerminated):
427         Workers are still special-target-like things that multiplex through
428         WorkerAgent instead of TargetAgent. We'd like to promote these to
429         be full targets in the future.
430
431         * UserInterface/Protocol/DirectBackendTarget.js: Renamed from Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js.
432         (WI.DirectBackendTarget):
433         (WI.DirectBackendTarget.connectionInfoForDebuggable):
434         (WI.DirectBackendTarget.prototype.get mainResource):
435         (WI.DirectBackendTarget.prototype.set mainResource):
436         This is the only "MainTarget" class. It is the backend target for a direct connection.
437
438         * UserInterface/Protocol/MultiplexingBackendTarget.js:
439         (WI.MultiplexingBackendTarget):
440         (WI.MultiplexingBackendTarget.prototype.initialize):
441         (WI.MultiplexingBackendTarget.prototype.get name):
442         (WI.MultiplexingBackendTarget.prototype.get executionContext):
443         (WI.MultiplexingBackendTarget.prototype.get mainResource):
444         This is the new backend target for a multi-target connection.
445         We don't expect it to be treated like other targets, so we don't
446         expect anyone to ask it for resources/executionContext/name info.
447
448         * UserInterface/Controllers/RuntimeManager.js:
449         (WI.TargetManager.prototype.evaluateInInspectedWindow):
450         This can be triggered by watch expressions before any target, and
451         therefore execution context, is available. Just return null, when
452         an execution context is available those clients will try again.
453
454         * UserInterface/Debug/Bootstrap.js:
455         Provide an WI.isEngineeringBuild boolean that can be used for various
456         debugging features.
457
458         * UserInterface/Main.html:
459         * UserInterface/Test.html:
460         New resources.
461
462         * UserInterface/Protocol/InspectorBackend.js:
463         (InspectorBackendClass.prototype.dispatch):
464         (InspectorBackendClass.prototype.runAfterPendingDispatches):
465         (InspectorBackend.Agent):
466         `InspectorBackend.mainConnection` was renamed `InspectorBackend.backendConnection`.
467
468         * UserInterface/Protocol/Connection.js:
469         (InspectorBackend.Connection):
470         (InspectorBackend.Connection.prototype._dispatchResponse):
471         (InspectorBackend.Connection.prototype._sendCommandToBackendWithCallback):
472         (InspectorBackend.Connection.prototype._sendCommandToBackendExpectingPromise):
473         (InspectorBackend.BackendConnection):
474         (InspectorBackend.BackendConnection.prototype.sendMessageToBackend):
475         (InspectorBackend.WorkerConnection):
476         (InspectorBackend.TargetConnection):
477         (InspectorBackend.TargetConnection.sendMessageToBackend):
478         Use a global sequence id to make filtering a bit easier in protocol tracing.
479         TargetConnection is identical to WorkerConnection except it uses TargetAgent
480         instead of WorkerAgent to perform multiplexing.
481
482         * UserInterface/Protocol/JavaScriptContextTarget.js:
483         (WI.JavaScriptContextTarget):
484         * UserInterface/Protocol/PageTarget.js:
485         (WI.PageTarget):
486         (WI.PageTarget.prototype.get displayName):
487         Specialized target types.
488
489         * UserInterface/Views/DebuggerSidebarPanel.js:
490         (WI.DebuggerSidebarPanel):
491         (WI.DebuggerSidebarPanel.prototype._targetAdded):
492         (WI.DebuggerSidebarPanel.prototype._targetRemoved):
493         (WI.DebuggerSidebarPanel.prototype._updateCallStackTreeOutline):
494         * UserInterface/Views/SourceCodeTextEditor.js:
495         (WI.SourceCodeTextEditor.prototype._targetAdded):
496         (WI.SourceCodeTextEditor.prototype._targetRemoved):
497         (WI.SourceCodeTextEditor.prototype._callFramesDidChange):
498         (WI.SourceCodeTextEditor.prototype._updateThreadIndicatorWidget):
499         (WI.SourceCodeTextEditor.prototype._reinsertAllThreadIndicators):
500         * UserInterface/Views/QuickConsole.js:
501         (WI.QuickConsole.prototype.initializeMainExecutionContextPathComponent):
502         (WI.QuickConsole.prototype._targetAdded):
503         (WI.QuickConsole.prototype._targetRemoved):
504         We make target added get called with all targets, including the
505         MultiplexingBackendTarget and PageTargets, both of which would
506         not have happened before. Before it was only WorkerTargets. Make
507         these sites a little more robust for the type of target they expect
508         to be able to handle.
509
510         * UserInterface/Base/Object.js:
511         * UserInterface/Controllers/DOMManager.js:
512         (WI.DOMManager):
513         (WI.DOMManager.prototype.transitionPageTarget):
514         (WI.DOMManager.prototype.requestDocument):
515         (WI.DOMManager.prototype._setDocument):
516         * UserInterface/Controllers/NetworkManager.js:
517         (WI.NetworkManager):
518         (WI.NetworkManager.prototype.transitionPageTarget):
519         (WI.NetworkManager.prototype.executionContextCreated):
520         (WI.NetworkManager.prototype._processMainFrameResourceTreePayload):
521         * UserInterface/Models/DefaultDashboard.js:
522         (WI.DefaultDashboard):
523         (WI.DefaultDashboard.prototype._mainResourceDidChange):
524         (WI.DefaultDashboard.prototype._transitionPageTarget):
525         * UserInterface/Views/NetworkTableContentView.js:
526         (WI.NetworkTableContentView):
527         (WI.NetworkTableContentView.prototype._mainResourceDidChange):
528         (WI.NetworkTableContentView.prototype._transitionPageTarget):
529         Special case handling when performing a page transition.
530
531         * UserInterface/Views/SettingsTabContentView.js:
532         * UserInterface/Debug/UncaughtExceptionReporter.js:
533         Document reloads are not supported right now.
534
535 2018-11-14  Devin Rousso  <drousso@apple.com>
536
537         Web Inspector: Canvas: don't start with auto-capture enabled
538         https://bugs.webkit.org/show_bug.cgi?id=191553
539
540         Reviewed by Matt Baker.
541
542         * UserInterface/Views/CanvasOverviewContentView.js:
543         (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount):
544         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize):
545         (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput):
546         * UserInterface/Views/CanvasOverviewContentView.css:
547         (.navigation-bar > .item.canvas-recording-auto-capture > label > input):
548
549 2018-11-14  Devin Rousso  <drousso@apple.com>
550
551         Web Inspector: Network Graphs are missing minimum sizes, might have no graph at all
552         https://bugs.webkit.org/show_bug.cgi?id=191208
553
554         Reviewed by Joseph Pecoraro.
555
556         `WI.NetworkTableContentView` used to rely on the `WI.timelineManager.persistentNetworkTimeline`
557         for events when a new resource is added. It also listened for `WI.Frame.Event.MainResourceDidChange`
558         on it's own, which was also listened to by `WI.timelineManager.persistentNetworkTimeline`.
559         Due to the order in which these listeners are added, the new main resource would get added
560         to the `WI.timelineManager.persistentNetworkTimeline` (and the `WI.NetworkTableContentView`
561         shortly after), and right after that the `WI.NetworkTableContentView` would reset the graph
562         in it's own listener for `WI.Frame.Event.MainResourceDidChange`.
563
564         This patch removes `WI.timelineManager.persistentNetworkTimeline` and instead makes it so
565         that `WI.NetworkTableContentView` listens for resource added and main frame changed events
566         on its own (similar to other views that follow this pattern), ensuring that there are no
567         event races.
568
569         Also relaxes the "requirement" that prevented 0 width blocks from being drawn, allowing
570         requests served from memory/disk to appear in the graph (their time is effectively 0).
571
572         * UserInterface/Views/NetworkTableContentView.js:
573         (WI.NetworkTableContentView):
574         (WI.NetworkTableContentView.prototype.closed):
575         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
576         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock):
577         (WI.NetworkTableContentView.prototype._updateWaterfallTimeRange): Added.
578         (WI.NetworkTableContentView.prototype._resourceLoadingDidFinish):
579         (WI.NetworkTableContentView.prototype._resourceLoadingDidFail):
580         (WI.NetworkTableContentView.prototype._handleResourceAdded): Added.
581         (WI.NetworkTableContentView.prototype._insertResourceAndReloadTable):
582         (WI.NetworkTableContentView.prototype._handleNodeDidFireEvent):
583         (WI.NetworkTableContentView.prototype._handleNodeLowPowerChanged):
584         * UserInterface/Views/NetworkTableContentView.css:
585         (.network-table .waterfall .block:matches(.mouse-tracking, .filler) + .block:not(.mouse-tracking, .filler)): Added.
586         (.network-table .waterfall .block.filler + .block): Deleted.
587
588         * UserInterface/Controllers/TimelineManager.js:
589         (WI.TimelineManager):
590         (WI.TimelineManager.prototype._mainResourceDidChange):
591         (WI.TimelineManager.prototype._resourceWasAdded):
592         (WI.TimelineManager.prototype.get persistentNetworkTimeline): Deleted.
593
594 2018-11-13  Matt Baker  <mattbaker@apple.com>
595
596         Web Inspector: Table should support select all (Cmd-A)
597         https://bugs.webkit.org/show_bug.cgi?id=190299
598         <rdar://problem/45029170>
599
600         Reviewed by Devin Rousso.
601
602         * UserInterface/Views/Table.js:
603         (WI.Table.prototype.selectAll):
604         (WI.Table.prototype._handleKeyDown):
605
606 2018-11-13  Matt Baker  <mattbaker@apple.com>
607
608         Web Inspector: Table with no selection should select the first/last row on down/up arrow key
609         https://bugs.webkit.org/show_bug.cgi?id=190100
610         <rdar://problem/44879243>
611
612         Reviewed by Devin Rousso.
613
614         Pressing the up or down arrow key when nothing is selected should select
615         the last or first row, respectively. After selecting the row make sure
616         it is visible by calling the new Table method `revealRow`.
617
618         * UserInterface/Views/Table.js:
619         (WI.Table.prototype.revealRow):
620         (WI.Table.prototype._handleKeyDown):
621         (WI.Table.prototype._selectRowsFromArrowKey):
622
623 2018-11-13  Nikita Vasilyev  <nvasilyev@apple.com>
624
625         Web Inspector: Styles: Command-A should select all properties
626         https://bugs.webkit.org/show_bug.cgi?id=191435
627         <rdar://problem/45921373>
628
629         Reviewed by Devin Rousso.
630
631         When focused on a style property, Command-A on Mac (Control-A on other platforms)
632         should select all properties of the style rule.
633
634         * UserInterface/Base/Utilities.js:
635         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
636         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties):
637         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
638
639 2018-11-12  Devin Rousso  <drousso@apple.com>
640
641         Web Inspector: Network: show secure certificate details per-request
642         https://bugs.webkit.org/show_bug.cgi?id=191447
643         <rdar://problem/30019476>
644
645         Reviewed by Joseph Pecoraro.
646
647         * UserInterface/Controllers/NetworkManager.js:
648         (WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache):
649         (WI.NetworkManager.prototype.resourceRequestDidReceiveResponse):
650
651         * UserInterface/Models/Resource.js:
652         (WI.Resource.prototype.get responseSecurity): Added.
653         (WI.Resource.prototype.get loadedSecurely): Added.
654         (WI.Resource.prototype.updateForResponse):
655
656         * UserInterface/Views/NetworkResourceDetailView.js:
657         (WI.NetworkResourceDetailView):
658         (WI.NetworkResourceDetailView.prototype.initialLayout):
659         (WI.NetworkResourceDetailView.prototype.showContentViewForIdentifier):
660         * UserInterface/Views/NetworkResourceDetailView.css:
661         (.content-view.resource-details .go-to-arrow): Added.
662         (.content-view.resource-details.showing-find-banner .search-highlight): Added.
663
664         * UserInterface/Views/ResourceSecurityContentView.js: Added.
665         (WI.ResourceSecurityContentView):
666         (WI.ResourceSecurityContentView.prototype.initialLayout):
667         (WI.ResourceSecurityContentView.prototype.layout):
668         (WI.ResourceSecurityContentView.prototype.closed):
669         (WI.ResourceSecurityContentView.prototype.get supportsSearch):
670         (WI.ResourceSecurityContentView.prototype.get numberOfSearchResults):
671         (WI.ResourceSecurityContentView.prototype.get hasPerformedSearch):
672         (WI.ResourceSecurityContentView.prototype.set automaticallyRevealFirstSearchResult):
673         (WI.ResourceSecurityContentView.prototype.performSearch):
674         (WI.ResourceSecurityContentView.prototype.searchCleared):
675         (WI.ResourceSecurityContentView.prototype.revealPreviousSearchResult):
676         (WI.ResourceSecurityContentView.prototype.revealNextSearchResult):
677         (WI.ResourceSecurityContentView.prototype._refreshCetificateSection):
678         (WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs):
679         (WI.ResourceSecurityContentView.prototype._revealSearchResult):
680         (WI.ResourceSecurityContentView.prototype._handleResourceResponseReceived):
681         * UserInterface/Views/ResourceSecurityContentView.css: Added.
682         (body[dir] .resource-security > section.certificate > .details):
683         (.resource-security .details .key):
684         (.resource-security .dns-name + .dns-name > .key,):
685         (.resource-security .show-more):
686         (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details):
687         (@media (prefers-dark-interface) .resource-security .details .key):
688
689         * UserInterface/Views/ResourceCookiesContentView.js:
690         (WI.ResourceCookiesContentView.prototype._refreshRequestCookiesSection):
691         (WI.ResourceCookiesContentView.prototype._refreshResponseCookiesSection):
692         (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithMessage): Deleted.
693         (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted.
694         * UserInterface/Views/ResourceHeadersContentView.js:
695         (WI.ResourceHeadersContentView.prototype._refreshSummarySection):
696         (WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections):
697         (WI.ResourceHeadersContentView.prototype._refreshRequestHeadersSection):
698         (WI.ResourceHeadersContentView.prototype._refreshResponseHeadersSection):
699         (WI.ResourceHeadersContentView.prototype._refreshQueryStringSection):
700         (WI.ResourceHeadersContentView.prototype._refreshRequestDataSection):
701         (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithMessage): Deleted.
702         (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted.
703         (WI.ResourceHeadersContentView.prototype._appendKeyValuePair): Deleted.
704         * UserInterface/Views/ResourceHeadersContentView.css:
705         (.resource-headers .h1-status > .key,):
706         (body[dir] .resource-headers > section.error > .details): Deleted.
707         (.resource-headers > section.error .key): Deleted.
708         (.resource-headers .details): Deleted.
709         (.resource-headers .details .pair): Deleted.
710         (body[dir=rtl] .resource-headers .details .pair): Deleted.
711         (.resource-headers .details .key): Deleted.
712         (.resource-headers .value): Deleted.
713         (.resource-headers .go-to-arrow): Deleted.
714         (.resource-headers.showing-find-banner .search-highlight): Deleted.
715         * UserInterface/Views/ResourceDetailsSection.js:
716         (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithMessage): Added.
717         (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithLoadingIndicator): Added.
718         (WI.ResourceDetailsSection.prototype.appendKeyValuePair): Added.
719         * UserInterface/Views/ResourceDetailsSection.css:
720         (.resource-details > section > .details): Added.
721         (.resource-details > section > .details > .pair): Added.
722         (body[dir=rtl] .resource-details > section > .details > .pair): Added.
723         (.resource-details > section > .details > .pair > .key): Added.
724         (.resource-details > section > .details > .pair > .value): Added.
725         (body[dir] .resource-details > section.error > .details): Added.
726         (.resource-details > section.error > .details > .pair > .key): Added.
727         Move commonly used functions/styles from container classes onto this object.
728
729         * UserInterface/Main.html:
730         * Localizations/en.lproj/localizedStrings.js:
731
732 2018-11-12  Matt Baker  <mattbaker@apple.com>
733
734         Web Inspector: Table should support shift-extending the row selection
735         https://bugs.webkit.org/show_bug.cgi?id=189718
736         <rdar://problem/44577942>
737
738         Reviewed by Devin Rousso.
739
740         Allow the table selection to be extended by shift-clicking a row, or by
741         holding shift and pressing either the up or down arrow key. If both command
742         and shift are pressed, shift is ignored. The selection behavior is modeled
743         after AppKit's NSTableView.
744
745         * UserInterface/Base/IndexSet.js:
746         (WI.IndexSet.prototype.addRange):
747         (WI.IndexSet.prototype.deleteRange):
748         (WI.IndexSet.prototype.equals):
749         (WI.IndexSet.prototype.difference):
750
751         * UserInterface/Views/Table.js:
752         (WI.Table):
753         (WI.Table.prototype.set allowsMultipleSelection):
754         (WI.Table.prototype.reloadData):
755         (WI.Table.prototype.selectRow):
756         (WI.Table.prototype.deselectRow):
757         (WI.Table.prototype._handleKeyDown):
758         Holding shift and pressing either the up or down arrow key extends the
759         selection to the next unselected row adjacent to the anchor row, or causes
760         the anchor row to be deselected, decreasing the selection. The table chooses
761         the action to take based on the direction of movement (up or down), and
762         the currently selected rows.
763
764         (WI.Table.prototype._selectRowsFromArrowKey):
765         (WI.Table.prototype._handleMouseDown.normalizeRange):
766         (WI.Table.prototype._handleMouseDown):
767         Clicking a row while holding down shift extends the selection to include
768         the rows between the anchor row (exclusive) and clicked row (inclusive).
769         The anchor row is equal to the value of `_selectedRowIndex` prior to
770         clicking a new row.
771
772         (WI.Table.prototype._deselectAllAndSelect):
773         (WI.Table.prototype._removeRows):
774         (WI.Table.prototype._toggleSelectedRowStyle):
775         (WI.Table.prototype._updateSelectedRows):
776         Helper method for updating the selection to the specified rows, and updating
777         DOM styles for rows that are added to or removed from the selection.
778
779 2018-11-12  Nikita Vasilyev  <nvasilyev@apple.com>
780
781         Web Inspector: Styles: inline swatches don't work when Multiple Properties Selection is enabled
782         https://bugs.webkit.org/show_bug.cgi?id=191165
783         <rdar://problem/45737972>
784
785         Reviewed by Devin Rousso.
786
787         * UserInterface/Views/SpreadsheetStyleProperty.js:
788         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
789         * UserInterface/Views/SpreadsheetTextField.js:
790         (WI.SpreadsheetTextField):
791         `click` is fired after `mouseup` and inline swatches are activated by `click` event.
792         Changing this to `click` allows swatches to activate before editing starts.
793
794         (WI.SpreadsheetTextField.prototype._handleMouseDown):
795         Clicking on the field that is being edited should't restart editing. It should move the text caret.
796
797 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
798
799         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
800         https://bugs.webkit.org/show_bug.cgi?id=189230
801         <rdar://problem/44050379>
802
803         Reviewed by Joseph Pecoraro.
804
805         Runs all png images through zopflipng. This results in a smaller file
806         size and takes care of this issue as a byproduct.
807
808         * UserInterface/Images/ApplicationCache.png:
809         * UserInterface/Images/ApplicationCache@2x.png:
810         * UserInterface/Images/ApplicationCacheManifest.png:
811         * UserInterface/Images/ApplicationCacheManifest@2x.png:
812         * UserInterface/Images/Breakpoint.png:
813         * UserInterface/Images/Breakpoint@2x.png:
814         * UserInterface/Images/BreakpointInactive.png:
815         * UserInterface/Images/BreakpointInactive@2x.png:
816         * UserInterface/Images/ClippingCSS.png:
817         * UserInterface/Images/ClippingCSS@2x.png:
818         * UserInterface/Images/ClippingCSSLarge.png:
819         * UserInterface/Images/ClippingCSSLarge@2x.png:
820         * UserInterface/Images/ClippingGeneric.png:
821         * UserInterface/Images/ClippingGeneric@2x.png:
822         * UserInterface/Images/ClippingGenericLarge.png:
823         * UserInterface/Images/ClippingGenericLarge@2x.png:
824         * UserInterface/Images/ClippingJS.png:
825         * UserInterface/Images/ClippingJS@2x.png:
826         * UserInterface/Images/ClippingJSLarge.png:
827         * UserInterface/Images/ClippingJSLarge@2x.png:
828         * UserInterface/Images/ColorIcon.png:
829         * UserInterface/Images/ColorIcon@2x.png:
830         * UserInterface/Images/Cookie.png:
831         * UserInterface/Images/Cookie@2x.png:
832         * UserInterface/Images/Database.png:
833         * UserInterface/Images/Database@2x.png:
834         * UserInterface/Images/DatabaseTable.png:
835         * UserInterface/Images/DatabaseTable@2x.png:
836         * UserInterface/Images/DocumentCSS.png:
837         * UserInterface/Images/DocumentCSS@2x.png:
838         * UserInterface/Images/DocumentCSSLarge.png:
839         * UserInterface/Images/DocumentCSSLarge@2x.png:
840         * UserInterface/Images/DocumentFont.png:
841         * UserInterface/Images/DocumentFont@2x.png:
842         * UserInterface/Images/DocumentFontLarge.png:
843         * UserInterface/Images/DocumentFontLarge@2x.png:
844         * UserInterface/Images/DocumentGL.png:
845         * UserInterface/Images/DocumentGL@2x.png:
846         * UserInterface/Images/DocumentGeneric.png:
847         * UserInterface/Images/DocumentGeneric@2x.png:
848         * UserInterface/Images/DocumentGenericLarge.png:
849         * UserInterface/Images/DocumentGenericLarge@2x.png:
850         * UserInterface/Images/DocumentImage.png:
851         * UserInterface/Images/DocumentImage@2x.png:
852         * UserInterface/Images/DocumentImageLarge.png:
853         * UserInterface/Images/DocumentImageLarge@2x.png:
854         * UserInterface/Images/DocumentJS.png:
855         * UserInterface/Images/DocumentJS@2x.png:
856         * UserInterface/Images/DocumentJSLarge.png:
857         * UserInterface/Images/DocumentJSLarge@2x.png:
858         * UserInterface/Images/DocumentMarkup.png:
859         * UserInterface/Images/DocumentMarkup@2x.png:
860         * UserInterface/Images/DocumentMarkupLarge.png:
861         * UserInterface/Images/DocumentMarkupLarge@2x.png:
862         * UserInterface/Images/FolderGeneric.png:
863         * UserInterface/Images/FolderGeneric@2x.png:
864         * UserInterface/Images/GradientStop.png:
865         * UserInterface/Images/GradientStop@2x.png:
866         * UserInterface/Images/GradientStopSelected.png:
867         * UserInterface/Images/GradientStopSelected@2x.png:
868         * UserInterface/Images/HoverMenuButton.png:
869         * UserInterface/Images/HoverMenuButton@2x.png:
870         * UserInterface/Images/InstructionPointer.png:
871         * UserInterface/Images/InstructionPointer@2x.png:
872         * UserInterface/Images/LocalStorage.png:
873         * UserInterface/Images/LocalStorage@2x.png:
874         * UserInterface/Images/SessionStorage.png:
875         * UserInterface/Images/SessionStorage@2x.png:
876         * UserInterface/Images/SliderThumb.png:
877         * UserInterface/Images/SliderThumb@2x.png:
878         * UserInterface/Images/SliderThumbPressed.png:
879         * UserInterface/Images/SliderThumbPressed@2x.png:
880         * UserInterface/Images/WebSocket.png:
881         * UserInterface/Images/WebSocket@2x.png:
882         * UserInterface/Images/WebSocketLarge.png:
883         * UserInterface/Images/WebSocketLarge@2x.png:
884         * UserInterface/Images/WorkerScript.png:
885         * UserInterface/Images/WorkerScript@2x.png:
886         * UserInterface/Images/WorkerScriptLarge.png:
887         * UserInterface/Images/WorkerScriptLarge@2x.png:
888
889 2018-11-12  Nikita Vasilyev  <nvasilyev@apple.com>
890
891         Web Inspector: Styles: Pressing Tab or Enter should start editing focused property
892         https://bugs.webkit.org/show_bug.cgi?id=191510
893         <rdar://problem/45970897>
894
895         Reviewed by Dean Jackson.
896
897         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
898         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
899
900 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
901
902         Web Inspector: Start moving toward better multi-target support
903         https://bugs.webkit.org/show_bug.cgi?id=191345
904
905         Reviewed by Devin Rousso.
906
907         This change continues the move toward better multi-target support
908         by explicitly using explicit target agents in more places, and
909         converting generalized feature checks into target agnostic versions
910         that use the new InspectorBackend.domains, which does not vary based
911         on the connected targets / debuggable type.
912
913         I also audited uses of RuntimeAgent, ConsoleAgent, and DebuggerAgent
914         for better multi-target support since these agents should already
915         have complete multi-target support.
916
917         * UserInterface/Protocol/Target.js:
918         (WI.Target.prototype.initialize):
919         Move explicitly to target.Agent feature checks with a known target.
920
921         * UserInterface/Controllers/DebuggerManager.js:
922         (WI.DebuggerManager.prototype.initializeTarget):
923         (WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange):
924         Move explicitly to target.DebuggerAgent for feature checks with a known target.
925
926         * UserInterface/Controllers/NetworkManager.js:
927         (WI.NetworkManager.prototype.initializeTarget):
928         Move explicitly to target.NetworkAgent for feature checks with a known target.
929
930         * UserInterface/Controllers/RuntimeManager.js:
931         (WI.RuntimeManager.prototype.initializeTarget):
932         (WI.RuntimeManager.prototype.saveResult):
933         * UserInterface/Protocol/RemoteObject.js:
934         (WI.RemoteObject.prototype.updatePreview):
935         (WI.RemoteObject.prototype.getDisplayablePropertyDescriptors):
936         (WI.RemoteObject.prototype.deprecatedGetDisplayableProperties):
937         * UserInterface/Views/SourceCodeTextEditor.js:
938         (WI.SourceCodeTextEditor.prototype._createTypeTokenAnnotator):
939         (WI.SourceCodeTextEditor.prototype._createBasicBlockAnnotator):
940         Move explicitly to target.RuntimeAgent for feature checks with a known target.
941
942         * UserInterface/Models/CSSCompletions.js:
943         (WI.CSSCompletions.initializeCSSCompletions):
944         Move explicitly to target.CSSAgent for feature checks with a known target.
945
946         * UserInterface/Views/ContextMenuUtilities.js:
947         Use the DebuggerAgent from the target associated with the DOMNode's
948         remote object instead of assuming the main target.
949
950         * UserInterface/Views/SettingsTabContentView.js:
951         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
952         Update the ConsoleAgent setting on all targets that support it.
953
954         * UserInterface/Views/BreakpointActionView.js:
955         (WI.BreakpointActionView):
956         All backends support BreakpointActionType, the assertion can go away.
957
958         * UserInterface/Views/LogContentView.js:
959         (WI.LogContentView.prototype.get navigationItems):
960         * UserInterface/Views/DOMTreeContentView.js:
961         (WI.DOMTreeContentView.prototype.get navigationItems):
962         Include additional `window.FooAgent` checks for these since they will need
963         to be revisited in the future.
964
965         * UserInterface/Protocol/InspectorBackend.js:
966         (InspectorBackendClass.prototype.get domains):
967         (InspectorBackendClass.prototype.activateDomain):
968         Expose InspectorBackend.domains.<Domain> for feature checking.
969
970         * UserInterface/Controllers/BreakpointPopoverController.js:
971         (WI.BreakpointPopoverController.prototype._createPopoverContent):
972         * UserInterface/Controllers/CSSManager.js:
973         (WI.CSSManager):
974         (WI.CSSManager.prototype._mainResourceDidChange):
975         * UserInterface/Controllers/TimelineManager.js:
976         (WI.TimelineManager.prototype._attemptAutoCapturingForFrame):
977         (WI.TimelineManager.prototype._updateAutoCaptureInstruments):
978         (WI.TimelineManager):
979         * UserInterface/Models/Canvas.js:
980         (WI.Canvas.prototype.startRecording):
981         (WI.Canvas.prototype.recordingFinished):
982         * UserInterface/Models/ScriptSyntaxTree.js:
983         (WI.ScriptSyntaxTree.functionReturnDivot):
984         * UserInterface/Protocol/DebuggerObserver.js:
985         (WI.DebuggerObserver):
986         * UserInterface/Protocol/NetworkObserver.js:
987         (WI.NetworkObserver.prototype.requestWillBeSent):
988         * UserInterface/Views/DebuggerSidebarPanel.js:
989         (WI.DebuggerSidebarPanel):
990         (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointClicked):
991         * UserInterface/Views/NetworkTimelineView.js:
992         (WI.NetworkTimelineView):
993         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
994         (WI.ResourceDetailsSidebarPanel.prototype._refreshRequestAndResponse):
995         * UserInterface/Views/WebSocketContentView.js:
996         (WI.WebSocketContentView):
997         (WI.NetworkManager.prototype.webSocketWillSendHandshakeRequest):
998         (WI.DebuggerManager.prototype.debuggerDidResume):
999         Feature check in a target agnostic way.
1000
1001 2018-11-08  Matt Baker  <mattbaker@apple.com>
1002
1003         Web Inspector: ResourceQueryController should early return when query is longer than search string
1004         https://bugs.webkit.org/show_bug.cgi?id=191436
1005
1006         Reviewed by Devin Rousso.
1007
1008         * UserInterface/Controllers/ResourceQueryController.js:
1009
1010         * UserInterface/Models/ResourceQueryMatch.js:
1011         (WI.ResourceQueryMatch):
1012         Drive-by fixes.
1013
1014 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
1015
1016         Uncaught Exception: undefined is not an object (evaluating 'treeElement.parent.removeChild')
1017         https://bugs.webkit.org/show_bug.cgi?id=191454
1018
1019         Reviewed by Matt Baker.
1020
1021         * UserInterface/Views/ResourceSidebarPanel.js:
1022         (WI.ResourceSidebarPanel.prototype._scriptsCleared):
1023         This was intending to iterate the Map's values, which are tree elements.
1024
1025 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
1026
1027         Web Inspector: Potential for watch expressions to never show results
1028         https://bugs.webkit.org/show_bug.cgi?id=191438
1029
1030         Reviewed by Matt Baker.
1031
1032         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
1033         (WI.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
1034         If there was no object don't bail, continue and resolve the Promise.
1035         In this case we can fallback to show `undefined`. This code might not be
1036         reachable right now, but is wrong as is.
1037
1038 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
1039
1040         Web Inspector: Debugger Popover does not work when paused in Worker
1041         https://bugs.webkit.org/show_bug.cgi?id=191342
1042
1043         Reviewed by Devin Rousso.
1044
1045         * UserInterface/Views/SourceCodeTextEditor.js:
1046         (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
1047         (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
1048         When receiving the result of the popover evaluation associate the RemoteObject with
1049         the target we used to evaluate (such as the Debugger call frame), not the target
1050         associated with the editor.
1051
1052 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
1053
1054         Web Inspector: Restrict domains at the target level instead of only at the window level
1055         https://bugs.webkit.org/show_bug.cgi?id=191344
1056
1057         Reviewed by Devin Rousso.
1058
1059         With this change the list of agents available on the target should accurately
1060         reflect the domains that target supports. We should start moving in the direction
1061         that if we are checking for, or using, a feature, we should ideally be using
1062         code that looks like `target.FooAgent.method` and not `window.FooAgent` or
1063         an unprefixed `FooAgent`. More changes to follow.
1064
1065         * UserInterface/Controllers/AppControllerBase.js:
1066         * UserInterface/Base/DebuggableType.js: Added.
1067         Extract debuggable type enum out into its own file loaded early on.
1068
1069         * UserInterface/Main.html:
1070         * UserInterface/Test.html:
1071         Load DebuggableType.js.
1072
1073         * UserInterface/Controllers/NetworkManager.js:
1074         (WI.NetworkManager.prototype.initializeTarget):
1075         With these changes target.ServiceWorker is only exposed on a ServiceWorker target.
1076
1077         * UserInterface/Protocol/Connection.js:
1078         (InspectorBackend.WorkerConnection):
1079         With these changes Target.js restricts the domains exposed on the Target so just
1080         clone all of the agents (we don't need to do anything special).
1081
1082         * UserInterface/Protocol/InspectorBackend.js:
1083         (InspectorBackendClass.prototype.activateDomain):
1084         Update supported domains per-type. If there is no explicit availability
1085         then the domain is supported on all types.
1086
1087         (InspectorBackendClass.prototype.supportedDomainsForDebuggableType):
1088         Get supported domains per-type.
1089
1090         (InspectorBackendClass.prototype.get workerSupportedDomains): Deleted.
1091         (InspectorBackendClass.prototype.workerSupportedDomain): Deleted.
1092         workerSupportedDomains is now unnecessary.
1093
1094         * UserInterface/Protocol/Target.js:
1095         (WI.Target.prototype._supportedDomainsForTargetType):
1096         Restrict supported domains for this target based on its type.
1097
1098         * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
1099         * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
1100         * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
1101         * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
1102         * Versions/Inspector-iOS-10.3.json:
1103         * Versions/Inspector-iOS-11.0.json:
1104         * Versions/Inspector-iOS-11.3.json:
1105         * Versions/Inspector-iOS-12.0.json:
1106         Regenerate protocol files now that workerSupportedDomains is unnecessary
1107         and explicit availability has been added to other domains.
1108
1109 2018-11-07  Nikita Vasilyev  <nvasilyev@apple.com>
1110
1111         REGRESSION(r236705): Web Inspector: wrong text color for selected DataGrid row
1112         https://bugs.webkit.org/show_bug.cgi?id=191405
1113         <rdar://problem/45893283>
1114
1115         Reviewed by Matt Baker.
1116
1117         Selection background color for both Dark Mode mode and Light Mode is dark blue.
1118         The text color for both cases should be white.
1119
1120         * UserInterface/Views/DataGrid.css:
1121         (body:not(.window-inactive, .window-docked-inactive) .data-grid:focus tr.editable.selected .cell-content > input):
1122
1123 2018-11-07  Joseph Pecoraro  <pecoraro@apple.com>
1124
1125         Web Inspector: Fix "Javascript" => "JavaScript" enum in protocol generated objects
1126         https://bugs.webkit.org/show_bug.cgi?id=191340
1127
1128         Reviewed by Devin Rousso.
1129
1130         * UserInterface/Models/Canvas.js:
1131         (WI.Canvas.fromPayload):
1132         Insert a missing break statement for the WebGPU case.
1133
1134         * UserInterface/Models/MemoryTimelineRecord.js:
1135         (WI.MemoryTimelineRecord.memoryCategoriesFromProtocol):
1136         Use new enum name.
1137
1138         * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
1139         * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
1140         * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
1141         * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
1142         * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
1143         * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
1144         * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
1145         * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
1146         Update enums with new generator.
1147
1148 2018-11-06  Joseph Pecoraro  <pecoraro@apple.com>
1149
1150         REGRESSION: Web Inspector: Popovers drawing incorrectly in Network Tab (clicking between a few items)
1151         https://bugs.webkit.org/show_bug.cgi?id=191323
1152
1153         Reviewed by Devin Rousso.
1154
1155         * UserInterface/Views/Popover.js:
1156         (WI.Popover.prototype._drawBackground):
1157         Save and restore the context state between updates. Something
1158         was affecting the clearRect, making it so that it didn't actually
1159         clear the entire rect each time.
1160
1161 2018-11-05  Devin Rousso  <drousso@apple.com>
1162
1163         Web Inspector: Audit: turn off Start button when all tests are removed
1164         https://bugs.webkit.org/show_bug.cgi?id=191235
1165
1166         Reviewed by Matt Baker.
1167
1168         * UserInterface/Views/AuditNavigationSidebarPanel.js:
1169         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
1170
1171 2018-11-05  Matt Baker  <mattbaker@apple.com>
1172
1173         Web Inspector: Table selection should not require that rows be in the cache
1174         https://bugs.webkit.org/show_bug.cgi?id=190993
1175         <rdar://problem/45613812>
1176
1177         Reviewed by Devin Rousso.
1178
1179         Deselecting a table row shouldn't depend on it being in the cache. This
1180         allows us to implement select all, and other kinds of bulk selection
1181         actions that affect rows that haven't been revealed.
1182
1183         * UserInterface/Views/Table.js:
1184         (WI.Table.prototype.deselectRow):
1185
1186 2018-11-05  Devin Rousso  <drousso@apple.com>
1187
1188         Web Inspector: show save/restore stack for recorded 2D Canvases
1189         https://bugs.webkit.org/show_bug.cgi?id=175283
1190         <rdar://problem/34040756>
1191
1192         Reviewed by Matt Baker.
1193
1194         Instead of using plain objects for holding the `WI.Recording`'s state, use a model object
1195         so that more data can be passed around. When visualizing the state, show any previously
1196         saved states in a `WI.DetailsSection` underneath the current state. If there are no saved
1197         states (meaning there is only the current state), don't use a `WI.DetailsSection`.
1198
1199         * UserInterface/Models/RecordingState.js: Added.
1200         (WI.RecordingState):
1201         (WI.RecordingState.fromContext):
1202         (WI.RecordingState.async swizzleInitialState):
1203         (WI.RecordingState.prototype.get source):
1204         (WI.RecordingState.prototype.has):
1205         (WI.RecordingState.prototype.get return):
1206         (WI.RecordingState.prototype.toJSON):
1207         (WI.RecordingState.prototype.[Symbol.iterator]):
1208
1209         * UserInterface/Models/Recording.js:
1210         (WI.Recording.prototype.async _process):
1211         (WI.Recording.prototype.async _swizzleState): Deleted.
1212
1213         * UserInterface/Models/RecordingAction.js:
1214         (WI.RecordingAction.prototype.process):
1215         (WI.RecordingAction.deriveCurrentState): Deleted.
1216
1217         * UserInterface/Views/RecordingContentView.js:
1218         (WI.RecordingContentView.prototype._generateContentCanvas2D):
1219
1220         * UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
1221         (WI.RecordingStateDetailsSidebarPanel):
1222         (WI.RecordingStateDetailsSidebarPanel.prototype.get scrollElement):
1223         (WI.RecordingStateDetailsSidebarPanel.prototype.sizeDidChange): Added.
1224         (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
1225         (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D.isColorProperty): Deleted.
1226         (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D.createInlineSwatch): Deleted.
1227         * UserInterface/Views/RecordingStateDetailsSidebarPanel.css:
1228         (.sidebar > .panel.details.recording-state > .content .details-section > .header .source): Added.
1229         (.sidebar > .panel.details.recording-state > .content .data-grid tr.modified): Added.
1230         (.sidebar > .panel.details.recording-state > .content .data-grid tr:not(.selected).non-standard .name-column): Added.
1231         (.sidebar > .panel.details.recording-state > .content .data-grid tr:not(.selected) .unavailable): Added.
1232         (.sidebar > .panel.details.recording-state > .content .data-grid .inline-swatch): Added.
1233         (.sidebar > .panel.details.recording-state > .content > .data-grid tr.modified): Deleted.
1234         (.sidebar > .panel.details.recording-state > .content > .data-grid tr:not(.selected).non-standard): Deleted.
1235         (.sidebar > .panel.details.recording-state > .content > .data-grid tr:not(.selected) .unavailable): Deleted.
1236         (.sidebar > .panel.details.recording-state > .content > .data-grid .inline-swatch): Deleted.
1237
1238         * UserInterface/Main.html:
1239         * UserInterface/Test.html:
1240
1241         * Localizations/en.lproj/localizedStrings.js:
1242
1243 2018-11-03  Devin Rousso  <drousso@apple.com>
1244
1245         Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
1246         https://bugs.webkit.org/show_bug.cgi?id=190854
1247
1248         Reviewed by Matt Baker.
1249
1250         * UserInterface/Models/RecordingAction.js:
1251         (WI.RecordingAction):
1252         (WI.RecordingAction.isFunctionForType):
1253         (WI.RecordingAction.constantNameForParameter):
1254         (WI.RecordingAction.prototype.get contextReplacer): Added.
1255         (WI.RecordingAction.prototype.async.swizzle):
1256         (WI.RecordingAction.prototype.apply):
1257         Create a constant list of actions for each recording type that need to replace the context
1258         with a different value before being applied (e.g. `width` should be applied to the
1259         `context`'s `canvas` instead of directly to the `context`).
1260
1261         * UserInterface/Views/RecordingContentView.js:
1262         (WI.RecordingContentView.prototype._generateContentCanvas2D.actionModifiesPath): Added.
1263         (WI.RecordingContentView.prototype._generateContentCanvas2D):
1264         (WI.RecordingContentView._actionModifiesPath): Deleted.
1265         Generate the path context after the actions are applied to the preview context so that the
1266         final width/height are known and can be used. This is needed because changing the
1267         width/height causes the content to be erased.
1268
1269         * UserInterface/Views/RecordingActionTreeElement.js:
1270         (WI.RecordingActionTreeElement._generateDOM):
1271         (WI.RecordingActionTreeElement._classNameForAction):
1272         * UserInterface/Views/RecordingActionTreeElement.css:
1273         (.tree-outline:focus .item.action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon): Added.
1274         (.item.action > .titles .context-replacer::after): Added.
1275         (.item.action.has-context-replacer > .icon): Added.
1276         (@media (prefers-dark-interface) .item.action:not(.invalid, .initial-state, .has-context-replacer) > .icon): Added.
1277         (.tree-outline:focus .item.action.selected:not(.initial-state, .invalid) > .icon): Deleted.
1278         (@media (prefers-dark-interface) .item.action:not(.initial-state) > .icon): Deleted.
1279         (@media (prefers-dark-interface) .tree-outline:not(.hide-disclosure-buttons) .item.action:not(.initial-state, .parent) > .icon): Deleted.
1280         Add the context replacer text to the beginning of the action's name if it exists.
1281
1282         * UserInterface/Views/CanvasContentView.js:
1283         (WI.CanvasContentView.prototype._refreshPixelSize):
1284         (WI.CanvasContentView.prototype._updatePixelSize): Deleted.
1285         Update preview image when the canvas' size changes.
1286
1287 2018-11-02  Matt Baker  <mattbaker@apple.com>
1288
1289         Web Inspector: support multiple selection/deletion of cookie records
1290         https://bugs.webkit.org/show_bug.cgi?id=66381
1291         <rdar://problem/19281525>
1292
1293         Reviewed by Devin Rousso.
1294
1295         * Localizations/en.lproj/localizedStrings.js:
1296
1297         * UserInterface/Views/CookieStorageContentView.js:
1298         (WI.CookieStorageContentView):
1299         (WI.CookieStorageContentView.prototype.get scrollableElements):
1300         (WI.CookieStorageContentView.prototype.tableNumberOfRows):
1301         (WI.CookieStorageContentView.prototype.tableSortChanged):
1302         (WI.CookieStorageContentView.prototype.tableCellContextMenuClicked):
1303         (WI.CookieStorageContentView.prototype.tableDidRemoveRows):
1304         (WI.CookieStorageContentView.prototype.tablePopulateCell):
1305         (WI.CookieStorageContentView.prototype.initialLayout):
1306         (WI.CookieStorageContentView.prototype._generateSortComparator):
1307         (WI.CookieStorageContentView.prototype._refreshButtonClicked):
1308         (WI.CookieStorageContentView.prototype._reloadCookies):
1309         (WI.CookieStorageContentView.prototype._updateSort):
1310         (WI.CookieStorageContentView.prototype._handleTableKeyDown):
1311         (WI.CookieStorageContentView.prototype.update): Deleted.
1312         (WI.CookieStorageContentView.prototype._rebuildTable): Deleted.
1313         (WI.CookieStorageContentView.prototype._sortDataGrid.localeCompare): Deleted.
1314         (WI.CookieStorageContentView.prototype._sortDataGrid.numberCompare): Deleted.
1315         (WI.CookieStorageContentView.prototype._sortDataGrid.expiresCompare): Deleted.
1316         (WI.CookieStorageContentView.prototype._sortDataGrid): Deleted.
1317         (WI.CookieStorageContentView.prototype._deleteCallback): Deleted.
1318         Replace DataGrid with Table. The content view serves as the table
1319         delegate and data source, and handles delete and backspace key events
1320         to allow deleting the selected cookies. Cookies may also be deleted from
1321         the table context menu and a new button in the navigation bar.
1322
1323         * UserInterface/Views/Table.js:
1324         (WI.Table.prototype.isRowSelected):
1325         (WI.Table.prototype.selectRow):
1326         (WI.Table.prototype.deselectRow):
1327         (WI.Table.prototype.removeRow):
1328         (WI.Table.prototype._getOrCreateRow):
1329         (WI.Table.prototype._handleMouseDown):
1330         (WI.Table.prototype._removeRows):
1331         (WI.Table.prototype._isRowSelected): Deleted.
1332         Make `isSelectedRow` public. It is more convenient and efficient than
1333         calling `Table.prototype.selectedRows.includes(rowIndex)`.
1334
1335 2018-11-01  Devin Rousso  <drousso@apple.com>
1336
1337         Web Inspector: View: introduce a didLayoutSubtree
1338         https://bugs.webkit.org/show_bug.cgi?id=191176
1339
1340         Reviewed by Matt Baker.
1341
1342         Introduce logic to allow subclasses of `WI.View` to perform logic after every `WI.View` in
1343         their subtree has finished `layout`.
1344
1345         * UserInterface/Views/View.js:
1346         (WI.View.prototype.didLayoutSubtree): Added.
1347         (WI.View.prototype._layoutSubtree):
1348
1349         * UserInterface/Views/NetworkTableContentView.js:
1350         (WI.NetworkTableContentView.prototype.layout):
1351         (WI.NetworkTableContentView.prototype.didLayoutSubtree): Added.
1352
1353 2018-11-01  Devin Rousso  <drousso@apple.com>
1354
1355         Web Inspector: Network: remove unnecessary media event tracking
1356         https://bugs.webkit.org/show_bug.cgi?id=191174
1357
1358         Reviewed by Joseph Pecoraro.
1359
1360         Renames "Group by Node" to "Group Media Requests" for clarity.
1361
1362         * UserInterface/Views/NetworkTableContentView.js:
1363         (WI.NetworkTableContentView):
1364         (WI.NetworkTableContentView.prototype.reset):
1365         (WI.NetworkTableContentView.prototype.showRepresentedObject):
1366         (WI.NetworkTableContentView.prototype.networkDetailViewClose):
1367         (WI.NetworkTableContentView.prototype._populateNameCell):
1368         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.createDOMEventLine):
1369         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
1370         (WI.NetworkTableContentView.prototype.layout):
1371         (WI.NetworkTableContentView.prototype._entryForDOMNode):
1372         (WI.NetworkTableContentView.prototype._handleGroupByDOMNodeCheckedDidChange):
1373         (WI.NetworkTableContentView.prototype._restoreSelectedRow):
1374         (WI.NetworkTableContentView.prototype._handleResourceEntryMousedownWaterfall):
1375         (WI.NetworkTableContentView.prototype._handleNodeEntryMousedownWaterfall):
1376         (WI.NetworkTableContentView.prototype._handleMousedownWaterfall):
1377         * UserInterface/Views/NetworkTableContentView.css:
1378         (.network-table .data-container .cell.name .range): Added.
1379         (.network-table .data-container .cell.name .range::before): Added.
1380         (.network-table:focus .data-container li.selected .cell.name .range): Added.
1381         (@media (prefers-dark-interface) .network-table .data-container .cell.name .range): Added.
1382         Always display the "Byte Range" title as a "subtitle", regardless of the media requests
1383         setting being toggled.
1384         Drive-by: update the position of the waterfall popover whenever the time range changes.
1385         Drive-by: close the details view if a node is selected and the media requests setting is
1386         turned off.
1387
1388         * UserInterface/Views/Popover.js:
1389         (WI.Popover.prototype.resize): Added.
1390         (WI.Popover.prototype.handleEvent):
1391
1392         * Localizations/en.lproj/localizedStrings.js:
1393
1394 2018-11-01  Devin Rousso  <drousso@apple.com>
1395
1396         Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'mouseBlock.addEventListener')
1397         https://bugs.webkit.org/show_bug.cgi?id=191020
1398
1399         Reviewed by Joseph Pecoraro.
1400
1401         * UserInterface/Views/TimelineRuler.js:
1402         (WI.TimelineRuler):
1403         Since `undefined` is not a number, it isn't less than `0`, which caused us to divide by
1404         `undefined` (equivalent to dividing by `0`), resulting in `NaN`.
1405
1406 2018-11-01  Nikita Vasilyev  <nvasilyev@apple.com>
1407
1408         Uncaught Exception: TypeError: undefined is not an object (evaluating 'WI.modifierKeys.metaKey') (at ScopeBarItem.js:87:67)
1409         https://bugs.webkit.org/show_bug.cgi?id=191173
1410
1411         Reviewed by Devin Rousso.
1412
1413         WI.modifierKeys was accessed before it was initialized. Move it from WI.contentLoaded to WI.loaded,
1414         which happens before WI.contentLoaded.
1415
1416         * UserInterface/Base/Main.js:
1417         (WI.loaded):
1418         (WI.contentLoaded):
1419
1420 2018-11-01  Nikita Vasilyev  <nvasilyev@apple.com>
1421
1422         REGRESSION(r237652): Web Inspector: dumpInspectorProtocolMessages is always enabled
1423         https://bugs.webkit.org/show_bug.cgi?id=191161
1424
1425         Reviewed by Joseph Pecoraro.
1426
1427         * UserInterface/Protocol/InspectorBackend.js:
1428         (InspectorBackendClass.prototype.get dumpInspectorProtocolMessages):
1429
1430 2018-11-01  Nikita Vasilyev  <nvasilyev@apple.com>
1431
1432         Web Inspector: Styles: Toggle selected properties by pressing Space or Command+/
1433         https://bugs.webkit.org/show_bug.cgi?id=181145
1434         <rdar://problem/36203388>
1435
1436         Reviewed by Brian Burg.
1437
1438         Pressing Space key or Command-/ toggles (comments out or uncomments) selected properties.
1439
1440         This patch only works with "Enable Selection of Multiple Properties" checked. It shouldn't introduce any
1441         changes when this setting is unchecked.
1442
1443         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
1444         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.get selectionRange):
1445         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties):
1446         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy):
1447         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
1448         * UserInterface/Views/SpreadsheetStyleProperty.js:
1449         (WI.SpreadsheetStyleProperty):
1450         (WI.SpreadsheetStyleProperty.prototype.update): Renamed from _update.
1451         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
1452         (WI.SpreadsheetStyleProperty.prototype.applyFilter):
1453         (WI.SpreadsheetStyleProperty.prototype.handleCopyEvent):
1454         Make `update` method public. No other changes were made.
1455
1456 2018-10-31  Devin Rousso  <drousso@apple.com>
1457
1458         Web Inspector: Canvas: create a setting for auto-recording newly created contexts
1459         https://bugs.webkit.org/show_bug.cgi?id=190856
1460
1461         Reviewed by Brian Burg.
1462
1463         * UserInterface/Controllers/CanvasManager.js:
1464         (WI.CanvasManager.supportsRecordingAutoCapture): Added.
1465         (WI.CanvasManager.prototype.setRecordingAutoCaptureFrameCount): Added.
1466
1467         * UserInterface/Models/Canvas.js:
1468         (WI.Canvas.prototype.startRecording):
1469         (WI.Canvas.prototype.recordingStarted):
1470         (WI.Canvas.prototype.recordingFinished):
1471
1472         * UserInterface/Models/Recording.js:
1473
1474         * UserInterface/Views/CanvasOverviewContentView.js:
1475         (WI.CanvasOverviewContentView):
1476         (WI.CanvasOverviewContentView.prototype.get navigationItems):
1477         (WI.CanvasOverviewContentView.prototype.initialLayout): Added.
1478         (WI.CanvasOverviewContentView.prototype.attached):
1479         (WI.CanvasOverviewContentView.prototype.detached):
1480         (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount): Added.
1481         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize): Added.
1482         (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput): Added.
1483         (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureCheckedDidChange): Added.
1484         (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureEnabledChanged): Added.
1485         (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged): Added.
1486         * UserInterface/Views/CanvasOverviewContentView.css:
1487         (.navigation-bar > .item.canvas-recording-auto-capture > label): Added.
1488         (.navigation-bar > .item.canvas-recording-auto-capture > label > input): Added.
1489         (.navigation-bar > .item.canvas-recording-auto-capture > label > input::-webkit-inner-spin-button): Added.
1490         (.popover-content > .tree-outline .item.recording > .icon): Deleted.
1491         (.popover-content > .tree-outline .item.recording:hover): Deleted.
1492         (.popover-content > .tree-outline .item.recording:hover > .icon): Deleted.
1493         Drive-by: removed unused CSS rules.
1494
1495         * UserInterface/Views/CanvasContentView.js:
1496         (WI.CanvasContentView.prototype.initialLayout):
1497         (WI.CanvasContentView.prototype._updateProgressView):
1498         (WI.CanvasContentView.prototype._updateViewRelatedItems):
1499
1500         * UserInterface/Views/CanvasTabContentView.js:
1501         (WI.CanvasTabContentView.prototype._recordingImportedOrStopped):
1502
1503         * UserInterface/Views/CheckboxNavigationItem.js:
1504         (WI.CheckboxNavigationItem):
1505         (WI.CheckboxNavigationItem.prototype._handleLabelClick): Added.
1506
1507         * UserInterface/Base/Setting.js:
1508
1509         * Localizations/en.lproj/localizedStrings.js:
1510
1511 2018-10-31  Devin Rousso  <drousso@apple.com>
1512
1513         Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
1514         https://bugs.webkit.org/show_bug.cgi?id=190641
1515         <rdar://problem/45319049>
1516
1517         Reviewed by Joseph Pecoraro.
1518
1519         * UserInterface/Protocol/DOMObserver.js:
1520         (WI.DOMObserver.prototype.videoLowPowerChanged): Added.
1521
1522         * UserInterface/Controllers/DOMManager.js:
1523         (WI.DOMManager.prototype.videoLowPowerChanged): Added.
1524
1525         * UserInterface/Models/DOMNode.js:
1526         (WI.DOMNode):
1527         (WI.DOMNode.prototype.get lowPowerRanges): Added.
1528         (WI.DOMNode.prototype.videoLowPowerChanged): Added.
1529         (WI.DOMNode.prototype.canEnterLowPowerMode): Added.
1530
1531         * UserInterface/Views/NetworkTableContentView.js:
1532         (WI.NetworkTableContentView.prototype._populateDomainCell):
1533         (WI.NetworkTableContentView.prototype._tryLinkResourceToDOMNode):
1534         (WI.NetworkTableContentView.prototype._handleNodeLowPowerChanged): Added.
1535         * UserInterface/Views/NetworkTableContentView.css:
1536         (.network-table :not(.header) .cell.waterfall .waterfall-container > .area):
1537         (.network-table :not(.header) .cell.waterfall .waterfall-container > .area.dom-fullscreen): Added.
1538         (.network-table :not(.header) .cell.waterfall .waterfall-container > .area.low-power): Added.
1539         (.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-fullscreen): Deleted.
1540
1541         * UserInterface/Views/DOMNodeEventsContentView.js:
1542         (WI.DOMNodeEventsContentView):
1543         (WI.DOMNodeEventsContentView.prototype.initialLayout):
1544         (WI.DOMNodeEventsContentView.prototype.closed): Deleted.
1545         (WI.DOMNodeEventsContentView.prototype._handleDOMNodeDidFireEvent): Deleted.
1546
1547         * UserInterface/Views/DOMEventsBreakdownView.js:
1548         (WI.DOMEventsBreakdownView):
1549         (WI.DOMEventsBreakdownView.prototype.initialLayout):
1550         (WI.DOMEventsBreakdownView.prototype.layout): Added.
1551         (WI.DOMEventsBreakdownView.prototype._handleDOMNodeDidFireEvent): Added.
1552         (WI.DOMEventsBreakdownView.prototype._handleDOMNodeLowPowerChanged): Added.
1553         (WI.DOMEventsBreakdownView.prototype.addEvent): Deleted.
1554         (WI.DOMEventsBreakdownView.prototype._populateTable.percentOfTotalTime): Deleted.
1555         (WI.DOMEventsBreakdownView.prototype._populateTable): Deleted.
1556         * UserInterface/Views/DOMEventsBreakdownView.css:
1557         (.dom-events-breakdown .graph > .area): Added.
1558         (.dom-events-breakdown .graph > .area.fullscreen):
1559         (.dom-events-breakdown .graph > .area.low-power): Added.
1560
1561         * Localizations/en.lproj/localizedStrings.js:
1562
1563 2018-10-31  Devin Rousso  <drousso@apple.com>
1564
1565         Web Inspector: Audit: save imported audits across WebInspector sessions
1566         https://bugs.webkit.org/show_bug.cgi?id=190858
1567         <rdar://problem/45527625>
1568
1569         Reviewed by Brian Burg.
1570
1571         * UserInterface/Base/ObjectStore.js: Added.
1572         (WI.ObjectStore):
1573         (WI.ObjectStore.supported):
1574         (WI.ObjectStore._open):
1575         (WI.ObjectStore.get _databaseName):
1576         (WI.ObjectStore.prototype.associateObject):
1577         (WI.ObjectStore.prototype.async getAll):
1578         (WI.ObjectStore.prototype.async add):
1579         (WI.ObjectStore.prototype.async addObject):
1580         (WI.ObjectStore.prototype.async delete):
1581         (WI.ObjectStore.prototype.async deleteObject):
1582         (WI.ObjectStore.prototype._resolveKeyPath):
1583         (WI.ObjectStore.prototype.async _operation.listener):
1584         (WI.ObjectStore.prototype.async _operation):
1585         Wrapper for a global `IndexedDB` instance for all of WebInspector (per level). Instances of
1586         `WI.ObjectStore` are able to control a given `IDBObjectStore` using a promise-based API.
1587
1588         *NOTE*: due to the constraint that `IDBObjectStore`s are only able to be created when the
1589         owner `IndexedDB` is "upgrade"d, all `WI.ObjectStore` must be declared before the database
1590         is opened for the first time. Additionally, any time a new `WI.ObjectStore` is added, the
1591         `version` needs to be incremented to ensure that the "upgrade" event fires.
1592
1593         To use any of the `*Object` functions, one must implement a `toJSON` on the object provided.
1594         This is so that `WI.ObjectStore` is able to add the resulting identifier value to the owner
1595         object while storing its `toJSON` value in the IndexedDB (e.g. for objects that have cycles).
1596
1597         * UserInterface/Controllers/AuditManager.js:
1598         (WI.AuditManager.prototype.import):
1599         (WI.AuditManager.prototype.loadStoredTests): Added.
1600         (WI.AuditManager.prototype.removeTest): Added.
1601         (WI.AuditManager.prototype._addTest):
1602
1603         * UserInterface/Views/AuditTabContentView.js:
1604         (WI.AuditTabContentView.prototype.initialLayout): Added.
1605         Attempt to load stored audits when the Audit tab is first shown (lazy-load).
1606
1607         * UserInterface/Views/AuditNavigationSidebarPanel.js:
1608         (WI.AuditNavigationSidebarPanel.prototype.initialLayout):
1609         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved): Added.
1610
1611         * UserInterface/Views/AuditTreeElement.js:
1612         (WI.AuditTreeElement.prototype.ondelete):
1613         Only allow top-level audits to be deleted, as that is what matches the `WI.ObjectStore`.
1614
1615         * UserInterface/Main.html:
1616         * UserInterface/Test.html:
1617
1618 2018-10-31  Joseph Pecoraro  <pecoraro@apple.com>
1619
1620         Web Inspector: Move a few remaining global WI settings to WI.settings
1621         https://bugs.webkit.org/show_bug.cgi?id=191137
1622
1623         Reviewed by Brian Burg.
1624
1625         Move and better name some of the WI.settings created in Main.js
1626         to WI.settings, alongside other global settings.
1627
1628         * UserInterface/Base/Main.js:
1629         (WI.loaded):
1630         Move settings, and register for settings changes in contentLoaded.
1631
1632         * UserInterface/Base/Setting.js:
1633         New settings, and sort values.
1634
1635         * UserInterface/Test/Test.js:
1636         (WI.loaded):
1637         Update setting values for tests.
1638
1639         * UserInterface/Controllers/NetworkManager.js:
1640         (WI.NetworkManager.prototype.initializeTarget):
1641         * UserInterface/Controllers/RuntimeManager.js:
1642         (WI.RuntimeManager.prototype.initializeTarget):
1643         * UserInterface/Models/DOMNode.js:
1644         (WI.DOMNode.prototype.get children):
1645         (WI.DOMNode.prototype.get nextSibling):
1646         (WI.DOMNode.prototype.get previousSibling):
1647         (WI.DOMNode.prototype.get childNodeCount):
1648         * UserInterface/Protocol/Target.js:
1649         (WI.Target.prototype.initialize):
1650         * UserInterface/Views/DOMTreeContentView.js:
1651         (WI.DOMTreeContentView):
1652         (WI.DOMTreeContentView.prototype.closed):
1653         (WI.DOMTreeContentView.prototype._togglePaintFlashing):
1654         (WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged):
1655         (WI.DOMTreeContentView.prototype._showShadowDOMSettingChanged):
1656         (WI.DOMTreeContentView.prototype._toggleShowsShadowDOMSetting):
1657         * UserInterface/Views/DOMTreeOutline.js:
1658         (WI.DOMTreeOutline):
1659         (WI.DOMTreeOutline.prototype.close):
1660         (WI.DOMTreeOutline.prototype._revealAndSelectNode):
1661         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
1662         (WI.LayerTreeDetailsSidebarPanel.prototype.initialLayout):
1663         (WI.LayerTreeDetailsSidebarPanel.prototype._updateDisplayWithLayers):
1664         * UserInterface/Views/Layers3DContentView.js:
1665         (WI.Layers3DContentView):
1666         (WI.Layers3DContentView.prototype.closed):
1667         (WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
1668         (WI.Layers3DContentView.prototype._togglePaintFlashing):
1669         * UserInterface/Views/NetworkTableContentView.js:
1670         (WI.NetworkTableContentView):
1671         (WI.NetworkTableContentView.prototype.closed):
1672         (WI.NetworkTableContentView.prototype._resourceCachingDisabledSettingChanged):
1673         (WI.NetworkTableContentView.prototype._toggleDisableResourceCache):
1674         * UserInterface/Views/ScriptContentView.js:
1675         (WI.ScriptContentView):
1676         (WI.ScriptContentView.prototype.closed):
1677         (WI.ScriptContentView.prototype._contentDidPopulate):
1678         (WI.ScriptContentView.prototype._enableControlFlowProfilerSettingChanged):
1679         (WI.ScriptContentView.prototype._showJavaScriptTypeInformationSettingChanged):
1680         * UserInterface/Views/SourceCodeTextEditor.js:
1681         (WI.SourceCodeTextEditor.prototype.shown):
1682         (WI.SourceCodeTextEditor.prototype._proceedPopulateWithContent):
1683         (WI.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
1684         (WI.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
1685         * UserInterface/Views/TextResourceContentView.js:
1686         (WI.TextResourceContentView):
1687         (WI.TextResourceContentView.prototype.closed):
1688         (WI.TextResourceContentView.prototype._contentDidPopulate):
1689         (WI.TextResourceContentView.prototype._enableControlFlowProfilerSettingChanged):
1690         (WI.TextResourceContentView.prototype._showJavaScriptTypeInformationSettingChanged):
1691         Renamed setting.
1692
1693 2018-10-31  Devin Rousso  <drousso@apple.com>
1694
1695         Web Inspector: Styles: missing contextmenu items for links
1696         https://bugs.webkit.org/show_bug.cgi?id=191021
1697
1698         Reviewed by Joseph Pecoraro.
1699
1700         * UserInterface/Views/SpreadsheetStyleProperty.js:
1701         (WI.SpreadsheetStyleProperty.prototype._renderValue):
1702         (WI.SpreadsheetStyleProperty.prototype._handleLinkContextMenu): Added.
1703         If the token is subtype of "link", add contextmenu items to the wrapper element.
1704
1705         * UserInterface/Views/ContextMenuUtilities.js:
1706         (WI.appendContextMenuItemsForURL.showResourceWithOptions):
1707         (WI.appendContextMenuItemsForURL):
1708         Drive-by: don't assume that `options` will be provided.
1709
1710         * Localizations/en.lproj/localizedStrings.js:
1711
1712 2018-10-31  Nikita Vasilyev  <nvasilyev@apple.com>
1713
1714         Web Inspector: Styles: implement copying and deletion of multiple properties
1715         https://bugs.webkit.org/show_bug.cgi?id=191037
1716         <rdar://problem/45650078>
1717
1718         Reviewed by Brian Burg.
1719
1720         This patch should only work with "Enable Selection of Multiple Properties" checked. It shouldn't introduce any
1721         changes when this setting is unchecked.
1722
1723         Mousedown on a property (1) and moving the mouse cursor to another property (2) should select properties 1, 2, and
1724         all properties between them until mouseup is fired.
1725
1726         Once selected:
1727         - Pressing Command-C should copy the selected properties.
1728         - Pressing Delete should remove the properties.
1729
1730         * UserInterface/Models/CSSProperty.js:
1731         (WI.CSSProperty.prototype.get formattedText):
1732         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
1733         (.spreadsheet-style-declaration-editor):
1734         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property):
1735         (.multiple-properties-selection .spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)):
1736         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected):
1737         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected:focus):
1738         (@media (prefers-dark-interface)):
1739
1740         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
1741         (WI.SpreadsheetCSSStyleDeclarationEditor):
1742         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
1743         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties):
1744         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.deselectProperties):
1745         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyBlur):
1746         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseEnter):
1747         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseLeave):
1748         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy):
1749         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
1750         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._hasSelectedProperties):
1751         Property selection is defined as two numbers: anchorIndex and focusIndex.
1752         The property with focusIndex is actually focused. The focus outline is replaced by a more subtle left blue border.
1753
1754         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
1755         (.spreadsheet-css-declaration.selecting,):
1756         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
1757         (WI.SpreadsheetCSSStyleDeclarationSection):
1758         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyBlur):
1759         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseEnter):
1760         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseLeave):
1761         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
1762         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowMouseUp):
1763         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
1764         * UserInterface/Views/SpreadsheetStyleProperty.js:
1765         (WI.SpreadsheetStyleProperty):
1766         Implement copying the same way it's done for DataGrid: by adding copyHandler property to the focused element.
1767         Add `tabIndex=-1` so the property element can be focused.
1768
1769         (WI.SpreadsheetStyleProperty.prototype.get property):
1770         (WI.SpreadsheetStyleProperty.prototype.get selected):
1771         (WI.SpreadsheetStyleProperty.prototype.set selected):
1772         (WI.SpreadsheetStyleProperty.prototype.remove):
1773         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
1774         (WI.SpreadsheetStyleProperty.prototype.handleCopyEvent):
1775         (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit):
1776         (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur):
1777         (WI.SpreadsheetStyleProperty.prototype._handleNamePaste):
1778
1779 2018-10-31  Devin Rousso  <drousso@apple.com>
1780
1781         Web Inspector: Audit: attempt to re-link DOM nodes for imported results
1782         https://bugs.webkit.org/show_bug.cgi?id=191044
1783         <rdar://problem/45687364>
1784
1785         Reviewed by Brian Burg.
1786
1787         When importing a `WI.AuditTestCaseResult`, attempt to `querySelector` for each item in
1788         `data.domNodes`. If a node is found, replace it with that node and show a tree instead.
1789
1790         * UserInterface/Models/AuditTestCase.js:
1791         (WI.AuditTestCase.async fromPayload): Added.
1792         (WI.AuditTestCase.fromPayload): Deleted.
1793
1794         * UserInterface/Models/AuditTestGroup.js:
1795         (WI.AuditTestGroup.async fromPayload): Added.
1796         (WI.AuditTestGroup.fromPayload): Deleted.
1797
1798         * UserInterface/Models/AuditTestCaseResult.js:
1799         (WI.AuditTestCaseResult.async fromPayload): Added.
1800         (WI.AuditTestCaseResult.fromPayload): Deleted.
1801
1802         * UserInterface/Models/AuditTestGroupResult.js:
1803         (WI.AuditTestGroupResult.async fromPayload): Added.
1804         (WI.AuditTestGroupResult.fromPayload): Deleted.
1805
1806         * UserInterface/Controllers/AuditManager.js:
1807         (WI.AuditManager.prototype.import):
1808
1809 2018-10-31  Joseph Pecoraro  <pecoraro@apple.com>
1810
1811         Follow-up review comment to r237652.
1812
1813         Reviewed by Brian Burg.
1814
1815         * UserInterface/Controllers/DebuggerManager.js:
1816         (WI.DebuggerManager):
1817
1818 2018-10-31  Joseph Pecoraro  <pecoraro@apple.com>
1819
1820         Web Inspector: Separate target initialization from frontend initialization
1821         https://bugs.webkit.org/show_bug.cgi?id=191052
1822         <rdar://problem/45658384>
1823
1824         Reviewed by Brian Burg.
1825
1826         * UserInterface/Base/Main.js:
1827         (WI.loaded):
1828         (WI.performOneTimeFrontendInitializationsUsingTarget):
1829         Create the targets after the rest of frontend initialization. This is a step
1830         toward a frontend opening and being told about multiple targets instead of
1831         knowing in advance a single target it is connected to. All backend
1832         messages during frontend initialization now happen with an explicit target.
1833
1834         * UserInterface/Controllers/ApplicationCacheManager.js:
1835         (WI.ApplicationCacheManager):
1836         (WI.ApplicationCacheManager.prototype.initializeTarget):
1837         (WI.ApplicationCacheManager.prototype.initialize):
1838         * UserInterface/Controllers/CSSManager.js:
1839         (WI.CSSManager):
1840         (WI.CSSManager.prototype.initializeTarget):
1841         * UserInterface/Controllers/CanvasManager.js:
1842         (WI.CanvasManager):
1843         (WI.CanvasManager.prototype.initializeTarget):
1844         * UserInterface/Controllers/ConsoleManager.js:
1845         (WI.ConsoleManager):
1846         (WI.ConsoleManager.prototype.initializeLogChannels):
1847         * UserInterface/Controllers/DOMManager.js:
1848         (WI.DOMManager):
1849         (WI.DOMManager.prototype.initializeTarget):
1850         * UserInterface/Controllers/DOMStorageManager.js:
1851         (WI.DOMStorageManager):
1852         (WI.DOMStorageManager.prototype.initializeTarget):
1853         * UserInterface/Controllers/DatabaseManager.js:
1854         (WI.DatabaseManager):
1855         (WI.DatabaseManager.prototype.initializeTarget):
1856         * UserInterface/Controllers/DebuggerManager.js:
1857         (WI.DebuggerManager):
1858         (WI.DebuggerManager.prototype.initializeTarget):
1859         (WI.DebuggerManager.restoreBreakpointsSoon): Deleted.
1860         * UserInterface/Controllers/HeapManager.js:
1861         (WI.HeapManager.prototype.initializeTarget):
1862         * UserInterface/Controllers/IndexedDBManager.js:
1863         (WI.IndexedDBManager):
1864         (WI.IndexedDBManager.prototype.initializeTarget):
1865         * UserInterface/Controllers/LayerTreeManager.js:
1866         (WI.LayerTreeManager.prototype.initializeTarget):
1867         * UserInterface/Controllers/MemoryManager.js:
1868         (WI.MemoryManager.prototype.initializeTarget):
1869         * UserInterface/Controllers/NetworkManager.js:
1870         (WI.NetworkManager):
1871         (WI.NetworkManager.prototype.initializeTarget):
1872         * UserInterface/Controllers/RuntimeManager.js:
1873         (WI.RuntimeManager):
1874         (WI.RuntimeManager.prototype.initializeTarget):
1875         * UserInterface/Controllers/TargetManager.js:
1876         (WI.TargetManager):
1877         (WI.TargetManager.prototype.initializeTargetsWithMainTarget):
1878         * UserInterface/Controllers/TimelineManager.js:
1879         (WI.TimelineManager):
1880         (WI.TimelineManager.prototype.initializeTarget):
1881         (WI.TimelineManager.prototype.set enabledTimelineTypes):
1882         (WI.TimelineManager.prototype._updateAutoCaptureInstruments):
1883         * UserInterface/Controllers/WorkerManager.js:
1884         (WI.WorkerManager):
1885         (WI.WorkerManager.prototype.initializeTarget):
1886         Move Target initialization out of the constructor into a top level
1887         `initializeTarget` function. This will be expected to be called
1888         by any target that the frontend connects to.
1889
1890         (WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange):
1891         Drive-by fix. Update all targets if the setting changes.
1892
1893         (WI.WorkerManager.prototype.workerCreated):
1894         Call initialize on the new target.
1895
1896         * UserInterface/Models/CSSCompletions.js:
1897         (WI.CSSCompletions.initializeCSSCompletions):
1898         (WI.CSSCompletions.requestCSSCompletions): Deleted.
1899         Rename requestCSSCompletions to initializeCSSCompletions to try
1900         and standardize on "initialize" being used for most frontend one
1901         time initialization tasks. This being one such operation that
1902         only needs to be performed once on a target that supports it.
1903
1904         * UserInterface/Protocol/Target.js:
1905         (WI.Target):
1906         (WI.Target.prototype.initialize):
1907         Perform explicit target initialization, such as initializing
1908         the state of all backend domains / agents. This is done by asking
1909         each of the managers to do initialization work for this target.
1910
1911         (WI.Target.prototype.get ApplicationCacheAgent):
1912         (WI.Target.prototype.get CSSAgent):
1913         (WI.Target.prototype.get CanvasAgent):
1914         (WI.Target.prototype.get ConsoleAgent):
1915         (WI.Target.prototype.get DOMAgent):
1916         (WI.Target.prototype.get DOMDebuggerAgent):
1917         (WI.Target.prototype.get DOMStorageAgent):
1918         (WI.Target.prototype.get DatabaseAgent):
1919         (WI.Target.prototype.get DebuggerAgent):
1920         (WI.Target.prototype.get HeapAgent):
1921         (WI.Target.prototype.get IndexedDBAgent):
1922         (WI.Target.prototype.get InspectorAgent):
1923         (WI.Target.prototype.get LayerTreeAgent):
1924         (WI.Target.prototype.get MemoryAgent):
1925         (WI.Target.prototype.get NetworkAgent):
1926         (WI.Target.prototype.get PageAgent):
1927         (WI.Target.prototype.get RecordingAgent):
1928         (WI.Target.prototype.get RuntimeAgent):
1929         (WI.Target.prototype.get ScriptProfilerAgent):
1930         (WI.Target.prototype.get ServiceWorkerAgent):
1931         (WI.Target.prototype.get TargetAgent):
1932         (WI.Target.prototype.get TimelineAgent):
1933         (WI.Target.prototype.get WorkerAgent):
1934         Accessors for all of the agents on a Target.
1935
1936         * UserInterface/Protocol/WorkerTarget.js:
1937         (WI.WorkerTarget):
1938         This is now automatically done in the base class.
1939
1940         * UserInterface/Test/Test.js:
1941         (WI.loaded):
1942         (WI.performOneTimeFrontendInitializationsUsingTarget):
1943         New necessary top level hooks, and initialize more like Main.js.
1944
1945 2018-10-31  Devin Rousso  <drousso@apple.com>
1946
1947         Web Inspector: Audit: show metadata for results
1948         https://bugs.webkit.org/show_bug.cgi?id=190853
1949         <rdar://problem/45527623>
1950
1951         Reviewed by Brian Burg.
1952
1953         * UserInterface/Models/AuditTestCase.js:
1954         (WI.AuditTestCase.prototype.async run):
1955         Capture timestamps around the `RunetimeAgent.evaluate` call, as well as the URL of the page.
1956
1957         * UserInterface/Models/AuditTestCaseResult.js:
1958         (WI.AuditTestCaseResult):
1959         (WI.AuditTestCaseResult.fromPayload):
1960         (WI.AuditTestCaseResult.prototype.get metadata): Added.
1961         (WI.AuditTestCaseResult.prototype.toJSON):
1962
1963         * UserInterface/Views/AuditTestCaseContentView.js:
1964         (WI.AuditTestCaseContentView.prototype.initialLayout):
1965         (WI.AuditTestCaseContentView.prototype.layout):
1966         * UserInterface/Views/AuditTestCaseContentView.css:
1967         (.content-view.audit-test-case > header h1): Added.
1968         (.content-view.audit-test-case > header h1 > img): Added.
1969         (.content-view.audit-test-case > header > .metadata): Added.
1970         (.content-view.audit-test-case > header > .metadata > .source > time): Added.
1971         (.content-view.audit-test-case > header > .metadata > .source > a): Added.
1972         (.content-view.audit-test-case > header > .metadata > .duration): Added.
1973         (.content-view.audit-test-case > header > h1): Deleted.
1974         (.content-view.audit-test-case > header > h1 > img): Deleted.
1975         Display any metadata information where the `WI.ScopeBar` is for `WI.AuditTestGroupContentView`s.
1976
1977         * UserInterface/Views/AuditTestContentView.css:
1978         (.content-view.audit-test > header):
1979         (.content-view.audit-test > header > .information): Added.
1980         * UserInterface/Views/AuditTestGroupContentView.css:
1981         (.content-view.audit-test-group > header):
1982         (.content-view.audit-test-group > header > .percentage-pass):
1983         (.content-view.audit-test-group > header > .information): Deleted.
1984         Move common CSS rules to common parent class.
1985
1986         * UserInterface/Base/Utilities.js:
1987
1988 2018-10-30  Devin Rousso  <drousso@apple.com>
1989
1990         Web Inspector: Audit: create Audit Tab
1991         https://bugs.webkit.org/show_bug.cgi?id=190754
1992
1993         Reviewed by Matt Baker.
1994
1995         Create an Audit tab for running audits on the inspected page. Leverage `Runtime.evaluate`
1996         for running the audit tests (arbitrary JavaScript), and use the returned value to generate
1997         a preview UI of the results. All tests/results can be exported/imported to formatted JSON:
1998
1999         `AuditTestCase` JSON:
2000             {
2001                 "type": "test-case",
2002                 "name": <string>,
2003                 <optional> "description": <string>,
2004                 "test": <stringified JavaScript function>,
2005             }
2006
2007         `AuditTestGroup` JSON:
2008             {
2009                 "type": "test-group",
2010                 "name": <string>,
2011                 <optional> "description": <string>,
2012                 "tests": [...<AuditTestCase, AuditTestGroup>],
2013             }
2014
2015         `AuditTestCaseResult` JSON:
2016             {
2017                 "type": "test-case-result",
2018                 "name": <string>,
2019                 <optional> "description": <string>,
2020                 "level": <"pass", "warn", "fail", "error", "unsupported">,
2021                 "data": {
2022                     "domNodes": [...<stringified CSS path>],
2023                     "domAttributes": [...<string>],
2024                     "errors": [...<string>],
2025                 },
2026             }
2027
2028         `AuditTestGroupResult` JSON:
2029             {
2030                 "type": "test-group-result",
2031                 "name": <string>,
2032                 <optional> "description": <string>,
2033                 "results": [...<AuditTestCaseResult, AuditTestGroupResult>],
2034             }
2035
2036         More keys may be added in the future (especially for `AuditTestCaseResult.data`).
2037
2038         * UserInterface/Controllers/AuditManager.js:
2039         (WI.AuditManager):
2040         (WI.AuditManager.synthesizeError): Added.
2041         (WI.AuditManager.prototype.get tests): Added.
2042         (WI.AuditManager.prototype.get results): Added.
2043         (WI.AuditManager.prototype.get runningState): Added.
2044         (WI.AuditManager.prototype.start): Added.
2045         (WI.AuditManager.prototype.stop): Added.
2046         (WI.AuditManager.prototype.import): Added.
2047         (WI.AuditManager.prototype.export): Added.
2048         (WI.AuditManager.prototype._addTest): Added.
2049         (WI.AuditManager.prototype._addResult): Added.
2050         (WI.AuditManager.prototype.get testSuites): Deleted.
2051         (WI.AuditManager.prototype.get reports): Deleted.
2052         (WI.AuditManager.prototype.async runAuditTestByRepresentedObject): Deleted.
2053         (WI.AuditManager.prototype.reportForId): Deleted.
2054         (WI.AuditManager.prototype.removeAllReports): Deleted.
2055         (WI.AuditManager.prototype.async _runTestCase): Deleted.
2056
2057         * UserInterface/Models/AuditTestBase.js: Added.
2058         (WI.AuditTestBases):
2059         (WI.AuditTestBases.prototype.get name):
2060         (WI.AuditTestBases.prototype.get description):
2061         (WI.AuditTestBases.prototype.get runningState):
2062         (WI.AuditTestBases.prototype.get result):
2063         (WI.AuditTestBases.prototype.async start):
2064         (WI.AuditTestBases.prototype.stop):
2065         (WI.AuditTestBases.prototype.clearResult):
2066         (WI.AuditTestBases.prototype.saveIdentityToCookie):
2067         (WI.AuditTestBases.prototype.toJSON):
2068         (WI.AuditTestBases.prototype.async run):
2069
2070         * UserInterface/Models/AuditTestCase.js:
2071         (WI.AuditTestCase):
2072         (WI.AuditTestCase.fromPayload): Added.
2073         (WI.AuditTestCase.prototype.toJSON): Added.
2074         (WI.AuditTestCase.prototype.async run): Added.
2075         (WI.AuditTestCase.prototype.async run.setLevel): Added.
2076         (WI.AuditTestCase.prototype.async run.addError): Added.
2077         (WI.AuditTestCase.prototype.async run.checkResultProperty.addErrorForValueType): Added.
2078         (WI.AuditTestCase.prototype.async run.checkResultProperty): Added.
2079         (WI.AuditTestCase.prototype.async run.async resultArrayForEach): Added.
2080         (WI.AuditTestCase.prototype.get id): Deleted.
2081         (WI.AuditTestCase.prototype.get name): Deleted.
2082         (WI.AuditTestCase.prototype.get suite): Deleted.
2083         (WI.AuditTestCase.prototype.get setup): Deleted.
2084         (WI.AuditTestCase.prototype.get tearDown): Deleted.
2085         (WI.AuditTestCase.prototype.get errorDetails): Deleted.
2086
2087         * UserInterface/Models/AuditTestGroup.js: Added.
2088         (WI.AuditTestGroup):
2089         (WI.AuditTestGroup.fromPayload):
2090         (WI.AuditTestGroup.prototype.get tests):
2091         (WI.AuditTestGroup.prototype.stop):
2092         (WI.AuditTestGroup.prototype.clearResult):
2093         (WI.AuditTestGroup.prototype.async run):
2094         (WI.AuditTestGroup.prototype.toJSON):
2095         (WI.AuditTestGroup.prototype._updateResult):
2096         (WI.AuditTestGroup.prototype._handleTestCompleted):
2097         (WI.AuditTestGroup.prototype._handleTestProgress):
2098
2099         * UserInterface/Models/AuditTestResultBase.js: Added.
2100         (WI.AuditTestResultBase):
2101         (WI.AuditTestResultBase.prototype.get name):
2102         (WI.AuditTestResultBase.prototype.get description):
2103         (WI.AuditTestResultBase.prototype.get result):
2104         (WI.AuditTestResultBase.prototype.get didPass):
2105         (WI.AuditTestResultBase.prototype.get didWarn):
2106         (WI.AuditTestResultBase.prototype.get didFail):
2107         (WI.AuditTestResultBase.prototype.get didError):
2108         (WI.AuditTestResultBase.prototype.get unsupported):
2109         (WI.AuditTestResultBase.prototype.saveIdentityToCookie):
2110         (WI.AuditTestResultBase.prototype.toJSON):
2111
2112         * UserInterface/Models/AuditTestCaseResult.js: Added.
2113         (WI.AuditTestCaseResult):
2114         (WI.AuditTestCaseResult.fromPayload.checkArray):
2115         (WI.AuditTestCaseResult.fromPayload):
2116         (WI.AuditTestCaseResult.prototype.get level):
2117         (WI.AuditTestCaseResult.prototype.get data):
2118         (WI.AuditTestCaseResult.prototype.get didPass):
2119         (WI.AuditTestCaseResult.prototype.get didWarn):
2120         (WI.AuditTestCaseResult.prototype.get didFail):
2121         (WI.AuditTestCaseResult.prototype.get didError):
2122         (WI.AuditTestCaseResult.prototype.get unsupported):
2123         (WI.AuditTestCaseResult.prototype.toJSON):
2124
2125         * UserInterface/Models/AuditTestGroupResult.js: Added.
2126         (WI.AuditTestGroupResult):
2127         (WI.AuditTestGroupResult.fromPayload):
2128         (WI.AuditTestGroupResult.prototype.get results):
2129         (WI.AuditTestGroupResult.prototype.get levelCounts):
2130         (WI.AuditTestGroupResult.prototype.get didPass):
2131         (WI.AuditTestGroupResult.prototype.get didWarn):
2132         (WI.AuditTestGroupResult.prototype.get didFail):
2133         (WI.AuditTestGroupResult.prototype.get didError):
2134         (WI.AuditTestGroupResult.prototype.get unsupported):
2135         (WI.AuditTestGroupResult.prototype.toJSON):
2136
2137         * UserInterface/Views/AuditTabContentView.js: Added.
2138         (WI.AuditTabContentView):
2139         (WI.AuditTabContentView.tabInfo):
2140         (WI.AuditTabContentView.isTabAllowed):
2141         (WI.AuditTabContentView.prototype.get type):
2142         (WI.AuditTabContentView.prototype.get supportsSplitContentBrowser):
2143         (WI.AuditTabContentView.prototype.canShowRepresentedObject):
2144         (WI.AuditTabContentView.prototype.shown):
2145         (WI.AuditTabContentView.prototype.hidden):
2146         (WI.AuditTabContentView.prototype._handleSpace):
2147
2148         * UserInterface/Views/AuditNavigationSidebarPanel.js: Added.
2149         (WI.AuditNavigationSidebarPanel):
2150         (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
2151         (WI.AuditNavigationSidebarPanel.prototype.initialLayout):
2152         (WI.AuditNavigationSidebarPanel.prototype.closed):
2153         (WI.AuditNavigationSidebarPanel.prototype._addTest):
2154         (WI.AuditNavigationSidebarPanel.prototype._addResult):
2155         (WI.AuditNavigationSidebarPanel.prototype._updateStartStopButtonNavigationItemState):
2156         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestAdded):
2157         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestCompleted):
2158         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestScheduled):
2159         (WI.AuditNavigationSidebarPanel.prototype._treeSelectionDidChange):
2160         (WI.AuditNavigationSidebarPanel.prototype._handleStartStopButtonNavigationItemClicked):
2161         (WI.AuditNavigationSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
2162         * UserInterface/Views/AuditNavigationSidebarPanel.css: Added.
2163         (.sidebar > .panel.navigation.audit > .content):
2164
2165         * UserInterface/Views/AuditTreeElement.js: Added.
2166         (WI.AuditTreeElement):
2167         (WI.AuditTreeElement.prototype.get result):
2168         (WI.AuditTreeElement.prototype.onattach):
2169         (WI.AuditTreeElement.prototype.ondetach):
2170         (WI.AuditTreeElement.prototype.onpopulate):
2171         (WI.AuditTreeElement.prototype.populateContextMenu):
2172         (WI.AuditTreeElement.prototype._start):
2173         (WI.AuditTreeElement.prototype._updateLevel):
2174         (WI.AuditTreeElement.prototype._showRunningSpinner):
2175         (WI.AuditTreeElement.prototype._showRunningProgress):
2176         (WI.AuditTreeElement.prototype._handleTestCaseCompleted):
2177         (WI.AuditTreeElement.prototype._handleTestResultCleared):
2178         (WI.AuditTreeElement.prototype._handleTestCaseScheduled):
2179         (WI.AuditTreeElement.prototype._handleTestGroupCompleted):
2180         (WI.AuditTreeElement.prototype._handleTestGroupProgress):
2181         (WI.AuditTreeElement.prototype._handleTestGroupScheduled):
2182         (WI.AuditTreeElement.prototype._handleStatusClick):
2183         * UserInterface/Views/AuditTreeElement.css: Added.
2184         (.tree-outline .item.audit > .status):
2185         (.tree-outline .item.audit > .status > img):
2186         (.tree-outline .item.audit:matches(.test-case, .test-group) > .status:hover > img):
2187         (.tree-outline .item.audit > .status:not(:hover) > img.show-on-hover, .tree-outline .item.audit.test-group.expanded > .status:not(:hover)):
2188         (.tree-outline .item.audit.test-group.expanded > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status):
2189         (.tree-outline .item.audit > .status > img.pass):
2190         (.tree-outline .item.audit > .status > img.warn):
2191         (.tree-outline .item.audit > .status > img.fail):
2192         (.tree-outline .item.audit > .status > img.error):
2193         (.tree-outline .item.audit > .status > img.unsupported):
2194         (.audit.test-case .icon):
2195         (.audit.test-group .icon):
2196         (.audit.test-case-result .icon):
2197         (.audit.test-group-result .icon):
2198
2199         * UserInterface/Views/AuditTestContentView.js: Added.
2200         (WI.AuditTestContentView):
2201         (WI.AuditTestContentView.prototype.get navigationItems):
2202         (WI.AuditTestContentView.prototype.get headerView):
2203         (WI.AuditTestContentView.prototype.get contentView):
2204         (WI.AuditTestContentView.prototype.get supportsSave):
2205         (WI.AuditTestContentView.prototype.get saveData):
2206         (WI.AuditTestContentView.prototype.initialLayout):
2207         (WI.AuditTestContentView.prototype.layout):
2208         (WI.AuditTestContentView.prototype.shown):
2209         (WI.AuditTestContentView.prototype.hidden):
2210         (WI.AuditTestContentView.prototype.get placeholderElement):
2211         (WI.AuditTestContentView.prototype.set placeholderElement):
2212         (WI.AuditTestContentView.prototype.showRunningPlaceholder):
2213         (WI.AuditTestContentView.prototype.showStoppingPlaceholder):
2214         (WI.AuditTestContentView.prototype.showNoResultPlaceholder):
2215         (WI.AuditTestContentView.prototype.showNoResultDataPlaceholder):
2216         (WI.AuditTestContentView.prototype.showFilteredPlaceholder):
2217         (WI.AuditTestContentView.prototype.hidePlaceholder):
2218         (WI.AuditTestContentView.prototype.applyFilter):
2219         (WI.AuditTestContentView.prototype.resetFilter):
2220         (WI.AuditTestContentView.prototype._exportAudit):
2221         (WI.AuditTestContentView.prototype._updateExportButtonNavigationItemState):
2222         (WI.AuditTestContentView.prototype._showPlaceholder):
2223         (WI.AuditTestContentView.prototype._handleExportButtonNavigationItemClicked):
2224         (WI.AuditTestContentView.prototype._handleTestChanged):
2225         * UserInterface/Views/AuditTestContentView.css: Added.
2226         (.content-view-container > .content-view.audit-test):
2227         (.content-view-container > .content-view.audit-test > header):
2228         (.content-view-container > .content-view.audit-test > header h1):
2229         (.content-view-container > .content-view.audit-test > header p):
2230         (.content-view.audit-test):
2231         (.content-view.audit-test h1):
2232         (.content-view.audit-test > header):
2233         (.content-view.audit-test > header p):
2234         (.content-view.audit-test .audit-test.filtered, .content-view.audit-test .audit-test .message-text-view):
2235         (.content-view.audit-test > section):
2236         (.content-view.audit-test > section > .message-text-view):
2237         (.content-view.audit-test.showing-placeholder):
2238         (.content-view.audit-test.showing-placeholder > section):
2239         (.content-view.audit-test.showing-placeholder > section > :not(.message-text-view)):
2240         (@media (prefers-dark-interface) .content-view.audit-test):
2241
2242         * UserInterface/Views/AuditTestCaseContentView.js: Added.
2243         (WI.AuditTestCaseContentView):
2244         (WI.AuditTestCaseContentView.prototype.initialLayout):
2245         (WI.AuditTestCaseContentView.prototype.layout):
2246         (WI.AuditTestCaseContentView.prototype.showRunningPlaceholder):
2247         * UserInterface/Views/AuditTestCaseContentView.css: Added.
2248         (.content-view-container > .content-view.audit-test-case > header):
2249         (.content-view-container > .content-view.audit-test-case > section > :not(.message-text-view):first-child):
2250         (.content-view.audit-test-case > header > h1):
2251         (.content-view.audit-test-case > header > h1 > img):
2252         (.content-view.audit-test-case > section > :not(.message-text-view)):
2253         (.content-view.audit-test-case > section > :not(.message-text-view):last-child):
2254         (.content-view.audit-test-case > section > :not(.message-text-view) + :not(.message-text-view)):
2255         (.content-view.audit-test-case > section h1):
2256         (.content-view.audit-test-case > section table):
2257         (.content-view.audit-test-case > section table > tr + tr > td):
2258         (.content-view.audit-test-case > section table > tr > td > :not(.tree-outline)):
2259         (.content-view.audit-test-case > section table > tr > td:first-child):
2260         (.content-view.audit-test-case > section > .dom-nodes > table > tr > td:first-child):
2261         (.content-view.audit-test-case > section code):
2262         (.content-view.audit-test-case > section mark):
2263
2264         * UserInterface/Views/AuditTestGroupContentView.js: Added.
2265         (WI.AuditTestGroupContentView):
2266         (WI.AuditTestGroupContentView.prototype.initialLayout):
2267         (WI.AuditTestGroupContentView.prototype.layout):
2268         (WI.AuditTestGroupContentView.prototype.shown):
2269         (WI.AuditTestGroupContentView.prototype.hidden):
2270         (WI.AuditTestGroupContentView.prototype.applyFilter):
2271         (WI.AuditTestGroupContentView.prototype.resetFilter):
2272         (WI.AuditTestGroupContentView.prototype.showRunningPlaceholder):
2273         (WI.AuditTestGroupContentView.prototype._subobjects):
2274         (WI.AuditTestGroupContentView.prototype._updateLevelScopeBar):
2275         (WI.AuditTestGroupContentView.prototype._handleTestGroupCompleted):
2276         (WI.AuditTestGroupContentView.prototype._handleTestGroupProgress):
2277         (WI.AuditTestGroupContentView.prototype._handleTestGroupScheduled):
2278         (WI.AuditTestGroupContentView.prototype._handleLevelScopeBarSelectionChanged):
2279         * UserInterface/Views/AuditTestGroupContentView.css: Added.
2280         (.content-view-container > .content-view.audit-test-group > header):
2281         (.content-view.audit-test-group > header):
2282         (.content-view.audit-test-group.no-matches + .audit-test-group > header):
2283         (.content-view.audit-test-group > header, .content-view.audit-test-group:not(.filtered):last-child > header):
2284         (.content-view.audit-test-group.contains-test-case > header):
2285         (.content-view.audit-test-group.contains-test-case + .audit-test-group.contains-test-case):
2286         (.content-view.audit-test-group.contains-test-case:not(.contains-test-group) > section, .content-view.audit-test-group.contains-test-case.contains-test-group > section > .audit-test-case):
2287         (.content-view.audit-test-group > header > .information):
2288         (.content-view.audit-test-group > header > .information > p):
2289         (.content-view.audit-test-group > header > nav):
2290         (.content-view.audit-test-group > header > nav:empty):
2291         (.content-view.audit-test-group > header > nav:not(:empty):before):
2292         (.content-view.audit-test-group > header > nav > .scope-bar > li):
2293         (.content-view.audit-test-group > header > nav > .scope-bar > li:not(:hover, .selected)):
2294         (.content-view.audit-test-group > header > nav > .scope-bar > li:last-child):
2295         (.content-view.audit-test-group > header > nav > .scope-bar > li::before):
2296         (.content-view.audit-test-group > header > nav > .scope-bar > li.pass::before):
2297         (.content-view.audit-test-group > header > nav > .scope-bar > li.warn::before):
2298         (.content-view.audit-test-group > header > nav > .scope-bar > li.fail::before):
2299         (.content-view.audit-test-group > header > nav > .scope-bar > li.error::before):
2300         (.content-view.audit-test-group > header > nav > .scope-bar > li.unsupported::before):
2301         (.content-view.audit-test-group > header > .percentage-pass):
2302         (.content-view.audit-test-group > header > .percentage-pass:not(:empty)::after):
2303         (.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):
2304         (.content-view.audit-test-group > section > .audit-test-case:last-child):
2305
2306         * UserInterface/Views/ScopeBarItem.js:
2307         (WI.ScopeBarItem):
2308         (WI.ScopeBarItem.prototype.set selected):
2309         * UserInterface/Views/MultipleScopeBarItem.js:
2310         (WI.MultipleScopeBarItem.prototype.set selectedScopeBarItem):
2311         Add an `independent` option that prevents selection changes from deselecting other
2312         `WI.ScopeBarItem`s in the same `WI.ScopeBar` (`exclusive` takes precedence).
2313
2314         * UserInterface/Views/DOMTreeElement.js:
2315         (WI.DOMTreeElement):
2316         (WI.DOMTreeElement.prototype.highlightAttribute):
2317         (WI.DOMTreeElement.prototype._buildAttributeDOM):
2318         * UserInterface/Views/DOMTreeOutline.css:
2319         (.tree-outline.dom li .highlight):
2320
2321         * UserInterface/Views/ToggleButtonNavigationItem.js:
2322         (WI.ToggleButtonNavigationItem.prototype.set toggled):
2323         Also change the `label` if the `ButtonStyle` has text.
2324
2325         * UserInterface/Base/Setting.js:
2326         * UserInterface/Views/SettingsTabContentView.js:
2327         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2328
2329         * UserInterface/Views/DividerNavigationItem.css:
2330         (.navigation-bar .item.divider):
2331
2332         * UserInterface/Base/Utilities.js:
2333         (Promise.chain): Added.
2334
2335         * UserInterface/Views/ContentView.js:
2336         (WI.ContentView.createFromRepresentedObject):
2337         (WI.ContentView.isViewable):
2338
2339         * UserInterface/Main.html:
2340         * UserInterface/Base/Main.js:
2341         (WI.loaded):
2342         (WI.contentLoaded):
2343
2344         * UserInterface/Test.html:
2345         * UserInterface/Base/Test.js:
2346         (WI.loaded):
2347
2348         * UserInterface/Images/Audit.svg: Added.
2349         * UserInterface/Images/AuditStart.svg: Added.
2350         * UserInterface/Images/AuditStop.svg: Added.
2351         * UserInterface/Images/AuditTestCase.svg: Added.
2352         * UserInterface/Images/AuditTestCaseResult.svg: Added.
2353         * UserInterface/Images/AuditTestError.svg: Added.
2354         * UserInterface/Images/AuditTestFail.svg: Added.
2355         * UserInterface/Images/AuditTestGroup.svg: Added.
2356         * UserInterface/Images/AuditTestGroupResult.svg: Added.
2357         * UserInterface/Images/AuditTestNoResult.svg: Added.
2358         * UserInterface/Images/AuditTestPass.svg: Added.
2359         * UserInterface/Images/AuditTestUnsupported.svg: Added.
2360         * UserInterface/Images/AuditTestWarn.svg: Added.
2361
2362         * Localizations/en.lproj/localizedStrings.js:
2363
2364 2018-10-30  Devin Rousso  <drousso@apple.com>
2365
2366         Web Inspector: provide options to WI.cssPath for more verbosity
2367         https://bugs.webkit.org/show_bug.cgi?id=190987
2368
2369         Reviewed by Brian Burg.
2370
2371         * UserInterface/Base/DOMUtilities.js:
2372         (WI.cssPath):
2373         (WI.cssPathComponent):
2374         When the option `full` is true, print every attribute along with every node in the hierarchy
2375         until the root is reached. This partially duplicates the effect of an XPath, but instead
2376         uses CSS selectors, making it much more human readable and recognizable.
2377
2378 2018-10-30  Devin Rousso  <drousso@apple.com>
2379
2380         Web Inspector: change WI.ColorWheel to use conic-gradient()
2381         https://bugs.webkit.org/show_bug.cgi?id=189485
2382
2383         Reviewed by Brian Burg.
2384
2385         Use the ("new") HSL `WI.ColorPicker` if `conic-gradient` is supported. Otherwise, use the
2386         ("old") RGB `WI.LegacyColorPicker`.
2387
2388         * UserInterface/Views/ColorWheel.js:
2389         (WI.ColorWheel):
2390         (WI.ColorWheel.prototype.set dimension):
2391         (WI.ColorWheel.prototype.set brightness):
2392         (WI.ColorWheel.prototype.get tintedColor):
2393         (WI.ColorWheel.prototype.set tintedColor):
2394         (WI.ColorWheel.prototype.get rawColor):
2395         (WI.ColorWheel.prototype.get _hue): Added.
2396         (WI.ColorWheel.prototype.get _saturation): Added.
2397         (WI.ColorWheel.prototype._updateColorForMouseEvent):
2398         (WI.ColorWheel.prototype._setCrosshairPosition):
2399         (WI.ColorWheel.prototype._updateGradient): Added.
2400         (WI.ColorWheel.prototype._pointInCircleForEvent.distance): Deleted.
2401         (WI.ColorWheel.prototype._pointInCircleForEvent.angleFromCenterToPoint): Deleted.
2402         (WI.ColorWheel.prototype._pointInCircleForEvent.pointOnCircumference): Deleted.
2403         (WI.ColorWheel.prototype._pointInCircleForEvent): Deleted.
2404         (WI.ColorWheel.prototype._tintedColorToPointAndBrightness): Deleted.
2405         (WI.ColorWheel.prototype._drawRawCanvas): Deleted.
2406         (WI.ColorWheel.prototype._colorAtPointWithBrightness): Deleted.
2407         (WI.ColorWheel.prototype._drawTintedCanvas): Deleted.
2408         (WI.ColorWheel.prototype._draw): Deleted.
2409         * UserInterface/Views/ColorWheel.css:
2410         (.color-wheel > .gradient): Added.
2411         (.color-wheel > .crosshair): Added.
2412
2413         * UserInterface/Views/LegacyColorWheel.js: Copied from Source/WebInspectorUI/UserInterface/Views/ColorWheel.js.
2414
2415         * UserInterface/Views/ColorPicker.js:
2416         (WI.ColorPicker):
2417         (WI.ColorPicker.supportsConicGradient): Added.
2418         (WI.ColorPicker.prototype._updateSliders):
2419
2420         * UserInterface/Models/Geometry.js:
2421         (WI.Point.prototype.distance):
2422
2423         * UserInterface/Main.html:
2424
2425 2018-10-30  Devin Rousso  <drousso@apple.com>
2426
2427         Web Inspector: make the layers sidebar in the Elements tab always visible
2428         https://bugs.webkit.org/show_bug.cgi?id=190158
2429
2430         Reviewed by Brian Burg.
2431
2432         * UserInterface/Views/ElementsTabContentView.js:
2433         (WI.ElementsTabContentView):
2434         * UserInterface/Views/SearchTabContentView.js:
2435         (WI.SearchTabContentView):
2436
2437 2018-10-30  Devin Rousso  <drousso@apple.com>
2438
2439         Web Inspector: refactor WI.ScopeBarItem for better extensibility
2440         https://bugs.webkit.org/show_bug.cgi?id=190986
2441
2442         Reviewed by Brian Burg.
2443
2444         Renames `withModifier` to `extendSelection` for clarity of usage, and to allow the changes
2445         in <https://webkit.org/b/190754> (adding an option to allow `WI.ScopeBarItem`s to be
2446         selected without deselcting any other `WI.ScopeBarItem`s) to use the same variable.
2447
2448         * UserInterface/Views/ScopeBarItem.js:
2449         (WI.ScopeBarItem):
2450         (WI.ScopeBarItem.prototype.set selected):
2451         (WI.ScopeBarItem.prototype._handleMouseDown):
2452         (WI.ScopeBarItem.prototype.setSelected): Deleted.
2453
2454         * UserInterface/Views/ScopeBar.js:
2455         (WI.ScopeBar):
2456         (WI.ScopeBar.prototype._populate):
2457         (WI.ScopeBar.prototype._itemSelectionDidChange):
2458
2459         * UserInterface/Views/MultipleScopeBarItem.js:
2460         (WI.MultipleScopeBarItem.prototype.set selectedScopeBarItem):
2461
2462         * UserInterface/Views/CanvasSidebarPanel.js:
2463         (WI.CanvasSidebarPanel.prototype._updateRecordingScopeBar):
2464         * UserInterface/Views/LogContentView.js:
2465         (WI.LogContentView):
2466         * UserInterface/Views/NetworkTableContentView.js:
2467         (WI.NetworkTableContentView):
2468         * UserInterface/Views/ResourceSidebarPanel.js:
2469         (WI.ResourceSidebarPanel):
2470         * UserInterface/Views/StorageSidebarPanel.js:
2471         (WI.StorageSidebarPanel):
2472
2473 2018-10-29  Nikita Vasilyev  <nvasilyev@apple.com>
2474
2475         Web Inspector: Flash views with red outline on initial layout
2476         https://bugs.webkit.org/show_bug.cgi?id=191048
2477
2478         Reviewed by Devin Rousso.
2479
2480         * UserInterface/Views/View.js:
2481         (WI.View.prototype._layoutSubtree):
2482         (WI.View.prototype._drawLayoutFlashingOutline):
2483
2484 2018-10-29  Devin Rousso  <drousso@apple.com>
2485
2486         Web Inspector: Canvas: show warning when path moves offscreen
2487         https://bugs.webkit.org/show_bug.cgi?id=191016
2488
2489         Reviewed by Joseph Pecoraro.
2490
2491         * UserInterface/Models/RecordingAction.js:
2492         (WI.RecordingAction):
2493         (WI.RecordingAction.deriveCurrentState):
2494         (WI.RecordingAction.prototype.get isVisual):
2495         (WI.RecordingAction.prototype.get warning): Added.
2496         (WI.RecordingAction.prototype.process.checkInvalidCurrentAxisPoint): Added.
2497         (WI.RecordingAction.prototype.process):
2498         (WI.RecordingAction.prototype.get hasVisibleEffect): Deleted.
2499         Replace `hasVisibleEffect` with a more general `warning` value, so that it can be used for
2500         more types of warnings.
2501
2502         * UserInterface/Views/RecordingActionTreeElement.js:
2503         (WI.RecordingActionTreeElement.prototype.onattach):
2504         * UserInterface/Views/RecordingActionTreeElement.css:
2505         (.item.action.visual.warning:not(.invalid) > .status > .warning): Added.
2506         (.item.action.visual.no-visible-effect:not(.invalid) > .status > .warning): Deleted.
2507
2508         * Localizations/en.lproj/localizedStrings.js:
2509
2510 2018-10-29  Devin Rousso  <drousso@apple.com>
2511
2512         Web Inspector: refactor code for getting properties via WI.RemoteObject
2513         https://bugs.webkit.org/show_bug.cgi?id=190989
2514
2515         Reviewed by Matt Baker.
2516
2517         * UserInterface/Protocol/RemoteObject.js:
2518         (WI.RemoteObject.prototype.getPropertyDescriptors): Added.
2519         (WI.RemoteObject.prototype.getPropertyDescriptorsAsObject): Added.
2520         (WI.RemoteObject.prototype.getOwnPropertyDescriptors): Deleted.
2521         (WI.RemoteObject.prototype.getAllPropertyDescriptors): Deleted.
2522         (WI.RemoteObject.prototype._getPropertyDescriptors): Deleted.
2523         (WI.RemoteObject.prototype.getOwnPropertyDescriptorsAsObject): Deleted.
2524
2525         * UserInterface/Views/ErrorObjectView.js:
2526         (WI.ErrorObjectView.prototype.update):
2527         * UserInterface/Views/ObjectTreePropertyTreeElement.js:
2528         (WI.ObjectTreePropertyTreeElement.prototype._updateChildren):
2529         * UserInterface/Views/ObjectTreeView.js:
2530         (WI.ObjectTreeView.prototype.update):
2531
2532 2018-10-29  Tim Horton  <timothy_horton@apple.com>
2533
2534         Modernize WebKit nibs and lprojs for localization's sake
2535         https://bugs.webkit.org/show_bug.cgi?id=190911
2536         <rdar://problem/45349466>
2537
2538         Reviewed by Dan Bernstein.
2539
2540         * WebInspectorUI.xcodeproj/project.pbxproj:
2541         English->en
2542
2543 2018-10-29  Devin Rousso  <drousso@apple.com>
2544
2545         Web Inspector: prevent Canvas tab from listening for "space" when not visibile
2546         https://bugs.webkit.org/show_bug.cgi?id=190988
2547
2548         Reviewed by Joseph Pecoraro.
2549
2550         * UserInterface/Views/CanvasTabContentView.js:
2551         (WI.CanvasTabContentView):
2552         (WI.CanvasTabContentView.prototype.shown):
2553         (WI.CanvasTabContentView.prototype.hidden): Added.
2554
2555 2018-10-27  Matt Baker  <mattbaker@apple.com>
2556
2557         Web Inspector: Table should support deleting rows
2558         https://bugs.webkit.org/show_bug.cgi?id=189803
2559         <rdar://problem/44655709>
2560
2561         Reviewed by Devin Rousso.
2562
2563         Add methods for removing rows from a Table without reloading the data
2564         source. This patch adds Table.prototype.removeRow for removing a single
2565         row, and Table.prototype.removeSelectedRows for removing the entire selection.
2566         The latter also attempts to select a new row, if possible, before removing
2567         the selection.
2568
2569         * UserInterface/Base/IndexSet.js:
2570         (WI.IndexSet.prototype.copy):
2571
2572         * UserInterface/Views/Table.js:
2573         (WI.Table):
2574         (WI.Table.prototype.get numberOfRows):
2575         Cache the number of rows in the table data source. Invalidate cached
2576         value whenever table data is reloaded. Removing rows immediately updates
2577         cached value, without incurring a potentially expensive reload.
2578
2579         (WI.Table.prototype.reloadData):
2580         (WI.Table.prototype.selectRow):
2581         (WI.Table.prototype.deselectRow):
2582         (WI.Table.prototype.removeRow):
2583         (WI.Table.prototype.removeSelectedRows):
2584         Remove the selected rows and select a new row, if possible.
2585         (WI.Table.prototype._updateVisibleRows):
2586         (WI.Table.prototype._handleKeyDown):
2587         (WI.Table.prototype._deselectAllAndSelect):
2588         Drive-by fix: should work when `rowToSelect` isn't already selected.
2589         (WI.Table.prototype._removeRows):
2590         Remove rows and adjust the indexes of rows that are shifted up as a result
2591         of preceding rows being removed.
2592
2593 2018-10-26  Devin Rousso  <drousso@apple.com>
2594
2595         Web Inspector: simplify some editing code checks
2596         https://bugs.webkit.org/show_bug.cgi?id=190970
2597
2598         Reviewed by Joseph Pecoraro.
2599
2600         * UserInterface/Base/Main.js:
2601         (WI._focusChanged):
2602
2603         * UserInterface/Base/Utilities.js:
2604
2605         * UserInterface/Views/EditingSupport.js:
2606         (WI.enclosingCodeMirror): Added.
2607         (WI.isBeingEdited):
2608         (WI.isEventTargetAnEditableField):
2609
2610         * UserInterface/Views/QuickConsole.js:
2611         (WI.QuickConsole):
2612
2613 2018-10-26  Devin Rousso  <drousso@apple.com>
2614
2615         Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'this._classListContainer.children')
2616         https://bugs.webkit.org/show_bug.cgi?id=190966
2617
2618         Reviewed by Joseph Pecoraro.
2619
2620         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
2621         (WI.GeneralStyleDetailsSidebarPanel.prototype.layout):
2622         (WI.GeneralStyleDetailsSidebarPanel.prototype._classToggleButtonClicked):
2623         (WI.GeneralStyleDetailsSidebarPanel.prototype._populateClassToggles):
2624         Don't try to reload the class toggles if the we haven't `layout` yet, as the element won't
2625         yet exist.
2626
2627 2018-10-25  Devin Rousso  <drousso@apple.com>
2628
2629         Web Inspector: Canvas Recording loading goes significantly slower when "Frame" tree element is expanded
2630         https://bugs.webkit.org/show_bug.cgi?id=190497
2631
2632         Reviewed by Joseph Pecoraro.
2633
2634         Save the `WI.TreeElement` that are in the DOM, and compare that with any `WI.TreeElement`
2635         that would be added to the DOM. If all of the following are true, don't edit the DOM:
2636          - no focused `WI.TreeElement` that isn't currently visible (we would scroll otherwise)
2637          - the set of previously visible `WI.TreeElement`s (e.g. not used for scroll padding) has at
2638            least one of the `WI.TreeElement`s that would be added from this update
2639             - this means that the user hasn't scrolled beyond the padding `WI.TreeElement`
2640          - there are no `WI.TreeElement`s that would be added from this update that were NOT added
2641            in a previous update
2642             - this covers the case that a `WI.TreeElement` is inserted in the visible area
2643
2644         * UserInterface/Base/Utilities.js:
2645
2646         * UserInterface/Views/TreeOutline.js:
2647         (WI.TreeOutline):
2648         (WI.TreeOutline.prototype.registerScrollVirtualizer):
2649         (WI.TreeOutline.prototype.updateVirtualizedElements.walk):
2650         (WI.TreeOutline.prototype.updateVirtualizedElements):
2651
2652 2018-10-25  Joseph Pecoraro  <pecoraro@apple.com>
2653
2654         JSContext Inspector: Broken frontend, DOMAgent is used but does not exist
2655         https://bugs.webkit.org/show_bug.cgi?id=190922
2656         <rdar://problem/45569827>
2657
2658         Reviewed by Devin Rousso.
2659
2660         * UserInterface/Controllers/DOMManager.js:
2661         (WI.DOMManager.prototype.requestDocument):
2662         Feature check for agents that may not exist in a JSContext.
2663
2664 2018-10-25  Devin Rousso  <drousso@apple.com>
2665
2666         Web Inspector: add corner rounding to the network timing "blocks"
2667         https://bugs.webkit.org/show_bug.cgi?id=190379
2668
2669         Reviewed by Timothy Hatcher.
2670
2671         * UserInterface/Views/NetworkTableContentView.css:
2672         (.waterfall .block):
2673         (body[dir=ltr] .waterfall .block): Added.
2674         (body[dir=rtl] .waterfall .block): Added.
2675         (.network-table .waterfall .block + .block): Added.
2676         (.network-table .waterfall .block.filler + .block, .network-table .waterfall .block:not(.request, .response) + :matches(.request, .response)): Added.
2677         (.network-table .waterfall .block:last-child): Added.
2678
2679 2018-10-25  Devin Rousso  <drousso@apple.com>
2680
2681         Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls
2682         https://bugs.webkit.org/show_bug.cgi?id=189874
2683         <rdar://problem/44700000>
2684
2685         Reviewed by Joseph Pecoraro.
2686
2687         * Localizations/en.lproj/localizedStrings.js:
2688
2689         * UserInterface/Protocol/DOMObserver.js:
2690         (WI.DOMObserver.prototype.didFireEvent):
2691         * UserInterface/Controllers/DOMManager.js:
2692         (WI.DOMManager.prototype.didFireEvent):
2693         Allow `data` to be passed to the frontend with `didFireEvent`.
2694
2695         * UserInterface/Models/DOMNode.js:
2696         (WI.DOMNode):
2697         (WI.DOMNode.getFullscreenDOMEvents): Added.
2698         (WI.DOMNode.prototype.didFireEvent):
2699         (WI.DOMNode.prototype._handleDOMNodeDidFireEvent): Added.
2700         (WI.DOMNode.prototype._addDOMEvent):
2701         (WI.DOMNode.prototype._shouldListenForEventListeners): Added.
2702         If an event is fired on an ancestor of this node, also record that event in this node's
2703         `domEvents`, including the `originator` node.
2704
2705         * UserInterface/Views/NetworkTableContentView.js:
2706         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
2707         * UserInterface/Views/NetworkTableContentView.css:
2708         (.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-fullscreen): Added.
2709
2710         * UserInterface/Views/DOMEventsBreakdownView.js:
2711         (WI.DOMEventsBreakdownView.prototype.initialLayout):
2712         (WI.DOMEventsBreakdownView.prototype._populateTable):
2713         * UserInterface/Views/DOMEventsBreakdownView.css:
2714         (.dom-events-breakdown .graph > .area.fullscreen): Added.
2715         (.dom-events-breakdown .inherited > .name, .dom-events-breakdown .inherited > .graph > .point): Added.
2716         (.dom-events-breakdown:not(.has-inherited) .originator): Added.
2717
2718 2018-10-25  Devin Rousso  <drousso@apple.com>
2719
2720         Web Inspector: Network: more aggressively snap timing blocks together
2721         https://bugs.webkit.org/show_bug.cgi?id=190439
2722
2723         Reviewed by Timothy Hatcher.
2724
2725         * UserInterface/Views/NetworkTableContentView.js:
2726         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock):
2727         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
2728         If the time difference between the end of the previous block and the start of this block
2729         would result in less than 2px of space, extend the next block back to the previous block.
2730
2731 2018-10-24  Devin Rousso  <drousso@apple.com>
2732
2733         Web Inspector: popovers for function source code are malformed
2734         https://bugs.webkit.org/show_bug.cgi?id=190859
2735
2736         Reviewed by Joseph Pecoraro.
2737
2738         Previously, the `WI.Popover` would be drawn twice: once when the
2739         `WI.CodeMirrorTokenTrackingController` determines that the user has hovered on a function
2740         token, and once again when the source for that function is formatted (after being retrieved).
2741         In the case that the formatter is able to return the prettified source within a frame (or
2742         two), the `WI.Popover` is still in the middle of animating to its new size, meaning that the
2743         changes made by the formatted `update` will be overridden on the next rAF (creates a flash).
2744
2745         * UserInterface/Views/Popover.js:
2746         (WI.Popover.prototype):
2747         (WI.Popover.prototype._animateFrame.drawBackground):
2748         (WI.Popover.prototype._drawBackground):
2749         Add a member variable to make sure that there is only ever one rAF firing at a time.
2750         Drive-by: rework the background code to only use one canvas.
2751
2752         * UserInterface/Views/SourceCodeTextEditor.js:
2753         (WI.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
2754         Don't show the `WI.Popover` until the formatter has finished prettifying the function's
2755         source code, as otherwise there is brief moment that the popover appears and is empty.
2756
2757 2018-10-24  Devin Rousso  <drousso@apple.com>
2758
2759         Web Inspector: REGRESSION (r237232): changing resources via up/down blurs the TreeOutline in Resources
2760         https://bugs.webkit.org/show_bug.cgi?id=190862
2761
2762         Reviewed by Matt Baker.
2763
2764         * UserInterface/Views/TextEditor.js:
2765         (WI.TextEditor.prototype.set selectedTextRange):
2766         Don't `focus` unless the `activeElement` is not a WebInspector element (e.g. <body>),
2767         meaning that the previously focused element has been removed from the DOM and no longer
2768         needs to keep the focus.
2769
2770 2018-10-24  Devin Rousso  <drousso@apple.com>
2771
2772         Web Inspector: CSP request payload on medium.com is unreadable, should be pretty-printed
2773         https://bugs.webkit.org/show_bug.cgi?id=190354
2774         <rdar://problem/45090894>
2775
2776         Reviewed by Joseph Pecoraro.
2777
2778         * UserInterface/Views/TextEditor.js:
2779         (WI.TextEditor.prototype.set string.update):
2780         (WI.TextEditor.prototype._attemptToDetermineMIMEType): Added.
2781         If the content doesn't already have a MIME type, attempt to determine one by trying to
2782         format it as "javascript" (e.g. request JSON that is simply missing a MIME type).
2783
2784         * UserInterface/Views/TextContentView.js:
2785         (WI.TextContentView):
2786         (WI.TextContentView.prototype._handleTextEditorMIMETypeChanged): Added.
2787         * UserInterface/Views/TextResourceContentView.js:
2788         (WI.TextResourceContentView):
2789         (WI.TextResourceContentView.prototype._handleTextEditorMIMETypeChanged): Added.
2790         * UserInterface/Views/ScriptContentView.js:
2791         (WI.ScriptContentView):
2792         (WI.ScriptContentView.prototype._handleTextEditorMIMETypeChanged): Added.
2793         Enable the "Pretty Print" navigation button if the MIME type changes to something that is
2794         able to be formatted.
2795         Drive-by: reorder the creation of the "Pretty Print" button so that it exists if
2796         `_attemptToDetermineMIMEType` finishes synchronously.
2797
2798 2018-10-23  Devin Rousso  <drousso@apple.com>
2799
2800         Uncaught Exception: TypeError: null is not an object (evaluating 'mouseBlock.addEventListener')
2801         https://bugs.webkit.org/show_bug.cgi?id=190766
2802
2803         Reviewed by Brian Burg.
2804
2805         * UserInterface/Views/NetworkTableContentView.js:
2806         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
2807         When creating the `mouseBlock`, if the `startTimestamp` and `endTimestamp` are equal, we
2808         don't create an element. If this is true for the total range of the `WI.Resouce` (meaning
2809         its `startTime` and `responseEnd`), don't even try to create blocks.
2810
2811 2018-10-23  Devin Rousso  <drousso@apple.com>
2812
2813         Web Inspector: "Queued NaNms" in Network tab
2814         https://bugs.webkit.org/show_bug.cgi?id=190767
2815         <rdar://problem/45420859>
2816
2817         Reviewed by Brian Burg.
2818
2819         * UserInterface/Models/ResourceTimingData.js:
2820         (WI.ResourceTimingData.prototype.get fetchStart):
2821         If the `WI.ResourceTimingData` has no `fetchStart` use the associated `WI.Resource`'s
2822         `requestSentTimestamp` (just like `startTime`).
2823
2824 2018-10-22  Joseph Pecoraro  <pecoraro@apple.com>
2825
2826         Web Inspector: Open Quickly dialog doesn't show named scripts that appear in the debugger sidebar
2827         https://bugs.webkit.org/show_bug.cgi?id=190649
2828
2829         Reviewed by Devin Rousso.
2830
2831         * UserInterface/Views/OpenResourceDialog.js:
2832         (WI.OpenResourceDialog.prototype.didPresentDialog):
2833         (WI.OpenResourceDialog.prototype._addResourcesForTarget):
2834         (WI.OpenResourceDialog.prototype._addScriptsForTarget):
2835         Include non-resource named scripts from the main target in
2836         the open quickly dialog.
2837
2838 2018-10-19  Joseph Pecoraro  <pecoraro@apple.com>
2839
2840         Web Inspector: Remove unused member variable of DebuggerSidebarPanel
2841         https://bugs.webkit.org/show_bug.cgi?id=190743
2842
2843         Reviewed by Devin Rousso.
2844
2845         * UserInterface/Views/DebuggerSidebarPanel.js:
2846         (WI.DebuggerSidebarPanel):
2847
2848 2018-10-17  Devin Rousso  <drousso@apple.com>
2849
2850         Web Inspector: Quickly Open to line/column does should have caret indicating where the position is
2851         https://bugs.webkit.org/show_bug.cgi?id=190643
2852
2853         Reviewed by Matt Baker.
2854
2855         * UserInterface/Views/TextEditor.js:
2856         (WI.TextEditor.prototype.set selectedTextRange):
2857         (WI.TextEditor.prototype.revealPosition):
2858         Ensure that CodeMirror is focused before attempting to `setSelection`.
2859         Drive-by: allow selections past the "end" of the line (since there is a `\n` or `\r`).
2860
2861         * UserInterface/Views/SourceCodeTextEditor.js:
2862         (WI.SourceCodeTextEditor.prototype.dialogWasDismissedWithRepresentedObject):
2863         Remove the extra `focus` call after dismissing the `WI.GoToLineDialog` since it is now
2864         handled by `WI.TextEditor` via `revealPosition`.
2865
2866 2018-10-16  Joseph Pecoraro  <pecoraro@apple.com>
2867
2868         Web Inspector: ⌃G to jump to line in CSS file wipes the line
2869         https://bugs.webkit.org/show_bug.cgi?id=190645
2870
2871         Reviewed by Devin Rousso.
2872
2873         * UserInterface/Base/Main.js:
2874         * UserInterface/Views/Dialog.js:
2875         (WI.Dialog.prototype.dismiss):
2876         * UserInterface/Views/SourceCodeTextEditor.js:
2877         (WI.SourceCodeTextEditor.prototype.dialogWasDismissed): Deleted.
2878         Rename the handler when dismissing a dialog with a value so that
2879         it is clear this is only on a successful value and not an invalid value.
2880         Dialog now only calls this delegate with a valid value. This addresses
2881         exceptions seen when the GoToLineDialog was dimissed via Escape and
2882         an unexpected `null` value was being handled in the delegate.
2883
2884         * UserInterface/Views/GoToLineDialog.js:
2885         (WI.GoToLineDialog.prototype._handleKeydownEvent):
2886         * UserInterface/Views/OpenResourceDialog.js:
2887         (WI.OpenResourceDialog.prototype._handleKeydownEvent):
2888         Prevent default on the event whenever we dismiss the dialog.
2889         Without this, the key event was also being sent to the editor.
2890         In this case, that meant an "Enter" key was replacing the new
2891         selection in the TextEditor with a newline!
2892
2893 2018-10-16  Devin Rousso  <drousso@apple.com>
2894
2895         Web Inspector: Canvas: capture previously saved states and add them to the recording payload
2896         https://bugs.webkit.org/show_bug.cgi?id=190473
2897
2898         Reviewed by Joseph Pecoraro.
2899
2900         Instead of sending a single object of the current state of the context, send an array of
2901         objects, one for each restore point. When replaying, recreate each restore point before
2902         applying the selected action(s).
2903
2904         * UserInterface/Models/Recording.js:
2905         (WI.Recording):
2906         (WI.Recording.fromPayload):
2907         (WI.Recording.prototype.toJSON):
2908         (WI.Recording.prototype.async._process):
2909         (WI.Recording.prototype.async._swizzleState): Added.
2910         * UserInterface/Models/RecordingAction.js:
2911         (WI.RecordingAction):
2912         (WI.RecordingAction.deriveCurrentState): Added.
2913         (WI.RecordingAction.prototype.get states): Added.
2914         (WI.RecordingAction.prototype.process):
2915         (WI.RecordingAction.prototype.get state): Deleted.
2916         Drive-by: when `process`ing, also check to see if any values in the current state changed
2917         outside of those expected in `_stateModifiers` (e.g. `restore` may modify some state values).
2918
2919         * UserInterface/Views/RecordingContentView.js:
2920         (WI.RecordingContentView.prototype._generateContentCanvas2D):
2921
2922         * UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
2923         (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
2924         Default to showing the most recent (current) state.
2925
2926         * UserInterface/Views/CanvasTabContentView.js:
2927         (WI.CanvasTabContentView.prototype.initialLayout): Added.
2928         (WI.CanvasTabContentView.prototype._addCanvas):
2929         (WI.CanvasTabContentView.prototype._removeCanvas):
2930         (WI.CanvasTabContentView.prototype._addRecording): Added.
2931         (WI.CanvasTabContentView.prototype._recordingImportedOrStopped):
2932         (WI.CanvasTabContentView.prototype._recordingAdded): Deleted.
2933         * UserInterface/Controllers/CanvasManager.js:
2934         (WI.CanvasManager):
2935         (WI.CanvasManager.prototype.get importedRecordings): Added.
2936         (WI.CanvasManager.prototype.importRecording):
2937         Drive-by: store imported recordings on `WI.CanvasManager` so that if the Canvas tab is
2938         closed we can still show the list of imported recordings.
2939
2940 2018-10-16  Devin Rousso  <drousso@apple.com>
2941
2942         Web Inspector: Canvas recording sidebar scroll position lost after switching tabs
2943         https://bugs.webkit.org/show_bug.cgi?id=190482
2944
2945         Reviewed by Joseph Pecoraro.
2946
2947         * UserInterface/Views/Sidebar.js:
2948         (WI.Sidebar.prototype.removeSidebarPanel):
2949         (WI.Sidebar.prototype.set selectedSidebarPanel):
2950         Call `hidden` before setting `selected` to `false`, as that sets `display: none;` on the
2951         element, which sets the `scrollTop` to `0`.
2952
2953         * UserInterface/Views/SidebarPanel.js:
2954         (WI.SidebarPanel.prototype.shown):
2955         (WI.SidebarPanel.prototype.hidden):
2956         (WI.SidebarPanel.prototype.get scrollElement): Added.
2957         Allow subclasses to specify the scrolling element for saving/restoring the scroll position.
2958
2959         * UserInterface/Views/CanvasSidebarPanel.js:
2960         (WI.CanvasSidebarPanel.prototype.get scrollElement): Added.
2961         * UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
2962         (WI.RecordingStateDetailsSidebarPanel.prototype.get scrollElement): Added.
2963
2964 2018-10-16  Devin Rousso  <drousso@apple.com>
2965
2966         Web Inspector: Should be a way to go directly from an event in the overview view to the specialized timeline for that event
2967         https://bugs.webkit.org/show_bug.cgi?id=135307
2968         <rdar://problem/17273966>
2969
2970         Reviewed by Joseph Pecoraro.
2971
2972         When a `WI.TimelineRecordBar` is clicked, call up the delegate chain to the overview and
2973         adjust the currently selected `WI.TimelineRecordBar` among the `WI.TimelineOverviewGraph`s.
2974         Similarly, selecting a `WI.DataGridNode` in any `WI.TimelineView` subclass will use the same
2975         logic to select the corresponding `WI.TimelineRecordBar`.
2976
2977         * UserInterface/Views/TimelineOverview.js:
2978         (WI.TimelineOverview):
2979         (WI.TimelineOverview.prototype.reset):
2980         (WI.TimelineOverview.prototype._recordSelected):
2981
2982         * UserInterface/Views/TimelineOverviewGraph.js:
2983         (WI.TimelineOverviewGraph):
2984         (WI.TimelineOverviewGraph.prototype.set selectedRecord):
2985         (WI.TimelineOverviewGraph.prototype.get selectedRecordBar): Added.
2986         (WI.TimelineOverviewGraph.prototype.set selectedRecordBar): Added.
2987         (WI.TimelineOverviewGraph.prototype.timelineRecordBarClicked): Added.
2988         (WI.TimelineOverviewGraph.prototype._needsSelectedRecordLayout):
2989
2990         * UserInterface/Views/TimelineRecordBar.js:
2991         (WI.TimelineRecordBar):
2992         (WI.TimelineRecordBar.prototype.get selected): Added.
2993         (WI.TimelineRecordBar.prototype.set selected): Added.
2994         (WI.TimelineRecordBar.prototype._handleClick): Added.
2995         * UserInterface/Views/TimelineRecordBar.css:
2996         (.timeline-record-bar.selected > .segment): Added.
2997         Add a `delegate` that is notified whenever the element is clicked.
2998
2999         * UserInterface/Views/TimelineDataGridNode.js:
3000         (WI.TimelineDataGridNode.prototype.refreshGraph.createBar):
3001         * UserInterface/Views/LayoutTimelineOverviewGraph.js:
3002         (WI.LayoutTimelineOverviewGraph.prototype.updateSelectedRecord):
3003         (WI.LayoutTimelineOverviewGraph.prototype._updateRowLayout.createBar):
3004         * UserInterface/Views/NetworkTimelineOverviewGraph.js:
3005         (WI.NetworkTimelineOverviewGraph.prototype.layout.createBar):
3006         * UserInterface/Views/ScriptTimelineOverviewGraph.js:
3007         (WI.ScriptTimelineOverviewGraph.prototype.layout.createBar):
3008         (WI.ScriptTimelineOverviewGraph.prototype.updateSelectedRecord):
3009
3010         * UserInterface/Views/TimelineRecordingContentView.js:
3011         (WI.TimelineRecordingContentView.prototype.showTimelineViewForTimeline):
3012
3013 2018-10-16  Devin Rousso  <drousso@apple.com>
3014
3015         Web Inspector: sequences of spaces longer than 16 don't show a dot
3016         https://bugs.webkit.org/show_bug.cgi?id=190528
3017
3018         Reviewed by Matt Baker.
3019
3020         * UserInterface/Views/CodeMirrorAdditions.js:
3021         Create a new CSS rule and add it to a unique <style> whenever a whitespace sequence with
3022         a length is seen for the first time.
3023
3024         * UserInterface/Views/CodeMirrorOverrides.css:
3025         (.show-whitespace-characters .CodeMirror .cm-whitespace-1::before): Deleted.
3026         (.show-whitespace-characters .CodeMirror .cm-whitespace-2::before): Deleted.
3027         (.show-whitespace-characters .CodeMirror .cm-whitespace-3::before): Deleted.
3028         (.show-whitespace-characters .CodeMirror .cm-whitespace-4::before): Deleted.
3029         (.show-whitespace-characters .CodeMirror .cm-whitespace-5::before): Deleted.
3030         (.show-whitespace-characters .CodeMirror .cm-whitespace-6::before): Deleted.
3031         (.show-whitespace-characters .CodeMirror .cm-whitespace-7::before): Deleted.
3032         (.show-whitespace-characters .CodeMirror .cm-whitespace-8::before): Deleted.
3033         (.show-whitespace-characters .CodeMirror .cm-whitespace-9::before): Deleted.
3034         (.show-whitespace-characters .CodeMirror .cm-whitespace-10::before): Deleted.
3035         (.show-whitespace-characters .CodeMirror .cm-whitespace-11::before): Deleted.
3036         (.show-whitespace-characters .CodeMirror .cm-whitespace-12::before): Deleted.
3037         (.show-whitespace-characters .CodeMirror .cm-whitespace-13::before): Deleted.
3038         (.show-whitespace-characters .CodeMirror .cm-whitespace-14::before): Deleted.
3039         (.show-whitespace-characters .CodeMirror .cm-whitespace-15::before): Deleted.
3040         (.show-whitespace-characters .CodeMirror .cm-whitespace-16::before): Deleted.
3041
3042 2018-10-15  Charles Vazac  <cvazac@gmail.com>
3043
3044         Web Inspector: Expose Server Timing Response Headers in Network Tab
3045         https://bugs.webkit.org/show_bug.cgi?id=190440
3046
3047         Reviewed by Joseph Pecoraro.
3048
3049         * Localizations/en.lproj/localizedStrings.js: new key "Server Timing:"
3050         * UserInterface/Main.html: add reference to Models/ServerTimingEntry.js
3051         * UserInterface/Models/Resource.js:
3052         (WI.Resource.prototype.get serverTiming):
3053         (WI.Resource.prototype.updateForResponse):
3054         * UserInterface/Models/ServerTimingEntry.js: Added.
3055         (WI.ServerTimingEntry):
3056         (WI.ServerTimingEntry.parseHeaders): parse raw response headers into an array of ServerTimingEntry objects
3057         (WI.ServerTimingEntry.parseHeaders.consumeDelimiter):
3058         (WI.ServerTimingEntry.parseHeaders.consumeToken):
3059         (WI.ServerTimingEntry.):
3060         * UserInterface/Test.html: add reference to Models/ServerTimingEntry.js
3061         * UserInterface/Views/ResourceTimingBreakdownView.js:
3062         (WI.ResourceTimingBreakdownView.prototype._appendServerTimingRow): render a table row per ServerTimingEntry object
3063         (WI.ResourceTimingBreakdownView.prototype.initialLayout):
3064         (WI.ResourceTimingBreakdownView):
3065
3066 2018-10-15  Nikita Vasilyev  <nvasilyev@apple.com>
3067
3068         Web Inspector: Dark Mode: pseudo elements in DOM tree are too dark
3069         https://bugs.webkit.org/show_bug.cgi?id=190541
3070         <rdar://problem/45238443>
3071
3072         Reviewed by Matt Baker.
3073
3074         * UserInterface/Views/DOMTreeOutline.css:
3075         (@media (prefers-dark-interface)):
3076         (.tree-outline.dom .html-pseudo-element):
3077
3078 2018-10-15  Matt Baker  <mattbaker@apple.com>
3079
3080         Web Inspector: REGRESSION (r233824): execution highlight range missing/incorrect in pretty printed code
3081         https://bugs.webkit.org/show_bug.cgi?id=188082
3082         <rdar://problem/42640580>
3083
3084         Reviewed by Joseph Pecoraro.
3085
3086         * UserInterface/Views/SourceCodeTextEditor.js:
3087         (WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
3088         TextEditor expects positions returned by the delegate to be relative to
3089         the editor's text content, not the original source code content.
3090
3091         * UserInterface/Views/TextEditor.js:
3092         (WI.TextEditor.prototype._updateExecutionRangeHighlight):
3093         Convert positions to CodeMirror format here rather than in the delegate
3094         method, which is a layer removed from CodeMirror.
3095
3096 2018-10-15  Nikita Vasilyev  <nvasilyev@apple.com>
3097
3098         Web Inspector: Dark Mode: unreadable text when hovering CSS properties while holding Command
3099         https://bugs.webkit.org/show_bug.cgi?id=190548
3100         <rdar://problem/45242098>
3101
3102         Reviewed by Joseph Pecoraro.
3103
3104         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
3105         (.meta-key-pressed .spreadsheet-css-declaration:not(.locked) :matches(.name, .value):not(.editing):hover):
3106         In the light mode the color remained the same.
3107
3108 2018-10-15  Nikita Vasilyev  <nvasilyev@apple.com>
3109
3110         Web Inspector: Dark Mode: style editor warnings should not look like errors
3111         https://bugs.webkit.org/show_bug.cgi?id=190569
3112         <rdar://problem/45261689>
3113
3114         Reviewed by Matt Baker.
3115
3116         Make warnings in the style editor look the same as warnings in the content views.
3117         Unify warning and error background color variables.
3118
3119         * UserInterface/Views/LogContentView.css:
3120         (@media (prefers-dark-interface)):
3121         (.console-error-level):
3122         (.console-warning-level):
3123         * UserInterface/Views/SourceCodeTextEditor.css:
3124         (.source-code.text-editor > .CodeMirror .warning):
3125         (.source-code.text-editor > .CodeMirror .error):
3126         (.source-code.text-editor > .CodeMirror .issue-widget.warning):
3127         (.source-code.text-editor > .CodeMirror .issue-widget.inline.warning):
3128         (.source-code.text-editor > .CodeMirror .issue-widget.error):
3129         (.source-code.text-editor > .CodeMirror .issue-widget.inline.error):
3130         (@media (prefers-dark-interface)):
3131         (.source-code.text-editor > .CodeMirror .issue-widget):
3132         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
3133         (.spreadsheet-style-declaration-editor .property.has-warning):
3134         (.spreadsheet-style-declaration-editor .property.has-warning .warning):
3135         (@media (prefers-dark-interface)):
3136         (.spreadsheet-style-declaration-editor :matches(.name, .value).editing):
3137         * UserInterface/Views/Variables.css:
3138         (:root):
3139         (@media (prefers-dark-interface)):
3140
3141 2018-10-12  Devin Rousso  <drousso@apple.com>
3142
3143         Web Inspector: Canvas: previews aren't removed when the parent view is hidden
3144         https://bugs.webkit.org/show_bug.cgi?id=190525
3145
3146         Reviewed by Matt Baker.
3147
3148         * UserInterface/Views/CanvasTabContentView.js:
3149         (WI.CanvasTabContentView.prototype.attached):
3150
3151         * UserInterface/Controllers/CanvasManager.js:
3152         (WI.CanvasManager.prototype.get canvases):
3153         (WI.CanvasManager.prototype.get shaderPrograms):
3154         Drive-by: simplify these getters.
3155
3156 2018-10-12  Joseph Pecoraro  <pecoraro@apple.com>
3157
3158         Web Inspector: Dark Mode: Highlight text in Network Headers search is too dark
3159         https://bugs.webkit.org/show_bug.cgi?id=190510
3160
3161         Reviewed by Devin Rousso.
3162
3163         * UserInterface/Views/ResourceHeadersContentView.css:
3164         (.resource-headers.showing-find-banner .search-highlight):
3165         Use adaptive text-color.
3166
3167 2018-10-12  Nikita Vasilyev  <nvasilyev@apple.com>
3168
3169         Web Inspector: Dark Mode: wrong color used for "goto arrow" for selected DOM breakpoint tree element
3170         https://bugs.webkit.org/show_bug.cgi?id=190180
3171         <rdar://problem/44927654>
3172
3173         Reviewed by Matt Baker.
3174
3175         * UserInterface/Views/Main.css:
3176         (@media (prefers-dark-interface)):
3177         (:focus .selected .go-to-arrow):
3178
3179 2018-10-11  Devin Rousso  <drousso@apple.com>
3180
3181         Web Inspector: Network: detail view reverts to "Response" when new requests are added
3182         https://bugs.webkit.org/show_bug.cgi?id=190443
3183
3184         Reviewed by Joseph Pecoraro.
3185
3186         * UserInterface/Views/NetworkTableContentView.js:
3187         (WI.NetworkTableContentView.prototype._showDetailView):
3188         Return early if we are already showing a detail view for the selected object.
3189
3190 2018-10-11  Matt Baker  <mattbaker@apple.com>
3191
3192         Web Inspector: remove unused  TreeOutline style .force-focus
3193         https://bugs.webkit.org/show_bug.cgi?id=190480
3194         <rdar://problem/45203484>
3195
3196         Reviewed by Joseph Pecoraro.
3197
3198         * UserInterface/Views/CallFrameTreeElement.css:
3199         (.tree-outline:focus .item.call-frame.selected .status > .status-image):
3200         (.tree-outline:matches(:focus, .force-focus) .item.call-frame.selected .status > .status-image): Deleted.
3201
3202         * UserInterface/Views/CanvasSidebarPanel.css:
3203         (.sidebar > .panel.navigation.canvas > .content > .recording-content > .tree-outline:focus .item.processing.selected .subtitle > progress):
3204         (.sidebar > .panel.navigation.canvas > .content > .recording-content > .tree-outline:matches(:focus, .force-focus) .item.processing.selected .subtitle > progress): Deleted.
3205
3206         * UserInterface/Views/DataGrid.css:
3207         (body[dir=ltr] .data-grid:focus tr.selected td:not(:last-child)):
3208         (body[dir=rtl] .data-grid:focus tr.selected td:not(:last-child)):
3209         (.data-grid:focus tr.parent.selected td.disclosure::before):
3210         (.data-grid:focus tr.parent.expanded.selected td.disclosure::before):
3211         (.data-grid:focus tr.selected):
3212         (.data-grid:focus tr.selected td .subtitle):
3213         (body:not(.window-inactive, .window-docked-inactive) .data-grid:focus tr.editable.selected .cell-content > input):
3214         (@media (prefers-dark-interface)):
3215         (body[dir=ltr] .data-grid:matches(:focus, .force-focus) tr.selected td:not(:last-child)): Deleted.
3216         (body[dir=rtl] .data-grid:matches(:focus, .force-focus) tr.selected td:not(:last-child)): Deleted.
3217         (.data-grid:matches(:focus, .force-focus) tr.parent.selected td.disclosure::before): Deleted.
3218         (.data-grid:matches(:focus, .force-focus) tr.parent.expanded.selected td.disclosure::before): Deleted.
3219         (.data-grid:matches(:focus, .force-focus) tr.selected): Deleted.
3220         (.data-grid:matches(:focus, .force-focus) tr.selected td .subtitle): Deleted.
3221         (body:not(.window-inactive, .window-docked-inactive) .data-grid:matches(:focus, .force-focus) tr.editable.selected .cell-content > input): Deleted.
3222
3223         * UserInterface/Views/Main.css:
3224         (:focus .selected .go-to-arrow):
3225         (:focus .selected .go-to-arrow:active):
3226         (:matches(:focus, .force-focus) .selected .go-to-arrow): Deleted.
3227         (:matches(:focus, .force-focus) .selected .go-to-arrow:active): Deleted.
3228
3229         * UserInterface/Views/ProfileView.css:
3230         (.profile > .data-grid:focus tr.selected td .location):
3231         (.profile > .data-grid:matches(:focus, .force-focus) tr.selected td .location): Deleted.
3232
3233         * UserInterface/Views/RecordingActionTreeElement.css:
3234         (.tree-outline:focus .item.action.selected:not(.initial-state, .invalid) > .icon):
3235         (body:not(.window-inactive, .window-docked-inactive) .tree-outline:focus .item.action.selected > .titles .parameter.swizzled,):
3236         (.tree-outline:matches(:focus, .force-focus) .item.action.selected:not(.initial-state, .invalid) > .icon): Deleted.
3237         (body:not(.window-inactive, .window-docked-inactive) .tree-outline:matches(:focus, .force-focus) .item.action.selected > .titles .parameter.swizzled,): Deleted.
3238
3239         * UserInterface/Views/ScriptDetailsTimelineView.css:
3240         (.tree-outline:focus .item.selected .alternate-subtitle):
3241         (.tree-outline:matches(:focus, .force-focus) .item.selected .alternate-subtitle): Deleted.
3242
3243         * UserInterface/Views/ShaderProgramTreeElement.css:
3244         (.tree-outline:focus .item.shader-program.selected .status > img):
3245         (.tree-outline:matches(:focus, .force-focus) .item.shader-program.selected .status > img): Deleted.
3246
3247         * UserInterface/Views/ThreadTreeElement.css:
3248         (.tree-outline:focus > .item.thread.selected .status-button.resume):
3249         (.tree-outline:matches(:focus, .force-focus) > .item.thread.selected .status-button.resume): Deleted.
3250
3251         * UserInterface/Views/TimelineRecordBar.css:
3252         (:focus .selected .timeline-record-bar > .segment):
3253         (:focus .selected .timeline-record-bar > .segment.inactive):
3254         (body[dir=ltr] :focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
3255         (body[dir=rtl] :focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
3256         (:matches(:focus, .force-focus) .selected .timeline-record-bar > .segment): Deleted.
3257         (:matches(:focus, .force-focus) .selected .timeline-record-bar > .segment.inactive): Deleted.
3258         (body[dir=ltr] :matches(:focus, .force-focus) .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.
3259         (body[dir=rtl] :matches(:focus, .force-focus) .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.
3260
3261         * UserInterface/Views/TreeElementStatusButton.css:
3262         (:focus .item.selected > .status > .status-button):
3263         (:matches(:focus, .force-focus) .item.selected > .status > .status-button): Deleted.
3264
3265         * UserInterface/Views/TreeOutline.css:
3266         (.tree-outline:focus .item.selected .disclosure-button):
3267         (.tree-outline:focus .item.selected.expanded .disclosure-button):
3268         (.tree-outline:focus .item.selected):
3269         (.tree-outline:focus .item.selected .subtitle):
3270         (.tree-outline:not(.large):focus .item.selected .status .indeterminate-progress-spinner):
3271         (.tree-outline:matches(:focus, .force-focus) .item.selected .disclosure-button): Deleted.
3272         (.tree-outline:matches(:focus, .force-focus) .item.selected.expanded .disclosure-button): Deleted.
3273         (.tree-outline:matches(:focus, .force-focus) .item.selected): Deleted.
3274         (.tree-outline:matches(:focus, .force-focus) .item.selected .subtitle): Deleted.
3275         (.tree-outline:not(.large):matches(:focus, .force-focus) .item.selected .status .indeterminate-progress-spinner): Deleted.
3276
3277 2018-10-11  Devin Rousso  <drousso@apple.com>
3278
3279         Web Inspector: detail view is not re-shown after sorting the Network table
3280         https://bugs.webkit.org/show_bug.cgi?id=190330
3281         <rdar://problem/45089607>
3282
3283         Reviewed by Matt Baker.
3284
3285         * UserInterface/Views/NetworkTableContentView.js:
3286         (WI.NetworkTableContentView.prototype._restoreSelectedRow):
3287
3288 2018-10-10  Devin Rousso  <drousso@apple.com>
3289
3290         Web Inspector: create special Network waterfall for media events
3291         https://bugs.webkit.org/show_bug.cgi?id=189773
3292         <rdar://problem/44626605>
3293
3294         Reviewed by Joseph Pecoraro.
3295
3296         * Localizations/en.lproj/localizedStrings.js:
3297         * UserInterface/Main.html:
3298         * UserInterface/Base/Utilities.js:
3299
3300         * UserInterface/Protocol/DOMObserver.js:
3301         (WI.DOMObserver.prototype.didFireEvent): Added.
3302         * UserInterface/Controllers/DOMManager.js:
3303         (WI.DOMManager.prototype.didFireEvent): Added.
3304         * UserInterface/Models/DOMNode.js:
3305         (WI.DOMNode):
3306         (WI.DOMNode.prototype.get domEvents): Added.
3307         (WI.DOMNode.prototype.didFireEvent): Added.
3308         (WI.DOMNode.prototype._addDOMEvent): Added.
3309
3310         * UserInterface/Views/NetworkTableContentView.js:
3311         (WI.NetworkTableContentView):
3312         (WI.NetworkTableContentView.prototype.shown):
3313         (WI.NetworkTableContentView.prototype.hidden):
3314         (WI.NetworkTableContentView.prototype.closed):
3315         (WI.NetworkTableContentView.prototype.reset):
3316         (WI.NetworkTableContentView.prototype.showRepresentedObject):
3317         (WI.NetworkTableContentView.prototype.networkDetailViewClose): Added.
3318         (WI.NetworkTableContentView.prototype.tableSortChanged):
3319         (WI.NetworkTableContentView.prototype.tableSelectionDidChange):
3320         (WI.NetworkTableContentView.prototype._populateNameCell):
3321         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.positionByStartOffset): Added.
3322         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.setWidthForDuration): Added.
3323         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.createDOMEventLine): Added.
3324         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock):
3325         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
3326         (WI.NetworkTableContentView.prototype._processPendingEntries):
3327         (WI.NetworkTableContentView.prototype._rowIndexForRepresentedObject): Added.
3328         (WI.NetworkTableContentView.prototype._updateEntryForResource):
3329         (WI.NetworkTableContentView.prototype._hideDetailView): Added.
3330         (WI.NetworkTableContentView.prototype._showDetailView): Added.
3331         (WI.NetworkTableContentView.prototype._positionDetailView): Added.
3332         (WI.NetworkTableContentView.prototype._resourceTransferSizeDidChange):
3333         (WI.NetworkTableContentView.prototype._tryLinkResourceToDOMNode):
3334         (WI.NetworkTableContentView.prototype._handleNodeDidFireEvent): Added.
3335         (WI.NetworkTableContentView.prototype._updateFilteredEntries):
3336         (WI.NetworkTableContentView.prototype._typeFilterScopeBarSelectionChanged):
3337         (WI.NetworkTableContentView.prototype._urlFilterDidChange):
3338         (WI.NetworkTableContentView.prototype._restoreSelectedRow):
3339         (WI.NetworkTableContentView.prototype._waterfallPopoverContent): Added.
3340         (WI.NetworkTableContentView.prototype._waterfallPopoverContentForResourceEntry): Added.
3341         (WI.NetworkTableContentView.prototype._waterfallPopoverContentForNodeEntry): Added.
3342         (WI.NetworkTableContentView.prototype._handleResourceEntryMousedownWaterfall): Added.
3343         (WI.NetworkTableContentView.prototype._handleNodeEntryMousedownWaterfall): Added.
3344         (WI.NetworkTableContentView.prototype._handleMousedownWaterfall): Added.
3345         (WI.NetworkTableContentView.prototype.networkResourceDetailViewClose): Deleted.
3346         (WI.NetworkTableContentView.prototype._rowIndexForResource): Deleted.
3347         (WI.NetworkTableContentView.prototype._hideResourceDetailView): Deleted.
3348         (WI.NetworkTableContentView.prototype._showResourceDetailView): Deleted.
3349         (WI.NetworkTableContentView.prototype._waterfallPopoverContentForResource): Deleted.
3350         * UserInterface/Views/NetworkTableContentView.css:
3351         (.content-view.network .network-table): Added.
3352         (.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-event): Added.
3353         (.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-activity): Added.
3354         (.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-activity.playing): Added.
3355
3356         * UserInterface/Views/NetworkDOMNodeDetailView.js: Added.
3357         (WI.NetworkDOMNodeDetailView):
3358         (WI.NetworkDOMNodeDetailView.prototype.initialLayout):
3359         (WI.NetworkDOMNodeDetailView.prototype.showContentViewForIdentifier):
3360
3361         * UserInterface/Views/NetworkResourceDetailView.css:
3362         (.content-view.resource-details):
3363         (.network-resource-detail): Deleted.
3364         (.network-resource-detail .navigation-bar): Deleted.
3365         (.network-resource-detail .item.close > .glyph): Deleted.
3366         (.network-resource-detail .item.close > .glyph:hover): Deleted.
3367         (.network-resource-detail .item.close > .glyph:active): Deleted.
3368         (.network .network-resource-detail .navigation-bar .item.radio.button.text-only): Deleted.
3369         (.network .network-resource-detail .navigation-bar .item.radio.button.text-only.selected): Deleted.
3370         (.network-resource-detail > .content-browser): Deleted.
3371         (@media (prefers-dark-interface)): Deleted.
3372         * UserInterface/Views/NetworkResourceDetailView.js:
3373         (WI.NetworkResourceDetailView):
3374         (WI.NetworkResourceDetailView.prototype.shown):
3375         (WI.NetworkResourceDetailView.prototype.headersContentViewGoToRequestData):
3376         (WI.NetworkResourceDetailView.prototype.sizesContentViewGoToHeaders):
3377         (WI.NetworkResourceDetailView.prototype.sizesContentViewGoToRequestBody):
3378         (WI.NetworkResourceDetailView.prototype.sizesContentViewGoToResponseBody):
3379         (WI.NetworkResourceDetailView.prototype.initialLayout):
3380         (WI.NetworkResourceDetailView.prototype.showContentViewForIdentifier):
3381         (WI.NetworkResourceDetailView.prototype.get resource): Deleted.
3382         (WI.NetworkResourceDetailView.prototype.hidden): Deleted.
3383         (WI.NetworkResourceDetailView.prototype.dispose): Deleted.
3384         (WI.NetworkResourceDetailView.prototype.willShowWithCookie): Deleted.
3385         (WI.NetworkResourceDetailView.prototype.initialLayout): Deleted.
3386         (WI.NetworkResourceDetailView.prototype._showPreferredContentView): Deleted.
3387         (WI.NetworkResourceDetailView.prototype._showContentViewForNavigationItem): Deleted.
3388         (WI.NetworkResourceDetailView.prototype._navigationItemSelected): Deleted.
3389         (WI.NetworkResourceDetailView.prototype._handleCloseButton): Deleted.
3390
3391         * UserInterface/Views/NetworkDetailView.js: Added.
3392         (WI.NetworkDetailView):
3393         (WI.NetworkDetailView.prototype.get representedObject):
3394         (WI.NetworkDetailView.prototype.shown):
3395         (WI.NetworkDetailView.prototype.hidden):
3396         (WI.NetworkDetailView.prototype.dispose):
3397         (WI.NetworkDetailView.prototype.willShowWithCookie):
3398         (WI.NetworkDetailView.prototype.initialLayout):
3399         (WI.NetworkDetailView.prototype.createDetailNavigationItem):
3400         (WI.NetworkDetailView.prototype.detailNavigationItemForIdentifier):
3401         (WI.NetworkDetailView.prototype.showContentViewForIdentifier):
3402         (WI.NetworkDetailView.prototype._showPreferredContentView):
3403         (WI.NetworkDetailView.prototype._navigationItemSelected):
3404         (WI.NetworkDetailView.prototype._handleCloseButton):
3405         * UserInterface/Views/NetworkDetailView.css: Added.
3406         (.network-detail):
3407         (.network-detail .navigation-bar):
3408         (.network-detail .item.close > .glyph):
3409         (.network-detail .item.close > .glyph:hover):
3410         (.network-detail .item.close > .glyph:active):
3411         (.network .network-detail .navigation-bar .item.radio.button.text-only):
3412         (.network .network-detail .navigation-bar .item.radio.button.text-only.selected):
3413         (.network-detail > .content-browser):
3414         (@media (prefers-dark-interface)):
3415         Create base class for detail views shown in the Network tab.
3416
3417         * UserInterface/Views/DOMNodeEventsContentView.js: Added.
3418         (WI.DOMNodeEventsContentView):
3419         (WI.DOMNodeEventsContentView.prototype.initialLayout):
3420         (WI.DOMNodeEventsContentView.prototype.closed):
3421         (WI.DOMNodeEventsContentView.prototype._handleDOMNodeDidFireEvent):
3422         * UserInterface/Views/DOMNodeEventsContentView.css: Added.
3423         (.dom-node-details.dom-events):
3424
3425         * UserInterface/Views/DOMEventsBreakdownView.js: Added.
3426         (WI.DOMEventsBreakdownView):
3427         (WI.DOMEventsBreakdownView.prototype.addEvent):
3428         (WI.DOMEventsBreakdownView.prototype.initialLayout):
3429         (WI.DOMEventsBreakdownView.prototype._populateTable.percentOfTotalTime):
3430         (WI.DOMEventsBreakdownView.prototype._populateTable):
3431         * UserInterface/Views/DOMEventsBreakdownView.css: Added.
3432         (.waterfall-popover-content .dom-events-breakdown):
3433         (.dom-events-breakdown):
3434         (.dom-events-breakdown table):
3435         (.dom-events-breakdown tr > :matches(th, td)):
3436         (.dom-events-breakdown tbody > tr):
3437         (.dom-events-breakdown .graph):
3438         (.dom-events-breakdown .graph > :matches(.point, .area)):
3439         (.dom-events-breakdown .graph > .point):
3440         (.dom-events-breakdown .time):
3441
3442         * UserInterface/Views/ResourceTimingBreakdownView.css:
3443         (.resource-timing-breakdown > table > tr.header:not(.total-row) > td): Added.
3444         (.popover.waterfall-popover): Deleted.
3445
3446 2018-10-10  Devin Rousso  <drousso@apple.com>
3447
3448         Web Inspector: REGRESSION(r236853): Uncaught Exception: undefined is not an object (evaluating 'entry.resource')
3449         https://bugs.webkit.org/show_bug.cgi?id=190442
3450
3451         Reviewed by Joseph Pecoraro.
3452
3453         * UserInterface/Views/NetworkTableContentView.js:
3454         (WI.NetworkTableContentView.prototype.reset):
3455         It's unnecessary to deselect rows in the `WI.Table` when we're about to remove them.
3456
3457 2018-10-10  Devin Rousso  <drousso@apple.com>
3458
3459         Web Inspector: REGRESSION: selection in network table is lost when new entries are added
3460         https://bugs.webkit.org/show_bug.cgi?id=190362
3461
3462         Reviewed by Matt Baker.
3463
3464         The `_selectedRows` list is cleared each time `reloadData` is called, meaning that
3465         `WI.Table` expects its "owner" to restore the selection (since it doesn't know how). As a
3466         result, `WI.NetworkTableContentView` needs to call `selectRow` _after_ `reloadData` is
3467         called, not before.
3468
3469         * UserInterface/Views/NetworkTableContentView.js:
3470         (WI.NetworkTableContentView.prototype.tableSortChanged):
3471         (WI.NetworkTableContentView.prototype._populateNameCell):
3472         (WI.NetworkTableContentView.prototype._processPendingEntries):
3473         (WI.NetworkTableContentView.prototype._insertResourceAndReloadTable):
3474         (WI.NetworkTableContentView.prototype._updateSort): Added.
3475         (WI.NetworkTableContentView.prototype._updateFilteredEntries):
3476         (WI.NetworkTableContentView.prototype._reloadTable): Added.
3477         (WI.NetworkTableContentView.prototype._resetFilters):
3478         (WI.NetworkTableContentView.prototype._typeFilterScopeBarSelectionChanged):
3479         (WI.NetworkTableContentView.prototype._handleGroupByDOMNodeCheckedDidChange):
3480         (WI.NetworkTableContentView.prototype._urlFilterDidChange):
3481         (WI.NetworkTableContentView.prototype._updateSortAndFilteredEntries): Deleted.
3482
3483         * UserInterface/Views/Table.js:
3484         (WI.Table.prototype.reloadData):
3485         Ensure that the `_selectedRowIndex` is also reset.
3486
3487 2018-10-10  Devin Rousso  <drousso@apple.com>
3488
3489         Web Inspector: notify the frontend when a canvas has started recording via console.record
3490         https://bugs.webkit.org/show_bug.cgi?id=190306
3491
3492         Reviewed by Brian Burg.
3493
3494         * UserInterface/Protocol/CanvasObserver.js:
3495         (WI.CanvasObserver.prototype.recordingStarted): Added.
3496
3497         * UserInterface/Protocol/CanvasManager.js:
3498         (WI.CanvasManager.prototype.recordingStarted): Added.
3499
3500         * UserInterface/Models/Canvas.js:
3501         (WI.Canvas.prototype.startRecording):
3502         (WI.Canvas.prototype.recordingStarted): Added.
3503         (WI.Canvas.prototype.recordingFinished):
3504
3505 2018-10-10  Devin Rousso  <drousso@apple.com>
3506
3507         Web Inspector: indent all network entries when "Group by Node" is checked
3508         https://bugs.webkit.org/show_bug.cgi?id=190388
3509
3510         Reviewed by Timothy Hatcher.
3511
3512         * UserInterface/Views/NetworkTableContentView.js:
3513         (WI.NetworkTableContentView.prototype._populateNameCell):
3514         (WI.NetworkTableContentView.prototype._handleGroupByDOMNodeCheckedDidChange):
3515
3516         * UserInterface/Views/NetworkTableContentView.css:
3517         (.network-table.grouped .data-container .cell.name): Added.
3518         (.network-table.grouped .data-container .cell:not(.parent).name): Added.
3519         (.network-table.grouped .data-container .cell.child.name): Added.
3520         (.network-table .cell.grouped-by-node.name): Deleted.
3521         (body[dir=ltr] .network-table .cell.grouped-by-node.name): Deleted.
3522         (body[dir=rtl] .network-table .cell.grouped-by-node.name): Deleted.
3523         Apply a padding to all nodes when the `WI.Table` is grouped.
3524
3525 2018-10-09  Devin Rousso  <drousso@apple.com>
3526
3527         Web Inspector: show redirect requests in Network and Timelines tabs
3528         https://bugs.webkit.org/show_bug.cgi?id=150005
3529         <rdar://problem/5378164>
3530
3531         Reviewed by Joseph Pecoraro.
3532
3533         * Localizations/en.lproj/localizedStrings.js:
3534         * UserInterface/Views/Variables.css:
3535         * UserInterface/Main.html:
3536         * UserInterface/Test.html:
3537
3538         * UserInterface/Controllers/NetworkManager.js:
3539         (WI.NetworkManager.prototype.resourceRequestWillBeSent):
3540
3541         * UserInterface/Models/Resource.js:
3542         (WI.Resource):
3543         (WI.Resource.prototype.get redirects): Added.
3544         (WI.Resource.prototype.get lastRedirectReceivedTimestamp):
3545         (WI.Resource.prototype.updateForRedirectResponse):
3546         Save each redirect in an array instead of just remembering the last timestamp.
3547
3548         * UserInterface/Models/ResourceTimingData.js:
3549         (WI.ResourceTimingData):
3550         (WI.ResourceTimingData.fromPayload.offsetToTimestamp):
3551         (WI.ResourceTimingData.fromPayload):
3552         (WI.ResourceTimingData.prototype.get redirectStart): Added.
3553         (WI.ResourceTimingData.prototype.get redirectEnd): Added.
3554         (WI.ResourceTimingData.prototype.get fetchStart): Added.
3555         Add missing fields for `Network.types.ResourceTiming`.
3556
3557         * UserInterface/Models/Redirect.js: Added.
3558         (WI.Redirect):
3559         (WI.Redirect.prototype.get url):
3560         (WI.Redirect.prototype.get requestMethod):
3561         (WI.Redirect.prototype.get requestHeaders):
3562         (WI.Redirect.prototype.get responseStatusCode):
3563         (WI.Redirect.prototype.get responseStatusText):
3564         (WI.Redirect.prototype.get responseHeaders):
3565         (WI.Redirect.prototype.get timestamp):
3566         (WI.Redirect.prototype.get urlComponents):
3567
3568         * UserInterface/Views/ResourceHeadersContentView.js:
3569         (WI.ResourceHeadersContentView):
3570         (WI.ResourceHeadersContentView.prototype.initialLayout):
3571         (WI.ResourceHeadersContentView.prototype.layout):
3572         (WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections): Added.
3573         (WI.ResourceHeadersContentView.prototype._resourceRequestHeadersDidChange):
3574         * UserInterface/Views/ResourceHeadersContentView.css:
3575         (body[dir] .resource-headers > section.summary > .details): Added.
3576         (body[dir] .resource-headers > section:matches(.redirect, .headers) > .details): Added.
3577         (.resource-headers .details .key):
3578         (.resource-headers .summary .key):
3579         (body[dir] .resource-headers > section > .details): Deleted.
3580         (body[dir] .resource-headers > section.headers > .details): Deleted.
3581         (.resource-headers .value): Deleted.
3582         Add a request/response header section for each redirect.
3583
3584         * UserInterface/Views/NetworkTableContentView.js:
3585         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock):
3586         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
3587         (WI.NetworkTableContentView.prototype._checkURLFilterAgainstResource):
3588         (WI.NetworkTableContentView.prototype._waterfallPopoverContentForResource):
3589         * UserInterface/Views/NetworkTableContentView.css:
3590         (.waterfall .block.redirect): Added.
3591         (.waterfall .block.queue):
3592         * UserInterface/Views/ResourceTimelineDataGridNode.js:
3593         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar):
3594         * UserInterface/Views/ResourceTimingBreakdownView.js:
3595         (WI.ResourceTimingBreakdownView.prototype.initialLayout):
3596         Add timeline/waterfall entries for total redirect time.
3597
3598 2018-10-09  Devin Rousso  <drousso@apple.com>
3599
3600         Web Inspector: Canvas Tab: grayed out Record button in navigator is nearly invisible
3601         https://bugs.webkit.org/show_bug.cgi?id=190365
3602         <rdar://problem/45097739>
3603
3604         Reviewed by Brian Burg.
3605
3606         * UserInterface/Views/CanvasSidebarPanel.css:
3607         (@media (prefers-dark-interface)): Added.
3608         (.sidebar > .panel.navigation.canvas > .navigation-bar > .item.record-start-stop.disabled): Added.
3609
3610 2018-10-09  Devin Rousso  <drousso@apple.com>
3611
3612         Web Inspector: REGRESSION: fix canvas test failures after r236952 and r236954
3613         https://bugs.webkit.org/show_bug.cgi?id=190403
3614
3615         Reviewed by Joseph Pecoraro.
3616
3617         * UserInterface/Controllers/CanvasManager.js:
3618         (WI.CanvasManager.prototype._removeCanvas):
3619         Clear the `shaderProgramCollection` when a `WI.Canvas` is removed so that a remove event is
3620         fired for each `WI.ShaderProgram`.
3621
3622 2018-10-08  Justin Fan  <justin_fan@apple.com>
3623
3624         WebGPU: Rename old WebGPU prototype to WebMetal
3625         https://bugs.webkit.org/show_bug.cgi?id=190325
3626         <rdar://problem/44990443>
3627
3628         Reviewed by Dean Jackson.
3629
3630         Rename WebGPU prototype files to WebMetal in preparation for implementing the new (Oct 2018) WebGPU interface.
3631         For WebInspector, add WebMetal to valid enums for canvas types.
3632
3633         * UserInterface/Models/Canvas.js:
3634         (WI.Canvas.fromPayload):
3635         (WI.Canvas.displayNameForContextType):
3636
3637 2018-10-08  Devin Rousso  <drousso@apple.com>
3638
3639         Web Inspector: Dark Mode: canvas recording glyph is black on gray
3640         https://bugs.webkit.org/show_bug.cgi?id=190367
3641         <rdar://problem/45099304>
3642
3643         Reviewed by Joseph Pecoraro.
3644
3645         * UserInterface/Views/CanvasOverviewContentView.css:
3646         (.content-view.canvas-overview .content-view.canvas > footer .view-recording): Added.
3647         (.content-view.canvas-overview .content-view.canvas > footer > .recordings::before): Deleted.
3648
3649 2018-10-08  Devin Rousso  <drousso@apple.com>
3650
3651         Web Inspector: allow multiple canvases to be recorded at the same time
3652         https://bugs.webkit.org/show_bug.cgi?id=190305
3653
3654         Reviewed by Brian Burg.
3655
3656         Moved the logic for maintaining whether a canvas is actively recording from
3657         `WI.CanvasManager` to `WI.Canvas`, meaning that each canvas can now record independently of
3658         every other canvas in the page. If multiple recordings are all finished simultaneously, only
3659         show the first one to be recieved by the frontend.
3660
3661         * UserInterface/Controllers/CanvasManager.js:
3662         (WI.CanvasManager):
3663         (WI.CanvasManager.prototype.recordingProgress):
3664         (WI.CanvasManager.prototype.recordingFinished):
3665         (WI.CanvasManager.prototype.programCreated):
3666         (WI.CanvasManager.prototype.programDeleted):
3667         (WI.CanvasManager.prototype._removeCanvas):
3668         (WI.CanvasManager.prototype._mainResourceDidChange):
3669         (WI.CanvasManager.prototype.get recordingCanvas): Deleted.
3670         (WI.CanvasManager.prototype.startRecording): Deleted.
3671         (WI.CanvasManager.prototype.stopRecording): Deleted.
3672         (WI.CanvasManager.prototype._dispatchShaderProgramRemoved): Deleted.
3673
3674         * UserInterface/Models/Canvas.js:
3675         (WI.Canvas.prototype.get recordingFrameCount): Added.
3676         (WI.Canvas.prototype.get recordingBufferUsed): Added.
3677         (WI.Canvas.prototype.get recordingActive): Added.
3678         (WI.Canvas.prototype.get isRecording): Deleted.
3679         (WI.Canvas.prototype.startRecording): Added.
3680         (WI.Canvas.prototype.stopRecording): Added.
3681         (WI.Canvas.prototype.recordingProgress): Added.
3682         (WI.Canvas.prototype.recordingFinished): Added.
3683
3684         * UserInterface/Views/CanvasTabContentView.js:
3685         (WI.CanvasTabContentView.prototype.attached):
3686         (WI.CanvasTabContentView.prototype.detached):
3687         (WI.CanvasTabContentView.prototype._recordingImportedOrStopped):
3688         (WI.CanvasTabContentView.prototype._handleSpace):
3689         (WI.CanvasTabContentView):
3690
3691         * UserInterface/Views/CanvasOverviewContentView.css:
3692         (.content-view.canvas-overview .content-view.canvas.recording-active): Added.
3693         (.content-view.canvas-overview .content-view.canvas.recording-active > header): Added.
3694         (.content-view.canvas-overview .content-view.canvas.recording-active > header > .titles > .title): Added.
3695         (.content-view.canvas-overview .content-view.canvas.recording-active > header > .titles > .subtitle): Added.
3696         (.content-view.canvas-overview .content-view.canvas.recording-active > header > .navigation-bar > .item): Added.
3697         (.content-view.canvas-overview .content-view.canvas:matches(:hover, .recording-active) > header > .navigation-bar): Added.
3698         (.content-view.canvas-overview .content-view.canvas:not(.recording-active) > header > .navigation-bar > .item.record-start-stop.disabled): Added.
3699         (.content-view.canvas-overview .content-view.canvas:not(.recording-active) > header > .navigation-bar > .item.record-start-stop:not(.disabled):hover): Added.
3700         (.content-view.canvas-overview .content-view.canvas:not(.recording-active) > header > .navigation-bar > .item.record-start-stop:not(.disabled):active): Added.
3701         (.content-view.canvas-overview .content-view.canvas.recording-active > .progress-vie): Added.
3702         (.content-view.canvas-overview .content-view.canvas.recording-active > .preview): Added.
3703         (.content-view.canvas-overview .content-view.canvas.recording-active): Added.
3704         (.content-view.canvas-overview .content-view.canvas.recording-active > header): Added.
3705         (.content-view.canvas-overview .content-view.canvas.recording-active > header > .titles > .subtitle): Added.
3706         (.content-view.canvas-overview .content-view.canvas.is-recording): Deleted.
3707         (.content-view.canvas-overview .content-view.canvas.is-recording > header): Deleted.
3708         (.content-view.canvas-overview .content-view.canvas.is-recording > header > .titles > .title): Deleted.
3709         (.content-view.canvas-overview .content-view.canvas.is-recording > header > .titles > .subtitle): Deleted.
3710         (.content-view.canvas-overview .content-view.canvas.is-recording > header > .navigation-bar > .item): Deleted.
3711         (.content-view.canvas-overview .content-view.canvas:matches(:hover, .is-recording) > header > .navigation-bar): Deleted.
3712         (.content-view.canvas-overview .content-view.canvas:not(.is-recording) > header > .navigation-bar > .item.record-start-stop.disabled): Deleted.
3713         (.content-view.canvas-overview .content-view.canvas:not(.is-recording) > header > .navigation-bar > .item.record-start-stop:not(.disabled):hover): Deleted.
3714         (.content-view.canvas-overview .content-view.canvas:not(.is-recording) > header > .navigation-bar > .item.record-start-stop:not(.disabled):active): Deleted.
3715         (.content-view.canvas-overview .content-view.canvas.is-recording > .progress-vie): Deleted.
3716         (.content-view.canvas-overview .content-view.canvas.is-recording > .preview): Deleted.
3717         (.content-view.canvas-overview .content-view.canvas.is-recording): Deleted.
3718         (.content-view.canvas-overview .content-view.canvas.is-recording > header): Deleted.
3719         (.content-view.canvas-overview .content-view.canvas.is-recording > header > .titles > .subtitle): Deleted.
3720
3721         * UserInterface/Views/CanvasContentView.js:
3722         (WI.CanvasContentView.prototype.attached):
3723         (WI.CanvasContentView.prototype.detached):
3724         (WI.CanvasContentView.prototype._toggleRecording):
3725         (WI.CanvasContentView.prototype._recordingProgress):
3726         (WI.CanvasContentView.prototype._recordingStopped):
3727         (WI.CanvasContentView.prototype._shaderProgramAdded):
3728         (WI.CanvasContentView.prototype._shaderProgramRemoved):
3729         (WI.CanvasContentView.prototype._updateRecordNavigationItem):
3730         (WI.CanvasContentView.prototype._updateProgressView):
3731
3732         * UserInterface/Views/CanvasSidebarPanel.js:
3733         (WI.CanvasSidebarPanel):
3734         (WI.CanvasSidebarPanel.prototype.set canvas):
3735         (WI.CanvasSidebarPanel.prototype._toggleRecording):
3736         (WI.CanvasSidebarPanel.prototype._updateRecordNavigationItem):
3737
3738         * UserInterface/Views/CanvasTreeElement.js:
3739         (WI.CanvasTreeElement):
3740         (WI.CanvasTreeElement.prototype._updateStatus):
3741
3742 2018-10-08  Devin Rousso  <drousso@apple.com>
3743
3744         Web Inspector: replace Range.svg icon
3745         https://bugs.webkit.org/show_bug.cgi?id=190372
3746
3747         Reviewed by Joseph Pecoraro.
3748
3749         * UserInterface/Images/Range.svg:
3750         * UserInterface/Images/RangeLarge.svg: Added.
3751
3752         * UserInterface/Models/Resource.js:
3753         (WI.Resource.classNameForResource): Added.
3754         Create a static function for specializing the `className` of `WI.Resource` objects.
3755
3756         * UserInterface/Views/NetworkTableContentView.js:
3757         (WI.NetworkTableContentView.prototype._populateNameCell):
3758
3759         * UserInterface/Views/ResourceTreeElement.js:
3760         (WI.ResourceTreeElement):
3761
3762         * UserInterface/Views/ResourceIcons.css:
3763         (.resource-icon.resource-type-ping .icon, .resource-icon.resource-type-beacon .icon, .large .resource-icon.resource-type-ping .icon, .large .resource-icon.resource-type-beacon .icon):
3764         (.resource-icon.resource-type-range .icon):
3765         (.large .resource-icon.resource-type-range .icon): Added.
3766         Drive-by: added `.large` versions of `ping` and `beacon` icons for the
3767         `WI.OpenResourceDialog` elements.
3768
3769 2018-10-08  Devin Rousso  <drousso@apple.com>
3770
3771         Web Inspector: group media network entries by the node that triggered the request
3772         https://bugs.webkit.org/show_bug.cgi?id=189606
3773         <rdar://problem/44438527>
3774
3775         Reviewed by Brian Burg.
3776
3777         Introduces a `WI.NavigationItem` for changing whether network entries are grouped by the
3778         node that initiated the load (if applicable). When grouped by node, a tree-like layout of
3779         the table cells (including expand/collapse) is used for resources that share the same
3780         initiator node. The values for the node's cell are based on it's initated resources.
3781
3782         * Localizations/en.lproj/localizedStrings.js:
3783         * UserInterface/Base/Setting.js:
3784
3785         * UserInterface/Controllers/DOMManager.js:
3786         (WI.DOMManager):
3787         (WI.DOMManager.prototype._mainResourceDidChange): Added.
3788         Whenever the frame navigates, re-request the document so that `NetworkAgent` is able to send
3789         valid `nodeId` for each request's `initiatorNode`. This means that the document should
3790         always be available.
3791
3792         * UserInterface/Views/NetworkTableContentView.js:
3793         (WI.NetworkTableContentView):
3794         (WI.NetworkTableContentView.prototype.get filterNavigationItems):
3795         (WI.NetworkTableContentView.prototype.closed):
3796         (WI.NetworkTableContentView.prototype.reset):
3797         (WI.NetworkTableContentView.prototype.tableSortChanged):
3798         (WI.NetworkTableContentView.prototype.tableSelectedRowChanged):
3799         (WI.NetworkTableContentView.prototype.tablePopulateCell):
3800         (WI.NetworkTableContentView.prototype._populateNameCell.createIconElement): Added.
3801         (WI.NetworkTableContentView.prototype._populateNameCell):
3802         (WI.NetworkTableContentView.prototype._populateDomainCell.createIconAndText): Added.
3803         (WI.NetworkTableContentView.prototype._populateDomainCell):
3804         (WI.NetworkTableContentView.prototype._populateInitiatorCell):
3805         (WI.NetworkTableContentView.prototype._populateTransferSizeCell):
3806         (WI.NetworkTableContentView.prototype._generateSortComparator):
3807         (WI.NetworkTableContentView.prototype._processPendingEntries):
3808         (WI.NetworkTableContentView.prototype._updateEntryForResource.updateExistingEntry): Added.
3809         (WI.NetworkTableContentView.prototype._updateEntryForResource):
3810         (WI.NetworkTableContentView.prototype._insertResourceAndReloadTable):
3811         (WI.NetworkTableContentView.prototype._entryForDOMNode): Added.
3812         (WI.NetworkTableContentView.prototype._tryLinkResourceToDOMNode): Added.
3813         (WI.NetworkTableContentView.prototype._uniqueValuesForDOMNodeEntry): Added.
3814         (WI.NetworkTableContentView.prototype._updateFilteredEntries):
3815         (WI.NetworkTableContentView.prototype._handleGroupByDOMNodeCheckedDidChange): Added.
3816         * UserInterface/Views/NetworkTableContentView.css:
3817         (.network-table .cell.dom-node.name .icon): Added.
3818         (.network-table .cell.dom-node.name .disclosure): Added.
3819         (body[dir=rtl] .network-table .cell.dom-node.name .disclosure): Added.
3820         (.network-table:focus li.selected .cell.dom-node.name .disclosure): Added.
3821         (.network-table .cell.dom-node.name .disclosure.expanded): Added.
3822         (.network-table:focus li.selected .cell.node.name .disclosure.expanded): Added.
3823         (.network-table .cell.grouped-by-node.name): Added.
3824         (body[dir=ltr] .network-table .cell.grouped-by-node.name): Added.
3825         (body[dir=rtl] .network-table .cell.grouped-by-node.name): Added.