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