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