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