Web Inspector: Autoformat doesn't work on icloud.com (javascript-packed.js)
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2018-12-20  Joseph Pecoraro  <pecoraro@apple.com>
2
3         Web Inspector: Autoformat doesn't work on icloud.com (javascript-packed.js)
4         https://bugs.webkit.org/show_bug.cgi?id=192946
5         <rdar://problem/42546126>
6
7         Rubber-stamped by Devin Rousso.
8
9         * UserInterface/Base/Utilities.js:
10         (whitespaceRatio):
11         (isTextLikelyMinified):
12         Check the first 2500 and the last 2500 characters whitespace ratio.
13         If either is below 20% then treat as minified.
14
15 2018-12-20  Joseph Pecoraro  <pecoraro@apple.com>
16
17         ITMLKit Inspector: Elements tab does not show DOM Tree
18         https://bugs.webkit.org/show_bug.cgi?id=192910
19         <rdar://problem/46680585>
20
21         Reviewed by Brian Burg.
22
23         * UserInterface/Protocol/Connection.js:
24         (InspectorBackend.Connection.prototype._dispatchEvent):
25         Better logging for errors.
26
27         * UserInterface/Base/Main.js:
28         * UserInterface/Controllers/AppController.js:
29         (WI.AppController.prototype.activateExtraDomains):
30         Let Targets get a chance to activate extra domains.
31         Perform a little more work in these cases.
32
33         * UserInterface/Protocol/Target.js:
34         (WI.Target):
35         (WI.Target.prototype.activateExtraDomain):
36         Expose agents for domains that are active.
37         Expose agents for extra domains when they are activated.
38
39 2018-12-20  Joseph Pecoraro  <pecoraro@apple.com>
40
41         ITMLKit Inspector: Computed Style Box Model section throws exceptions
42         https://bugs.webkit.org/show_bug.cgi?id=192911
43         <rdar://problem/46861112>
44
45         Reviewed by Matt Baker.
46
47         * UserInterface/Views/BoxModelDetailsSectionRow.js:
48         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement):
49         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement):
50         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics):
51         ITMLKit doesn't always provide a display/position/width/height etc properties.
52         Protect against this, and just show an empty message in the box model section
53         if those properties do not exist.
54
55 2018-12-20  Devin Rousso  <drousso@apple.com>
56
57         Web Inspector: UIString should take an optional key and description to aid localization
58         https://bugs.webkit.org/show_bug.cgi?id=153962
59         <rdar://problem/24542505>
60
61         Reviewed by Brian Burg.
62
63         * UserInterface/Base/LoadLocalizedStrings.js:
64         (WI.UIString):
65
66         * UserInterface/Test/Test.js:
67         (WI.UIString):
68
69         * UserInterface/Views/AuditTestGroupContentView.js:
70         (WI.AuditTestGroupContentView.prototype.initialLayout):
71
72 2018-12-20  Devin Rousso  <drousso@apple.com>
73
74         Web Inspector: Audits: don't cache default audits
75         https://bugs.webkit.org/show_bug.cgi?id=192918
76         <rdar://problem/46626543>
77
78         Reviewed by Brian Burg.
79
80         Instead of adding the default audits to the "audits" `WI.ObjectStore`, which preserves them
81         across WebInspector sessions, load them every time WebInspector is opened (unless there are
82         existing audits) so that the localized strings are able to respond to locale changes.
83
84         * UserInterface/Controllers/AuditManager.js:
85         (WI.AuditManager.prototype.removeTest):
86         (WI.AuditManager.prototype.addDefaultTestsIfNeeded):
87
88 2018-12-20  Devin Rousso  <drousso@apple.com>
89
90         Web Inspector: Dark Mode: unreadable background color for tables containing object previews
91         https://bugs.webkit.org/show_bug.cgi?id=192887
92         <rdar://problem/46855270>
93
94         Reviewed by Brian Burg.
95
96         * UserInterface/Views/LogContentView.css:
97         (.console-messages:focus .console-item .data-grid tr.selected td:not(:last-child)): Added.
98         (@media (prefers-dark-interface) .console-item .data-grid tr.selected): Added.
99         (@media (prefers-dark-interface) .console-messages:focus .console-item.selected .data-grid tr.selected): Added.
100         (@media (prefers-dark-interface) .console-messages:focus .console-item .data-grid tr.selected td:not(:last-child)): Added.
101
102         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.css:
103         (.content-view.indexed-database-object-store > .data-grid tr.selected):
104         (.content-view.indexed-database-object-store > .data-grid:focus tr.selected): Added.
105         (@media (prefers-dark-interface) .content-view.indexed-database-object-store > .data-grid tr.selected): Added.
106         (@media (prefers-dark-interface) .content-view.indexed-database-object-store > .data-grid:focus tr.selected): Added.
107         (@media (prefers-dark-interface) .content-view.indexed-database-object-store > .data-grid:focus tr.selected td:not(:last-child)): Added.
108
109 2018-12-19  Devin Rousso  <drousso@apple.com>
110
111         Web Inspector: Audit: fix descriptions for default tests
112         https://bugs.webkit.org/show_bug.cgi?id=192764
113         <rdar://problem/46729437>
114
115         Reviewed by Matt Baker.
116
117         * UserInterface/Controllers/AuditManager.js:
118         (WI.AuditManager.prototype.addDefaultTestsIfNeeded):
119
120         * Localizations/en.lproj/localizedStrings.js:
121
122 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
123
124         Web Inspector: "E" icon on debugger dashboard is too close to current function name
125         https://bugs.webkit.org/show_bug.cgi?id=192915
126
127         Reviewed by Matt Baker.
128
129         * UserInterface/Views/DebuggerDashboardView.css:
130         (.dashboard.debugger > .location):
131         (body[dir=ltr] .dashboard.debugger > .location :matches(.function-icon, .event-listener-icon)):
132         (body[dir=rtl] .dashboard.debugger > .location :matches(.function-icon, .event-listener-icon)):
133         (.dashboard.debugger > .location .function-icon): Deleted.
134         (body[dir=ltr] .dashboard.debugger > .location .function-icon): Deleted.
135         (body[dir=rtl] .dashboard.debugger > .location .function-icon): Deleted.
136
137 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
138
139         Web Inspector: Dark Mode: ThreadTreeElement status icon is hard to see when hovered
140         https://bugs.webkit.org/show_bug.cgi?id=192097
141         <rdar://problem/46318421>
142
143         Reviewed by Matt Baker.
144
145         * UserInterface/Views/ThreadTreeElement.css:
146         (.tree-outline > .item.thread .status-button.resume):
147         (.tree-outline > .item.thread .status-button.resume:active):
148
149 2018-12-19  Devin Rousso  <drousso@apple.com>
150
151         Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'effectiveDOMNode.enabledPseudoClasses')
152         https://bugs.webkit.org/show_bug.cgi?id=192783
153
154         Reviewed by Joseph Pecoraro.
155
156         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
157         (WI.GeneralStyleDetailsSidebarPanel.prototype._forcedPseudoClassCheckboxChanged):
158         (WI.GeneralStyleDetailsSidebarPanel.prototype._updatePseudoClassCheckboxes):
159
160 2018-12-19  Devin Rousso  <drousso@apple.com>
161
162         Web Inspector: REGRESSION (r237195): Timelines: selecting a rendering frame row moves the time selection
163         https://bugs.webkit.org/show_bug.cgi?id=192773
164         <rdar://problem/46782446>
165
166         Reviewed by Joseph Pecoraro.
167
168         * UserInterface/Views/TimelineOverview.js:
169         (WI.TimelineOverview.prototype._recordSelected):
170         The Frames timeline uses `frameIndex` instead of `startTime`/`endTime`, so when trying to
171         ensure that the selected record is within the filtered range, use `frameIndex` instead.
172         The associated `WI.TimelineRuler` will already be using an index-based approach for
173         selection, so this will match.
174
175 2018-12-19  Devin Rousso  <drousso@apple.com>
176
177         Web Inspector: Canvas: the recording auto-capture input shouldn't start focused
178         https://bugs.webkit.org/show_bug.cgi?id=192454
179
180         Reviewed by Joseph Pecoraro.
181
182         * UserInterface/Views/CanvasOverviewContentView.js:
183         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel):
184         (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged):
185
186 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
187
188         Web Inspector: Styles: shift-clicking a color-swatch to change formats starts editing the color
189         https://bugs.webkit.org/show_bug.cgi?id=192784
190         <rdar://problem/46801028>
191
192         Reviewed by Devin Rousso.
193
194         * UserInterface/Views/SpreadsheetStyleProperty.js:
195         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
196
197 2018-12-19  Matt Baker  <mattbaker@apple.com>
198
199         Web Inspector: Elements tab: arrow key after undoing a DOM node delete selects the wrong element
200         https://bugs.webkit.org/show_bug.cgi?id=192871
201         <rdar://problem/46849060>
202
203         Reviewed by Devin Rousso.
204
205         Undoing a DOM node removal reinserts the node into the DOMTreeOutline.
206         When the reinserted node precedes the selected node in the tree, the
207         SelectionController should update `_lastSelectedIndex`.
208
209         * UserInterface/Controllers/SelectionController.js:
210         (WI.SelectionController.prototype.didInsertItem):
211
212 2018-12-19  Devin Rousso  <drousso@apple.com>
213
214         Web Inspector: Audit: provide localization support for % pass display
215         https://bugs.webkit.org/show_bug.cgi?id=192870
216         <rdar://problem/46779245>
217
218         Reviewed by Brian Burg.
219
220         * UserInterface/Views/AuditTestGroupContentView.js:
221         (WI.AuditTestGroupContentView.prototype.initialLayout):
222         (WI.AuditTestGroupContentView.prototype.layout):
223         * UserInterface/Views/AuditTestGroupContentView.css:
224         (.content-view.audit-test-group > header > .percentage-pass):
225         (.content-view.audit-test-group > header > .percentage-pass > span): Added.
226         (@media (prefers-dark-interface) .content-view.audit-test-group > header > .percentage-pass): Added.
227         (@media (prefers-dark-interface) .content-view.audit-test-group > header > .percentage-pass > span): Added.
228         (.content-view.audit-test-group > header > .percentage-pass:not(:empty)::after): Deleted.
229
230         * Localizations/en.lproj/localizedStrings.js:
231
232 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
233
234         Web Inspector: Computed: make UI more usable when the panel is narrow
235         https://bugs.webkit.org/show_bug.cgi?id=192578
236         <rdar://problem/46615753>
237
238         Reviewed by Devin Rousso.
239
240         * UserInterface/Views/ComputedStyleSection.css:
241         (.computed-style-section .computed-property-item .property-traces):
242         (.computed-style-section .computed-property-item.expanded .disclosure-button):
243         (.computed-style-section .computed-property-item .property-trace-item):
244         (.computed-style-section .computed-property-item .property-trace-item::before):
245         (.computed-style-section .computed-property-item .property):
246         (.computed-style-section .computed-property-item .property-trace-item .selector):
247         Allow CSS property values and selectors to take more than one line.
248
249         (.computed-style-section .property-trace-item .property .name,):
250         * UserInterface/Views/ComputedStyleSection.js:
251         (WI.ComputedStyleSection.prototype._createTrace):
252         * UserInterface/Views/SpreadsheetStyleProperty.js:
253         (WI.SpreadsheetStyleProperty.prototype.update):
254
255 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
256
257         Web Inspector: Timelines: correctly label Intersection Observer callbacks
258         https://bugs.webkit.org/show_bug.cgi?id=192669
259         <rdar://problem/46702490>
260
261         Reviewed by Joseph Pecoraro.
262
263         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
264         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
265         that they get correctly labeled in the Inspector timeline.
266
267         * Localizations/en.lproj/localizedStrings.js:
268         * UserInterface/Controllers/TimelineManager.js:
269         (WI.TimelineManager.prototype._processRecord):
270         * UserInterface/Models/ScriptTimelineRecord.js:
271         (WI.ScriptTimelineRecord.EventType.displayName):
272         * UserInterface/Views/TimelineTabContentView.js:
273         (WI.TimelineTabContentView.iconClassNameForRecord):
274
275 2018-12-19  Devin Rousso  <drousso@apple.com>
276
277         Web Inspector: Audit: "Clear Filters" button gets clipped when window is vertically small
278         https://bugs.webkit.org/show_bug.cgi?id=192868
279         <rdar://problem/46780400>
280
281         Reviewed by Matt Baker.
282
283         * UserInterface/Views/Main.css:
284         (.message-text-view):
285
286 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
287
288         Web Inspector: Dark Mode: selected text is too light when Inspector window is inactive
289         https://bugs.webkit.org/show_bug.cgi?id=190542
290         <rdar://problem/45238712>
291
292         Reviewed by Devin Rousso.
293
294         * UserInterface/Views/CodeMirrorOverrides.css:
295         (.CodeMirror .CodeMirror-selected):
296
297 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
298
299         Web Inspector: column sort controls in Layers tab sidebar don't render correctly in dark mode
300         https://bugs.webkit.org/show_bug.cgi?id=192845
301
302         Reviewed by Devin Rousso.
303
304         * UserInterface/Views/DataGrid.css:
305         (@media (prefers-dark-interface)):
306         (.data-grid th.sortable:active):
307         Drive-by: replace obnoxiously light background of the pressed header with a more subtle gray.
308
309         (.data-grid th.sort-ascending > div:first-child::after, .data-grid th.sort-descending > div:first-child::after):
310         Invert colors of the arrow glyph.
311
312 2018-12-18  Devin Rousso  <drousso@apple.com>
313
314         Web Inspector: Layers: increase default column width for other localizations
315         https://bugs.webkit.org/show_bug.cgi?id=192812
316         <rdar://problem/46628625>
317
318         Reviewed by Brian Burg.
319
320         * UserInterface/Views/LayerDetailsSidebarPanel.js:
321         (WI.LayerDetailsSidebarPanel.prototype._buildDataGrid):
322         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
323         (WI.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
324
325 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
326
327         Web Inspector: m3u8 content not shown, it should be text
328         https://bugs.webkit.org/show_bug.cgi?id=192731
329         <rdar://problem/46747728>
330
331         Reviewed by Devin Rousso.
332
333         * UserInterface/Base/MIMETypeUtilities.js:
334         (WI.shouldTreatMIMETypeAsText):
335         Support m3u8/m3u files as text.
336
337 2018-12-17  Devin Rousso  <drousso@apple.com>
338
339         Web Inspector: Canvas: path view is misaligned
340         https://bugs.webkit.org/show_bug.cgi?id=192761
341
342         Reviewed by Joseph Pecoraro.
343
344         * UserInterface/Views/RecordingContentView.css:
345         (.content-view:not(.tab).recording :matches(img, canvas)):
346         (.content-view:not(.tab).recording canvas.path):
347
348 2018-12-17  Devin Rousso  <drousso@apple.com>
349
350         Web Inspector: Audit: add plural result strings
351         https://bugs.webkit.org/show_bug.cgi?id=192769
352         <rdar://problem/46628680>
353
354         Reviewed by Brian Burg.
355
356         * UserInterface/Views/AuditTestContentView.js:
357         (WI.AuditTestContentView.prototype.showNoResultDataPlaceholder):
358
359         * UserInterface/Views/AuditTestGroupContentView.js:
360         (WI.AuditTestGroupContentView.prototype.layout):
361
362         * Localizations/en.lproj/localizedStrings.js:
363
364 2018-12-17  Devin Rousso  <drousso@apple.com>
365
366         Web Inspector: Settings: add singular "space" UIString
367         https://bugs.webkit.org/show_bug.cgi?id=192766
368         <rdar://problem/46776948>
369
370         Reviewed by Brian Burg.
371
372         * UserInterface/Views/SettingEditor.js:
373         (WI.SettingEditor):
374         (WI.SettingEditor.prototype.get label):
375         (WI.SettingEditor.prototype.set label): Added.
376
377         * UserInterface/Views/SettingsTabContentView.js:
378         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
379         (WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting): Added.
380         (WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting.updateLabel): Added.
381
382         * Localizations/en.lproj/localizedStrings.js:
383
384 2018-12-15  Nikita Vasilyev  <nvasilyev@apple.com>
385
386         Web Inspector: Styles: toggling selected properties may cause data corruption
387         https://bugs.webkit.org/show_bug.cgi?id=192396
388         <rdar://problem/46478383>
389
390         Reviewed by Devin Rousso.
391
392         Uncommenting a property after a commented out property used to insert an unnecessary semicolon,
393         and not updating ranges of the following properties.
394
395         For example:
396
397             /* color: red; */
398             /* font-size: 12px */
399
400         Uncommenting `font-size` would result in something like this:
401
402             /* color: red; */; font-size: 12px
403                              ^
404                              unnecessary semicolon
405
406         Now the semicolon doesn't get inserted and the white space is preserved better:
407
408             /* color: red; */
409             font-size: 12px
410
411         * UserInterface/Models/CSSProperty.js:
412         (WI.CSSProperty.prototype._updateOwnerStyleText):
413         (WI.CSSProperty.prototype._appendSemicolonIfNeeded): Removed.
414         (WI.CSSProperty.prototype._prependSemicolonIfNeeded): Added.
415
416         * UserInterface/Views/SpreadsheetStyleProperty.js:
417         (WI.SpreadsheetStyleProperty.prototype.remove):
418         (WI.SpreadsheetStyleProperty.prototype.update):
419         (WI.SpreadsheetStyleProperty.prototype._handleNameChange):
420         (WI.SpreadsheetStyleProperty.prototype._handleValueChange):
421         Style declaration should be locked while editing. Add asserts to ensure this.
422
423 2018-12-14  Matt Baker  <mattbaker@apple.com>
424
425         Web Inspector: REGRESSION(r238599): Uncaught Exception: TypeError: null is not an object (evaluating 'treeElement.listItemElement.classList')
426         https://bugs.webkit.org/show_bug.cgi?id=192090
427         <rdar://problem/46318614>
428
429         Reviewed by Devin Rousso.
430
431         * UserInterface/Views/TreeOutline.js:
432         (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
433         Check that `listItemElement` is valid before accessing it to update class
434         names. The selection can change before the TreeElement has been attached.
435
436 2018-12-14  Matt Baker  <mattbaker@apple.com>
437
438         Web Inspector: Cookies view should use model objects instead of raw payload data
439         https://bugs.webkit.org/show_bug.cgi?id=189533
440         <rdar://problem/44364183>
441
442         Reviewed by Joseph Pecoraro and Devin Rousso.
443
444         * UserInterface/Models/Cookie.js:
445         (WI.Cookie):
446         (WI.Cookie.fromPayload):
447         (WI.Cookie.parseSetCookieResponseHeader):
448         (WI.Cookie.prototype.get type):
449         (WI.Cookie.prototype.get name):
450         (WI.Cookie.prototype.get value):
451         (WI.Cookie.prototype.get header):
452         (WI.Cookie.prototype.get expires):
453         (WI.Cookie.prototype.get maxAge):
454         (WI.Cookie.prototype.get path):
455         (WI.Cookie.prototype.get domain):
456         (WI.Cookie.prototype.get secure):
457         (WI.Cookie.prototype.get httpOnly):
458         (WI.Cookie.prototype.get sameSite):
459         (WI.Cookie.prototype.get size):
460         (WI.Cookie.prototype.get url):
461         (WI.Cookie.prototype.expirationDate):
462         Cleanup Cookie object; add pubic getters for data, `url` property,
463         static `fromPayload` method, and calculate `_size` if missing.
464
465         * UserInterface/Views/CookieStorageContentView.js:
466         (WI.CookieStorageContentView.prototype.tableDidRemoveRows):
467         (WI.CookieStorageContentView.prototype._reloadCookies):
468         Create Cookie objects from the payload instead of using raw payload data.
469
470 2018-12-13  Devin Rousso  <drousso@apple.com>
471
472         Web Inspector: remove DOM.BackendNodeId and associated commands/events
473         https://bugs.webkit.org/show_bug.cgi?id=192478
474
475         Reviewed by Matt Baker.
476
477         * Versions/Inspector-iOS-8.0.json:
478         * Versions/Inspector-iOS-9.0.json:
479         * Versions/Inspector-iOS-9.3.json:
480         * Versions/Inspector-iOS-10.0.json:
481         * Versions/Inspector-iOS-10.3.json:
482         * Versions/Inspector-iOS-11.0.json:
483         * Versions/Inspector-iOS-11.3.json:
484         * Versions/Inspector-iOS-12.0.json:
485         * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
486         * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
487         * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
488         * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
489         * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
490         * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
491         * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
492         * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
493
494 2018-12-13  Devin Rousso  <drousso@apple.com>
495
496         Web Inspector: experimental settings reload button disappears after changing more than one setting
497         https://bugs.webkit.org/show_bug.cgi?id=192645
498         <rdar://problem/46626204>
499
500         Reviewed by Joseph Pecoraro.
501
502         * UserInterface/Views/SettingsTabContentView.js:
503         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView.listenForChange):
504         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
505
506 2018-12-13  Matt Baker  <mattbaker@apple.com>
507
508         Web Inspector: REGRESSION(r238602): Elements: deleting multiple DOM nodes doesn't select the nearest node after deletion
509         https://bugs.webkit.org/show_bug.cgi?id=192116
510         <rdar://problem/46344339>
511
512         Reviewed by Devin Rousso.
513
514         * UserInterface/Controllers/SelectionController.js:
515         (WI.SelectionController.prototype.removeSelectedItems):
516         Finding a new index to select should go through the delegate instead of
517         naively advancing the index.
518
519         * UserInterface/Views/DOMTreeElement.js:
520         (WI.DOMTreeElement.prototype._populateNodeContextMenu):
521         (WI.DOMTreeElement.prototype.ondelete): Deleted.
522         The menu item for removing the DOM node is now managed by the parent
523         DOMTreeOutline, since its UI and behavior now depend on whether there
524         are multiple elements selected.
525
526         * UserInterface/Views/DOMTreeOutline.js:
527         (WI.DOMTreeOutline.prototype.populateContextMenu):
528         (WI.DOMTreeOutline.prototype.ondelete.level):
529         (WI.DOMTreeOutline.prototype.ondelete):
530         Implement `ondelete` to remove selected DOM nodes using the delete and
531         backspace keys. Also used by the DOMTreeOutline's context menu handler.
532
533 2018-12-13  Matt Baker  <mattbaker@apple.com>
534
535         Web Inspector: Table selection becomes corrupted when deleting selected cookies
536         https://bugs.webkit.org/show_bug.cgi?id=192388
537         <rdar://problem/46472364>
538
539         Reviewed by Devin Rousso.
540
541         * UserInterface/Controllers/SelectionController.js:
542         (WI.SelectionController):
543         (WI.SelectionController.prototype.didRemoveItems):
544         (WI.SelectionController.prototype._updateSelectedItems):
545         (WI.SelectionController.prototype.didRemoveItem): Deleted.
546         Replace `didRemoveItem` with a method taking an IndexSet. Calling the
547         single-index version while iterating over multiple rows in ascending
548         order is unsafe, a detail best left to the SelectionController.
549
550         * UserInterface/Views/Table.js:
551         (WI.Table.prototype.removeRow):
552         (WI.Table.prototype._removeRows):
553         Notify SelectionController of removed rows.
554
555         * UserInterface/Views/TreeOutline.js:
556         (WI.TreeOutline.prototype.insertChild):
557         (WI.TreeOutline.prototype.removeChildAtIndex):
558         Remove the child from the element's `children` after calling `_forgetTreeElement`,
559         which needs to calculate the child's index to pass to the SelectionController.
560
561         (WI.TreeOutline.prototype.removeChildren):
562         Remove child items during iteration so that `children` doesn't contain
563         detached TreeElements while calling `_forgetTreeElement`.
564
565         (WI.TreeOutline.prototype._rememberTreeElement):
566         (WI.TreeOutline.prototype._forgetTreeElement):
567
568 2018-12-10  Matt Baker  <mattbaker@apple.com>
569
570         Web Inspector: REGRESSION (r238599): unable to select specific timeline
571         https://bugs.webkit.org/show_bug.cgi?id=192443
572         <rdar://problem/46608087>
573
574         Reviewed by Joseph Pecoraro.
575
576         When determining the trailing horizontal edge for TreeElement mouse
577         events, TreeOutline should not assume that its containing DOM element
578         is only as wide as its <ol> element.
579
580         * UserInterface/Views/TreeOutline.js:
581         (WI.TreeOutline.prototype.treeElementFromEvent):
582
583 2018-12-10  Matt Baker  <mattbaker@apple.com>
584
585         Web Inspector: Move TreeOutlineGroup coordination out of TreeElement
586         https://bugs.webkit.org/show_bug.cgi?id=192487
587         <rdar://problem/46543431>
588
589         Reviewed by Devin Rousso.
590
591         * UserInterface/Views/TreeElement.js:
592         (WI.TreeElement.prototype.select):
593         (WI.TreeElement.prototype.deselect):
594
595         * UserInterface/Views/TreeOutlineGroup.js:
596         (WI.TreeOutlineGroup):
597         (WI.TreeOutlineGroup.prototype.itemAdded):
598         (WI.TreeOutlineGroup.prototype.itemRemoved):
599         (WI.TreeOutlineGroup.prototype._removeConflictingTreeSelections):
600         (WI.TreeOutlineGroup.prototype._treeOutlineSelectionDidChange):
601         (WI.TreeOutlineGroup.groupForTreeOutline): Deleted.
602         (WI.TreeOutlineGroup.prototype.didSelectTreeElement): Deleted.
603         make the group responsible for listening to selection changes from the
604         TreeOutlines it manages, and synchronizing the selection between them.
605
606 2018-12-10  Dean Jackson  <dino@apple.com>
607
608         Use text/javascript as recommended by the HTML specification
609         https://bugs.webkit.org/show_bug.cgi?id=192525
610         <rdar://problem/46569636>
611
612         Reviewed by Jon Lee.
613
614         The HTML specification says we should use text/javascript for
615         JavaScript files:
616         https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type
617
618         * UserInterface/Base/MIMETypeUtilities.js:
619         (WI.mimeTypeForFileExtension):
620         * UserInterface/Views/TextEditor.js:
621         (WI.TextEditor.prototype._attemptToDetermineMIMEType):
622
623 2018-12-06  Matt Baker  <mattbaker@apple.com>
624
625         Web Inspector: REGRESSION(r238602): Elements: collapsing a DOM node with the left arrow doesn't work
626         https://bugs.webkit.org/show_bug.cgi?id=192353
627         <rdar://problem/46455019>
628
629         Reviewed by Devin Rousso.
630
631         * UserInterface/Views/TreeElement.js:
632         (WI.TreeElement.prototype.deselect):
633         Don't early return when the element is not the selected tree element.
634         This condition no longer holds now that TreeOutline supports multiple selection.
635
636 2018-12-05  Matt Baker  <mattbaker@apple.com>
637
638         Web Inspector: SelectionController should not extend the selection when allowsMultipleSelection is false
639         https://bugs.webkit.org/show_bug.cgi?id=192390
640         <rdar://problem/46473624>
641
642         Reviewed by Devin Rousso.
643
644         * UserInterface/Controllers/SelectionController.js:
645         (WI.SelectionController.prototype.selectItem):
646
647 2018-12-04  Nikita Vasilyev  <nvasilyev@apple.com>
648
649         Web Inspector: Add style editing debug mode
650         https://bugs.webkit.org/show_bug.cgi?id=192282
651         <rdar://problem/46399176>
652
653         Reviewed by Matt Baker.
654
655         Introduce a style editing debug mode to help to troubleshoot complex bugs in the style editor.
656
657           - Log CSS changes;
658           - Display red border for locked style declarations.
659
660         * UserInterface/Base/Setting.js:
661         * UserInterface/Models/CSSProperty.js:
662         (WI.CSSProperty.prototype._updateOwnerStyleText):
663         * UserInterface/Views/SettingsTabContentView.js:
664         (WI.SettingsTabContentView.prototype._createDebugSettingsView):
665         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
666         (.spreadsheet-style-declaration-editor.debug-style-locked::after):
667         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
668         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
669         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._updateStyleLock):
670         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._updateDebugLockStatus):
671
672 2018-12-04  Matt Baker  <mattbaker@apple.com>
673
674         Web Inspector: REGRESSION(r238602): Elements: changing selection no longer highlights the selected node
675         https://bugs.webkit.org/show_bug.cgi?id=192354
676         <rdar://problem/46444438>
677
678         Reviewed by Joseph Pecoraro.
679
680         * UserInterface/Views/TreeOutline.js:
681         (WI.TreeOutline.prototype._treeKeyDown):
682         (WI.TreeOutline.prototype._handleMouseDown):
683
684 2018-12-04  Joseph Pecoraro  <pecoraro@apple.com>
685
686         Web Inspector: REGRESSION(r238330): Timeline auto-capture does not work after page transition
687         https://bugs.webkit.org/show_bug.cgi?id=192248
688         <rdar://problem/46390199>
689
690         Reviewed by Devin Rousso.
691
692         * UserInterface/Base/Main.js:
693         (WI.transitionPageTarget):
694         Let the TimelineManager perform work on page transitions.
695
696         * UserInterface/Controllers/TimelineManager.js:
697         (WI.TimelineManager.prototype.initializeTarget):
698         Initialize the autocapture state of the target.
699
700         (WI.TimelineManager.prototype.transitionPageTarget):
701         When transitioning pages perform a legacy (frontend based) timeline capture.
702
703 2018-12-04  Matt Baker  <mattbaker@apple.com>
704
705         Web Inspector: Elements: $0 is shown for all selected elements
706         https://bugs.webkit.org/show_bug.cgi?id=192119
707         <rdar://problem/46327554>
708
709         Reviewed by Devin Rousso.
710
711         * UserInterface/Views/ContentBrowserTabContentView.js:
712         (WI.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObject):
713         * UserInterface/Views/DOMTreeContentView.js:
714         (WI.DOMTreeContentView):
715         (WI.DOMTreeContentView.prototype.layout):
716         (WI.DOMTreeContentView.prototype._domTreeSelectionDidChange):
717         Update the selected DOM node using the TreeOutline's selection change
718         event, instead of in `onselect`, which wasn't always called.
719
720         * UserInterface/Views/DOMTreeElement.js:
721         (WI.DOMTreeElement.prototype.onselect): Deleted.
722         (WI.DOMTreeElement.prototype.ondeselect): Deleted.
723         Eliminate `onselect` and `ondeselect`. TreeOutline clients should use
724         the TreeOutline.Event.SelectedDidChange event instead.
725
726         * UserInterface/Views/DOMTreeOutline.css:
727         (.tree-outline.dom li.last-selected > span::after):
728         (.tree-outline.dom:focus li.last-selected > span::after):
729         (.tree-outline.dom li.selected > span::after): Deleted.
730         (.tree-outline.dom:focus li.selected > span::after): Deleted.
731         * UserInterface/Views/DOMTreeOutline.js:
732         (WI.DOMTreeOutline.prototype.updateSelection): Deleted.
733
734         * UserInterface/Views/DebuggerSidebarPanel.js:
735         (WI.DebuggerSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):
736         * UserInterface/Views/FolderizedTreeElement.js:
737         (WI.FolderizedTreeElement.prototype._addTreeElement):
738         * UserInterface/Views/NavigationSidebarPanel.js:
739         (WI.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
740         (WI.NavigationSidebarPanel.prototype._treeElementWasFiltered):
741         (WI.NavigationSidebarPanel):
742         * UserInterface/Views/OpenResourceDialog.js:
743         (WI.OpenResourceDialog.prototype._populateResourceTreeOutline):
744         (WI.OpenResourceDialog.prototype._handleKeydownEvent):
745         * UserInterface/Views/SourceCodeTreeElement.js:
746         (WI.SourceCodeTreeElement.prototype.descendantResourceTreeElementTypeDidChange):
747         * UserInterface/Views/TreeElement.js:
748         (WI.TreeElement.prototype.select):
749         (WI.TreeElement.prototype.revealAndSelect):
750         (WI.TreeElement.prototype.deselect):
751         Remove `suppressOnDeselect` and rename `suppressOnSelect` to `suppressNotification`.
752         Now that `ondeselect` has been removed `suppressOnDeselect` is no longer
753         meaningful, as TreeOutline generates a single `SelectedDidChange` event
754         when the selected item changes. In the case of `revealAndSelect`, both
755         arguments had the same value.
756
757         * UserInterface/Views/TreeOutline.js:
758         (WI.TreeOutline):
759         (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
760         Add a unique class name to the last selected TreeElement to distinguish
761         it from other selected elements.
762
763 2018-12-04  Matt Baker  <mattbaker@apple.com>
764
765         Web Inspector: Elements: ⌘-A should select all visible nodes
766         https://bugs.webkit.org/show_bug.cgi?id=192120
767         <rdar://problem/46344435>
768
769         Reviewed by Devin Rousso.
770
771         * UserInterface/Views/TreeOutline.js:
772         (WI.TreeOutline.prototype._treeKeyDown):
773         Remove an early return, allowing `WI.SelectionController` to handle ⌘-A
774         and select all items.
775
776 2018-12-04  Devin Rousso  <drousso@apple.com>
777
778         Web Inspector: Audit: tests should support async operations
779         https://bugs.webkit.org/show_bug.cgi?id=192171
780         <rdar://problem/46423562>
781
782         Reviewed by Joseph Pecoraro.
783
784         * UserInterface/Controllers/RuntimeManager.js:
785         (WI.RuntimeManager.supportsAwaitPromise): Added.
786
787         * UserInterface/Models/AuditTestCase.js:
788         (WI.AuditTestCase.prototype.async run.async parseResponse.checkResultProperty.addErrorForValueType): Deleted.
789         (WI.AuditTestCase.prototype.async run.async parseResponse.checkResultProperty): Deleted.
790         (WI.AuditTestCase.prototype.async run.async parseResponse.async resultArrayForEach): Deleted.
791         (WI.AuditTestCase.prototype.async run.async parseResponse): Added.
792         (WI.AuditTestCase.prototype.async run):
793         (WI.AuditTestCase.prototype.async run.checkResultProperty.addErrorForValueType): Deleted.
794         (WI.AuditTestCase.prototype.async run.checkResultProperty): Deleted.
795         (WI.AuditTestCase.prototype.async run.async resultArrayForEach): Deleted.
796
797         * UserInterface/Models/AuditTestCaseResult.js:
798         (WI.AuditTestCaseResult.async fromPayload):
799         (WI.AuditTestCaseResult.prototype.toJSON):
800
801         * UserInterface/Views/AuditTestCaseContentView.js:
802         (WI.AuditTestCaseContentView.prototype.layout):
803
804 2018-12-03  Devin Rousso  <drousso@apple.com>
805
806         Web Inspector: Audit: save the expanded state of test groups
807         https://bugs.webkit.org/show_bug.cgi?id=192346
808         <rdar://problem/46440704>
809
810         Reviewed by Matt Baker.
811
812         * UserInterface/Views/AuditTreeElement.js:
813         (WI.AuditTreeElement):
814         (WI.AuditTreeElement.prototype.onattach):
815         (WI.AuditTreeElement.prototype.onexpand): Added.
816         (WI.AuditTreeElement.prototype.oncollapse): Added.
817
818 2018-12-03  Devin Rousso  <drousso@apple.com>
819
820         Web Inspector: Audit: sidebar briefly shows "No Filter Results" before populating default audits
821         https://bugs.webkit.org/show_bug.cgi?id=192341
822         <rdar://problem/46436550>
823
824         Reviewed by Matt Baker.
825
826         * UserInterface/Views/AuditNavigationSidebarPanel.js:
827         (WI.AuditNavigationSidebarPanel.prototype.initialLayout):
828         (WI.AuditNavigationSidebarPanel.prototype._addTest):
829         (WI.AuditNavigationSidebarPanel.prototype._addResult):
830         (WI.AuditNavigationSidebarPanel.prototype.applyFiltersToTreeElement): Deleted.
831         Delay the construction of the "Results" folder until it's needed, since adding a hidden
832         `WI.TreeElement` will cause the placeholder to appear.
833
834 2018-12-03  Devin Rousso  <drousso@apple.com>
835
836         Web Inspector: Audit: navigating while tests are running should stop and clear all results
837         https://bugs.webkit.org/show_bug.cgi?id=192317
838         <rdar://problem/46435222>
839
840         Reviewed by Joseph Pecoraro.
841
842         * UserInterface/Controllers/AuditManager.js:
843         (WI.AuditManager.prototype.async start):
844         (WI.AuditManager.prototype._handleFrameMainResourceDidChange):
845
846         * UserInterface/Views/AuditNavigationSidebarPanel.js:
847         (WI.AuditNavigationSidebarPanel.prototype.initialLayout):
848         Drive-by: pass the index of the saved result.
849
850 2018-12-03  Devin Rousso  <drousso@apple.com>
851
852         Web Inspector: Audit: "Add Default Audits" shown when there are no filter results
853         https://bugs.webkit.org/show_bug.cgi?id=192105
854
855         Reviewed by Matt Baker.
856
857         * UserInterface/Views/NavigationSidebarPanel.js:
858         (WI.NavigationSidebarPanel):
859         (WI.NavigationSidebarPanel.prototype.get hasActiveFilters): Added.
860         (WI.NavigationSidebarPanel.prototype.suppressFilteringOnTreeElements):
861         (WI.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder):
862         (WI.NavigationSidebarPanel.prototype.hideEmptyContentPlaceholder):
863         (WI.NavigationSidebarPanel.prototype.updateEmptyContentPlaceholder):
864         (WI.NavigationSidebarPanel.prototype.updateFilter):
865         (WI.NavigationSidebarPanel.prototype._checkForEmptyFilterResults.checkTreeOutlineForEmptyFilterResults):
866         (WI.NavigationSidebarPanel.prototype._filterDidChange):
867         (WI.NavigationSidebarPanel.prototype._updateFilter): Deleted.
868         (WI.NavigationSidebarPanel.prototype._createEmptyContentPlaceholderIfNeeded): Deleted.
869
870         * UserInterface/Views/AuditNavigationSidebarPanel.js:
871         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
872         Drive-by: change capitalization for consistency with other navigation sidebars.
873
874         * Localizations/en.lproj/localizedStrings.js:
875
876 2018-12-03  Devin Rousso  <drousso@apple.com>
877
878         Web Inspector: Canvas: add singular localized string for "Record first %s frames"
879         https://bugs.webkit.org/show_bug.cgi?id=192189
880
881         Reviewed by Joseph Pecoraro.
882
883         * UserInterface/Views/CanvasOverviewContentView.js:
884         (WI.CanvasOverviewContentView):
885         (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount):
886         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel): Added.
887         (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput):
888         (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged):
889         (WI.CanvasOverviewContentView.prototype.initialLayout): Deleted.
890         Drive-by: update the auto-capture navigation item when the view is first created so there is
891         no flashing of in the navigation bar (before `initialLayout` is called).
892
893         * UserInterface/Views/CheckboxNavigationItem.js:
894         (WI.CheckboxNavigationItem):
895         (WI.CheckboxNavigationItem.prototype.set label): Added.
896
897         * Localizations/en.lproj/localizedStrings.js:
898
899 2018-12-03  Matt Baker  <mattbaker@apple.com>
900
901         Web Inspector: REGRESSION(r238599): Multiple Selection: restoring selection when opening WebInspector puts the TreeElement into a permanent selected state
902         https://bugs.webkit.org/show_bug.cgi?id=192091
903         <rdar://problem/46321795>
904
905         Reviewed by Devin Rousso.
906
907         * UserInterface/Controllers/SelectionController.js:
908         (WI.SelectionController.prototype.didInsertItem):
909         Fix a bug where selected indexes were overwritten by the inserted index.
910
911         * UserInterface/Views/TreeOutline.js:
912         (WI.TreeOutline):
913         (WI.TreeOutline.prototype.insertChild):
914         Update the SelectionController with the newly inserted index before
915         attaching the TreeElement. Attaching the TreeElement can cause it to
916         become selected, which would add the index to the SelectionController,
917         only to have it immediately incremented by the call to `didInsertItem`.
918         Additionally, change `insertionIndex` to be the index of the inserted
919         item instead of the inserted item's previous sibling.
920
921         (WI.TreeOutline.prototype._rememberTreeElement):
922         (WI.TreeOutline.prototype._forgetTreeElement):
923         (WI.TreeOutline.prototype._indexOfTreeElement.previousElement): Deleted.
924         Eliminate TreeElement index caching, which could become stale and cause
925         the wrong index to be calculated. Additionally, instead of walking up the
926         parent chain to determine the index, start at the root and use existing
927         method `traverseNextTreeElement`.
928
929 2018-12-03  Devin Rousso  <drousso@apple.com>
930
931         Web Inspector: Audit: test tree elements should start out collapsed
932         https://bugs.webkit.org/show_bug.cgi?id=192107
933
934         Reviewed by Matt Baker.
935
936         * UserInterface/Views/AuditTreeElement.js:
937         (WI.AuditTreeElement.prototype.onattach):
938
939 2018-12-03  Nikita Vasilyev  <nvasilyev@apple.com>
940
941         Web Inspector: Styles: can't select properties of read-only rules
942         https://bugs.webkit.org/show_bug.cgi?id=192266
943
944         Reviewed by Devin Rousso.
945
946         Implement multiple properties selection for read-only rules (such as User Agent Stylesheets)
947         in the Styles panel.
948
949         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
950         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
951         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
952         Keep selection on layout.
953
954         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingFirstProperty):
955         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingLastProperty):
956         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyBlur):
957         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseEnter):
958         SpreadsheetCSSStyleDeclarationEditor is used by ComputedStyleDetailsPanel, which doesn't have:
959           - spreadsheetCSSStyleDeclarationEditorPropertyBlur
960           - spreadsheetCSSStyleDeclarationEditorPropertyMouseEnter
961
962         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyFocusMoved):
963         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
964         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
965         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
966         * UserInterface/Views/SpreadsheetStyleProperty.js:
967         (WI.SpreadsheetStyleProperty.prototype.startEditingName):
968         (WI.SpreadsheetStyleProperty.prototype.startEditingValue):
969
970 2018-11-30  Brian Burg  <bburg@apple.com>
971
972         Web Inspector: resource combining should be more robust against missing WebKitAdditions
973         https://bugs.webkit.org/show_bug.cgi?id=192255
974         <rdar://problem/46042879>
975
976         Reviewed by Joseph Pecoraro.
977
978         * Scripts/copy-user-interface-resources.pl:
979         (combineOrStripResourcesForWebKitAdditions):
980
981 2018-11-30  Nikita Vasilyev  <nvasilyev@apple.com>
982
983         Web Inspector: Jumping from Computed to Styles should select property
984         https://bugs.webkit.org/show_bug.cgi?id=192198
985
986         Reviewed by Devin Rousso.
987
988         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
989         (.spreadsheet-style-declaration-editor .property.highlighted): Deleted.
990         (@keyframes style-property-highlight): Deleted.
991         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
992         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty):
993         Remove unnecessary `__propertyView` property.
994
995         * UserInterface/Views/SpreadsheetStyleProperty.js:
996         (WI.SpreadsheetStyleProperty.prototype.detached):
997         (WI.SpreadsheetStyleProperty.prototype.highlight): Deleted.
998
999 2018-11-30  Matt Baker  <mattbaker@apple.com>
1000
1001         Web Inspector: REGRESSION(r238599): Multiple Selection: selecting a breakpoint will change the selection to it's parent on the first click
1002         https://bugs.webkit.org/show_bug.cgi?id=192093
1003         <rdar://problem/46318466>
1004
1005         Reviewed by Devin Rousso.
1006
1007         * UserInterface/Views/TreeElement.js:
1008         (WI.TreeElement.prototype.select):
1009         TreeElement shouldn't manage the TreeOutline's selection barrier.
1010
1011         * UserInterface/Views/TreeOutline.js:
1012         (WI.TreeOutline):
1013         (WI.TreeOutline.prototype.get processingSelectionChange):
1014         (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
1015         (WI.TreeOutline.prototype.selectTreeElementInternal):
1016         The selection re-entry barrier `processingSelectionChange` should be
1017         managed internally by TreeOutline, and exposed as a read-only property.
1018         Fix a bug where the barrier was cleared before dispatching the change
1019         notification, which can cause re-entry as a side effect.
1020
1021 2018-11-30  Devin Rousso  <drousso@apple.com>
1022
1023         Web Inspector: Settings: reload button needs horizontal spacing
1024         https://bugs.webkit.org/show_bug.cgi?id=192231
1025         <rdar://problem/46274363>
1026
1027         Reviewed by Matt Baker.
1028
1029         * UserInterface/Views/SettingsTabContentView.css:
1030         (.content-view.settings > .settings-view > .container button):
1031         (.content-view.settings > .settings-view > .container > .title):
1032         (.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]):
1033         (body[dir=ltr] .content-view.settings > .settings-view > .container > .title): Deleted.
1034         (body[dir=rtl] .content-view.settings > .settings-view > .container > .title): Deleted.
1035         (body[dir=ltr] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]): Deleted.
1036         (body[dir=rtl] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]): Deleted.
1037         Drive-by: replace `dir=*` attribute rules with `-webkit-margin-*` properties.
1038
1039 2018-11-30  Joseph Pecoraro  <pecoraro@apple.com>
1040
1041         Web Inspector: Uncaught Exception opening Web Inspector to Debugger Tab
1042         https://bugs.webkit.org/show_bug.cgi?id=192174
1043
1044         Reviewed by Devin Rousso.
1045
1046         * UserInterface/Protocol/InspectorBackend.js:
1047         (InspectorBackendClass.prototype.runAfterPendingDispatches):
1048         Dispatch the callback with a timeout if there is no backend target yet
1049         so it doesn't get lost.
1050
1051         * UserInterface/Protocol/Connection.js:
1052         (InspectorBackend.Connection.prototype.runAfterPendingDispatches):
1053         Change the ambiguous name "script" to the more familiar "callback".
1054
1055 2018-11-30  Devin Rousso  <drousso@apple.com>
1056
1057         Web Inspector: replace all unicode characters with the escaped character code
1058         https://bugs.webkit.org/show_bug.cgi?id=192216
1059         <rdar://problem/46275637>
1060
1061         Reviewed by Brian Burg.
1062
1063         * Localizations/en.lproj/localizedStrings.js:
1064         * UserInterface/Controllers/BreakpointPopoverController.js:
1065         * UserInterface/Debug/UncaughtExceptionReporter.js:
1066         * UserInterface/Models/AuditTestCase.js:
1067         * UserInterface/Models/Canvas.js:
1068         * UserInterface/Models/RecordingAction.js:
1069         * UserInterface/Models/ScriptTimelineRecord.js:
1070         * UserInterface/Views/AuditTestCaseContentView.js:
1071         * UserInterface/Views/AuditTestContentView.js:
1072         * UserInterface/Views/AuditTestGroupContentView.js:
1073         * UserInterface/Views/CallFrameView.js:
1074         * UserInterface/Views/CanvasContentView.js:
1075         * UserInterface/Views/CanvasOverviewContentView.css:
1076         * UserInterface/Views/ConsoleMessageView.css:
1077         * UserInterface/Views/ContextMenuUtilities.js:
1078         * UserInterface/Views/DOMEventsBreakdownView.js:
1079         * UserInterface/Views/DataGrid.css:
1080         * UserInterface/Views/DataGrid.js:
1081         * UserInterface/Views/DatabaseTableContentView.js:
1082         * UserInterface/Views/DebuggerDashboardView.css:
1083         * UserInterface/Views/DebuggerSidebarPanel.js:
1084         * UserInterface/Views/ErrorObjectView.js:
1085         * UserInterface/Views/EventBreakpointPopover.js:
1086         * UserInterface/Views/InlineSwatch.js:
1087         * UserInterface/Views/LayerTreeDataGridNode.js:
1088         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
1089         * UserInterface/Views/Layers3DContentView.js:
1090         * UserInterface/Views/LayoutTimelineDataGridNode.js:
1091         * UserInterface/Views/NetworkTableContentView.css:
1092         * UserInterface/Views/NetworkTableContentView.js:
1093         * UserInterface/Views/ObjectPreviewView.js:
1094         * UserInterface/Views/ProfileDataGridNode.js:
1095         * UserInterface/Views/ResourceTimelineDataGridNode.js:
1096         * UserInterface/Views/ScriptDetailsTimelineView.css:
1097         * UserInterface/Views/TextEditor.css:
1098         * UserInterface/Views/TreeOutline.css:
1099
1100 2018-11-29  Matt Baker  <mattbaker@apple.com>
1101
1102         Web Inspector: RTL: disclosure triangles should be flipped and aligned right
1103         https://bugs.webkit.org/show_bug.cgi?id=192089
1104         <rdar://problem/46316753>
1105
1106         Reviewed by Devin Rousso.
1107
1108         * UserInterface/Views/ComputedStyleSection.css:
1109         (.computed-style-section .computed-property-item .disclosure-button):
1110         (body[dir=rtl] .computed-style-section .computed-property-item .disclosure-button):
1111
1112         * UserInterface/Views/ConsoleMessageView.css:
1113         (.console-message.expandable .console-top-level-message::before):
1114         (body[dir=rtl] .console-message.expandable .console-top-level-message::before):
1115
1116         * UserInterface/Views/ErrorObjectView.css:
1117         (.error-object > .formatted-error::before):
1118         (body[dir=rtl] .error-object > .formatted-error::before):
1119         (.error-object .content):
1120
1121         * UserInterface/Views/LogContentView.css:
1122         (.console-group-title::before):
1123         (body[dir=ltr] .console-group-title::before):
1124         (body[dir=rtl] .console-group-title::before):
1125
1126         * UserInterface/Views/ObjectTreeView.css:
1127         (body[dir=rtl] .object-tree > :matches(.title, .object-preview)::before):
1128
1129         * UserInterface/Views/TypeTreeElement.css:
1130         (body[dir=rtl] .item.type-tree-element.parent > .disclosure-button):
1131
1132 2018-11-28  Dean Jackson  <dino@apple.com>
1133
1134         [ES Modules] Allow .mjs content when loaded from file://
1135         https://bugs.webkit.org/show_bug.cgi?id=192100
1136         <rdar://problem/46320065>
1137
1138         Reviewed by Sam Weinig.
1139
1140         Add a mapping from .mjs to application/javascript.
1141
1142         * UserInterface/Base/MIMETypeUtilities.js:
1143         (WI.mimeTypeForFileExtension):
1144
1145 2018-11-29  Matt Baker  <mattbaker@apple.com>
1146
1147         Web Inspector: Elements: selecting more than one DOM node causes the scope highlight to contrast
1148         https://bugs.webkit.org/show_bug.cgi?id=192118
1149         <rdar://problem/46325664>
1150
1151         Reviewed by Devin Rousso.
1152
1153         Use an alpha blended border for the "selected" DOM scope highlight,
1154         matching the "hovered" scope highlight.
1155
1156         * UserInterface/Views/DOMTreeOutline.css:
1157         (.tree-outline.dom li.selected + ol.children.expanded):
1158
1159 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
1160
1161         Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash
1162         https://bugs.webkit.org/show_bug.cgi?id=192016
1163         <rdar://problem/46284417>
1164
1165         Reviewed by Devin Rousso.
1166
1167         * UserInterface/Base/Main.js:
1168         (WI.loaded):
1169         (WI.initializeBackendTarget):
1170         (WI.contentLoaded):
1171         (WI.whenTargetsAvailable):
1172         Don't evaluate any InspectorFrontendAPI commands until the frontend
1173         has initialized a main target and the user interface.
1174
1175 2018-11-28  Nikita Vasilyev  <nvasilyev@apple.com>
1176
1177         Web Inspector: Styles: enable selection of multiple properties by default
1178         https://bugs.webkit.org/show_bug.cgi?id=192109
1179         <rdar://problem/46323565>
1180
1181         Reviewed by Devin Rousso.
1182
1183         * UserInterface/Base/Setting.js:
1184         * UserInterface/Views/SettingsTabContentView.js:
1185         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
1186         Remove the checkbox.
1187
1188         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
1189         (.spreadsheet-style-declaration-editor .property):
1190         (.spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)):
1191         (.spreadsheet-style-declaration-editor .property.selected):
1192         (.spreadsheet-style-declaration-editor .property.selected:focus):
1193         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property): Deleted.
1194         (.multiple-properties-selection .spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)): Deleted.
1195         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected): Deleted.
1196         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected:focus): Deleted.
1197         Remove `.multiple-properties-selection` class.
1198
1199         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
1200         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
1201         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
1202         (WI.SpreadsheetCSSStyleDeclarationSection):
1203         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
1204         * UserInterface/Views/SpreadsheetStyleProperty.js:
1205         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
1206         * UserInterface/Views/SpreadsheetTextField.js:
1207         (WI.SpreadsheetTextField):
1208         (WI.SpreadsheetTextField.prototype._handleFocus): Deleted.
1209
1210 2018-11-28  Devin Rousso  <drousso@apple.com>
1211
1212         Web Inspector: Audit: empty results folder is shown after clearing filters
1213         https://bugs.webkit.org/show_bug.cgi?id=192106
1214
1215         Reviewed by Matt Baker.
1216
1217         * UserInterface/Views/AuditNavigationSidebarPanel.js:
1218         (WI.AuditNavigationSidebarPanel.prototype.applyFiltersToTreeElement): Added.
1219
1220 2018-11-28  Matt Baker  <mattbaker@apple.com>
1221
1222         Web Inspector: Remove unused DataGrid and TreeOutline code
1223         https://bugs.webkit.org/show_bug.cgi?id=191622
1224         <rdar://problem/46052014>
1225
1226         Reviewed by Devin Rousso.
1227
1228         * UserInterface/Views/CanvasDetailsSidebarPanel.js:
1229         (WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
1230
1231         * UserInterface/Views/DOMTreeElement.js:
1232         (WI.DOMTreeElement.prototype.insertChildElement):
1233
1234         * UserInterface/Views/DOMTreeOutline.js:
1235         (WI.DOMTreeOutline):
1236         (WI.DOMTreeOutline.prototype.update):
1237
1238         * UserInterface/Views/DataGrid.js:
1239         (WI.DataGrid.prototype.removeChildrenRecursive): Deleted.
1240
1241         * UserInterface/Views/DataGridNode.js:
1242         (WI.DataGridNode.prototype.removeChildren):
1243         (WI.DataGridNode.prototype.removeChildrenRecursive): Deleted.
1244
1245         * UserInterface/Views/ErrorObjectView.css:
1246         (.error-object:not(.expanded) .content):
1247         (.error-object .content):
1248         (.error-object:not(.expanded) .tree-outline): Deleted.
1249         (.error-object .tree-outline): Deleted.
1250
1251         * UserInterface/Views/ErrorObjectView.js:
1252         (WI.ErrorObjectView):
1253         (WI.ErrorObjectView.prototype.get treeOutline): Deleted.
1254         Use a simple container since TreeOutline features aren't used,
1255         and remove unused property `treeOutline`.
1256
1257         * UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
1258         (WI.RecordingTraceDetailsSidebarPanel):
1259
1260         * UserInterface/Views/TreeElement.js:
1261         (WI.TreeElement.prototype.removeChildren):
1262         (WI.TreeElement.prototype.removeChildrenRecursive): Deleted.
1263
1264         * UserInterface/Views/TreeOutline.js:
1265         (WI.TreeOutline):
1266         (WI.TreeOutline.prototype.removeChildrenRecursive): Deleted.
1267         (WI.TreeOutline.prototype.reattachIfIndexChanged): Deleted.
1268         Removed `element` parameter now that the only use case has been removed.
1269
1270 2018-11-27  Matt Baker  <mattbaker@apple.com>
1271
1272         Web Inspector: Elements tab should allow selecting/deleting multiple DOM nodes
1273         https://bugs.webkit.org/show_bug.cgi?id=192059
1274         <rdar://problem/46294827>
1275
1276         Reviewed by Devin Rousso.
1277
1278         Enable multiple DOM node selection in the DOMTreeContentView.
1279
1280         * UserInterface/Controllers/SelectionController.js:
1281         (WI.SelectionController):
1282         (WI.SelectionController.prototype.get allowsEmptySelection):
1283         (WI.SelectionController.prototype.set allowsEmptySelection):
1284         Allow clients to control whether the last selected item can be deselected.
1285         (WI.SelectionController.prototype.deselectItem):
1286         (WI.SelectionController.prototype.didInsertItem):
1287         Rewritten to prevent infinite loop.
1288         (WI.SelectionController.prototype.didRemoveItem):
1289         (WI.SelectionController.prototype._updateSelectedItems):
1290         (WI.SelectionController.prototype._adjustIndexesAfter): Deleted.
1291
1292         * UserInterface/Views/DOMTreeContentView.js:
1293         (WI.DOMTreeContentView):
1294
1295         * UserInterface/Views/DOMTreeElement.js:
1296         (WI.DOMTreeElement.prototype.updateSelectionArea):
1297         * UserInterface/Views/DOMTreeOutline.js:
1298         (WI.DOMTreeOutline.prototype.updateSelection):
1299         Updating the selection area DOM element should not assume that only one
1300         TreeElement is selected at a time.
1301
1302         * UserInterface/Views/TreeOutline.js:
1303         (WI.TreeOutline.prototype.get allowsEmptySelection):
1304         (WI.TreeOutline.prototype.set allowsEmptySelection):
1305         (WI.TreeOutline.prototype.set selectedTreeElement):
1306         (WI.TreeOutline.prototype.get selectedTreeElements):
1307         (WI.TreeOutline.prototype._treeKeyDown):
1308
1309         * UserInterface/Views/TreeOutlineGroup.js:
1310         (WI.TreeOutlineGroup):
1311         (WI.TreeOutlineGroup.prototype._removeConflictingTreeSelections):
1312         Eliminate use of `TreeElement.prototype.deselect`.
1313
1314 2018-11-27  Matt Baker  <mattbaker@apple.com>
1315
1316         Web Inspector: TreeOutline should re-use multiple-selection logic from Table
1317         https://bugs.webkit.org/show_bug.cgi?id=191483
1318         <rdar://problem/45953305>
1319
1320         Reviewed by Devin Rousso.
1321
1322         Update TreeOutline to use SelectionController. Adopting SelectionController
1323         in TreeOutline is not as straightforward as it was in Table. Selected items
1324         are tracked by index, and TreeElement lacks an explicit index. As a consequence
1325         TreeElement indexes are calcualted as needed and cached. The cache is cleared
1326         whenever an element is added or removed.
1327
1328         * UserInterface/Controllers/SelectionController.js:
1329         (WI.SelectionController.prototype.didInsertItem):
1330         (WI.SelectionController.prototype.didRemoveItem):
1331         (WI.SelectionController.prototype.handleKeyDown):
1332         Drive-by syntax error fix.
1333         (WI.SelectionController.prototype._adjustIndexesAfter):
1334         (WI.SelectionController):
1335
1336         * UserInterface/Views/DOMTreeElement.js:
1337         (WI.DOMTreeElement.prototype.canSelectOnMouseDown):
1338         (WI.DOMTreeElement.prototype.selectOnMouseDown): Deleted.
1339
1340         * UserInterface/Views/DOMTreeOutline.js:
1341         (WI.DOMTreeOutline.prototype._onmousedown):
1342         Item selection is now handled by SelectionController.
1343
1344         * UserInterface/Views/ShaderProgramTreeElement.js:
1345         (WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
1346         (WI.ShaderProgramTreeElement.prototype.selectOnMouseDown): Deleted.
1347
1348         * UserInterface/Views/TreeElement.js:
1349         (WI.TreeElement.prototype.canSelectOnMouseDown):
1350         (WI.TreeElement.prototype._attach):
1351         (WI.TreeElement.prototype.select):
1352         (WI.TreeElement.prototype.deselect):
1353         Route item selection through the parent TreeOutline, in order to go though
1354         the TreeOutline's SelectionController.
1355
1356         (WI.TreeElement.treeElementMouseDown): Deleted.
1357         Moved handler to TreeOutline, which owns the SelectionController that
1358         needs to respond to mouse events.
1359
1360         * UserInterface/Views/TreeOutline.js:
1361         (WI.TreeOutline):
1362         (WI.TreeOutline.prototype.get allowsMultipleSelection):
1363         (WI.TreeOutline.prototype.set allowsMultipleSelection):
1364         (WI.TreeOutline.prototype.get selectedTreeElement):
1365         (WI.TreeOutline.prototype.set selectedTreeElement):
1366         (WI.TreeOutline.prototype.insertChild):
1367         (WI.TreeOutline.prototype.removeChildAtIndex):
1368         (WI.TreeOutline.prototype._rememberTreeElement):
1369         (WI.TreeOutline.prototype._forgetTreeElement):
1370         (WI.TreeOutline.prototype._treeKeyDown):
1371         (WI.TreeOutline.prototype.selectionControllerNumberOfItems):
1372         (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
1373         (WI.TreeOutline.prototype.selectionControllerNextSelectableIndex):
1374         (WI.TreeOutline.prototype.selectionControllerPreviousSelectableIndex):
1375         (WI.TreeOutline.prototype.selectTreeElementInternal):
1376         (WI.TreeOutline._generateStyleRulesIfNeeded._indexOfTreeElement.previousElement):
1377         (WI.TreeOutline._generateStyleRulesIfNeeded):
1378
1379 2018-11-27  Nikita Vasilyev  <nvasilyev@apple.com>
1380
1381         Web Inspector: Experimental Computed panel is unreadable in Dark Mode
1382         https://bugs.webkit.org/show_bug.cgi?id=192053
1383
1384         Reviewed by Matt Baker.
1385
1386         * UserInterface/Views/ComputedStyleDetailsPanel.css:
1387         (@media (prefers-dark-interface)):
1388         (.computed-with-traces .details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)):
1389         * UserInterface/Views/ComputedStyleSection.css:
1390         (.computed-style-section .computed-property-item.expanded):
1391         (.computed-style-section .computed-property-item.expanded + .computed-property-item):
1392         (@media (prefers-dark-interface)):
1393
1394 2018-11-27  Nikita Vasilyev  <nvasilyev@apple.com>
1395
1396         Web Inspector: Computed panel: allow to expand properties to show list of overridden values
1397         https://bugs.webkit.org/show_bug.cgi?id=191984
1398
1399         Reviewed by Devin Rousso.
1400
1401         Introduce the new experimental Computed Style Cascades.
1402
1403         Each property now can expand to show a list of overridden values, their corresponding
1404         selectors, and source locations.
1405
1406         * Localizations/en.lproj/localizedStrings.js:
1407         * UserInterface/Base/Setting.js:
1408         * UserInterface/Main.html:
1409         * UserInterface/Models/DOMNodeStyles.js:
1410         (WI.DOMNodeStyles.prototype.get uniqueOrderedStyles):
1411         Move `uniqueOrderedStyles` function unmodified from SpreadsheetRulesStyleDetailsPanel so it can be used by ComputedStyleDetailsPanel, too.
1412
1413         * UserInterface/Views/ComputedStyleDetailsPanel.css:
1414         (.computed-with-traces .computed-style-properties):
1415         (.computed-with-traces .details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)):
1416         (.computed-with-traces .details-section.computed-style-properties > .content):
1417         (.computed-with-traces .computed-style-properties .property .go-to-arrow):
1418
1419         * UserInterface/Views/ComputedStyleDetailsPanel.js:
1420         (WI.ComputedStyleDetailsPanel.prototype.refresh):
1421         (WI.ComputedStyleDetailsPanel.prototype.applyFilter):
1422         (WI.ComputedStyleDetailsPanel.prototype.focusFirstSection):
1423         (WI.ComputedStyleDetailsPanel.prototype.initialLayout):
1424         (WI.ComputedStyleDetailsPanel.prototype._computePropertyTraces):
1425         (WI.ComputedStyleDetailsPanel.prototype._computedStyleShowAllCheckboxValueChanged):
1426         (WI.ComputedStyleDetailsPanel.prototype._handlePropertiesSectionCollapsedStateChanged):
1427         (WI.ComputedStyleDetailsPanel.prototype._handleEditorFilterApplied):
1428         (WI.ComputedStyleDetailsPanel):
1429         Use the new Computed section (WI.ComputedStyleSection) only when it's enabled in the experimental settings.
1430         Otherwise, use the current Computed section.
1431
1432         * UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
1433         (WI.ComputedStyleDetailsSidebarPanel):
1434
1435         * UserInterface/Views/ComputedStyleSection.css: Added.
1436         (.computed-style-section):
1437         (.computed-style-section .computed-property-item):
1438         (.computed-style-section .computed-property-item.expanded):
1439         (.computed-style-section .computed-property-item.expanded + .computed-property-item):
1440         (.computed-style-section .computed-property-item .disclosure-button):
1441         (.computed-style-section .computed-property-item .property-traces):
1442         (.computed-style-section .computed-property-item.expanded .property-traces):
1443         (.computed-style-section .computed-property-item.expanded .disclosure-button):
1444         (.computed-style-section .computed-property-item .property-trace-item):
1445         (.computed-style-section .computed-property-item .property-trace-item .property.overridden .value):
1446         (.computed-style-section .property-trace-item-left,):
1447         (.computed-style-section .property-trace-item-right):
1448         (.computed-style-section .computed-property-item .property-trace-item .value):
1449         (.computed-style-section .property .value):
1450         (.computed-style-section .computed-property-item .property):
1451         (.computed-style-section .computed-property-item .property .name):
1452         (.computed-style-section .computed-property-item .property-trace-item .selector):
1453         (.computed-style-section .computed-property-item .origin):
1454         (.computed-style-section .computed-property-item .go-to-link):
1455         (.computed-style-section .property-trace-item .property .name,):
1456         (.computed-style-section .property-trace-item .property .value + span):
1457         (.computed-style-properties.details-section > .content,):
1458
1459         * UserInterface/Views/ComputedStyleSection.js: Added.
1460         (WI.ComputedStyleSection):
1461         (WI.ComputedStyleSection.prototype.get style):
1462         (WI.ComputedStyleSection.prototype.set style):
1463         (WI.ComputedStyleSection.prototype.get styleTraces):
1464         (WI.ComputedStyleSection.prototype.set styleTraces):
1465         (WI.ComputedStyleSection.prototype.set showsImplicitProperties):
1466         (WI.ComputedStyleSection.prototype.set alwaysShowPropertyNames):
1467         (WI.ComputedStyleSection.prototype.set propertyVisibilityMode):
1468         (WI.ComputedStyleSection.prototype.set hideFilterNonMatchingProperties):
1469         (WI.ComputedStyleSection.prototype.get propertiesToRender):
1470         (WI.ComputedStyleSection.prototype.layout):
1471         (WI.ComputedStyleSection.prototype.detached):
1472         (WI.ComputedStyleSection.prototype.hidden):
1473         (WI.ComputedStyleSection.prototype.applyFilter):
1474         (WI.ComputedStyleSection.prototype.spreadsheetStylePropertyShowProperty):
1475         (WI.ComputedStyleSection.prototype._createTrace):
1476         (WI.ComputedStyleSection.prototype._handlePropertiesChanged):
1477
1478         * UserInterface/Views/ExpandableView.js: Added.
1479         (WI.ExpandableView):
1480         (WI.ExpandableView.prototype.get element):
1481         (WI.ExpandableView.prototype._onDisclosureButtonClick):
1482         (WI.ExpandableView.prototype._update):
1483
1484         * UserInterface/Views/SettingsTabContentView.js:
1485         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
1486
1487         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
1488         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
1489         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.layout):
1490         Replace `_renderOrigin` with WI.StyleOriginView so it could be used by WI.ComputedStyleSection.
1491
1492         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
1493         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
1494
1495         * UserInterface/Views/SpreadsheetStyleProperty.js:
1496         (WI.SpreadsheetStyleProperty.prototype.update):
1497         (WI.SpreadsheetStyleProperty.prototype._isEditable):
1498         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
1499         Introduce `readOnly` option so WI.SpreadsheetStyleProperty could be used by WI.ComputedStyleSection.
1500
1501         * UserInterface/Views/StyleOriginView.js: Added.
1502         (WI.StyleOriginView):
1503
1504 2018-11-27  Timothy Hatcher  <timothy@apple.com>
1505
1506         Web Inspector: Add support for forcing color scheme appearance in DOM tree.
1507         https://bugs.webkit.org/show_bug.cgi?id=191820
1508         rdar://problem/46153172
1509
1510         Reviewed by Devin Rousso.
1511
1512         * Localizations/en.lproj/localizedStrings.js: Updated.
1513         * UserInterface/Controllers/CSSManager.js:
1514         (WI.CSSManager):
1515         (WI.CSSManager.prototype.get defaultAppearance): Added.
1516         (WI.CSSManager.prototype.get forcedAppearance): Added.
1517         (WI.CSSManager.prototype.set forcedAppearance): Added.
1518         (WI.CSSManager.prototype.canForceAppearance): Added.
1519         (WI.CSSManager.prototype.defaultAppearanceDidChange): Added.
1520         * UserInterface/Images/Appearance.svg: Added.
1521         * UserInterface/Protocol/PageObserver.js:
1522         (WI.PageObserver.prototype.defaultAppearanceChanged): Added.
1523         * UserInterface/Views/DOMTreeContentView.js:
1524         (WI.DOMTreeContentView):
1525         (WI.DOMTreeContentView.prototype.get navigationItems):
1526         (WI.DOMTreeContentView.prototype._defaultAppearanceDidChange): Added.
1527         (WI.DOMTreeContentView.prototype._toggleAppearance): Added.
1528
1529 2018-11-27  Matt Baker  <mattbaker@apple.com>
1530
1531         Web Inspector: Cookies table needs copy keyboard shortcut and context menu support
1532         https://bugs.webkit.org/show_bug.cgi?id=191482
1533         <rdar://problem/45953002>
1534
1535         Reviewed by Joseph Pecoraro.
1536
1537         * UserInterface/Views/CookieStorageContentView.js:
1538         (WI.CookieStorageContentView.prototype.handleCopyEvent):
1539         (WI.CookieStorageContentView.prototype.tableCellContextMenuClicked):
1540         As with Delete, if the target row is selected, all selected rows are copied.
1541         Otherwise only the target row is copied. This distinction will be surfaced
1542         in the UI in https://webkit.org/b/191095.
1543
1544         (WI.CookieStorageContentView.prototype.tablePopulateCell):
1545         (WI.CookieStorageContentView.prototype._cookiesAtIndexes):
1546         (WI.CookieStorageContentView.prototype._formatCookiesAsText):
1547         (WI.CookieStorageContentView.prototype._formatCookiePropertyForColumn):
1548         (WI.CookieStorageContentView):
1549         Break Cookie property formatting into a helper method, which is used for
1550         formatting Table cells and creating plain text for the clipboard.
1551
1552         * UserInterface/Views/Table.js:
1553         (WI.Table.prototype.get columns):
1554
1555 2018-11-27  Matt Baker  <mattbaker@apple.com>
1556
1557         Web Inspector: Table selection should be handled by a SelectionController
1558         https://bugs.webkit.org/show_bug.cgi?id=191977
1559         <rdar://problem/46253093>
1560
1561         Reviewed by Devin Rousso.
1562
1563         Add a SelectionController class, which manages an IndexSet of selected
1564         items, and provides operations for adding and removing items from the
1565         selection. Complex behaviors such as shift-clicking to select a range of
1566         items, and updating the selection using the keyboard, are forwarded to
1567         the controller using special-purpose methods that accept DOM Event objects.
1568
1569         * UserInterface/Base/Utilities.js:
1570
1571         * UserInterface/Controllers/SelectionController.js: Added.
1572         (WI.SelectionController):
1573         (WI.SelectionController.prototype.get delegate):
1574         (WI.SelectionController.prototype.get lastSelectedItem):
1575         (WI.SelectionController.prototype.get selectedItems):
1576         (WI.SelectionController.prototype.get allowsMultipleSelection):
1577         (WI.SelectionController.prototype.set allowsMultipleSelection):
1578         (WI.SelectionController.prototype.get numberOfItems):
1579         (WI.SelectionController.prototype.hasSelectedItem):
1580         (WI.SelectionController.prototype.selectItem):
1581         (WI.SelectionController.prototype.deselectItem):
1582         (WI.SelectionController.prototype.selectAll):
1583         (WI.SelectionController.prototype.deselectAll):
1584         (WI.SelectionController.prototype.removeSelectedItems):
1585         (WI.SelectionController.prototype.reset):
1586         (WI.SelectionController.prototype.didRemoveItem):
1587         (WI.SelectionController.prototype.handleKeyDown):
1588         (WI.SelectionController.prototype.handleItemMouseDown.normalizeRange):
1589         (WI.SelectionController.prototype.handleItemMouseDown):
1590         (WI.SelectionController.prototype._deselectAllAndSelect):
1591         (WI.SelectionController.prototype._selectItemsFromArrowKey):
1592         (WI.SelectionController.prototype._nextSelectableIndex):
1593         (WI.SelectionController.prototype._previousSelectableIndex):
1594         (WI.SelectionController.prototype._updateSelectedItems):
1595
1596         * UserInterface/Main.html:
1597         * UserInterface/Test.html:
1598
1599         * UserInterface/Views/Table.js:
1600         (WI.Table):
1601         (WI.Table.prototype.get selectedRow):
1602         (WI.Table.prototype.get selectedRows):
1603         (WI.Table.prototype.get allowsMultipleSelection):
1604         (WI.Table.prototype.set allowsMultipleSelection):
1605         (WI.Table.prototype.isRowSelected):
1606         (WI.Table.prototype.reloadData):
1607         (WI.Table.prototype.selectRow):
1608         (WI.Table.prototype.deselectRow):
1609         (WI.Table.prototype.selectAll):
1610         (WI.Table.prototype.deselectAll):
1611         (WI.Table.prototype.removeRow):
1612         (WI.Table.prototype.removeSelectedRows):
1613         (WI.Table.prototype.selectionControllerSelectionDidChange):
1614         (WI.Table.prototype.selectionControllerNumberOfItems):
1615         (WI.Table.prototype.selectionControllerNextSelectableIndex):
1616         (WI.Table.prototype.selectionControllerPreviousSelectableIndex):
1617         (WI.Table.prototype._handleKeyDown):
1618         (WI.Table.prototype._handleMouseDown):
1619         (WI.Table.prototype._removeRows):
1620         (WI.Table.prototype._toggleSelectedRowStyle):
1621         (WI.Table.prototype._selectRowsFromArrowKey): Deleted.
1622         (WI.Table.prototype._handleMouseDown.normalizeRange): Deleted.
1623         (WI.Table.prototype._deselectAllAndSelect): Deleted.
1624         (WI.Table.prototype._notifySelectionDidChange): Deleted.
1625         (WI.Table.prototype._updateSelectedRows): Deleted.
1626
1627 2018-11-26  Devin Rousso  <drousso@apple.com>
1628
1629         Web Inspector: "No Filter Results" in navigation sidebar should have a button to clear filters
1630         https://bugs.webkit.org/show_bug.cgi?id=191916
1631
1632         Reviewed by Joseph Pecoraro.
1633
1634         * UserInterface/Views/NavigationSidebarPanel.js:
1635         (WI.NavigationSidebarPanel.prototype.resetFilter): Added.
1636         (WI.NavigationSidebarPanel.prototype._checkForEmptyFilterResults.checkTreeOutlineForEmptyFilterResults):
1637
1638         * UserInterface/Views/FilterBar.js:
1639         (WI.FilterBar.prototype.clear):
1640
1641         * UserInterface/Views/FilterBarButton.js:
1642         (WI.FilterBarButton.prototype.toggle):
1643
1644         * UserInterface/Views/ResourceSidebarPanel.js:
1645         (WI.ResourceSidebarPanel.prototype.resetFilter): Added.
1646         * UserInterface/Views/StorageSidebarPanel.js:
1647         (WI.StorageSidebarPanel.prototype.resetFilter): Added.
1648
1649         * UserInterface/Views/AuditTestContentView.js:
1650         (WI.AuditTestContentView.prototype.showFilteredPlaceholder):
1651         * UserInterface/Views/NetworkTableContentView.js:
1652         (WI.NetworkTableContentView.prototype._showEmptyFilterResultsMessage):
1653
1654         * UserInterface/Views/Main.css:
1655         (.message-text-view > .message + button): Added.
1656
1657         * Localizations/en.lproj/localizedStrings.js:
1658
1659 2018-11-26  Devin Rousso  <drousso@apple.com>
1660
1661         Web Inspector: Audit: automatically add to tab bar when the experimental setting is enabled
1662         https://bugs.webkit.org/show_bug.cgi?id=191659
1663
1664         Reviewed by Joseph Pecoraro.
1665
1666         * UserInterface/Views/SettingsTabContentView.js:
1667         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
1668
1669         * UserInterface/Base/Main.js:
1670         (WI.loaded):
1671         Drive-by: use existing constants instead of hard-coded strings for consistency.
1672
1673 2018-11-25  Devin Rousso  <drousso@apple.com>
1674
1675         Web Inspector: Timelines: add Media timeline
1676         https://bugs.webkit.org/show_bug.cgi?id=191625
1677
1678         Reviewed by Matt Baker.
1679
1680         Add a new timeline to Timelines for media related events (e.g. event/fullscreen/low-power).
1681         Mimics what is visible by using the same instrumentation points as the Network tab when
1682         "Group Media Requests" is enabled.
1683
1684         * UserInterface/Models/MediaInstrument.js: Added.
1685         (WI.MediaInstrument):
1686         (WI.MediaInstrument.supported):
1687         (WI.MediaInstrument.prototype.get timelineRecordType):
1688         (WI.MediaInstrument.prototype.startInstrumentation):
1689         (WI.MediaInstrument.prototype.stopInstrumentation):
1690
1691         * UserInterface/Models/MediaTimelineRecord.js: Added.
1692         (WI.MediaTimelineRecord):
1693         (WI.MediaTimelineRecord.prototype.get eventType):
1694         (WI.MediaTimelineRecord.prototype.get domNode):
1695         (WI.MediaTimelineRecord.prototype.get domEvent):
1696         (WI.MediaTimelineRecord.prototype.get isLowPower):
1697         (WI.MediaTimelineRecord.prototype.get displayName):
1698         (WI.MediaTimelineRecord.prototype.saveIdentityToCookie):
1699
1700         * UserInterface/Views/MediaTimelineDataGridNode.js: Added.
1701         (WI.MediaTimelineDataGridNode):
1702         (WI.MediaTimelineDataGridNode.prototype.get records):
1703         (WI.MediaTimelineDataGridNode.prototype.get data):
1704         (WI.MediaTimelineDataGridNode.prototype.createCellContent):
1705         (WI.MediaTimelineDataGridNode.prototype.iconClassNames):
1706         (WI.MediaTimelineDataGridNode.prototype.filterableDataForColumn):
1707
1708         * UserInterface/Views/MediaTimelineOverviewGraph.js: Added.
1709         (WI.MediaTimelineOverviewGraph):
1710         (WI.MediaTimelineOverviewGraph.prototype.reset):
1711         (WI.MediaTimelineOverviewGraph.prototype.shown):
1712         (WI.MediaTimelineOverviewGraph.prototype.hidden):
1713         (WI.MediaTimelineOverviewGraph.prototype.layout):
1714         (WI.MediaTimelineOverviewGraph.prototype.updateSelectedRecord):
1715         (WI.MediaTimelineOverviewGraph.prototype._handleRecordAdded):
1716         * UserInterface/Views/MediaTimelineOverviewGraph.css: Added.
1717         (.timeline-overview-graph.media > .timeline-record-bar):
1718         (.timeline-overview-graph.media > .timeline-record-bar > .segment):
1719
1720         * UserInterface/Views/MediaTimelineView.js: Added.
1721         (WI.MediaTimelineView):
1722         (WI.MediaTimelineView.prototype.get secondsPerPixel):
1723         (WI.MediaTimelineView.prototype.get selectionPathComponents):
1724         (WI.MediaTimelineView.prototype.closed):
1725         (WI.MediaTimelineView.prototype.reset):
1726         (WI.MediaTimelineView.prototype.dataGridSortComparator.compareDOMNodes):
1727         (WI.MediaTimelineView.prototype.dataGridSortComparator.):
1728         (WI.MediaTimelineView.prototype.dataGridSortComparator):
1729         (WI.MediaTimelineView.prototype.layout):
1730         (WI.MediaTimelineView.prototype._processPendingRecords):
1731         (WI.MediaTimelineView.prototype._handleRecordAdded):
1732         (WI.MediaTimelineView.prototype._handleSelectionPathComponentSiblingSelected):
1733         * UserInterface/Views/MediaTimelineView.css: Added.
1734         (.timeline-view.media > .data-grid):
1735
1736         * UserInterface/Views/DOMEventsBreakdownView.js:
1737         (WI.DOMEventsBreakdownView.prototype.layout):
1738         * UserInterface/Views/DOMNodeEventsContentView.js:
1739         (WI.DOMNodeEventsContentView.prototype.initialLayout):
1740         * UserInterface/Views/NetworkDOMNodeDetailView.js:
1741         (WI.NetworkDOMNodeDetailView):
1742         (WI.NetworkDOMNodeDetailView.prototype.showContentViewForIdentifier):
1743         * UserInterface/Views/NetworkTableContentView.js:
1744         (WI.NetworkTableContentView):
1745         (WI.NetworkTableContentView.prototype.get filterNavigationItems):
1746         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
1747         (WI.NetworkTableContentView.prototype._showDetailView):
1748         (WI.NetworkTableContentView.prototype._waterfallPopoverContentForNodeEntry):
1749         Remove passing of `startTimestamp` to `WI.DOMEventsBreakdownView`, as we should be showing
1750         absolute timestamps for each event, not relative to the start of the recording.
1751
1752         * UserInterface/Views/TimelineIcons.css:
1753         (.media-icon .icon): Added.
1754         (.dom-event-record .icon): Added.
1755         (.dom-event-record.fullscreen .icon): Added.
1756         (.low-power-record .icon): Added.
1757
1758         * UserInterface/Controllers/TimelineManager.js:
1759         (WI.TimelineManager.availableTimelineTypes):
1760         (WI.TimelineManager.prototype.capturingStarted):
1761         (WI.TimelineManager.prototype.capturingStopped):
1762         (WI.TimelineManager.prototype._updateAutoCaptureInstruments):
1763         (WI.TimelineManager.prototype._handleDOMNodeDidFireEvent): Added.
1764         (WI.TimelineManager.prototype._handleDOMNodeLowPowerChanged): Added.
1765
1766         * UserInterface/Views/TimelineRuler.js:
1767         (WI.TimelineRuler.prototype.clearMarkers):
1768         (WI.TimelineRuler.prototype._handleClick):
1769         * UserInterface/Views/TimelineOverview.js:
1770         (WI.TimelineOverview.prototype._timelineRulerMouseClicked):
1771         * UserInterface/Models/TimelineRecording.js:
1772         (WI.TimelineRecording.prototype.reset):
1773         (WI.TimelineRecording.prototype.addEventMarker):
1774         (WI.TimelineRecording.prototype.addRecord):
1775         (WI.TimelineRecording.prototype._keyForRecord):
1776         Drive-by: rework the logic for "click" event pass-through to the graph underneath.
1777
1778         * UserInterface/Models/Instrument.js:
1779         (WI.Instrument.createForTimelineType):
1780
1781         * UserInterface/Models/TimelineRecord.js:
1782
1783         * UserInterface/Views/TimelineTabContentView.js:
1784         (WI.TimelineTabContentView.displayNameForTimelineType):
1785         (WI.TimelineTabContentView.iconClassNameForTimelineType):
1786         (WI.TimelineTabContentView.genericClassNameForTimelineType):
1787         (WI.TimelineTabContentView.iconClassNameForRecord):
1788         (WI.TimelineTabContentView.displayNameForRecord):
1789         * UserInterface/Views/TimelineRecordBar.css:
1790         (.timeline-record-bar.timeline-record-type-media > .segment): Added.
1791
1792         * UserInterface/Views/ContentView.js:
1793         (WI.ContentView.createFromRepresentedObject):
1794         * UserInterface/Views/TimelineOverviewGraph.js:
1795         (WI.TimelineOverviewGraph.createForTimeline):
1796
1797         * UserInterface/Models/ScriptTimelineRecord.js:
1798         (WI.ScriptTimelineRecord.EventType.displayName):
1799
1800         * UserInterface/Main.html:
1801         * UserInterface/Test.html:
1802         * Localizations/en.lproj/localizedStrings.js:
1803         * UserInterface/Images/DOMEvent.svg: Added.
1804         * UserInterface/Images/DOMEventFullscreen.svg: Added.
1805         * UserInterface/Images/LowPower.svg: Added.
1806         * UserInterface/Images/MediaInstrument.svg: Added.
1807
1808 2018-11-25  Matt Baker  <mattbaker@apple.com>
1809
1810         Web Inspector: Remove parameters from TreeOutline SelectionDidChange event
1811         https://bugs.webkit.org/show_bug.cgi?id=191770
1812
1813         Reviewed by Devin Rousso.
1814
1815         * UserInterface/Controllers/CallFrameTreeController.js:
1816         (WI.CallFrameTreeController.prototype._treeSelectionDidChange):
1817         * UserInterface/Views/AuditNavigationSidebarPanel.js:
1818         (WI.AuditNavigationSidebarPanel.prototype._treeSelectionDidChange):
1819         * UserInterface/Views/CanvasSidebarPanel.js:
1820         (WI.CanvasSidebarPanel):
1821         (WI.CanvasSidebarPanel.prototype._treeSelectionDidChange):
1822         (WI.CanvasSidebarPanel.prototype._treeOutlineSelectionDidChange): Deleted.
1823         * UserInterface/Views/CanvasTabContentView.js:
1824         (WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange):
1825         * UserInterface/Views/DebuggerSidebarPanel.js:
1826         (WI.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
1827         * UserInterface/Views/OpenResourceDialog.js:
1828         (WI.OpenResourceDialog.prototype._treeSelectionDidChange):
1829         * UserInterface/Views/ResourceSidebarPanel.js:
1830         (WI.ResourceSidebarPanel.prototype._treeSelectionDidChange):
1831         * UserInterface/Views/SearchSidebarPanel.js:
1832         (WI.SearchSidebarPanel.prototype._treeSelectionDidChange):
1833         * UserInterface/Views/StorageSidebarPanel.js:
1834         (WI.StorageSidebarPanel._treeSelectionDidChange):
1835         * UserInterface/Views/TimelineDataGrid.js:
1836         (WI.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
1837         (WI.TimelineDataGrid):
1838         * UserInterface/Views/TimelineTabContentView.js:
1839         (WI.TimelineTabContentView.prototype._recordingsTreeSelectionDidChange):
1840         Use `event.target.selectedTreeElement` instead of `event.data.selectedElement`.
1841
1842         * UserInterface/Views/TimelineOverview.js:
1843         (WI.TimelineOverview.prototype._timelinesTreeSelectionDidChange):
1844         (WI.TimelineOverview.prototype._timelinesTreeSelectionDidChange.updateGraphSelectedState): Deleted.
1845         Refactor away the single place `event.data.deselectedElement` was used.
1846
1847         * UserInterface/Views/TreeElement.js:
1848         (WI.TreeElement.prototype.select):
1849         (WI.TreeElement.prototype.deselect):
1850         Remove `selectedElement` and `deselectedElement` from event data.
1851
1852 2018-11-19  Devin Rousso  <drousso@apple.com>
1853
1854         Web Inspector: Audit: removing and re-adding the tab will duplicate tests
1855         https://bugs.webkit.org/show_bug.cgi?id=191843
1856
1857         Reviewed by Matt Baker.
1858
1859         * UserInterface/Controllers/AuditManager.js:
1860         (WI.AuditManager.prototype.loadStoredTests):
1861         If we already have tests, don't attempt to load any stored tests.
1862
1863 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
1864
1865         Web Inspector: "Reload Web Inspector" button no longer partially works
1866         https://bugs.webkit.org/show_bug.cgi?id=191773
1867         <rdar://problem/46139932>
1868
1869         Reviewed by Devin Rousso.
1870
1871         * UserInterface/Base/Main.js:
1872         * UserInterface/Debug/UncaughtExceptionReporter.js:
1873         (sheetElement.innerHTML):
1874         * UserInterface/Views/SettingsTabContentView.js:
1875
1876 2018-11-17  Devin Rousso  <drousso@apple.com>
1877
1878         Web Inspector: Network: add button to show system certificate dialog
1879         https://bugs.webkit.org/show_bug.cgi?id=191458
1880         <rdar://problem/45977019>
1881
1882         Reviewed by Joseph Pecoraro.
1883
1884         * UserInterface/Controllers/NetworkManager.js:
1885         (WI.NetworkManager.supportsShowCertificate): Added.
1886
1887         * UserInterface/Models/Resource.js:
1888         (WI.Resource.prototype.showCertificate): Added.
1889
1890         * UserInterface/Views/ResourceSecurityContentView.js:
1891         (WI.ResourceSecurityContentView.prototype._refreshCetificateSection):
1892         * UserInterface/Views/ResourceSecurityContentView.css:
1893         (.resource-security .details > .show-certificate > .key): Added.
1894         (.resource-security .details > .show-certificate > .key > .error): Added.
1895
1896         * Localizations/en.lproj/localizedStrings.js:
1897
1898 2018-11-16  Devin Rousso  <drousso@apple.com>
1899
1900         Web Inspector: Audit: add default tests
1901         https://bugs.webkit.org/show_bug.cgi?id=191758
1902
1903         Reviewed by Matt Baker.
1904
1905         * UserInterface/Controllers/AuditManager.js:
1906         (WI.AuditManager.prototype.loadStoredTests):
1907         (WI.AuditManager.prototype.addDefaultTestsIfNeeded): Added.
1908         If there are no previously saved tests in the database, automatically add the default set.
1909
1910         * UserInterface/Views/AuditNavigationSidebarPanel.js:
1911         (WI.AuditNavigationSidebarPanel.prototype._addTest):
1912         (WI.AuditNavigationSidebarPanel.prototype._addResult):
1913         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
1914         * UserInterface/Views/AuditNavigationSidebarPanel.css:
1915         (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view): Added.
1916         (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > .message): Added.
1917         (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > button): Added.
1918         When the last test is removed, show a placeholder message that allows the user to re-add the
1919         default set of tests.
1920
1921         * UserInterface/Views/NavigationSidebarPanel.js:
1922         (WI.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder):
1923         (WI.NavigationSidebarPanel.prototype._createEmptyContentPlaceholderIfNeeded):
1924
1925         * Localizations/en.lproj/localizedStrings.js:
1926
1927 2018-11-16  Devin Rousso  <drousso@apple.com>
1928
1929         Web Inspector: Audit: minor style improvements
1930         https://bugs.webkit.org/show_bug.cgi?id=191727
1931
1932         Reviewed by Joseph Pecoraro.
1933
1934         * UserInterface/Controllers/AuditManager.js:
1935         (WI.AuditManager):
1936         (WI.AuditManager.prototype._handleFrameMainResourceDidChange): Added.
1937         Clear test results when the main frame navigates, but don't clear the saved results.
1938
1939         * UserInterface/Models/AuditTestCase.js:
1940         (WI.AuditTestCase.prototype.async run):
1941         * UserInterface/Models/AuditTestCaseResult.js:
1942         (WI.AuditTestCaseResult):
1943         (WI.AuditTestCaseResult.async fromPayload):
1944         (WI.AuditTestCaseResult.prototype.get resolvedDOMNodes): Added.
1945         (WI.AuditTestCaseResult.prototype.toJSON):
1946         Capture the full CSS path for any returned DOM nodes when the test finishes running, so that
1947         if the node moves around the path isn't modified as well.
1948
1949         * UserInterface/Views/AuditTestCaseContentView.js:
1950         (WI.AuditTestCaseContentView.prototype.layout):
1951         Always show the URL for the test when viewing a saved result.
1952
1953         * UserInterface/Views/AuditTestContentView.css:
1954         (.content-view-container > .content-view.audit-test > header p):
1955         (.content-view.audit-test > header):
1956         * UserInterface/Views/AuditTestCaseContentView.css:
1957         (.content-view.audit-test-case > header): Added.
1958         (.content-view.audit-test-case > header h1 > img):
1959         (.content-view.audit-test-case > header > .metadata > .source): Added.
1960         (.content-view.audit-test-case > header > .metadata > .duration):
1961         (.content-view.audit-test-case > section table > tr > td:first-child):
1962         * UserInterface/Views/AuditTestGroupContentView.css:
1963         (.content-view.audit-test-group > header):
1964         Horizontally align items in the header for visual consistency.
1965
1966 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
1967
1968         Web Inspector: Include default filtering of InspectorBackend.dumpInspectorProtocolMessages with multi target backend
1969         https://bugs.webkit.org/show_bug.cgi?id=191785
1970
1971         Reviewed by Matt Baker.
1972
1973         * UserInterface/Debug/Bootstrap.js:
1974         (dumpMessagesCurrentState):
1975         (applyDumpMessagesState):
1976         (WI.runBootstrapOperations):
1977         Include tri-state for the logs button.
1978
1979         * UserInterface/Protocol/InspectorBackend.js:
1980         (InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages):
1981         (InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages):
1982         (InspectorBackendClass.prototype._startOrStopAutomaticTracing):
1983         Add new filtering state (the Setting already got added in the past).
1984
1985         * UserInterface/Protocol/LoggingProtocolTracer.js:
1986         (WI.LoggingProtocolTracer):
1987         (WI.LoggingProtocolTracer.prototype.set filterMultiplexingBackend):
1988         (WI.LoggingProtocolTracer.prototype.get filterMultiplexingBackend):
1989         (WI.LoggingProtocolTracer.prototype._processEntry):
1990         Perform new filtering.
1991
1992 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
1993
1994         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local Inspector)
1995         https://bugs.webkit.org/show_bug.cgi?id=191740
1996         <rdar://problem/45470897>
1997
1998         Reviewed by Timothy Hatcher.
1999
2000         * UserInterface/Protocol/Connection.js:
2001         (InspectorBackend.Connection.prototype._dispatchResponse):
2002         Hide the TargetAgent does not exist message. This is necessary so that WebKitLegacy
2003         tests don't include this line in output each test.
2004
2005         * UserInterface/Test.html:
2006         * UserInterface/Test/Test.js:
2007         (WI.loaded):
2008         (WI.resetMainExecutionContext):
2009         (WI.performOneTimeFrontendInitializationsUsingTarget):
2010         Behave more like Main.js and initialize a MultiplexingBackendTarget when the
2011         TargetAgent is available.
2012
2013         * UserInterface/Protocol/InspectorBackend.js:
2014         (InspectorBackendClass.prototype.runAfterPendingDispatches):
2015         Use the main target, a.k.a. the page connection. The backend target's
2016         messages don't have any responses, so this was effectively not waiting
2017         at all.
2018
2019 2018-11-16  Matt Baker  <mattbaker@apple.com>
2020
2021         Web Inspector: TreeOutline shouldn't select first child of an expanded element on right arrow key
2022         https://bugs.webkit.org/show_bug.cgi?id=191766
2023
2024         Reviewed by Devin Rousso.
2025
2026         * UserInterface/Views/TreeOutline.js:
2027         (WI.TreeOutline.prototype._treeKeyDown):
2028
2029 2018-11-14  Matt Baker  <mattbaker@apple.com>
2030
2031         Web Inspector: Table should recalculate scrollable height when resized
2032         https://bugs.webkit.org/show_bug.cgi?id=191328
2033         <rdar://problem/45854412>
2034
2035         Reviewed by Devin Rousso.
2036
2037         * UserInterface/Views/NetworkTableContentView.js:
2038         (WI.NetworkTableContentView.prototype._hideDetailView):
2039         Force table columns to layout after hiding the detail view.
2040
2041         * UserInterface/Views/Table.js:
2042         (WI.Table):
2043         (WI.Table.prototype.showColumn):
2044         Call `_resizeColumnsAndFiller` instead of `resize`. The latter also cleared
2045         `_cachedWidth`, which isn't unnecessary since the width hasn't changed.
2046
2047         (WI.Table.prototype.layout):
2048         previously `_resizeColumnsAndFiller` always occurred after `_updateVisibleRows`,
2049         it was just a matter of whether the cached width and height were cleared first.
2050         That now happens in `sizeDidChange`.
2051
2052         (WI.Table.prototype.sizeDidChange):
2053         (WI.Table.prototype._updateVisibleRows):
2054         (WI.Table.prototype.resize): Deleted.
2055         Internally this cleared the cached width and height, which moved to `sizeDidChange`.
2056         Externally this was used by NetworkTableContentView to force columns to
2057         layout after hiding the details view. Calling `updateLayout` on the table
2058         accomplishes the same thing using the standard View API.
2059
2060         (WI.Table.prototype._resizeColumnsAndFiller):
2061         Only update the cached width, since the height will already have been
2062         updated. The number of rows doesn't change during this method, so that
2063         check was removed.
2064
2065 2018-11-14  Devin Rousso  <drousso@apple.com>
2066
2067         Web Inspector: REGRESSION(r236540): Debugger: breakpoints are sorted alphabetically instead of numerically
2068         https://bugs.webkit.org/show_bug.cgi?id=191560
2069
2070         Reviewed by Joseph Pecoraro.
2071
2072         When sorting breakpoints, if the `WI.TreeElement`s being compared both contain instances of
2073         `WI.Breakpoint`, sort by `WI.SourceCodeLocation` instead of title.
2074
2075         We only do this for `WI.Breakpoint` because they are the only debuggable item that has a
2076         `WI.SourceCodeLocation` (e.g. `WI.EventBreakpoint` is just an event name string).
2077
2078         * UserInterface/Views/DebuggerSidebarPanel.js:
2079         (WI.DebuggerSidebarPanel.prototype._addTreeElement):
2080         (WI.DebuggerSidebarPanel.prototype._compareBreakpointTreeElements): Added.
2081         (WI.DebuggerSidebarPanel.prototype._addIssue):
2082         (WI.DebuggerSidebarPanel.prototype._addTreeElement.comparator): Deleted.
2083         (WI.DebuggerSidebarPanel.prototype._compareTreeElements): Deleted.
2084
2085 2018-11-14  Nikita Vasilyev  <nvasilyev@apple.com>
2086
2087         Web Inspector: Styles: shift-clicking on a property should extend selection
2088         https://bugs.webkit.org/show_bug.cgi?id=191575
2089         <rdar://problem/46012855>
2090
2091         Reviewed by Devin Rousso.
2092
2093         When there's at least one property is selected, Shift-clicking another property should extend the selection.
2094         Pressing Up or Down keys while holding Shift also extends the selection.
2095
2096         Remove unnecessary `_startedSelection`. Use `hasSelectedProperties` and `_isMousePressed` instead.
2097
2098         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
2099         `_isMousePressed` was set to `true` by mistake, causing numerous assertion fails.
2100
2101         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.set focusIndex):
2102         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.hasSelectedProperties): Renamed from _hasSelectedProperties.
2103         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.extendSelectedProperties): Added.
2104         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseLeave): Removed.
2105         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy):
2106
2107         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
2108         Implement Shift-ArrowUp/ArrowDown keys.
2109
2110         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2111         (WI.SpreadsheetCSSStyleDeclarationSection):
2112         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyBlur):
2113         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseLeave): Removed.
2114         This was only used to set _startedSelection.
2115
2116         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
2117         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowClick):
2118         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
2119         Remove _startedSelection and use hasSelectedProperties method instead.
2120
2121         * UserInterface/Views/SpreadsheetStyleProperty.js:
2122         (WI.SpreadsheetStyleProperty):
2123         Remove spreadsheetStylePropertyMouseLeave since it is no longer used.
2124
2125 2018-11-14  Devin Rousso  <drousso@apple.com>
2126
2127         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
2128         https://bugs.webkit.org/show_bug.cgi?id=191628
2129
2130         Reviewed by Dean Jackson.
2131
2132         * UserInterface/Models/Recording.js:
2133         (WI.Recording.prototype.async swizzle):
2134
2135         * UserInterface/Models/RecordingAction.js:
2136         (WI.RecordingAction.fromPayload):
2137         (WI.RecordingAction.prototype.async swizzle):
2138
2139 2018-11-14  Devin Rousso  <drousso@apple.com>
2140
2141         Web Inspector: add drag+drop for importing Audits and Recordings
2142         https://bugs.webkit.org/show_bug.cgi?id=191566
2143
2144         Reviewed by Joseph Pecoraro.
2145
2146         Reorganize the file loading logic for the Audit and Canvas tabs/managers. Add "drop" event
2147         handlers to the tabs that add and show the corresponding object for the imported data.
2148
2149         * UserInterface/Views/AuditTabContentView.js:
2150         (WI.AuditTabContentView):
2151         (WI.AuditTabContentView.prototype._handleDragOver): Added.
2152         (WI.AuditTabContentView.prototype._handleDrop): Added.
2153         * UserInterface/Views/CanvasTabContentView.js:
2154         (WI.CanvasTabContentView):
2155         (WI.CanvasTabContentView.prototype._addCanvas):
2156         (WI.CanvasTabContentView.prototype._recordingImportedOrStopped):
2157         (WI.CanvasTabContentView.prototype._handleDragOver): Added.
2158         (WI.CanvasTabContentView.prototype._handleDrop): Added.
2159
2160         * UserInterface/Controllers/AuditManager.js:
2161         (WI.AuditManager.prototype.async processJSON): Added.
2162         (WI.AuditManager.prototype.export):
2163         (WI.AuditManager.prototype.import): Deleted.
2164         * UserInterface/Controllers/CanvasManager.js:
2165         (WI.CanvasManager.prototype.processJSON): Added.
2166         (WI.CanvasManager.prototype.importRecording): Deleted.
2167
2168         * UserInterface/Views/AuditNavigationSidebarPanel.js:
2169         (WI.AuditNavigationSidebarPanel):
2170         (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
2171         (WI.AuditNavigationSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
2172         * UserInterface/Views/CanvasSidebarPanel.js:
2173         (WI.CanvasSidebarPanel):
2174         (WI.CanvasSidebarPanel.prototype._handleImportButtonNavigationItemClicked): Added.
2175         (WI.CanvasSidebarPanel.prototype._recordingChanged):
2176         (WI.CanvasSidebarPanel.prototype._updateRecordNavigationItem):
2177
2178         * UserInterface/Views/CanvasOverviewContentView.js:
2179         (WI.CanvasOverviewContentView):
2180         (WI.CanvasOverviewContentView.prototype._handleImportButtonNavigationItemClicked): Added.
2181
2182         * UserInterface/Base/FileUtilities.js:
2183         (WI.FileUtilities.save): Added.
2184         (WI.FileUtilities.importText): Added.
2185         (WI.FileUtilities.importJSON): Added.
2186         (WI.FileUtilities.async readText): Added.
2187         (WI.FileUtilities.async readJSON): Added.
2188         (WI.saveDataToFile): Deleted.
2189         (WI.loadDataFromFile): Deleted.
2190         * UserInterface/Base/Main.js:
2191         (WI._contextMenuRequested):
2192         (WI._save):
2193         (WI._saveAs):
2194         * UserInterface/Views/ContextMenuUtilities.js:
2195         (WI.appendContextMenuItemsForSourceCode):
2196         * UserInterface/Views/LogContentView.js:
2197         (WI.LogContentView.prototype._handleContextMenuEvent):
2198         * UserInterface/Views/NetworkTableContentView.js:
2199         (WI.NetworkTableContentView.prototype._exportHAR):
2200         * UserInterface/Views/RecordingContentView.js:
2201         (WI.RecordingContentView.prototype._exportRecording):
2202         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2203         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._save):
2204         Move file related functions into a static class container.
2205
2206         * Localizations/en.lproj/localizedStrings.js:
2207
2208 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
2209
2210         Web Inspector: Include target identifier in protocol logging
2211         https://bugs.webkit.org/show_bug.cgi?id=191478
2212
2213         Reviewed by Devin Rousso.
2214
2215         * UserInterface/Protocol/Connection.js:
2216         (InspectorBackend.Connection.prototype._dispatchResponse):
2217         (InspectorBackend.Connection.prototype._dispatchEvent):
2218         (InspectorBackend.Connection.prototype._sendMessageToBackend):
2219         Call tracer log methods with the connection.
2220
2221         * UserInterface/Debug/CapturingProtocolTracer.js:
2222         * UserInterface/Protocol/ProtocolTracer.js:
2223         * UserInterface/Protocol/LoggingProtocolTracer.js:
2224         (WI.LoggingProtocolTracer):
2225         (WI.LoggingProtocolTracer.prototype.logFrontendException):
2226         (WI.LoggingProtocolTracer.prototype.logFrontendRequest):
2227         (WI.LoggingProtocolTracer.prototype.logWillHandleResponse):
2228         (WI.LoggingProtocolTracer.prototype.logDidHandleResponse):
2229         (WI.LoggingProtocolTracer.prototype.logDidHandleEvent):
2230         Include the connection in log methods.
2231
2232         (WI.LoggingProtocolTracer.prototype.logProtocolError):
2233         Removed, this is never called.
2234                 
2235         (WI.LoggingProtocolTracer.prototype._processEntry):
2236         Include the target identifier in entry messages.
2237
2238 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
2239
2240         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
2241         https://bugs.webkit.org/show_bug.cgi?id=191494
2242         <rdar://problem/45469854>
2243
2244         Reviewed by Devin Rousso.
2245
2246         This starts introducing multi-target support into the Web Inspector frontend.
2247         Specifically a backend connection that is persistent, but has the ability to
2248         connect to and transition between Page targets received through that backend
2249         connection.
2250
2251         This patch introduces the concept of a "Backend Target" which is the single
2252         connection that the frontend contains to a backend. The old way of connecting
2253         directly to a target is still supported. In that case the frontend constructs
2254         a DirectBackendTarget for the debuggable type the frontend was spawns for.
2255         However, if the frontend opens and has a TargetAgent, then it is likely
2256         connected to a multi-target supporting backend and instead constructs a
2257         MultiplexingBackendTarget, and will receive further information about
2258         sub-targets to connect to. The only sub-target at the moment is a Page
2259         sub-target.
2260
2261         As part of bringing up multi-target support this adds a few measures to
2262         handle situations where the frontend is playing fast and loose with agents.
2263         When the frontend does `FooAgent.method` it intends that to be performed
2264         on the "main" target being debugged. Likewise when the frontend loops
2265         over targets it expects them to be the debuggable targets. This patch
2266         profiles a new implementation of `WI.mainTarget` and `WI.targets` to
2267         match the assumptions being made by the frontend.
2268
2269           - In a direct-target world, there is a single target which
2270             should be used for global agents and in WI.targets.
2271
2272           - In a multi-target world, the page target is the one that
2273             should be used for global agents and WI.targets is the list
2274             of sub-targets (excluding the MultiplexingBackendTarget).
2275
2276         In a multi-target world, there are now commonly two Targets. The
2277         MultiplexingBackendTarget and a PageTarget sub-target. In the future
2278         this may include more targets, such as ServiceWorkers, DedicatedWorkers,
2279         and perhaps even frames.
2280
2281         In a multi-target world, the frontend is immediately told about targets
2282         as soon as it opens (via Target.targetCreated). In order to support
2283         this, frontend initialization happens without a main target being available.
2284         So this makes a few small changes to frontend initialization to perform
2285         a bit of work once we know what the main target is.
2286
2287         During a page transition the frontend is told to destroy existing targets
2288         and is soon after told about any new page targets (via Target.targetDestroyed
2289         and Target.targetCreated). The frontend special cases this page transition.
2290         It expects only one Page target to be alive at any time, accessible through
2291         WI.pageTarget. When a page transition happens the WI.pageTarget changes, and
2292         the frontend performs a bit of work to prepare the UI to handle the transition:
2293         `<Manager>.transitionPageTarget` / WI.Notification.TransitionPageTarget.
2294         For the most part the UI behaves fine as long once there are main frame
2295         change and main resource change events, but those other events allow
2296         the frontend to respond to the specific page transition cases.
2297
2298         * UserInterface/Base/Main.js:
2299         (WI.loaded):
2300         (WI.initializeBackendTarget):
2301         (WI.initializePageTarget):
2302         (WI.transitionPageTarget):
2303         (WI.terminatePageTarget):
2304         (WI.resetMainExecutionContext):
2305         (WI.redirectGlobalAgentsToConnection):
2306         (WI.contentLoaded):
2307         New global functions for target initialization
2308         and page transitioning.
2309
2310         * UserInterface/Test/Test.js:
2311         (WI.loaded):
2312         (WI.initializeBackendTarget):
2313         (WI.initializePageTarget):
2314         (WI.transitionPageTarget):
2315         (WI.terminatePageTarget):
2316         (WI.resetMainExecutionContext):
2317         (WI.redirectGlobalAgentsToConnection):
2318         New global functions for target initialization.
2319         Tests continue to be a direct connection to the Page.
2320
2321         * UserInterface/Protocol/TargetObserver.js:
2322         (WI.TargetObserver.prototype.targetCreated):
2323         (WI.TargetObserver.prototype.targetDestroyed):
2324         (WI.TargetObserver.prototype.dispatchMessageFromTarget):
2325         New observer goes to the manager.
2326
2327         * UserInterface/Controllers/TargetManager.js:
2328         (WI.TargetManager):
2329         (WI.TargetManager.prototype.get targets):
2330         (WI.TargetManager.prototype.get allTargets):
2331         (WI.TargetManager.prototype.targetForIdentifier):
2332         (WI.TargetManager.prototype.targetCreated):
2333         (WI.TargetManager.prototype.targetDestroyed):
2334         (WI.TargetManager.prototype.dispatchMessageFromTarget):
2335         (WI.TargetManager.prototype.createMultiplexingBackendTarget):
2336         (WI.TargetManager.prototype.createDirectBackendTarget):
2337         (WI.TargetManager.prototype._addTarget):
2338         (WI.TargetManager.prototype._removeTarget):
2339         (WI.TargetManager.prototype._createTarget):
2340         (WI.TargetManager.prototype._checkAndHandlePageTargetTransition):
2341         (WI.TargetManager.prototype._checkAndHandlePageTargetTermination):
2342         (WI.TargetManager.prototype.addTarget): Deleted.
2343         (WI.TargetManager.prototype.removeTarget): Deleted.
2344         (WI.TargetManager.prototype.initializeMainTarget): Deleted.
2345         TargetManager is where we handle creating and destroying targets
2346         and their connections. In order to simplify things a bit we make
2347         `WI.targets`, which goes through `get targets()` an array instead
2348         of a Set. And this includes only the sub-targets.
2349
2350         * UserInterface/Controllers/WorkerManager.js:
2351         (WI.WorkerManager.prototype.workerCreated):
2352         (WI.WorkerManager.prototype.workerTerminated):
2353         Workers are still special-target-like things that multiplex through
2354         WorkerAgent instead of TargetAgent. We'd like to promote these to
2355         be full targets in the future.
2356
2357         * UserInterface/Protocol/DirectBackendTarget.js: Renamed from Source/WebInspectorUI/UserInterface/Protocol/MainTarget.js.
2358         (WI.DirectBackendTarget):
2359         (WI.DirectBackendTarget.connectionInfoForDebuggable):
2360         (WI.DirectBackendTarget.prototype.get mainResource):
2361         (WI.DirectBackendTarget.prototype.set mainResource):
2362         This is the only "MainTarget" class. It is the backend target for a direct connection.
2363
2364         * UserInterface/Protocol/MultiplexingBackendTarget.js:
2365         (WI.MultiplexingBackendTarget):
2366         (WI.MultiplexingBackendTarget.prototype.initialize):
2367         (WI.MultiplexingBackendTarget.prototype.get name):
2368         (WI.MultiplexingBackendTarget.prototype.get executionContext):
2369         (WI.MultiplexingBackendTarget.prototype.get mainResource):
2370         This is the new backend target for a multi-target connection.
2371         We don't expect it to be treated like other targets, so we don't
2372         expect anyone to ask it for resources/executionContext/name info.
2373
2374         * UserInterface/Controllers/RuntimeManager.js:
2375         (WI.TargetManager.prototype.evaluateInInspectedWindow):
2376         This can be triggered by watch expressions before any target, and
2377         therefore execution context, is available. Just return null, when
2378         an execution context is available those clients will try again.
2379
2380         * UserInterface/Debug/Bootstrap.js:
2381         Provide an WI.isEngineeringBuild boolean that can be used for various
2382         debugging features.
2383
2384         * UserInterface/Main.html:
2385         * UserInterface/Test.html:
2386         New resources.
2387
2388         * UserInterface/Protocol/InspectorBackend.js:
2389         (InspectorBackendClass.prototype.dispatch):
2390         (InspectorBackendClass.prototype.runAfterPendingDispatches):
2391         (InspectorBackend.Agent):
2392         `InspectorBackend.mainConnection` was renamed `InspectorBackend.backendConnection`.
2393
2394         * UserInterface/Protocol/Connection.js:
2395         (InspectorBackend.Connection):
2396         (InspectorBackend.Connection.prototype._dispatchResponse):
2397         (InspectorBackend.Connection.prototype._sendCommandToBackendWithCallback):
2398         (InspectorBackend.Connection.prototype._sendCommandToBackendExpectingPromise):
2399         (InspectorBackend.BackendConnection):
2400         (InspectorBackend.BackendConnection.prototype.sendMessageToBackend):
2401         (InspectorBackend.WorkerConnection):
2402         (InspectorBackend.TargetConnection):
2403         (InspectorBackend.TargetConnection.sendMessageToBackend):
2404         Use a global sequence id to make filtering a bit easier in protocol tracing.
2405         TargetConnection is identical to WorkerConnection except it uses TargetAgent
2406         instead of WorkerAgent to perform multiplexing.
2407
2408         * UserInterface/Protocol/JavaScriptContextTarget.js:
2409         (WI.JavaScriptContextTarget):
2410         * UserInterface/Protocol/PageTarget.js:
2411         (WI.PageTarget):
2412         (WI.PageTarget.prototype.get displayName):
2413         Specialized target types.
2414
2415         * UserInterface/Views/DebuggerSidebarPanel.js:
2416         (WI.DebuggerSidebarPanel):
2417         (WI.DebuggerSidebarPanel.prototype._targetAdded):
2418         (WI.DebuggerSidebarPanel.prototype._targetRemoved):
2419         (WI.DebuggerSidebarPanel.prototype._updateCallStackTreeOutline):
2420         * UserInterface/Views/SourceCodeTextEditor.js:
2421         (WI.SourceCodeTextEditor.prototype._targetAdded):
2422         (WI.SourceCodeTextEditor.prototype._targetRemoved):
2423         (WI.SourceCodeTextEditor.prototype._callFramesDidChange):
2424         (WI.SourceCodeTextEditor.prototype._updateThreadIndicatorWidget):
2425         (WI.SourceCodeTextEditor.prototype._reinsertAllThreadIndicators):
2426         * UserInterface/Views/QuickConsole.js:
2427         (WI.QuickConsole.prototype.initializeMainExecutionContextPathComponent):
2428         (WI.QuickConsole.prototype._targetAdded):
2429         (WI.QuickConsole.prototype._targetRemoved):
2430         We make target added get called with all targets, including the
2431         MultiplexingBackendTarget and PageTargets, both of which would
2432         not have happened before. Before it was only WorkerTargets. Make
2433         these sites a little more robust for the type of target they expect
2434         to be able to handle.
2435
2436         * UserInterface/Base/Object.js:
2437         * UserInterface/Controllers/DOMManager.js:
2438         (WI.DOMManager):
2439         (WI.DOMManager.prototype.transitionPageTarget):
2440         (WI.DOMManager.prototype.requestDocument):
2441         (WI.DOMManager.prototype._setDocument):
2442         * UserInterface/Controllers/NetworkManager.js:
2443         (WI.NetworkManager):
2444         (WI.NetworkManager.prototype.transitionPageTarget):
2445         (WI.NetworkManager.prototype.executionContextCreated):
2446         (WI.NetworkManager.prototype._processMainFrameResourceTreePayload):
2447         * UserInterface/Models/DefaultDashboard.js:
2448         (WI.DefaultDashboard):
2449         (WI.DefaultDashboard.prototype._mainResourceDidChange):
2450         (WI.DefaultDashboard.prototype._transitionPageTarget):
2451         * UserInterface/Views/NetworkTableContentView.js:
2452         (WI.NetworkTableContentView):
2453         (WI.NetworkTableContentView.prototype._mainResourceDidChange):
2454         (WI.NetworkTableContentView.prototype._transitionPageTarget):
2455         Special case handling when performing a page transition.
2456
2457         * UserInterface/Views/SettingsTabContentView.js:
2458         * UserInterface/Debug/UncaughtExceptionReporter.js:
2459         Document reloads are not supported right now.
2460
2461 2018-11-14  Devin Rousso  <drousso@apple.com>
2462
2463         Web Inspector: Canvas: don't start with auto-capture enabled
2464         https://bugs.webkit.org/show_bug.cgi?id=191553
2465
2466         Reviewed by Matt Baker.
2467
2468         * UserInterface/Views/CanvasOverviewContentView.js:
2469         (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount):
2470         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize):
2471         (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput):
2472         * UserInterface/Views/CanvasOverviewContentView.css:
2473         (.navigation-bar > .item.canvas-recording-auto-capture > label > input):
2474
2475 2018-11-14  Devin Rousso  <drousso@apple.com>
2476
2477         Web Inspector: Network Graphs are missing minimum sizes, might have no graph at all
2478         https://bugs.webkit.org/show_bug.cgi?id=191208
2479
2480         Reviewed by Joseph Pecoraro.
2481
2482         `WI.NetworkTableContentView` used to rely on the `WI.timelineManager.persistentNetworkTimeline`
2483         for events when a new resource is added. It also listened for `WI.Frame.Event.MainResourceDidChange`
2484         on it's own, which was also listened to by `WI.timelineManager.persistentNetworkTimeline`.
2485         Due to the order in which these listeners are added, the new main resource would get added
2486         to the `WI.timelineManager.persistentNetworkTimeline` (and the `WI.NetworkTableContentView`
2487         shortly after), and right after that the `WI.NetworkTableContentView` would reset the graph
2488         in it's own listener for `WI.Frame.Event.MainResourceDidChange`.
2489
2490         This patch removes `WI.timelineManager.persistentNetworkTimeline` and instead makes it so
2491         that `WI.NetworkTableContentView` listens for resource added and main frame changed events
2492         on its own (similar to other views that follow this pattern), ensuring that there are no
2493         event races.
2494
2495         Also relaxes the "requirement" that prevented 0 width blocks from being drawn, allowing
2496         requests served from memory/disk to appear in the graph (their time is effectively 0).
2497
2498         * UserInterface/Views/NetworkTableContentView.js:
2499         (WI.NetworkTableContentView):
2500         (WI.NetworkTableContentView.prototype.closed):
2501         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
2502         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock):
2503         (WI.NetworkTableContentView.prototype._updateWaterfallTimeRange): Added.
2504         (WI.NetworkTableContentView.prototype._resourceLoadingDidFinish):
2505         (WI.NetworkTableContentView.prototype._resourceLoadingDidFail):
2506         (WI.NetworkTableContentView.prototype._handleResourceAdded): Added.
2507         (WI.NetworkTableContentView.prototype._insertResourceAndReloadTable):
2508         (WI.NetworkTableContentView.prototype._handleNodeDidFireEvent):
2509         (WI.NetworkTableContentView.prototype._handleNodeLowPowerChanged):
2510         * UserInterface/Views/NetworkTableContentView.css:
2511         (.network-table .waterfall .block:matches(.mouse-tracking, .filler) + .block:not(.mouse-tracking, .filler)): Added.
2512         (.network-table .waterfall .block.filler + .block): Deleted.
2513
2514         * UserInterface/Controllers/TimelineManager.js:
2515         (WI.TimelineManager):
2516         (WI.TimelineManager.prototype._mainResourceDidChange):
2517         (WI.TimelineManager.prototype._resourceWasAdded):
2518         (WI.TimelineManager.prototype.get persistentNetworkTimeline): Deleted.
2519
2520 2018-11-13  Matt Baker  <mattbaker@apple.com>
2521
2522         Web Inspector: Table should support select all (Cmd-A)
2523         https://bugs.webkit.org/show_bug.cgi?id=190299
2524         <rdar://problem/45029170>
2525
2526         Reviewed by Devin Rousso.
2527
2528         * UserInterface/Views/Table.js:
2529         (WI.Table.prototype.selectAll):
2530         (WI.Table.prototype._handleKeyDown):
2531
2532 2018-11-13  Matt Baker  <mattbaker@apple.com>
2533
2534         Web Inspector: Table with no selection should select the first/last row on down/up arrow key
2535         https://bugs.webkit.org/show_bug.cgi?id=190100
2536         <rdar://problem/44879243>
2537
2538         Reviewed by Devin Rousso.
2539
2540         Pressing the up or down arrow key when nothing is selected should select
2541         the last or first row, respectively. After selecting the row make sure
2542         it is visible by calling the new Table method `revealRow`.
2543
2544         * UserInterface/Views/Table.js:
2545         (WI.Table.prototype.revealRow):
2546         (WI.Table.prototype._handleKeyDown):
2547         (WI.Table.prototype._selectRowsFromArrowKey):
2548
2549 2018-11-13  Nikita Vasilyev  <nvasilyev@apple.com>
2550
2551         Web Inspector: Styles: Command-A should select all properties
2552         https://bugs.webkit.org/show_bug.cgi?id=191435
2553         <rdar://problem/45921373>
2554
2555         Reviewed by Devin Rousso.
2556
2557         When focused on a style property, Command-A on Mac (Control-A on other platforms)
2558         should select all properties of the style rule.
2559
2560         * UserInterface/Base/Utilities.js:
2561         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
2562         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties):
2563         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
2564
2565 2018-11-12  Devin Rousso  <drousso@apple.com>
2566
2567         Web Inspector: Network: show secure certificate details per-request
2568         https://bugs.webkit.org/show_bug.cgi?id=191447
2569         <rdar://problem/30019476>
2570
2571         Reviewed by Joseph Pecoraro.
2572
2573         * UserInterface/Controllers/NetworkManager.js:
2574         (WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache):
2575         (WI.NetworkManager.prototype.resourceRequestDidReceiveResponse):
2576
2577         * UserInterface/Models/Resource.js:
2578         (WI.Resource.prototype.get responseSecurity): Added.
2579         (WI.Resource.prototype.get loadedSecurely): Added.
2580         (WI.Resource.prototype.updateForResponse):
2581
2582         * UserInterface/Views/NetworkResourceDetailView.js:
2583         (WI.NetworkResourceDetailView):
2584         (WI.NetworkResourceDetailView.prototype.initialLayout):
2585         (WI.NetworkResourceDetailView.prototype.showContentViewForIdentifier):
2586         * UserInterface/Views/NetworkResourceDetailView.css:
2587         (.content-view.resource-details .go-to-arrow): Added.
2588         (.content-view.resource-details.showing-find-banner .search-highlight): Added.
2589
2590         * UserInterface/Views/ResourceSecurityContentView.js: Added.
2591         (WI.ResourceSecurityContentView):
2592         (WI.ResourceSecurityContentView.prototype.initialLayout):
2593         (WI.ResourceSecurityContentView.prototype.layout):
2594         (WI.ResourceSecurityContentView.prototype.closed):
2595         (WI.ResourceSecurityContentView.prototype.get supportsSearch):
2596         (WI.ResourceSecurityContentView.prototype.get numberOfSearchResults):
2597         (WI.ResourceSecurityContentView.prototype.get hasPerformedSearch):
2598         (WI.ResourceSecurityContentView.prototype.set automaticallyRevealFirstSearchResult):
2599         (WI.ResourceSecurityContentView.prototype.performSearch):
2600         (WI.ResourceSecurityContentView.prototype.searchCleared):
2601         (WI.ResourceSecurityContentView.prototype.revealPreviousSearchResult):
2602         (WI.ResourceSecurityContentView.prototype.revealNextSearchResult):
2603         (WI.ResourceSecurityContentView.prototype._refreshCetificateSection):
2604         (WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs):
2605         (WI.ResourceSecurityContentView.prototype._revealSearchResult):
2606         (WI.ResourceSecurityContentView.prototype._handleResourceResponseReceived):
2607         * UserInterface/Views/ResourceSecurityContentView.css: Added.
2608         (body[dir] .resource-security > section.certificate > .details):
2609         (.resource-security .details .key):
2610         (.resource-security .dns-name + .dns-name > .key,):
2611         (.resource-security .show-more):
2612         (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details):
2613         (@media (prefers-dark-interface) .resource-security .details .key):
2614
2615         * UserInterface/Views/ResourceCookiesContentView.js:
2616         (WI.ResourceCookiesContentView.prototype._refreshRequestCookiesSection):
2617         (WI.ResourceCookiesContentView.prototype._refreshResponseCookiesSection):
2618         (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithMessage): Deleted.
2619         (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted.
2620         * UserInterface/Views/ResourceHeadersContentView.js:
2621         (WI.ResourceHeadersContentView.prototype._refreshSummarySection):
2622         (WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections):
2623         (WI.ResourceHeadersContentView.prototype._refreshRequestHeadersSection):
2624         (WI.ResourceHeadersContentView.prototype._refreshResponseHeadersSection):
2625         (WI.ResourceHeadersContentView.prototype._refreshQueryStringSection):
2626         (WI.ResourceHeadersContentView.prototype._refreshRequestDataSection):
2627         (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithMessage): Deleted.
2628         (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted.
2629         (WI.ResourceHeadersContentView.prototype._appendKeyValuePair): Deleted.
2630         * UserInterface/Views/ResourceHeadersContentView.css:
2631         (.resource-headers .h1-status > .key,):
2632         (body[dir] .resource-headers > section.error > .details): Deleted.
2633         (.resource-headers > section.error .key): Deleted.
2634         (.resource-headers .details): Deleted.
2635         (.resource-headers .details .pair): Deleted.
2636         (body[dir=rtl] .resource-headers .details .pair): Deleted.
2637         (.resource-headers .details .key): Deleted.
2638         (.resource-headers .value): Deleted.
2639         (.resource-headers .go-to-arrow): Deleted.
2640         (.resource-headers.showing-find-banner .search-highlight): Deleted.
2641         * UserInterface/Views/ResourceDetailsSection.js:
2642         (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithMessage): Added.
2643         (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithLoadingIndicator): Added.
2644         (WI.ResourceDetailsSection.prototype.appendKeyValuePair): Added.
2645         * UserInterface/Views/ResourceDetailsSection.css:
2646         (.resource-details > section > .details): Added.
2647         (.resource-details > section > .details > .pair): Added.
2648         (body[dir=rtl] .resource-details > section > .details > .pair): Added.
2649         (.resource-details > section > .details > .pair > .key): Added.
2650         (.resource-details > section > .details > .pair > .value): Added.
2651         (body[dir] .resource-details > section.error > .details): Added.
2652         (.resource-details > section.error > .details > .pair > .key): Added.
2653         Move commonly used functions/styles from container classes onto this object.
2654
2655         * UserInterface/Main.html:
2656         * Localizations/en.lproj/localizedStrings.js:
2657
2658 2018-11-12  Matt Baker  <mattbaker@apple.com>
2659
2660         Web Inspector: Table should support shift-extending the row selection
2661         https://bugs.webkit.org/show_bug.cgi?id=189718
2662         <rdar://problem/44577942>
2663
2664         Reviewed by Devin Rousso.
2665
2666         Allow the table selection to be extended by shift-clicking a row, or by
2667         holding shift and pressing either the up or down arrow key. If both command
2668         and shift are pressed, shift is ignored. The selection behavior is modeled
2669         after AppKit's NSTableView.
2670
2671         * UserInterface/Base/IndexSet.js:
2672         (WI.IndexSet.prototype.addRange):
2673         (WI.IndexSet.prototype.deleteRange):
2674         (WI.IndexSet.prototype.equals):
2675         (WI.IndexSet.prototype.difference):
2676
2677         * UserInterface/Views/Table.js:
2678         (WI.Table):
2679         (WI.Table.prototype.set allowsMultipleSelection):
2680         (WI.Table.prototype.reloadData):
2681         (WI.Table.prototype.selectRow):
2682         (WI.Table.prototype.deselectRow):
2683         (WI.Table.prototype._handleKeyDown):
2684         Holding shift and pressing either the up or down arrow key extends the
2685         selection to the next unselected row adjacent to the anchor row, or causes
2686         the anchor row to be deselected, decreasing the selection. The table chooses
2687         the action to take based on the direction of movement (up or down), and
2688         the currently selected rows.
2689
2690         (WI.Table.prototype._selectRowsFromArrowKey):
2691         (WI.Table.prototype._handleMouseDown.normalizeRange):
2692         (WI.Table.prototype._handleMouseDown):
2693         Clicking a row while holding down shift extends the selection to include
2694         the rows between the anchor row (exclusive) and clicked row (inclusive).
2695         The anchor row is equal to the value of `_selectedRowIndex` prior to
2696         clicking a new row.
2697
2698         (WI.Table.prototype._deselectAllAndSelect):
2699         (WI.Table.prototype._removeRows):
2700         (WI.Table.prototype._toggleSelectedRowStyle):
2701         (WI.Table.prototype._updateSelectedRows):
2702         Helper method for updating the selection to the specified rows, and updating
2703         DOM styles for rows that are added to or removed from the selection.
2704
2705 2018-11-12  Nikita Vasilyev  <nvasilyev@apple.com>
2706
2707         Web Inspector: Styles: inline swatches don't work when Multiple Properties Selection is enabled
2708         https://bugs.webkit.org/show_bug.cgi?id=191165
2709         <rdar://problem/45737972>
2710
2711         Reviewed by Devin Rousso.
2712
2713         * UserInterface/Views/SpreadsheetStyleProperty.js:
2714         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
2715         * UserInterface/Views/SpreadsheetTextField.js:
2716         (WI.SpreadsheetTextField):
2717         `click` is fired after `mouseup` and inline swatches are activated by `click` event.
2718         Changing this to `click` allows swatches to activate before editing starts.
2719
2720         (WI.SpreadsheetTextField.prototype._handleMouseDown):
2721         Clicking on the field that is being edited should't restart editing. It should move the text caret.
2722
2723 2018-11-12  Don Olmstead  <don.olmstead@sony.com>
2724
2725         Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
2726         https://bugs.webkit.org/show_bug.cgi?id=189230
2727         <rdar://problem/44050379>
2728
2729         Reviewed by Joseph Pecoraro.
2730
2731         Runs all png images through zopflipng. This results in a smaller file
2732         size and takes care of this issue as a byproduct.
2733
2734         * UserInterface/Images/ApplicationCache.png:
2735         * UserInterface/Images/ApplicationCache@2x.png:
2736         * UserInterface/Images/ApplicationCacheManifest.png:
2737         * UserInterface/Images/ApplicationCacheManifest@2x.png:
2738         * UserInterface/Images/Breakpoint.png:
2739         * UserInterface/Images/Breakpoint@2x.png:
2740         * UserInterface/Images/BreakpointInactive.png:
2741         * UserInterface/Images/BreakpointInactive@2x.png:
2742         * UserInterface/Images/ClippingCSS.png:
2743         * UserInterface/Images/ClippingCSS@2x.png:
2744         * UserInterface/Images/ClippingCSSLarge.png:
2745         * UserInterface/Images/ClippingCSSLarge@2x.png:
2746         * UserInterface/Images/ClippingGeneric.png:
2747         * UserInterface/Images/ClippingGeneric@2x.png:
2748         * UserInterface/Images/ClippingGenericLarge.png:
2749         * UserInterface/Images/ClippingGenericLarge@2x.png:
2750         * UserInterface/Images/ClippingJS.png:
2751         * UserInterface/Images/ClippingJS@2x.png:
2752         * UserInterface/Images/ClippingJSLarge.png:
2753         * UserInterface/Images/ClippingJSLarge@2x.png:
2754         * UserInterface/Images/ColorIcon.png:
2755         * UserInterface/Images/ColorIcon@2x.png:
2756         * UserInterface/Images/Cookie.png:
2757         * UserInterface/Images/Cookie@2x.png:
2758         * UserInterface/Images/Database.png:
2759         * UserInterface/Images/Database@2x.png:
2760         * UserInterface/Images/DatabaseTable.png:
2761         * UserInterface/Images/DatabaseTable@2x.png:
2762         * UserInterface/Images/DocumentCSS.png:
2763         * UserInterface/Images/DocumentCSS@2x.png:
2764         * UserInterface/Images/DocumentCSSLarge.png:
2765         * UserInterface/Images/DocumentCSSLarge@2x.png:
2766         * UserInterface/Images/DocumentFont.png:
2767         * UserInterface/Images/DocumentFont@2x.png:
2768         * UserInterface/Images/DocumentFontLarge.png:
2769         * UserInterface/Images/DocumentFontLarge@2x.png:
2770         * UserInterface/Images/DocumentGL.png:
2771         * UserInterface/Images/DocumentGL@2x.png:
2772         * UserInterface/Images/DocumentGeneric.png:
2773         * UserInterface/Images/DocumentGeneric@2x.png:
2774         * UserInterface/Images/DocumentGenericLarge.png:
2775         * UserInterface/Images/DocumentGenericLarge@2x.png:
2776         * UserInterface/Images/DocumentImage.png:
2777         * UserInterface/Images/DocumentImage@2x.png:
2778         * UserInterface/Images/DocumentImageLarge.png:
2779         * UserInterface/Images/DocumentImageLarge@2x.png:
2780         * UserInterface/Images/DocumentJS.png:
2781         * UserInterface/Images/DocumentJS@2x.png:
2782         * UserInterface/Images/DocumentJSLarge.png:
2783         * UserInterface/Images/DocumentJSLarge@2x.png:
2784         * UserInterface/Images/DocumentMarkup.png:
2785         * UserInterface/Images/DocumentMarkup@2x.png:
2786         * UserInterface/Images/DocumentMarkupLarge.png:
2787         * UserInterface/Images/DocumentMarkupLarge@2x.png:
2788         * UserInterface/Images/FolderGeneric.png:
2789         * UserInterface/Images/FolderGeneric@2x.png:
2790         * UserInterface/Images/GradientStop.png:
2791         * UserInterface/Images/GradientStop@2x.png:
2792         * UserInterface/Images/GradientStopSelected.png:
2793         * UserInterface/Images/GradientStopSelected@2x.png:
2794         * UserInterface/Images/HoverMenuButton.png:
2795         * UserInterface/Images/HoverMenuButton@2x.png:
2796         * UserInterface/Images/InstructionPointer.png:
2797         * UserInterface/Images/InstructionPointer@2x.png:
2798         * UserInterface/Images/LocalStorage.png:
2799         * UserInterface/Images/LocalStorage@2x.png:
2800         * UserInterface/Images/SessionStorage.png:
2801         * UserInterface/Images/SessionStorage@2x.png:
2802         * UserInterface/Images/SliderThumb.png:
2803         * UserInterface/Images/SliderThumb@2x.png:
2804         * UserInterface/Images/SliderThumbPressed.png:
2805         * UserInterface/Images/SliderThumbPressed@2x.png:
2806         * UserInterface/Images/WebSocket.png:
2807         * UserInterface/Images/WebSocket@2x.png:
2808         * UserInterface/Images/WebSocketLarge.png:
2809         * UserInterface/Images/WebSocketLarge@2x.png:
2810         * UserInterface/Images/WorkerScript.png:
2811         * UserInterface/Images/WorkerScript@2x.png:
2812         * UserInterface/Images/WorkerScriptLarge.png:
2813         * UserInterface/Images/WorkerScriptLarge@2x.png:
2814
2815 2018-11-12  Nikita Vasilyev  <nvasilyev@apple.com>
2816
2817         Web Inspector: Styles: Pressing Tab or Enter should start editing focused property
2818         https://bugs.webkit.org/show_bug.cgi?id=191510
2819         <rdar://problem/45970897>
2820
2821         Reviewed by Dean Jackson.
2822
2823         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
2824         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
2825
2826 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
2827
2828         Web Inspector: Start moving toward better multi-target support
2829         https://bugs.webkit.org/show_bug.cgi?id=191345
2830
2831         Reviewed by Devin Rousso.
2832
2833         This change continues the move toward better multi-target support
2834         by explicitly using explicit target agents in more places, and
2835         converting generalized feature checks into target agnostic versions
2836         that use the new InspectorBackend.domains, which does not vary based
2837         on the connected targets / debuggable type.
2838
2839         I also audited uses of RuntimeAgent, ConsoleAgent, and DebuggerAgent
2840         for better multi-target support since these agents should already
2841         have complete multi-target support.
2842
2843         * UserInterface/Protocol/Target.js:
2844         (WI.Target.prototype.initialize):
2845         Move explicitly to target.Agent feature checks with a known target.
2846
2847         * UserInterface/Controllers/DebuggerManager.js:
2848         (WI.DebuggerManager.prototype.initializeTarget):
2849         (WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange):
2850         Move explicitly to target.DebuggerAgent for feature checks with a known target.
2851
2852         * UserInterface/Controllers/NetworkManager.js:
2853         (WI.NetworkManager.prototype.initializeTarget):
2854         Move explicitly to target.NetworkAgent for feature checks with a known target.
2855
2856         * UserInterface/Controllers/RuntimeManager.js:
2857         (WI.RuntimeManager.prototype.initializeTarget):
2858         (WI.RuntimeManager.prototype.saveResult):
2859         * UserInterface/Protocol/RemoteObject.js:
2860         (WI.RemoteObject.prototype.updatePreview):
2861         (WI.RemoteObject.prototype.getDisplayablePropertyDescriptors):
2862         (WI.RemoteObject.prototype.deprecatedGetDisplayableProperties):
2863         * UserInterface/Views/SourceCodeTextEditor.js:
2864         (WI.SourceCodeTextEditor.prototype._createTypeTokenAnnotator):
2865         (WI.SourceCodeTextEditor.prototype._createBasicBlockAnnotator):
2866         Move explicitly to target.RuntimeAgent for feature checks with a known target.
2867
2868         * UserInterface/Models/CSSCompletions.js:
2869         (WI.CSSCompletions.initializeCSSCompletions):
2870         Move explicitly to target.CSSAgent for feature checks with a known target.
2871
2872         * UserInterface/Views/ContextMenuUtilities.js:
2873         Use the DebuggerAgent from the target associated with the DOMNode's
2874         remote object instead of assuming the main target.
2875
2876         * UserInterface/Views/SettingsTabContentView.js:
2877         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
2878         Update the ConsoleAgent setting on all targets that support it.
2879
2880         * UserInterface/Views/BreakpointActionView.js:
2881         (WI.BreakpointActionView):
2882         All backends support BreakpointActionType, the assertion can go away.
2883
2884         * UserInterface/Views/LogContentView.js:
2885         (WI.LogContentView.prototype.get navigationItems):
2886         * UserInterface/Views/DOMTreeContentView.js:
2887         (WI.DOMTreeContentView.prototype.get navigationItems):
2888         Include additional `window.FooAgent` checks for these since they will need
2889         to be revisited in the future.
2890
2891         * UserInterface/Protocol/InspectorBackend.js:
2892         (InspectorBackendClass.prototype.get domains):
2893         (InspectorBackendClass.prototype.activateDomain):
2894         Expose InspectorBackend.domains.<Domain> for feature checking.
2895
2896         * UserInterface/Controllers/BreakpointPopoverController.js:
2897         (WI.BreakpointPopoverController.prototype._createPopoverContent):
2898         * UserInterface/Controllers/CSSManager.js:
2899         (WI.CSSManager):
2900         (WI.CSSManager.prototype._mainResourceDidChange):
2901         * UserInterface/Controllers/TimelineManager.js:
2902         (WI.TimelineManager.prototype._attemptAutoCapturingForFrame):
2903         (WI.TimelineManager.prototype._updateAutoCaptureInstruments):
2904         (WI.TimelineManager):
2905         * UserInterface/Models/Canvas.js:
2906         (WI.Canvas.prototype.startRecording):
2907         (WI.Canvas.prototype.recordingFinished):
2908         * UserInterface/Models/ScriptSyntaxTree.js:
2909         (WI.ScriptSyntaxTree.functionReturnDivot):
2910         * UserInterface/Protocol/DebuggerObserver.js:
2911         (WI.DebuggerObserver):
2912         * UserInterface/Protocol/NetworkObserver.js:
2913         (WI.NetworkObserver.prototype.requestWillBeSent):
2914         * UserInterface/Views/DebuggerSidebarPanel.js:
2915         (WI.DebuggerSidebarPanel):
2916         (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointClicked):
2917         * UserInterface/Views/NetworkTimelineView.js:
2918         (WI.NetworkTimelineView):
2919         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
2920         (WI.ResourceDetailsSidebarPanel.prototype._refreshRequestAndResponse):
2921         * UserInterface/Views/WebSocketContentView.js:
2922         (WI.WebSocketContentView):
2923         (WI.NetworkManager.prototype.webSocketWillSendHandshakeRequest):
2924         (WI.DebuggerManager.prototype.debuggerDidResume):
2925         Feature check in a target agnostic way.
2926
2927 2018-11-08  Matt Baker  <mattbaker@apple.com>
2928
2929         Web Inspector: ResourceQueryController should early return when query is longer than search string
2930         https://bugs.webkit.org/show_bug.cgi?id=191436
2931
2932         Reviewed by Devin Rousso.
2933
2934         * UserInterface/Controllers/ResourceQueryController.js:
2935
2936         * UserInterface/Models/ResourceQueryMatch.js:
2937         (WI.ResourceQueryMatch):
2938         Drive-by fixes.
2939
2940 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
2941
2942         Uncaught Exception: undefined is not an object (evaluating 'treeElement.parent.removeChild')
2943         https://bugs.webkit.org/show_bug.cgi?id=191454
2944
2945         Reviewed by Matt Baker.
2946
2947         * UserInterface/Views/ResourceSidebarPanel.js:
2948         (WI.ResourceSidebarPanel.prototype._scriptsCleared):
2949         This was intending to iterate the Map's values, which are tree elements.
2950
2951 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
2952
2953         Web Inspector: Potential for watch expressions to never show results
2954         https://bugs.webkit.org/show_bug.cgi?id=191438
2955
2956         Reviewed by Matt Baker.
2957
2958         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
2959         (WI.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
2960         If there was no object don't bail, continue and resolve the Promise.
2961         In this case we can fallback to show `undefined`. This code might not be
2962         reachable right now, but is wrong as is.
2963
2964 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
2965
2966         Web Inspector: Debugger Popover does not work when paused in Worker
2967         https://bugs.webkit.org/show_bug.cgi?id=191342
2968
2969         Reviewed by Devin Rousso.
2970
2971         * UserInterface/Views/SourceCodeTextEditor.js:
2972         (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
2973         (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
2974         When receiving the result of the popover evaluation associate the RemoteObject with
2975         the target we used to evaluate (such as the Debugger call frame), not the target
2976         associated with the editor.
2977
2978 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
2979
2980         Web Inspector: Restrict domains at the target level instead of only at the window level
2981         https://bugs.webkit.org/show_bug.cgi?id=191344
2982
2983         Reviewed by Devin Rousso.
2984
2985         With this change the list of agents available on the target should accurately
2986         reflect the domains that target supports. We should start moving in the direction
2987         that if we are checking for, or using, a feature, we should ideally be using
2988         code that looks like `target.FooAgent.method` and not `window.FooAgent` or
2989         an unprefixed `FooAgent`. More changes to follow.
2990
2991         * UserInterface/Controllers/AppControllerBase.js:
2992         * UserInterface/Base/DebuggableType.js: Added.
2993         Extract debuggable type enum out into its own file loaded early on.
2994
2995         * UserInterface/Main.html:
2996         * UserInterface/Test.html:
2997         Load DebuggableType.js.
2998
2999         * UserInterface/Controllers/NetworkManager.js:
3000         (WI.NetworkManager.prototype.initializeTarget):
3001         With these changes target.ServiceWorker is only exposed on a ServiceWorker target.
3002
3003         * UserInterface/Protocol/Connection.js:
3004         (InspectorBackend.WorkerConnection):
3005         With these changes Target.js restricts the domains exposed on the Target so just
3006         clone all of the agents (we don't need to do anything special).
3007
3008         * UserInterface/Protocol/InspectorBackend.js:
3009         (InspectorBackendClass.prototype.activateDomain):
3010         Update supported domains per-type. If there is no explicit availability
3011         then the domain is supported on all types.
3012
3013         (InspectorBackendClass.prototype.supportedDomainsForDebuggableType):
3014         Get supported domains per-type.
3015
3016         (InspectorBackendClass.prototype.get workerSupportedDomains): Deleted.
3017         (InspectorBackendClass.prototype.workerSupportedDomain): Deleted.
3018         workerSupportedDomains is now unnecessary.
3019
3020         * UserInterface/Protocol/Target.js:
3021         (WI.Target.prototype._supportedDomainsForTargetType):
3022         Restrict supported domains for this target based on its type.
3023
3024         * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
3025         * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
3026         * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
3027         * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
3028         * Versions/Inspector-iOS-10.3.json:
3029         * Versions/Inspector-iOS-11.0.json:
3030         * Versions/Inspector-iOS-11.3.json:
3031         * Versions/Inspector-iOS-12.0.json:
3032         Regenerate protocol files now that workerSupportedDomains is unnecessary
3033         and explicit availability has been added to other domains.
3034
3035 2018-11-07  Nikita Vasilyev  <nvasilyev@apple.com>
3036
3037         REGRESSION(r236705): Web Inspector: wrong text color for selected DataGrid row
3038         https://bugs.webkit.org/show_bug.cgi?id=191405
3039         <rdar://problem/45893283>
3040
3041         Reviewed by Matt Baker.
3042
3043         Selection background color for both Dark Mode mode and Light Mode is dark blue.
3044         The text color for both cases should be white.
3045
3046         * UserInterface/Views/DataGrid.css:
3047         (body:not(.window-inactive, .window-docked-inactive) .data-grid:focus tr.editable.selected .cell-content > input):
3048
3049 2018-11-07  Joseph Pecoraro  <pecoraro@apple.com>
3050
3051         Web Inspector: Fix "Javascript" => "JavaScript" enum in protocol generated objects
3052         https://bugs.webkit.org/show_bug.cgi?id=191340
3053
3054         Reviewed by Devin Rousso.
3055
3056         * UserInterface/Models/Canvas.js:
3057         (WI.Canvas.fromPayload):
3058         Insert a missing break statement for the WebGPU case.
3059
3060         * UserInterface/Models/MemoryTimelineRecord.js:
3061         (WI.MemoryTimelineRecord.memoryCategoriesFromProtocol):
3062         Use new enum name.
3063
3064         * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
3065         * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
3066         * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
3067         * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
3068         * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
3069         * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
3070         * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
3071         * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
3072         Update enums with new generator.
3073
3074 2018-11-06  Joseph Pecoraro  <pecoraro@apple.com>
3075
3076         REGRESSION: Web Inspector: Popovers drawing incorrectly in Network Tab (clicking between a few items)
3077         https://bugs.webkit.org/show_bug.cgi?id=191323
3078
3079         Reviewed by Devin Rousso.
3080
3081         * UserInterface/Views/Popover.js:
3082         (WI.Popover.prototype._drawBackground):
3083         Save and restore the context state between updates. Something
3084         was affecting the clearRect, making it so that it didn't actually
3085         clear the entire rect each time.
3086
3087 2018-11-05  Devin Rousso  <drousso@apple.com>
3088
3089         Web Inspector: Audit: turn off Start button when all tests are removed
3090         https://bugs.webkit.org/show_bug.cgi?id=191235
3091
3092         Reviewed by Matt Baker.
3093
3094         * UserInterface/Views/AuditNavigationSidebarPanel.js:
3095         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
3096
3097 2018-11-05  Matt Baker  <mattbaker@apple.com>
3098
3099         Web Inspector: Table selection should not require that rows be in the cache
3100         https://bugs.webkit.org/show_bug.cgi?id=190993
3101         <rdar://problem/45613812>
3102
3103         Reviewed by Devin Rousso.
3104
3105         Deselecting a table row shouldn't depend on it being in the cache. This
3106         allows us to implement select all, and other kinds of bulk selection
3107         actions that affect rows that haven't been revealed.
3108
3109         * UserInterface/Views/Table.js:
3110         (WI.Table.prototype.deselectRow):
3111
3112 2018-11-05  Devin Rousso  <drousso@apple.com>
3113
3114         Web Inspector: show save/restore stack for recorded 2D Canvases
3115         https://bugs.webkit.org/show_bug.cgi?id=175283
3116         <rdar://problem/34040756>
3117
3118         Reviewed by Matt Baker.
3119
3120         Instead of using plain objects for holding the `WI.Recording`'s state, use a model object
3121         so that more data can be passed around. When visualizing the state, show any previously
3122         saved states in a `WI.DetailsSection` underneath the current state. If there are no saved
3123         states (meaning there is only the current state), don't use a `WI.DetailsSection`.
3124
3125         * UserInterface/Models/RecordingState.js: Added.
3126         (WI.RecordingState):
3127         (WI.RecordingState.fromContext):
3128         (WI.RecordingState.async swizzleInitialState):
3129         (WI.RecordingState.prototype.get source):
3130         (WI.RecordingState.prototype.has):
3131         (WI.RecordingState.prototype.get return):
3132         (WI.RecordingState.prototype.toJSON):
3133         (WI.RecordingState.prototype.[Symbol.iterator]):
3134
3135         * UserInterface/Models/Recording.js:
3136         (WI.Recording.prototype.async _process):
3137         (WI.Recording.prototype.async _swizzleState): Deleted.
3138
3139         * UserInterface/Models/RecordingAction.js:
3140         (WI.RecordingAction.prototype.process):
3141         (WI.RecordingAction.deriveCurrentState): Deleted.
3142
3143         * UserInterface/Views/RecordingContentView.js:
3144         (WI.RecordingContentView.prototype._generateContentCanvas2D):
3145
3146         * UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
3147         (WI.RecordingStateDetailsSidebarPanel):
3148         (WI.RecordingStateDetailsSidebarPanel.prototype.get scrollElement):
3149         (WI.RecordingStateDetailsSidebarPanel.prototype.sizeDidChange): Added.
3150         (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
3151         (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D.isColorProperty): Deleted.
3152         (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D.createInlineSwatch): Deleted.
3153         * UserInterface/Views/RecordingStateDetailsSidebarPanel.css:
3154         (.sidebar > .panel.details.recording-state > .content .details-section > .header .source): Added.
3155         (.sidebar > .panel.details.recording-state > .content .data-grid tr.modified): Added.
3156         (.sidebar > .panel.details.recording-state > .content .data-grid tr:not(.selected).non-standard .name-column): Added.
3157         (.sidebar > .panel.details.recording-state > .content .data-grid tr:not(.selected) .unavailable): Added.
3158         (.sidebar > .panel.details.recording-state > .content .data-grid .inline-swatch): Added.
3159         (.sidebar > .panel.details.recording-state > .content > .data-grid tr.modified): Deleted.
3160         (.sidebar > .panel.details.recording-state > .content > .data-grid tr:not(.selected).non-standard): Deleted.
3161         (.sidebar > .panel.details.recording-state > .content > .data-grid tr:not(.selected) .unavailable): Deleted.
3162         (.sidebar > .panel.details.recording-state > .content > .data-grid .inline-swatch): Deleted.
3163
3164         * UserInterface/Main.html:
3165         * UserInterface/Test.html:
3166
3167         * Localizations/en.lproj/localizedStrings.js:
3168
3169 2018-11-03  Devin Rousso  <drousso@apple.com>
3170
3171         Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
3172         https://bugs.webkit.org/show_bug.cgi?id=190854
3173
3174         Reviewed by Matt Baker.
3175
3176         * UserInterface/Models/RecordingAction.js:
3177         (WI.RecordingAction):
3178         (WI.RecordingAction.isFunctionForType):
3179         (WI.RecordingAction.constantNameForParameter):
3180         (WI.RecordingAction.prototype.get contextReplacer): Added.
3181         (WI.RecordingAction.prototype.async.swizzle):
3182         (WI.RecordingAction.prototype.apply):
3183         Create a constant list of actions for each recording type that need to replace the context
3184         with a different value before being applied (e.g. `width` should be applied to the
3185         `context`'s `canvas` instead of directly to the `context`).
3186
3187         * UserInterface/Views/RecordingContentView.js:
3188         (WI.RecordingContentView.prototype._generateContentCanvas2D.actionModifiesPath): Added.
3189         (WI.RecordingContentView.prototype._generateContentCanvas2D):
3190         (WI.RecordingContentView._actionModifiesPath): Deleted.
3191         Generate the path context after the actions are applied to the preview context so that the
3192         final width/height are known and can be used. This is needed because changing the
3193         width/height causes the content to be erased.
3194
3195         * UserInterface/Views/RecordingActionTreeElement.js:
3196         (WI.RecordingActionTreeElement._generateDOM):
3197         (WI.RecordingActionTreeElement._classNameForAction):
3198         * UserInterface/Views/RecordingActionTreeElement.css:
3199         (.tree-outline:focus .item.action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon): Added.
3200         (.item.action > .titles .context-replacer::after): Added.
3201         (.item.action.has-context-replacer > .icon): Added.
3202         (@media (prefers-dark-interface) .item.action:not(.invalid, .initial-state, .has-context-replacer) > .icon): Added.
3203         (.tree-outline:focus .item.action.selected:not(.initial-state, .invalid) > .icon): Deleted.
3204         (@media (prefers-dark-interface) .item.action:not(.initial-state) > .icon): Deleted.
3205         (@media (prefers-dark-interface) .tree-outline:not(.hide-disclosure-buttons) .item.action:not(.initial-state, .parent) > .icon): Deleted.
3206         Add the context replacer text to the beginning of the action's name if it exists.
3207
3208         * UserInterface/Views/CanvasContentView.js:
3209         (WI.CanvasContentView.prototype._refreshPixelSize):
3210         (WI.CanvasContentView.prototype._updatePixelSize): Deleted.
3211         Update preview image when the canvas' size changes.
3212
3213 2018-11-02  Matt Baker  <mattbaker@apple.com>
3214
3215         Web Inspector: support multiple selection/deletion of cookie records
3216         https://bugs.webkit.org/show_bug.cgi?id=66381
3217         <rdar://problem/19281525>
3218
3219         Reviewed by Devin Rousso.
3220
3221         * Localizations/en.lproj/localizedStrings.js:
3222
3223         * UserInterface/Views/CookieStorageContentView.js:
3224         (WI.CookieStorageContentView):
3225         (WI.CookieStorageContentView.prototype.get scrollableElements):
3226         (WI.CookieStorageContentView.prototype.tableNumberOfRows):
3227         (WI.CookieStorageContentView.prototype.tableSortChanged):
3228         (WI.CookieStorageContentView.prototype.tableCellContextMenuClicked):
3229         (WI.CookieStorageContentView.prototype.tableDidRemoveRows):
3230         (WI.CookieStorageContentView.prototype.tablePopulateCell):
3231         (WI.CookieStorageContentView.prototype.initialLayout):
3232         (WI.CookieStorageContentView.prototype._generateSortComparator):
3233         (WI.CookieStorageContentView.prototype._refreshButtonClicked):
3234         (WI.CookieStorageContentView.prototype._reloadCookies):
3235         (WI.CookieStorageContentView.prototype._updateSort):
3236         (WI.CookieStorageContentView.prototype._handleTableKeyDown):
3237         (WI.CookieStorageContentView.prototype.update): Deleted.
3238         (WI.CookieStorageContentView.prototype._rebuildTable): Deleted.
3239         (WI.CookieStorageContentView.prototype._sortDataGrid.localeCompare): Deleted.
3240         (WI.CookieStorageContentView.prototype._sortDataGrid.numberCompare): Deleted.
3241         (WI.CookieStorageContentView.prototype._sortDataGrid.expiresCompare): Deleted.
3242         (WI.CookieStorageContentView.prototype._sortDataGrid): Deleted.
3243         (WI.CookieStorageContentView.prototype._deleteCallback): Deleted.
3244         Replace DataGrid with Table. The content view serves as the table
3245         delegate and data source, and handles delete and backspace key events
3246         to allow deleting the selected cookies. Cookies may also be deleted from
3247         the table context menu and a new button in the navigation bar.
3248
3249         * UserInterface/Views/Table.js:
3250         (WI.Table.prototype.isRowSelected):
3251         (WI.Table.prototype.selectRow):
3252         (WI.Table.prototype.deselectRow):
3253         (WI.Table.prototype.removeRow):
3254         (WI.Table.prototype._getOrCreateRow):
3255         (WI.Table.prototype._handleMouseDown):
3256         (WI.Table.prototype._removeRows):
3257         (WI.Table.prototype._isRowSelected): Deleted.
3258         Make `isSelectedRow` public. It is more convenient and efficient than
3259         calling `Table.prototype.selectedRows.includes(rowIndex)`.
3260
3261 2018-11-01  Devin Rousso  <drousso@apple.com>
3262
3263         Web Inspector: View: introduce a didLayoutSubtree
3264         https://bugs.webkit.org/show_bug.cgi?id=191176
3265
3266         Reviewed by Matt Baker.
3267
3268         Introduce logic to allow subclasses of `WI.View` to perform logic after every `WI.View` in
3269         their subtree has finished `layout`.
3270
3271         * UserInterface/Views/View.js:
3272         (WI.View.prototype.didLayoutSubtree): Added.
3273         (WI.View.prototype._layoutSubtree):
3274
3275         * UserInterface/Views/NetworkTableContentView.js:
3276         (WI.NetworkTableContentView.prototype.layout):
3277         (WI.NetworkTableContentView.prototype.didLayoutSubtree): Added.
3278
3279 2018-11-01  Devin Rousso  <drousso@apple.com>
3280
3281         Web Inspector: Network: remove unnecessary media event tracking
3282         https://bugs.webkit.org/show_bug.cgi?id=191174
3283
3284         Reviewed by Joseph Pecoraro.
3285
3286         Renames "Group by Node" to "Group Media Requests" for clarity.
3287
3288         * UserInterface/Views/NetworkTableContentView.js:
3289         (WI.NetworkTableContentView):
3290         (WI.NetworkTableContentView.prototype.reset):
3291         (WI.NetworkTableContentView.prototype.showRepresentedObject):
3292         (WI.NetworkTableContentView.prototype.networkDetailViewClose):
3293         (WI.NetworkTableContentView.prototype._populateNameCell):
3294         (WI.NetworkTableContentView.prototype._populateWaterfallGraph.createDOMEventLine):
3295         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
3296         (WI.NetworkTableContentView.prototype.layout):
3297         (WI.NetworkTableContentView.prototype._entryForDOMNode):
3298         (WI.NetworkTableContentView.prototype._handleGroupByDOMNodeCheckedDidChange):
3299         (WI.NetworkTableContentView.prototype._restoreSelectedRow):
3300         (WI.NetworkTableContentView.prototype._handleResourceEntryMousedownWaterfall):
3301         (WI.NetworkTableContentView.prototype._handleNodeEntryMousedownWaterfall):
3302         (WI.NetworkTableContentView.prototype._handleMousedownWaterfall):
3303         * UserInterface/Views/NetworkTableContentView.css:
3304         (.network-table .data-container .cell.name .range): Added.
3305         (.network-table .data-container .cell.name .range::before): Added.
3306         (.network-table:focus .data-container li.selected .cell.name .range): Added.
3307         (@media (prefers-dark-interface) .network-table .data-container .cell.name .range): Added.
3308         Always display the "Byte Range" title as a "subtitle", regardless of the media requests
3309         setting being toggled.
3310         Drive-by: update the position of the waterfall popover whenever the time range changes.
3311         Drive-by: close the details view if a node is selected and the media requests setting is
3312         turned off.
3313
3314         * UserInterface/Views/Popover.js:
3315         (WI.Popover.prototype.resize): Added.
3316         (WI.Popover.prototype.handleEvent):
3317
3318         * Localizations/en.lproj/localizedStrings.js:
3319
3320 2018-11-01  Devin Rousso  <drousso@apple.com>
3321
3322         Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'mouseBlock.addEventListener')
3323         https://bugs.webkit.org/show_bug.cgi?id=191020
3324
3325         Reviewed by Joseph Pecoraro.
3326
3327         * UserInterface/Views/TimelineRuler.js:
3328         (WI.TimelineRuler):
3329         Since `undefined` is not a number, it isn't less than `0`, which caused us to divide by
3330         `undefined` (equivalent to dividing by `0`), resulting in `NaN`.
3331
3332 2018-11-01  Nikita Vasilyev  <nvasilyev@apple.com>
3333
3334         Uncaught Exception: TypeError: undefined is not an object (evaluating 'WI.modifierKeys.metaKey') (at ScopeBarItem.js:87:67)
3335         https://bugs.webkit.org/show_bug.cgi?id=191173
3336
3337         Reviewed by Devin Rousso.
3338
3339         WI.modifierKeys was accessed before it was initialized. Move it from WI.contentLoaded to WI.loaded,
3340         which happens before WI.contentLoaded.
3341
3342         * UserInterface/Base/Main.js:
3343         (WI.loaded):
3344         (WI.contentLoaded):
3345
3346 2018-11-01  Nikita Vasilyev  <nvasilyev@apple.com>
3347
3348         REGRESSION(r237652): Web Inspector: dumpInspectorProtocolMessages is always enabled
3349         https://bugs.webkit.org/show_bug.cgi?id=191161
3350
3351         Reviewed by Joseph Pecoraro.
3352
3353         * UserInterface/Protocol/InspectorBackend.js:
3354         (InspectorBackendClass.prototype.get dumpInspectorProtocolMessages):
3355
3356 2018-11-01  Nikita Vasilyev  <nvasilyev@apple.com>
3357
3358         Web Inspector: Styles: Toggle selected properties by pressing Space or Command+/
3359         https://bugs.webkit.org/show_bug.cgi?id=181145
3360         <rdar://problem/36203388>
3361
3362         Reviewed by Brian Burg.
3363
3364         Pressing Space key or Command-/ toggles (comments out or uncomments) selected properties.
3365
3366         This patch only works with "Enable Selection of Multiple Properties" checked. It shouldn't introduce any
3367         changes when this setting is unchecked.
3368
3369         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
3370         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.get selectionRange):
3371         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties):
3372         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy):
3373         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
3374         * UserInterface/Views/SpreadsheetStyleProperty.js:
3375         (WI.SpreadsheetStyleProperty):
3376         (WI.SpreadsheetStyleProperty.prototype.update): Renamed from _update.
3377         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
3378         (WI.SpreadsheetStyleProperty.prototype.applyFilter):
3379         (WI.SpreadsheetStyleProperty.prototype.handleCopyEvent):
3380         Make `update` method public. No other changes were made.
3381
3382 2018-10-31  Devin Rousso  <drousso@apple.com>
3383
3384         Web Inspector: Canvas: create a setting for auto-recording newly created contexts
3385         https://bugs.webkit.org/show_bug.cgi?id=190856
3386
3387         Reviewed by Brian Burg.
3388
3389         * UserInterface/Controllers/CanvasManager.js:
3390         (WI.CanvasManager.supportsRecordingAutoCapture): Added.
3391         (WI.CanvasManager.prototype.setRecordingAutoCaptureFrameCount): Added.
3392
3393         * UserInterface/Models/Canvas.js:
3394         (WI.Canvas.prototype.startRecording):
3395         (WI.Canvas.prototype.recordingStarted):
3396         (WI.Canvas.prototype.recordingFinished):
3397
3398         * UserInterface/Models/Recording.js:
3399
3400         * UserInterface/Views/CanvasOverviewContentView.js:
3401         (WI.CanvasOverviewContentView):
3402         (WI.CanvasOverviewContentView.prototype.get navigationItems):
3403         (WI.CanvasOverviewContentView.prototype.initialLayout): Added.
3404         (WI.CanvasOverviewContentView.prototype.attached):
3405         (WI.CanvasOverviewContentView.prototype.detached):
3406         (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount): Added.
3407         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize): Added.
3408         (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput): Added.
3409         (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureCheckedDidChange): Added.
3410         (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureEnabledChanged): Added.
3411         (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged): Added.
3412         * UserInterface/Views/CanvasOverviewContentView.css:
3413         (.navigation-bar > .item.canvas-recording-auto-capture > label): Added.
3414         (.navigation-bar > .item.canvas-recording-auto-capture > label > input): Added.
3415         (.navigation-bar > .item.canvas-recording-auto-capture > label > input::-webkit-inner-spin-button): Added.
3416         (.popover-content > .tree-outline .item.recording > .icon): Deleted.
3417         (.popover-content > .tree-outline .item.recording:hover): Deleted.
3418         (.popover-content > .tree-outline .item.recording:hover > .icon): Deleted.
3419         Drive-by: removed unused CSS rules.
3420
3421         * UserInterface/Views/CanvasContentView.js:
3422         (WI.CanvasContentView.prototype.initialLayout):
3423         (WI.CanvasContentView.prototype._updateProgressView):
3424         (WI.CanvasContentView.prototype._updateViewRelatedItems):
3425
3426         * UserInterface/Views/CanvasTabContentView.js:
3427         (WI.CanvasTabContentView.prototype._recordingImportedOrStopped):
3428
3429         * UserInterface/Views/CheckboxNavigationItem.js:
3430         (WI.CheckboxNavigationItem):
3431         (WI.CheckboxNavigationItem.prototype._handleLabelClick): Added.
3432
3433         * UserInterface/Base/Setting.js:
3434
3435         * Localizations/en.lproj/localizedStrings.js:
3436
3437 2018-10-31  Devin Rousso  <drousso@apple.com>
3438
3439         Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
3440         https://bugs.webkit.org/show_bug.cgi?id=190641
3441         <rdar://problem/45319049>
3442
3443         Reviewed by Joseph Pecoraro.
3444
3445         * UserInterface/Protocol/DOMObserver.js:
3446         (WI.DOMObserver.prototype.videoLowPowerChanged): Added.
3447
3448         * UserInterface/Controllers/DOMManager.js:
3449         (WI.DOMManager.prototype.videoLowPowerChanged): Added.
3450
3451         * UserInterface/Models/DOMNode.js:
3452         (WI.DOMNode):
3453         (WI.DOMNode.prototype.get lowPowerRanges): Added.
3454         (WI.DOMNode.prototype.videoLowPowerChanged): Added.
3455         (WI.DOMNode.prototype.canEnterLowPowerMode): Added.
3456
3457         * UserInterface/Views/NetworkTableContentView.js:
3458         (WI.NetworkTableContentView.prototype._populateDomainCell):
3459         (WI.NetworkTableContentView.prototype._tryLinkResourceToDOMNode):
3460         (WI.NetworkTableContentView.prototype._handleNodeLowPowerChanged): Added.
3461         * UserInterface/Views/NetworkTableContentView.css:
3462         (.network-table :not(.header) .cell.waterfall .waterfall-container > .area):
3463         (.network-table :not(.header) .cell.waterfall .waterfall-container > .area.dom-fullscreen): Added.
3464         (.network-table :not(.header) .cell.waterfall .waterfall-container > .area.low-power): Added.
3465         (.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-fullscreen): Deleted.
3466
3467         * UserInterface/Views/DOMNodeEventsContentView.js:
3468         (WI.DOMNodeEventsContentView):
3469         (WI.DOMNodeEventsContentView.prototype.initialLayout):
3470         (WI.DOMNodeEventsContentView.prototype.closed): Deleted.
3471         (WI.DOMNodeEventsContentView.prototype._handleDOMNodeDidFireEvent): Deleted.
3472
3473         * UserInterface/Views/DOMEventsBreakdownView.js:
3474         (WI.DOMEventsBreakdownView):
3475         (WI.DOMEventsBreakdownView.prototype.initialLayout):
3476         (WI.DOMEventsBreakdownView.prototype.layout): Added.
3477         (WI.DOMEventsBreakdownView.prototype._handleDOMNodeDidFireEvent): Added.
3478         (WI.DOMEventsBreakdownView.prototype._handleDOMNodeLowPowerChanged): Added.
3479         (WI.DOMEventsBreakdownView.prototype.addEvent): Deleted.
3480         (WI.DOMEventsBreakdownView.prototype._populateTable.percentOfTotalTime): Deleted.
3481         (WI.DOMEventsBreakdownView.prototype._populateTable): Deleted.
3482         * UserInterface/Views/DOMEventsBreakdownView.css:
3483         (.dom-events-breakdown .graph > .area): Added.
3484         (.dom-events-breakdown .graph > .area.fullscreen):
3485         (.dom-events-breakdown .graph > .area.low-power): Added.
3486
3487         * Localizations/en.lproj/localizedStrings.js:
3488
3489 2018-10-31  Devin Rousso  <drousso@apple.com>
3490
3491         Web Inspector: Audit: save imported audits across WebInspector sessions
3492         https://bugs.webkit.org/show_bug.cgi?id=190858
3493         <rdar://problem/45527625>
3494
3495         Reviewed by Brian Burg.
3496
3497         * UserInterface/Base/ObjectStore.js: Added.
3498         (WI.ObjectStore):
3499         (WI.ObjectStore.supported):
3500         (WI.ObjectStore._open):
3501         (WI.ObjectStore.get _databaseName):
3502         (WI.ObjectStore.prototype.associateObject):
3503         (WI.ObjectStore.prototype.async getAll):
3504         (WI.ObjectStore.prototype.async add):
3505         (WI.ObjectStore.prototype.async addObject):
3506         (WI.ObjectStore.prototype.async delete):
3507         (WI.ObjectStore.prototype.async deleteObject):
3508         (WI.ObjectStore.prototype._resolveKeyPath):
3509         (WI.ObjectStore.prototype.async _operation.listener):
3510         (WI.ObjectStore.prototype.async _operation):
3511         Wrapper for a global `IndexedDB` instance for all of WebInspector (per level). Instances of
3512         `WI.ObjectStore` are able to control a given `IDBObjectStore` using a promise-based API.
3513
3514         *NOTE*: due to the constraint that `IDBObjectStore`s are only able to be created when the
3515         owner `IndexedDB` is "upgrade"d, all `WI.ObjectStore` must be declared before the database
3516         is opened for the first time. Additionally, any time a new `WI.ObjectStore` is added, the
3517         `version` needs to be incremented to ensure that the "upgrade" event fires.
3518
3519         To use any of the `*Object` functions, one must implement a `toJSON` on the object provided.
3520         This is so that `WI.ObjectStore` is able to add the resulting identifier value to the owner
3521         object while storing its `toJSON` value in the IndexedDB (e.g. for objects that have cycles).
3522
3523         * UserInterface/Controllers/AuditManager.js:
3524         (WI.AuditManager.prototype.import):
3525         (WI.AuditManager.prototype.loadStoredTests): Added.
3526         (WI.AuditManager.prototype.removeTest): Added.
3527         (WI.AuditManager.prototype._addTest):
3528
3529         * UserInterface/Views/AuditTabContentView.js:
3530         (WI.AuditTabContentView.prototype.initialLayout): Added.
3531         Attempt to load stored audits when the Audit tab is first shown (lazy-load).
3532
3533         * UserInterface/Views/AuditNavigationSidebarPanel.js:
3534         (WI.AuditNavigationSidebarPanel.prototype.initialLayout):
3535         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved): Added.
3536
3537         * UserInterface/Views/AuditTreeElement.js:
3538         (WI.AuditTreeElement.prototype.ondelete):
3539         Only allow top-level audits to be deleted, as that is what matches the `WI.ObjectStore`.
3540
3541         * UserInterface/Main.html:
3542         * UserInterface/Test.html:
3543
3544 2018-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3545
3546         Web Inspector: Move a few remaining global WI settings to WI.settings
3547         https://bugs.webkit.org/show_bug.cgi?id=191137
3548
3549         Reviewed by Brian Burg.
3550
3551         Move and better name some of the WI.settings created in Main.js
3552         to WI.settings, alongside other global settings.
3553
3554         * UserInterface/Base/Main.js:
3555         (WI.loaded):
3556         Move settings, and register for settings changes in contentLoaded.
3557
3558         * UserInterface/Base/Setting.js:
3559         New settings, and sort values.
3560
3561         * UserInterface/Test/Test.js:
3562         (WI.loaded):
3563         Update setting values for tests.
3564
3565         * UserInterface/Controllers/NetworkManager.js:
3566         (WI.NetworkManager.prototype.initializeTarget):
3567         * UserInterface/Controllers/RuntimeManager.js:
3568         (WI.RuntimeManager.prototype.initializeTarget):
3569         * UserInterface/Models/DOMNode.js:
3570         (WI.DOMNode.prototype.get children):
3571         (WI.DOMNode.prototype.get nextSibling):
3572         (WI.DOMNode.prototype.get previousSibling):
3573         (WI.DOMNode.prototype.get childNodeCount):
3574         * UserInterface/Protocol/Target.js:
3575         (WI.Target.prototype.initialize):
3576         * UserInterface/Views/DOMTreeContentView.js:
3577         (WI.DOMTreeContentView):
3578         (WI.DOMTreeContentView.prototype.closed):
3579         (WI.DOMTreeContentView.prototype._togglePaintFlashing):
3580         (WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged):
3581         (WI.DOMTreeContentView.prototype._showShadowDOMSettingChanged):
3582         (WI.DOMTreeContentView.prototype._toggleShowsShadowDOMSetting):
3583         * UserInterface/Views/DOMTreeOutline.js:
3584         (WI.DOMTreeOutline):
3585         (WI.DOMTreeOutline.prototype.close):
3586         (WI.DOMTreeOutline.prototype._revealAndSelectNode):
3587         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
3588         (WI.LayerTreeDetailsSidebarPanel.prototype.initialLayout):
3589         (WI.LayerTreeDetailsSidebarPanel.prototype._updateDisplayWithLayers):
3590         * UserInterface/Views/Layers3DContentView.js:
3591         (WI.Layers3DContentView):
3592         (WI.Layers3DContentView.prototype.closed):
3593         (WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
3594         (WI.Layers3DContentView.prototype._togglePaintFlashing):
3595         * UserInterface/Views/NetworkTableContentView.js:
3596         (WI.NetworkTableContentView):
3597         (WI.NetworkTableContentView.prototype.closed):
3598         (WI.NetworkTableContentView.prototype._resourceCachingDisabledSettingChanged):
3599         (WI.NetworkTableContentView.prototype._toggleDisableResourceCache):
3600         * UserInterface/Views/ScriptContentView.js:
3601         (WI.ScriptContentView):
3602         (WI.ScriptContentView.prototype.closed):
3603         (WI.ScriptContentView.prototype._contentDidPopulate):
3604         (WI.ScriptContentView.prototype._enableControlFlowProfilerSettingChanged):
3605         (WI.ScriptContentView.prototype._showJavaScriptTypeInformationSettingChanged):
3606         * UserInterface/Views/SourceCodeTextEditor.js:
3607         (WI.SourceCodeTextEditor.prototype.shown):
3608         (WI.SourceCodeTextEditor.prototype._proceedPopulateWithContent):
3609         (WI.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
3610         (WI.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
3611         * UserInterface/Views/TextResourceContentView.js:
3612         (WI.TextResourceContentView):
3613         (WI.TextResourceContentView.prototype.closed):
3614         (WI.TextResourceContentView.prototype._contentDidPopulate):
3615         (WI.TextResourceContentView.prototype._enableControlFlowProfilerSettingChanged):
3616         (WI.TextResourceContentView.prototype._showJavaScriptTypeInformationSettingChanged):
3617         Renamed setting.
3618
3619 2018-10-31  Devin Rousso  <drousso@apple.com>
3620
3621         Web Inspector: Styles: missing contextmenu items for links
3622         https://bugs.webkit.org/show_bug.cgi?id=191021
3623
3624         Reviewed by Joseph Pecoraro.
3625
3626         * UserInterface/Views/SpreadsheetStyleProperty.js:
3627         (WI.SpreadsheetStyleProperty.prototype._renderValue):
3628         (WI.SpreadsheetStyleProperty.prototype._handleLinkContextMenu): Added.
3629         If the token is subtype of "link", add contextmenu items to the wrapper element.
3630
3631         * UserInterface/Views/ContextMenuUtilities.js:
3632         (WI.appendContextMenuItemsForURL.showResourceWithOptions):
3633         (WI.appendContextMenuItemsForURL):
3634         Drive-by: don't assume that `options` will be provided.
3635
3636         * Localizations/en.lproj/localizedStrings.js:
3637
3638 2018-10-31  Nikita Vasilyev  <nvasilyev@apple.com>
3639
3640         Web Inspector: Styles: implement copying and deletion of multiple properties
3641         https://bugs.webkit.org/show_bug.cgi?id=191037
3642         <rdar://problem/45650078>
3643
3644         Reviewed by Brian Burg.
3645
3646         This patch should only work with "Enable Selection of Multiple Properties" checked. It shouldn't introduce any
3647         changes when this setting is unchecked.
3648
3649         Mousedown on a property (1) and moving the mouse cursor to another property (2) should select properties 1, 2, and
3650         all properties between them until mouseup is fired.
3651
3652         Once selected:
3653         - Pressing Command-C should copy the selected properties.
3654         - Pressing Delete should remove the properties.
3655
3656         * UserInterface/Models/CSSProperty.js:
3657         (WI.CSSProperty.prototype.get formattedText):
3658         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
3659         (.spreadsheet-style-declaration-editor):
3660         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property):
3661         (.multiple-properties-selection .spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)):
3662         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected):
3663         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected:focus):
3664         (@media (prefers-dark-interface)):
3665
3666         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
3667         (WI.SpreadsheetCSSStyleDeclarationEditor):
3668         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
3669         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.selectProperties):
3670         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.deselectProperties):
3671         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyBlur):
3672         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseEnter):
3673         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseLeave):
3674         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy):
3675         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
3676         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._hasSelectedProperties):
3677         Property selection is defined as two numbers: anchorIndex and focusIndex.
3678         The property with focusIndex is actually focused. The focus outline is replaced by a more subtle left blue border.
3679
3680         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
3681         (.spreadsheet-css-declaration.selecting,):
3682         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
3683         (WI.SpreadsheetCSSStyleDeclarationSection):
3684         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyBlur):
3685         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseEnter):
3686         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseLeave):
3687         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
3688         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowMouseUp):
3689         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
3690         * UserInterface/Views/SpreadsheetStyleProperty.js:
3691         (WI.SpreadsheetStyleProperty):
3692         Implement copying the same way it's done for DataGrid: by adding copyHandler property to the focused element.
3693         Add `tabIndex=-1` so the property element can be focused.
3694
3695         (WI.SpreadsheetStyleProperty.prototype.get property):
3696         (WI.SpreadsheetStyleProperty.prototype.get selected):
3697         (WI.SpreadsheetStyleProperty.prototype.set selected):
3698         (WI.SpreadsheetStyleProperty.prototype.remove):
3699         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
3700         (WI.SpreadsheetStyleProperty.prototype.handleCopyEvent):
3701         (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit):
3702         (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur):
3703         (WI.SpreadsheetStyleProperty.prototype._handleNamePaste):
3704
3705 2018-10-31  Devin Rousso  <drousso@apple.com>
3706
3707         Web Inspector: Audit: attempt to re-link DOM nodes for imported results
3708         https://bugs.webkit.org/show_bug.cgi?id=191044
3709         <rdar://problem/45687364>
3710
3711         Reviewed by Brian Burg.
3712
3713         When importing a `WI.AuditTestCaseResult`, attempt to `querySelector` for each item in
3714         `data.domNodes`. If a node is found, replace it with that node and show a tree instead.
3715
3716         * UserInterface/Models/AuditTestCase.js:
3717         (WI.AuditTestCase.async fromPayload): Added.
3718         (WI.AuditTestCase.fromPayload): Deleted.
3719
3720         * UserInterface/Models/AuditTestGroup.js:
3721         (WI.AuditTestGroup.async fromPayload): Added.
3722         (WI.AuditTestGroup.fromPayload): Deleted.
3723
3724         * UserInterface/Models/AuditTestCaseResult.js:
3725         (WI.AuditTestCaseResult.async fromPayload): Added.
3726         (WI.AuditTestCaseResult.fromPayload): Deleted.
3727
3728         * UserInterface/Models/AuditTestGroupResult.js:
3729         (WI.AuditTestGroupResult.async fromPayload): Added.
3730         (WI.AuditTestGroupResult.fromPayload): Deleted.
3731
3732         * UserInterface/Controllers/AuditManager.js:
3733         (WI.AuditManager.prototype.import):
3734
3735 2018-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3736
3737         Follow-up review comment to r237652.
3738
3739         Reviewed by Brian Burg.
3740
3741         * UserInterface/Controllers/DebuggerManager.js:
3742         (WI.DebuggerManager):
3743
3744 2018-10-31  Joseph Pecoraro  <pecoraro@apple.com>
3745
3746         Web Inspector: Separate target initialization from frontend initialization
3747         https://bugs.webkit.org/show_bug.cgi?id=191052
3748         <rdar://problem/45658384>
3749
3750         Reviewed by Brian Burg.
3751
3752         * UserInterface/Base/Main.js:
3753         (WI.loaded):
3754         (WI.performOneTimeFrontendInitializationsUsingTarget):
3755         Create the targets after the rest of frontend initialization. This is a step
3756         toward a frontend opening and being told about multiple targets instead of
3757         knowing in advance a single target it is connected to. All backend
3758         messages during frontend initialization now happen with an explicit target.
3759
3760         * UserInterface/Controllers/ApplicationCacheManager.js:
3761         (WI.ApplicationCacheManager):
3762         (WI.ApplicationCacheManager.prototype.initializeTarget):
3763         (WI.ApplicationCacheManager.prototype.initialize):
3764         * UserInterface/Controllers/CSSManager.js:
3765         (WI.CSSManager):
3766         (WI.CSSManager.prototype.initializeTarget):
3767         * UserInterface/Controllers/CanvasManager.js:
3768         (WI.CanvasManager):
3769         (WI.CanvasManager.prototype.initializeTarget):
3770         * UserInterface/Controllers/ConsoleManager.js:
3771         (WI.ConsoleManager):
3772         (WI.ConsoleManager.prototype.initializeLogChannels):
3773         * UserInterface/Controllers/DOMManager.js:
3774         (WI.DOMManager):
3775         (WI.DOMManager.prototype.initializeTarget):
3776         * UserInterface/Controllers/DOMStorageManager.js:
3777         (WI.DOMStorageManager):
3778         (WI.DOMStorageManager.prototype.initializeTarget):
3779         * UserInterface/Controllers/DatabaseManager.js:
3780         (WI.DatabaseManager):
3781         (WI.DatabaseManager.prototype.initializeTarget):
3782         * UserInterface/Controllers/DebuggerManager.js:
3783         (WI.DebuggerManager):
3784         (WI.DebuggerManager.prototype.initializeTarget):
3785         (WI.DebuggerManager.restoreBreakpointsSoon): Deleted.
3786         * UserInterface/Controllers/HeapManager.js:
3787         (WI.HeapManager.prototype.initializeTarget):
3788         * UserInterface/Controllers/IndexedDBManager.js:
3789         (WI.IndexedDBManager):
3790         (WI.IndexedDBManager.prototype.initializeTarget):
3791         * UserInterface/Controllers/LayerTreeManager.js:
3792         (WI.LayerTreeManager.prototype.initializeTarget):
3793         * UserInterface/Controllers/MemoryManager.js:
3794         (WI.MemoryManager.prototype.initializeTarget):
3795         * UserInterface/Controllers/NetworkManager.js:
3796         (WI.NetworkManager):
3797         (WI.NetworkManager.prototype.initializeTarget):
3798         * UserInterface/Controllers/RuntimeManager.js:
3799         (WI.RuntimeManager):
3800         (WI.RuntimeManager.prototype.initializeTarget):
3801         * UserInterface/Controllers/TargetManager.js:
3802         (WI.TargetManager):
3803         (WI.TargetManager.prototype.initializeTargetsWithMainTarget):
3804         * UserInterface/Controllers/TimelineManager.js:
3805         (WI.TimelineManager):
3806         (WI.TimelineManager.prototype.initializeTarget):
3807         (WI.TimelineManager.prototype.set enabledTimelineTypes):
3808         (WI.TimelineManager.prototype._updateAutoCaptureInstruments):
3809         * UserInterface/Controllers/WorkerManager.js:
3810         (WI.WorkerManager):
3811         (WI.WorkerManager.prototype.initializeTarget):
3812         Move Target initialization out of the constructor into a top level
3813         `initializeTarget` function. This will be expected to be called
3814         by any target that the frontend connects to.
3815
3816         (WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange):
3817         Drive-by fix. Update all targets if the setting changes.
3818
3819         (WI.WorkerManager.prototype.workerCreated):
3820         Call initialize on the new target.
3821
3822         * UserInterface/Models/CSSCompletions.js:
3823         (WI.CSSCompletions.initializeCSSCompletions):
3824         (WI.CSSCompletions.requestCSSCompletions): Deleted.
3825         Rename requestCSSCompletions to initializeCSSCompletions to try
3826         and standardize on "initialize" being used for most frontend one
3827         time initialization tasks. This being one such operation that
3828         only needs to be performed once on a target that supports it.
3829
3830         * UserInterface/Protocol/Target.js:
3831         (WI.Target):
3832         (WI.Target.prototype.initialize):
3833         Perform explicit target initialization, such as initializing
3834         the state of all backend domains / agents. This is done by asking
3835         each of the managers to do initialization work for this target.
3836
3837         (WI.Target.prototype.get ApplicationCacheAgent):
3838         (WI.Target.prototype.get CSSAgent):
3839         (WI.Target.prototype.get CanvasAgent):
3840         (WI.Target.prototype.get ConsoleAgent):
3841         (WI.Target.prototype.get DOMAgent):
3842         (WI.Target.prototype.get DOMDebuggerAgent):
3843         (WI.Target.prototype.get DOMStorageAgent):
3844         (WI.Target.prototype.get DatabaseAgent):
3845         (WI.Target.prototype.get DebuggerAgent):
3846         (WI.Target.prototype.get HeapAgent):
3847         (WI.Target.prototype.get IndexedDBAgent):
3848         (WI.Target.prototype.get InspectorAgent):
3849         (WI.Target.prototype.get LayerTreeAgent):
3850         (WI.Target.prototype.get MemoryAgent):
3851         (WI.Target.prototype.get NetworkAgent):
3852         (WI.Target.prototype.get PageAgent):
3853         (WI.Target.prototype.get RecordingAgent):
3854         (WI.Target.prototype.get RuntimeAgent):
3855         (WI.Target.prototype.get ScriptProfilerAgent):
3856         (WI.Target.prototype.get ServiceWorkerAgent):
3857         (WI.Target.prototype.get TargetAgent):
3858         (WI.Target.prototype.get TimelineAgent):
3859         (WI.Target.prototype.get WorkerAgent):
3860         Accessors for all of the agents on a Target.
3861
3862         * UserInterface/Protocol/WorkerTarget.js:
3863         (WI.WorkerTarget):
3864         This is now automatically done in the base class.
3865
3866         * UserInterface/Test/Test.js:
3867         (WI.loaded):
3868         (WI.performOneTimeFrontendInitializationsUsingTarget):
3869         New necessary top level hooks, and initialize more like Main.js.
3870
3871 2018-10-31  Devin Rousso  <drousso@apple.com>
3872
3873         Web Inspector: Audit: show metadata for results
3874         https://bugs.webkit.org/show_bug.cgi?id=190853
3875         <rdar://problem/45527623>
3876
3877         Reviewed by Brian Burg.
3878
3879         * UserInterface/Models/AuditTestCase.js:
3880         (WI.AuditTestCase.prototype.async run):
3881         Capture timestamps around the `RunetimeAgent.evaluate` call, as well as the URL of the page.