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