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