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