Web Inspector: Refactor WI.CSSStyleDeclaration.prototype.update
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2019-01-23  Nikita Vasilyev  <nvasilyev@apple.com>
2
3         Web Inspector: Refactor WI.CSSStyleDeclaration.prototype.update
4         https://bugs.webkit.org/show_bug.cgi?id=193737
5
6         Reviewed by Matt Baker.
7
8         Remove unused event data from the WI.CSSStyleDeclaration.Event.PropertiesChanged event.
9
10         * UserInterface/Models/CSSStyleDeclaration.js:
11         (WI.CSSStyleDeclaration.prototype.update):
12
13 2019-01-23  Devin Rousso  <drousso@apple.com>
14
15         WebInspector: Confusingly nested events in the timeline for Mutation Observers
16         https://bugs.webkit.org/show_bug.cgi?id=192884
17         <rdar://problem/46854178>
18
19         Reviewed by Joseph Pecoraro.
20
21         If a microtask event (e.g. `ObserverCallback`) is contained within a `EvaluatedScript`
22         event, move that microtask event to be a sibling of the `EvaluateScript`, subtracting the
23         microtask's time taken from the `EvaluateScript`'s time. If there are no other children
24         after this move, then remove the `EvaluateScript` altogether.
25
26         * UserInterface/Controllers/TimelineManager.js:
27         (WI.TimelineManager.prototype.eventRecorded.fixMicrotaskPlacement): Added.
28         (WI.TimelineManager.prototype.eventRecorded):
29         (WI.TimelineManager.prototype._mergeScriptProfileRecords):
30
31 2019-01-23  Joseph Pecoraro  <pecoraro@apple.com>
32
33         Web Inspector: Network Waterfall column should redraw when adding/removing new columns
34         https://bugs.webkit.org/show_bug.cgi?id=193696
35         <rdar://problem/47464149>
36
37         Reviewed by Devin Rousso.
38
39         * UserInterface/Views/TableColumn.js:
40         (WI.TableColumn.prototype.get needsReloadOnResize):
41         * UserInterface/Views/NetworkTableContentView.js:
42         (WI.NetworkTableContentView.prototype.initialLayout):
43         Mark the waterfall column as sensitive to any resizes.
44
45         * UserInterface/Views/Table.js:
46         (WI.Table.prototype.showColumn):
47         (WI.Table.prototype.hideColumn):
48         Update column widths and reload any columns that may be sensitive to resizes.
49
50 2019-01-22  Devin Rousso  <drousso@apple.com>
51
52         Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
53         https://bugs.webkit.org/show_bug.cgi?id=116191
54         <rdar://problem/13905910>
55
56         Reviewed by Joseph Pecoraro.
57
58         * UserInterface/Controllers/TimelineManager.js:
59         (WI.TimelineManager.prototype._processRecord):
60
61 2019-01-22  Devin Rousso  <drousso@apple.com>
62
63         Web Inspector: expose Audit and Recording versions to the frontend
64         https://bugs.webkit.org/show_bug.cgi?id=193262
65         <rdar://problem/47130684>
66
67         Reviewed by Joseph Pecoraro.
68
69         * UserInterface/Protocol/InspectorBackend.js:
70         (InspectorBackendClass.prototype.registerVersion): Added.
71
72         * UserInterface/Models/AuditTestCase.js:
73         * UserInterface/Models/Recording.js:
74         (WI.Recording.fromPayload):
75         Add Interface version values.
76
77 2019-01-22  Nikita Vasilyev  <nvasilyev@apple.com>
78
79         Web Inspector: Styles: refactor properties/allProperties/visibleProperties/allVisibleProperties
80         https://bugs.webkit.org/show_bug.cgi?id=193615
81
82         Reviewed by Devin Rousso.
83
84         Remove unused visibleProperties.
85
86         Rename:
87         - properties to enabledProperties;
88         - allProperties to properties;
89         - allVisibleProperties to visibleProperties.
90
91         * UserInterface/Models/CSSProperty.js:
92         (WI.CSSProperty.prototype._prependSemicolonIfNeeded):
93         (WI.CSSProperty):
94         * UserInterface/Models/CSSStyleDeclaration.js:
95         (WI.CSSStyleDeclaration):
96         (WI.CSSStyleDeclaration.prototype.get enabledProperties):
97         (WI.CSSStyleDeclaration.prototype.get properties):
98         (WI.CSSStyleDeclaration.prototype.propertyForName):
99         (WI.CSSStyleDeclaration.prototype.newBlankProperty):
100         (WI.CSSStyleDeclaration.prototype.shiftPropertiesAfter):
101         (WI.CSSStyleDeclaration.prototype._rangeAfterPropertyAtIndex):
102         * UserInterface/Models/DOMNodeStyles.js:
103         (WI.DOMNodeStyles.prototype._parseStylePropertyPayload):
104         (WI.DOMNodeStyles.prototype._markOverriddenProperties):
105         (WI.DOMNodeStyles.prototype._associateRelatedProperties):
106         (WI.DOMNodeStyles.prototype._isPropertyFoundInMatchingRules):
107         (WI.DOMNodeStyles):
108         * UserInterface/Views/BoxModelDetailsSectionRow.js:
109         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics):
110         * UserInterface/Views/ComputedStyleDetailsPanel.js:
111         (WI.ComputedStyleDetailsPanel.prototype._computePropertyTraces):
112         * UserInterface/Views/ComputedStyleSection.js:
113         (WI.ComputedStyleSection.prototype.get propertiesToRender):
114         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
115         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.get propertiesToRender):
116         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
117         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
118         * UserInterface/Views/SpreadsheetStyleProperty.js:
119         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
120
121 2019-01-22  Joseph Pecoraro  <pecoraro@apple.com>
122
123         Web Inspector: Network Table appears broken after filter - rows look collapsed
124         https://bugs.webkit.org/show_bug.cgi?id=192730
125         <rdar://problem/46853158>
126
127         Reviewed by Devin Rousso.
128
129         * UserInterface/Views/Table.js:
130         (WI.Table.prototype._applyColumnWidthsToColumnsIfNeeded):
131         Affect the filler row like the other applyColumnWidths calls since this
132         now may be the initial call to size visible columns.
133
134 2019-01-22  Devin Rousso  <drousso@apple.com>
135
136         Web Inspector: Audit: use plural strings for Passed, Failed, and Unsupported
137         https://bugs.webkit.org/show_bug.cgi?id=193675
138         <rdar://problem/46628680>
139
140         Reviewed by Joseph Pecoraro.
141
142         * UserInterface/Views/AuditTestGroupContentView.js:
143         (WI.AuditTestGroupContentView.prototype.layout):
144
145         * Localizations/en.lproj/localizedStrings.js:
146
147 2019-01-18  Jer Noble  <jer.noble@apple.com>
148
149         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
150         https://bugs.webkit.org/show_bug.cgi?id=189553
151
152         Reviewed by Tim Horton.
153
154         * Configurations/Base.xcconfig:
155         * Configurations/SDKVariant.xcconfig: Added.
156
157 2019-01-18  Devin Rousso  <drousso@apple.com>
158
159         Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'resource.finished')
160         https://bugs.webkit.org/show_bug.cgi?id=193589
161
162         Reviewed by Joseph Pecoraro.
163
164         * UserInterface/Views/NetworkTableContentView.js:
165         (WI.NetworkTableContentView.prototype.get supportsSave):
166         (WI.NetworkTableContentView.prototype._HARResources):
167
168 2019-01-17  Truitt Savell  <tsavell@apple.com>
169
170         Unreviewed, rolling out r240124.
171
172         This commit broke an internal build.
173
174         Reverted changeset:
175
176         "SDK_VARIANT build destinations should be separate from non-
177         SDK_VARIANT builds"
178         https://bugs.webkit.org/show_bug.cgi?id=189553
179         https://trac.webkit.org/changeset/240124
180
181 2019-01-17  Jer Noble  <jer.noble@apple.com>
182
183         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
184         https://bugs.webkit.org/show_bug.cgi?id=189553
185
186         Reviewed by Tim Horton.
187
188         * Configurations/Base.xcconfig:
189         * Configurations/SDKVariant.xcconfig: Added.
190
191 2019-01-16  Matt Baker  <mattbaker@apple.com>
192
193         Web Inspector: Fix TreeOutline TypeError:​ this._indexesForSubtree is not a function
194         https://bugs.webkit.org/show_bug.cgi?id=193501
195         <rdar://problem/47323967>
196
197         Reviewed by Joseph Pecoraro.
198
199         * UserInterface/Views/TreeOutline.js:
200         (WI.TreeOutline.prototype.removeChildAtIndex):
201
202 2019-01-15  Devin Rousso  <drousso@apple.com>
203
204         Web Inspector: Audit: create new IDL type for exposing special functionality in test context
205         https://bugs.webkit.org/show_bug.cgi?id=193149
206         <rdar://problem/46801218>
207
208         Reviewed by Joseph Pecoraro.
209
210         Add `AuditAgent` getters and plumbing.
211
212         * UserInterface/Protocol/Target.js:
213         (WI.Target.prototype.get AuditAgent): Added.
214
215         * UserInterface/Models/AuditTestCase.js:
216         (WI.AuditTestCase.prototype.async run):
217
218         * UserInterface/Controllers/AuditManager.js:
219         (WI.AuditManager.prototype.async start):
220
221         * .eslintrc:
222
223 2019-01-14  Devin Rousso  <drousso@apple.com>
224
225         Web Inspector: Event breakpoints: typing uppercase "DOM" doesn't show completions for events that start with "DOM"
226         https://bugs.webkit.org/show_bug.cgi?id=193384
227
228         Reviewed by Joseph Pecoraro.
229
230         * UserInterface/Views/EventBreakpointPopover.js:
231         (WI.EventBreakpointPopover.prototype.show):
232
233 2019-01-14  Devin Rousso  <drousso@apple.com>
234
235         Web Inspector: Event breakpoints: text field and completion popover fonts should match
236         https://bugs.webkit.org/show_bug.cgi?id=193249
237
238         Reviewed by Matt Baker.
239
240         * UserInterface/Views/EventBreakpointPopover.css:
241         (.popover .event-breakpoint-content > .event-type > input): Added.
242         (.popover .event-breakpoint-content > .event-type > input::placeholder): Added.
243         * UserInterface/Views/EventBreakpointPopover.js:
244         (WI.EventBreakpointPopover.prototype.show):
245         (WI.EventBreakpointPopover.prototype._showSuggestionsView):
246         Subtract the <input> border and padding from the bounds position so the <input> text lines
247         up with the `WI.CompletionSuggestionsView` text.
248
249         * UserInterface/Views/CompletionSuggestionsView.js:
250         (WI.CompletionSuggestionsView):
251         Drive-by: force `dir=ltr` to match the `text-align: left;` CSS styling.
252
253 2019-01-14  Nikita Vasilyev  <nvasilyev@apple.com>
254
255         Web Inspector: Styles: pressing Down key on empty value field shouldn't discard completion popover
256         https://bugs.webkit.org/show_bug.cgi?id=193098
257         <rdar://problem/47016036>
258
259         Reviewed by Devin Rousso.
260
261         Hide CompletionSuggestionsView when SpreadsheetTextField moves, e.g. by scrolling or resizing the sidebar.
262         Update CompletionSuggestionsView position after pressing Up or Down key, because SpreadsheetTextField may
263         move from wrapping text.
264
265         * UserInterface/Views/CompletionSuggestionsView.js:
266         (WI.CompletionSuggestionsView.prototype.hide):
267         (WI.CompletionSuggestionsView.prototype.show):
268         (WI.CompletionSuggestionsView.prototype.showUntilAnchorMoves): Removed.
269         (WI.CompletionSuggestionsView.prototype.hideWhenElementMoves): Added.
270         (WI.CompletionSuggestionsView.prototype._stopMoveTimer): Added.
271         (WI.CompletionSuggestionsView):
272
273         * UserInterface/Views/SpreadsheetTextField.js:
274         (WI.SpreadsheetTextField.prototype.set suggestionHint):
275         (WI.SpreadsheetTextField.prototype.completionSuggestionsSelectedCompletion):
276         (WI.SpreadsheetTextField.prototype._handleKeyDownForSuggestionView):
277         (WI.SpreadsheetTextField.prototype._updateCompletions):
278         (WI.SpreadsheetTextField.prototype._showSuggestionsView): Added.
279
280         (WI.SpreadsheetTextField.prototype._reAttachSuggestionHint):
281         Drive-by: abstract out repeating code into a private method.
282
283 2019-01-14  Devin Rousso  <drousso@apple.com>
284
285         Web Inspector: Settings: group titles should vertically align with the first editor
286         https://bugs.webkit.org/show_bug.cgi?id=193391
287
288         Reviewed by Dean Jackson.
289
290         * UserInterface/Views/SettingsTabContentView.css:
291         (.content-view.settings > .settings-view > .container):
292         (.content-view.settings > .settings-view > .container > .editor-group > .editor): Added.
293         (.content-view.settings > .settings-view > .container > .editor-group > .editor:first-child > *): Added.
294         (.content-view.settings > .settings-view > .container > .editor-group > .editor select):
295         (.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="number"]):
296
297 2019-01-11  Matt Baker  <mattbaker@apple.com>
298
299         Web Inspector: REGRESSION: deleting an audit puts selection in a selected but invisible state
300         https://bugs.webkit.org/show_bug.cgi?id=192917
301         <rdar://problem/46875285>
302
303         Reviewed by Devin Rousso.
304
305         SelectionController should not be notified of removed children until the
306         child items have been removed from the TreeOutline. Doing so at this stage
307         is unsafe, since this method checks `this.selectedTreeElement`, which could
308         return the adjusted index from the SelectionController before anything has
309         actually been removed from the TreeOutline.
310
311         The number of calls to SelectionController.prototype.didRemoveItems is also
312         reduced somewhat, since we're no longer calling it for every TreeElement.
313
314         * UserInterface/Views/TreeOutline.js:
315         (WI.TreeOutline.prototype.removeChildAtIndex):
316         (WI.TreeOutline.prototype.removeChildren):
317         (WI.TreeOutline.prototype._forgetTreeElement):
318         (WI.TreeOutline.prototype._indexesForSubtree): Added.        
319
320 2019-01-10  Devin Rousso  <drousso@apple.com>
321
322         Web Inspector: Audit: allow audits to be enabled/disabled
323         https://bugs.webkit.org/show_bug.cgi?id=192210
324         <rdar://problem/46423583>
325
326         Reviewed by Joseph Pecoraro.
327
328         * UserInterface/Controllers/AuditManager.js:
329         (WI.AuditManager.prototype.get editing): Added.
330         (WI.AuditManager.prototype.set editing): Added.
331         (WI.AuditManager.prototype.stop):
332         (WI.AuditManager.prototype.addDefaultTestsIfNeeded):
333         Since default audits aren't stored, keep a list of disabled default tests in a `WI.Setting`.
334
335         * UserInterface/Models/AuditTestBase.js:
336         (WI.AuditTestBase):
337         (WI.AuditTestBase.prototype.get disabled): Added.
338         (WI.AuditTestBase.prototype.set disabled): Added.
339         (WI.AuditTestBase.prototype.async start):
340         (WI.AuditTestBase.prototype.stop):
341         (WI.AuditTestBase.toJSON):
342
343         * UserInterface/Models/AuditTestCase.js:
344         (WI.AuditTestCase):
345         (WI.AuditTestCase.async fromPayload):
346         (WI.AuditTestCase.prototype.toJSON):
347
348         * UserInterface/Models/AuditTestGroup.js:
349         (WI.AuditTestGroup):
350         (WI.AuditTestGroup.async fromPayload):
351         (WI.AuditTestGroup.prototype.get disabled): Added.
352         (WI.AuditTestGroup.prototype.set disabled): Added.
353         (WI.AuditTestGroup.prototype.toJSON):
354         (WI.AuditTestGroup.prototype.async run):
355         (WI.AuditTestGroup.prototype._handleTestDisabledChanged): Added.
356         (WI.AuditTestGroup.prototype._handleTestProgress):
357         Propagate `disabled` changes to all sub-tests, unless the change was caused by one of the
358         sub-tests, in which case we are now in an intermediate state.
359
360         * UserInterface/Views/AuditNavigationSidebarPanel.js:
361         (WI.AuditNavigationSidebarPanel):
362         (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
363         (WI.AuditNavigationSidebarPanel.prototype.initialLayout):
364         (WI.AuditNavigationSidebarPanel.prototype.hasCustomFilters): Added.
365         (WI.AuditNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters): Added.
366         (WI.AuditNavigationSidebarPanel.prototype._addTest):
367         (WI.AuditNavigationSidebarPanel.prototype._addResult):
368         (WI.AuditNavigationSidebarPanel.prototype._updateStartStopButtonNavigationItemState):
369         (WI.AuditNavigationSidebarPanel.prototype._updateEditButtonNavigationItemState): Added.
370         (WI.AuditNavigationSidebarPanel.prototype._handleAuditManagerEditingChanged): Added.
371         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
372         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestScheduled):
373         (WI.AuditNavigationSidebarPanel.prototype._treeSelectionDidChange):
374         (WI.AuditNavigationSidebarPanel.prototype._handleEditButtonNavigationItemClicked): Added.
375         * UserInterface/Views/AuditNavigationSidebarPanel.css:
376         (.sidebar > .panel.navigation.audit > .content):
377         (.sidebar > .panel.navigation.audit > .content > .tree-outline): Added.
378         (.sidebar > .panel.navigation.audit > .content .edit-audits:not(.disabled):active): Added.
379         (.sidebar > .panel.navigation.audit > .content .edit-audits:not(.disabled).activated): Added.
380         (.sidebar > .panel.navigation.audit > .content .edit-audits:not(.disabled).activated:active): Added.
381         (.sidebar > .panel.navigation.audit > .content .edit-audits.disabled): Added.
382         (.finish-editing-audits-placeholder.message-text-view .navigation-item-help .navigation-bar): Added.
383         Leverage custom filters to ensure that disabled audits arent shown when not editing and that
384         result tree elements aren't shown while editing.
385
386         * UserInterface/Views/AuditTestGroupContentView.js:
387         (WI.AuditTestGroupContentView.prototype.shown):
388
389         * UserInterface/Views/AuditTreeElement.js:
390         (WI.AuditTreeElement.prototype.onattach):
391         (WI.AuditTreeElement.prototype.canSelectOnMouseDown): Added.
392         (WI.AuditTreeElement.prototype._updateTestGroupDisabled): Added.
393         (WI.AuditTreeElement.prototype._handleTestDisabledChanged): Added.
394         (WI.AuditTreeElement.prototype._handleManagerEditingChanged): Added.
395         * UserInterface/Views/AuditTreeElement.css:
396         (.tree-outline .item.audit > .status:not(:hover) > img.show-on-hover, .tree-outline .item.audit.test-group.expanded:not(.editing-audits) > .status:not(:hover)): Added.
397         (.tree-outline .item.audit.manager-active > .status > img.show-on-hover, .tree-outline .item.audit.test-group.expanded:not(.editing-audits) > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): Added.
398         (.tree-outline .item.audit > .status:not(:hover) > img.show-on-hover, .tree-outline .item.audit.test-group.expanded > .status:not(:hover)): Deleted.
399         (.tree-outline .item.audit.manager-active > .status > img.show-on-hover, .tree-outline .item.audit.test-group.expanded > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): Deleted.
400         Prevent selection and running when editing.
401
402         * UserInterface/Views/TreeOutline.css:
403         (.tree-outline .children.expanded:not([hidden])): Added.
404         (.tree-outline .children.expanded): Deleted.
405
406         * UserInterface/Base/ObjectStore.js:
407         (WI.ObjectStore._open):
408         Batch operations together to help avoid multiple simultaneous `indexedDB.open` calls. This
409         should also help preserve the order of operations, as once the database is open, operations
410         are executed in the order they were enqueued.
411
412         (WI.ObjectStore.prototype.async.addObject):
413         Pass a unique `Symbol` to the `toJSON` call on the given object so that the object can save
414         additional values that wouldn't normally be saved. This doesn't conflict with normal usage
415         of `toJSON` (e.g. `JSON.stringify`) because that case also passes in a value:
416          - `undefined`, if it was called directly on the object
417          - the key for this object in the containing object
418          - the index of this object in the containing array
419         In any case, the value can never equal the unique `Symbol`, so it's guaranteed that the code
420         will only run for `WI.ObjectStore` operations.
421
422         (WI.ObjectStore.prototype.async.clear): Added.
423
424         * Localizations/en.lproj/localizedStrings.js:
425
426 2019-01-09  Devin Rousso  <drousso@apple.com>
427
428         Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open
429         https://bugs.webkit.org/show_bug.cgi?id=193284
430
431         Reviewed by Joseph Pecoraro.
432
433         If inspector^2 is closed, stringify all messages.
434         If inspector^2 is open, log each message JSON object without modifying it.
435
436         * UserInterface/Protocol/LoggingProtocolTracer.js:
437         (WI.LoggingProtocolTracer.prototype._processEntry):
438
439 2019-01-09  Nikita Vasilyev  <nvasilyev@apple.com>
440
441         Web Inspector: Styles: clicking on property that soon to be discarded shouldn't start selection
442         https://bugs.webkit.org/show_bug.cgi?id=193218
443         <rdar://problem/47098303>
444
445         Reviewed by Devin Rousso.
446
447         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
448         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
449         A style property may get removed on blur event, so propertyElement may get removed from the DOM right when mousedown event happens.
450
451         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowClick):
452         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
453         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):
454
455 2019-01-08  Nikita Vasilyev  <nvasilyev@apple.com>
456
457         Web Inspector: Styles: Undo reverts all changes at once
458         https://bugs.webkit.org/show_bug.cgi?id=177676
459         <rdar://problem/34745031>
460
461         Reviewed by Devin Rousso.
462
463         Command-Z used to revert all changes at once because Web Inspector never
464         set any history checkpoints in the style editor.
465
466         * UserInterface/Views/SpreadsheetStyleProperty.js:
467         (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur):
468         * UserInterface/Views/SpreadsheetTextField.js:
469         (WI.SpreadsheetTextField.prototype._handleBlur):
470
471 2019-01-08  Nikita Vasilyev  <nvasilyev@apple.com>
472
473         Web Inspector: Use prefers-color-scheme instead of prefers-dark-interface
474         https://bugs.webkit.org/show_bug.cgi?id=193265
475
476         Reviewed by Timothy Hatcher.
477
478         * UserInterface/Views/AuditTestContentView.css:
479         (@media (prefers-color-scheme: dark)):
480         * UserInterface/Views/AuditTestGroupContentView.css:
481         (@media (prefers-color-scheme: dark)):
482         * UserInterface/Views/BezierEditor.css:
483         (@media (prefers-color-scheme: dark)):
484         * UserInterface/Views/BoxModelDetailsSectionRow.css:
485         (@media (prefers-color-scheme: dark)):
486         * UserInterface/Views/BreakpointActionView.css:
487         (@media (prefers-color-scheme: dark)):
488         * UserInterface/Views/BreakpointPopoverController.css:
489         (@media (prefers-color-scheme: dark)):
490         * UserInterface/Views/ButtonNavigationItem.css:
491         (@media (prefers-color-scheme: dark)):
492         * UserInterface/Views/ButtonToolbarItem.css:
493         (@media (prefers-color-scheme: dark)):
494         * UserInterface/Views/CallFrameView.css:
495         (@media (prefers-color-scheme: dark)):
496         * UserInterface/Views/CanvasContentView.css:
497         (@media (prefers-color-scheme: dark)):
498         * UserInterface/Views/CanvasOverviewContentView.css:
499         (@media (prefers-color-scheme: dark)):
500         * UserInterface/Views/CanvasSidebarPanel.css:
501         (@media (prefers-color-scheme: dark)):
502         * UserInterface/Views/CanvasTabContentView.css:
503         (@media (prefers-color-scheme: dark)):
504         * UserInterface/Views/CodeMirrorOverrides.css:
505         (@media (prefers-color-scheme: dark)):
506         * UserInterface/Views/CompletionSuggestionsView.css:
507         (@media (prefers-color-scheme: dark)):
508         * UserInterface/Views/ComputedStyleDetailsPanel.css:
509         (@media (prefers-color-scheme: dark)):
510         * UserInterface/Views/ComputedStyleSection.css:
511         (@media (prefers-color-scheme: dark)):
512         * UserInterface/Views/ConsoleMessageView.css:
513         (@media (prefers-color-scheme: dark)):
514         * UserInterface/Views/ConsolePrompt.css:
515         (@media (prefers-color-scheme: dark)):
516         * UserInterface/Views/DOMNodeDetailsSidebarPanel.css:
517         (@media (prefers-color-scheme: dark)):
518         * UserInterface/Views/DOMTreeOutline.css:
519         (@media (prefers-color-scheme: dark)):
520         * UserInterface/Views/DataGrid.css:
521         (@media (prefers-color-scheme: dark)):
522         * UserInterface/Views/DebuggerDashboardView.css:
523         (@media (prefers-color-scheme: dark)):
524         * UserInterface/Views/DebuggerSidebarPanel.css:
525         (@media (prefers-color-scheme: dark)):
526         * UserInterface/Views/DefaultDashboardView.css:
527         (@media (prefers-color-scheme: dark)):
528         * UserInterface/Views/DetailsSection.css:
529         (@media (prefers-color-scheme: dark)):
530         * UserInterface/Views/DividerNavigationItem.css:
531         (@media (prefers-color-scheme: dark)):
532         * UserInterface/Views/Editing.css:
533         (@media (prefers-color-scheme: dark)):
534         * UserInterface/Views/FindBanner.css:
535         (@media (prefers-color-scheme: dark)):
536         * UserInterface/Views/FontResourceContentView.css:
537         (@media (prefers-color-scheme: dark)):
538         * UserInterface/Views/FormattedValue.css:
539         (@media (prefers-color-scheme: dark)):
540         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
541         (@media (prefers-color-scheme: dark)):
542         * UserInterface/Views/HoverMenu.css:
543         (@media (prefers-color-scheme: dark)):
544         * UserInterface/Views/ImageResourceContentView.css:
545         (@media (prefers-color-scheme: dark)):
546         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.css:
547         (@media (prefers-color-scheme: dark)):
548         * UserInterface/Views/LogContentView.css:
549         (@media (prefers-color-scheme: dark)):
550
551         * UserInterface/Views/Main.css:
552         (:root):
553
554         (@media (prefers-color-scheme: dark)):
555         * UserInterface/Views/NetworkDetailView.css:
556         (@media (prefers-color-scheme: dark)):
557         * UserInterface/Views/NetworkTableContentView.css:
558         (@media (prefers-color-scheme: dark)):
559         * UserInterface/Views/NewTabContentView.css:
560         (@media (prefers-color-scheme: dark)):
561         * UserInterface/Views/ObjectPreviewView.css:
562         (@media (prefers-color-scheme: dark)):
563         * UserInterface/Views/ObjectTreePropertyTreeElement.css:
564         (@media (prefers-color-scheme: dark)):
565         * UserInterface/Views/OpenResourceDialog.css:
566         (@media (prefers-color-scheme: dark)):
567         * UserInterface/Views/ProgressView.css:
568         (@media (prefers-color-scheme: dark)):
569         * UserInterface/Views/QuickConsole.css:
570         (@media (prefers-color-scheme: dark)):
571         * UserInterface/Views/RecordingActionTreeElement.css:
572         (@media (prefers-color-scheme: dark)):
573         * UserInterface/Views/RecordingContentView.css:
574         (@media (prefers-color-scheme: dark)):
575         * UserInterface/Views/RecordingStateDetailsSidebarPanel.css:
576         (@media (prefers-color-scheme: dark)):
577         * UserInterface/Views/ResourceSecurityContentView.css:
578         (@media (prefers-color-scheme: dark)):
579         * UserInterface/Views/ResourceSizesContentView.css:
580         (@media (prefers-color-scheme: dark)):
581         * UserInterface/Views/ResourceTimingBreakdownView.css:
582         (@media (prefers-color-scheme: dark)):
583         * UserInterface/Views/ScopeBar.css:
584         (@media (prefers-color-scheme: dark)):
585         * UserInterface/Views/ScopeChainDetailsSidebarPanel.css:
586         (@media (prefers-color-scheme: dark)):
587         * UserInterface/Views/SearchBar.css:
588         (@media (prefers-color-scheme: dark)):
589         * UserInterface/Views/SearchSidebarPanel.css:
590         (@media (prefers-color-scheme: dark)):
591         * UserInterface/Views/SettingsTabContentView.css:
592         (@media (prefers-color-scheme: dark)):
593         * UserInterface/Views/ShaderProgramContentView.css:
594         (@media (prefers-color-scheme: dark)):
595         * UserInterface/Views/ShaderProgramTreeElement.css:
596         (@media (prefers-color-scheme: dark)):
597         * UserInterface/Views/SourceCodeTextEditor.css:
598         (@media (prefers-color-scheme: dark)):
599         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
600         (@media (prefers-color-scheme: dark)):
601         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
602         (@media (prefers-color-scheme: dark)):
603         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.css:
604         (@media (prefers-color-scheme: dark)):
605         * UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
606         (@media (prefers-color-scheme: dark)):
607         * UserInterface/Views/TabBar.css:
608         (@media (prefers-color-scheme: dark)):
609         * UserInterface/Views/Table.css:
610         (@media (prefers-color-scheme: dark)):
611         * UserInterface/Views/TextEditor.css:
612         (@media (prefers-color-scheme: dark)):
613         * UserInterface/Views/TimelineDataGrid.css:
614         (@media (prefers-color-scheme: dark)):
615         * UserInterface/Views/TimelineIcons.css:
616         (@media (prefers-color-scheme: dark)):
617         * UserInterface/Views/TimelineOverview.css:
618         (@media (prefers-color-scheme: dark)):
619         * UserInterface/Views/Toolbar.css:
620         (@media (prefers-color-scheme: dark)):
621         * UserInterface/Views/TreeOutline.css:
622         (@media (prefers-color-scheme: dark)):
623         * UserInterface/Views/URLBreakpointPopover.css:
624         (@media (prefers-color-scheme: dark)):
625         * UserInterface/Views/Variables.css:
626         (@media (prefers-color-scheme: dark)):
627         * UserInterface/Views/WebSocketContentView.css:
628         (@media (prefers-color-scheme: dark)):
629
630 2019-01-07  Devin Rousso  <drousso@apple.com>
631
632         Web Inspector: Audit: run arrow shouldn't be visible when running tests
633         https://bugs.webkit.org/show_bug.cgi?id=192209
634         <rdar://problem/46423615>
635
636         Reviewed by Brian Burg.
637
638         * UserInterface/Views/AuditTreeElement.js:
639         (WI.AuditTreeElement.prototype.onattach):
640         (WI.AuditTreeElement.prototype.ondetach):
641         (WI.AuditTreeElement.prototype._updateLevel):
642         (WI.AuditTreeElement.prototype._handleAuditManagerTestScheduled): Added.
643         (WI.AuditTreeElement.prototype._handleAuditManagerTestCompleted): Added.
644         * UserInterface/Views/AuditTreeElement.css: Added.
645         (.tree-outline .item.audit:matches(.test-case, .test-group):not(.manager-active) > .status:hover > img): Added.
646         (.tree-outline .item.audit.manager-active > .status > img.show-on-hover, .tree-outline .item.audit.test-group.expanded > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): Added.
647         (.tree-outline .item.audit:matches(.test-case, .test-group) > .status:hover > img): Deleted.
648         (.tree-outline .item.audit.test-group.expanded > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): Deleted.
649
650 2019-01-07  Devin Rousso  <drousso@apple.com>
651
652         Web Inspector: extend XHR breakpoints to work with fetch
653         https://bugs.webkit.org/show_bug.cgi?id=185843
654         <rdar://problem/40431027>
655
656         Reviewed by Matt Baker.
657
658         * UserInterface/Controllers/DOMDebuggerManager.js:
659         (WI.DOMDebuggerManager):
660         (WI.DOMDebuggerManager.supportsURLBreakpoints): Added.
661         (WI.DOMDebuggerManager.prototype.get urlBreakpoints): Added.
662         (WI.DOMDebuggerManager.prototype.urlBreakpointForURL): Added.
663         (WI.DOMDebuggerManager.prototype.addURLBreakpoint): Added.
664         (WI.DOMDebuggerManager.prototype.removeURLBreakpoint): Added.
665         (WI.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints):
666         (WI.DOMDebuggerManager.prototype._updateURLBreakpoint): Added.
667         (WI.DOMDebuggerManager.prototype._resolveURLBreakpoint): Added.
668         (WI.DOMDebuggerManager.prototype._saveURLBreakpoints): Added.
669         (WI.DOMDebuggerManager.prototype._urlBreakpointDisabledStateDidChange): Added.
670         (WI.DOMDebuggerManager.prototype.get xhrBreakpoints): Deleted.
671         (WI.DOMDebuggerManager.prototype.xhrBreakpointForURL): Deleted.
672         (WI.DOMDebuggerManager.prototype.addXHRBreakpoint): Deleted.
673         (WI.DOMDebuggerManager.prototype.removeXHRBreakpoint): Deleted.
674         (WI.DOMDebuggerManager.prototype._updateXHRBreakpoint.breakpointUpdated): Deleted.
675         (WI.DOMDebuggerManager.prototype._updateXHRBreakpoint): Deleted.
676         (WI.DOMDebuggerManager.prototype._resolveXHRBreakpoint): Deleted.
677         (WI.DOMDebuggerManager.prototype._saveXHRBreakpoints): Deleted.
678         (WI.DOMDebuggerManager.prototype._xhrBreakpointDisabledStateDidChange): Deleted.
679
680         * UserInterface/Controllers/DebuggerManager.js:
681         (WI.DebuggerManager.prototype._pauseReasonFromPayload):
682
683         * UserInterface/Views/DebuggerSidebarPanel.js:
684         (WI.DebuggerSidebarPanel):
685         (WI.DebuggerSidebarPanel.prototype.willDismissPopover):
686         (WI.DebuggerSidebarPanel.prototype._addBreakpoint):
687         (WI.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
688         (WI.DebuggerSidebarPanel.prototype._addTreeElement):
689         (WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
690         (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointClicked):
691
692         * UserInterface/Views/NavigationSidebarPanel.js:
693         (WI.NavigationSidebarPanel.prototype._isTreeElementWithoutRepresentedObject):
694
695         * UserInterface/Models/URLBreakpoint.js: Renamed from Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js.
696         * UserInterface/Views/URLBreakpointPopover.css: Renamed from Source/WebInspectorUI/UserInterface/Views/XHRBreakpointPopover.css.
697         * UserInterface/Views/URLBreakpointPopover.js: Renamed from Source/WebInspectorUI/UserInterface/Views/XHRBreakpointPopover.js.
698         * UserInterface/Views/URLBreakpointTreeElement.css: Renamed from Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.css.
699         * UserInterface/Views/URLBreakpointTreeElement.js: Renamed from Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js.
700
701         * UserInterface/Base/Setting.js:
702         (WI.Setting.migrateValue): Added.
703
704         * UserInterface/Main.html:
705         * UserInterface/Test.html:
706
707         * Localizations/en.lproj/localizedStrings.js:
708
709 2019-01-07  Devin Rousso  <drousso@apple.com>
710
711         Web Inspector: Network: show secure connection details per-request
712         https://bugs.webkit.org/show_bug.cgi?id=191539
713         <rdar://problem/45979891>
714
715         Reviewed by Joseph Pecoraro.
716
717         * UserInterface/Models/Resource.js:
718         (WI.Resource):
719         (WI.Resource.prototype.get security): Added.
720         (WI.Resource.prototype.updateForResponse):
721         (WI.Resource.prototype.updateWithMetrics):
722         (WI.Resource.prototype.get responseSecurity): Deleted.
723
724         * UserInterface/Views/ResourceSecurityContentView.js:
725         (WI.ResourceSecurityContentView):
726         (WI.ResourceSecurityContentView.prototype.initialLayout):
727         (WI.ResourceSecurityContentView.prototype.layout):
728         (WI.ResourceSecurityContentView.prototype._refreshConnectionSection): Added.
729         (WI.ResourceSecurityContentView.prototype._refreshCetificateSection):
730         (WI.ResourceSecurityContentView.prototype._handleResourceMetricsDidChange): Added.
731         * UserInterface/Views/ResourceSecurityContentView.css:
732         (body[dir] .resource-security > section:matches(.connection, .certificate) > .details): Added.
733         (@media (prefers-dark-interface) body[dir] .resource-security > section:matches(.connection, .certificate) > .details): Added.
734         (body[dir] .resource-security > section.certificate > .details): Deleted.
735         (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details): Deleted.
736
737         * Localizations/en.lproj/localizedStrings.js:
738
739 2019-01-07  Nikita Vasilyev  <nvasilyev@apple.com>
740
741         Web Inspector: "white" isn't recognized as a color keyword
742         https://bugs.webkit.org/show_bug.cgi?id=193173
743         <rdar://problem/47068595>
744
745         Reviewed by Joseph Pecoraro.
746
747         Attempt to parse "atom" token types as colors.
748
749         Display color picker only for color-aware properties. For instance,
750         display it for "color: white" but not for "-apple-pay-button-style: white".
751
752         * UserInterface/Models/CSSKeywordCompletions.js:
753         (addKeywordsForName):
754         (WI.CSSKeywordCompletions.forProperty):
755         (WI.CSSKeywordCompletions.isColorAwareProperty):
756         * UserInterface/Views/SpreadsheetStyleProperty.js:
757         (WI.SpreadsheetStyleProperty.prototype._renderValue):
758         (WI.SpreadsheetStyleProperty.prototype._addColorTokens):
759
760 2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
761
762         Web Inspector: subclasses of WI.ClusterContentView don't save/restore content views after the initial view
763         https://bugs.webkit.org/show_bug.cgi?id=192451
764         <rdar://problem/46800958>
765
766         Reviewed by Devin Rousso.
767
768         * UserInterface/Models/BackForwardEntry.js:
769         (WI.BackForwardEntry.prototype.prepareToHide):
770         * UserInterface/Views/ClusterContentView.js:
771         (WI.ClusterContentView.prototype.get shouldSaveStateOnHide):
772         * UserInterface/Views/ContentView.js:
773         (WI.ContentView.prototype.get shouldSaveStateOnHide):
774         Allow ClusterContentViews to save its state whenever its hidden,
775         this means it can be properly restored to the last state it had
776         instead of the initial state it was shown with.
777
778 2019-01-04  Devin Rousso  <drousso@apple.com>
779
780         Web Inspector: Audit: disable breakpoints when running Audit
781         https://bugs.webkit.org/show_bug.cgi?id=193158
782         <rdar://problem/47057083>
783
784         Reviewed by Joseph Pecoraro.
785
786         * UserInterface/Controllers/DebuggerManager.js:
787         (WI.DebuggerManager):
788         (WI.DebuggerManager.prototype._startDisablingBreakpointsTemporarily):
789         (WI.DebuggerManager.prototype._stopDisablingBreakpointsTemporarily):
790         (WI.DebuggerManager.prototype._handleAuditManagerTestScheduled): Added.
791         (WI.DebuggerManager.prototype._handleAuditManagerTestCompleted): Added.
792
793         * UserInterface/Views/DebuggerSidebarPanel.js:
794         (WI.DebuggerSidebarPanel.prototype._timelineCapturingWillStart):
795         (WI.DebuggerSidebarPanel.prototype._timelineCapturingStopped):
796         (WI.DebuggerSidebarPanel.prototype._handleAuditManagerTestScheduled): Added.
797         (WI.DebuggerSidebarPanel.prototype._handleAuditManagerTestCompleted): Added.
798         (WI.DebuggerSidebarPanel.prototype._updateBreakpointsDisabledBanner):
799         * UserInterface/Views/DebuggerSidebarPanel.css:
800         (.sidebar > .panel.navigation.debugger .warning-banner + .warning-banner): Added.
801
802         * UserInterface/Base/Main.js:
803         (WI.loaded):
804         * UserInterface/Test/Test.js:
805         (WI.loaded):
806         Move `WI.auditManager` higher in the managers list so that it can be used in
807         `WI.DebuggerManager`'s constructor.
808
809         * Localizations/en.lproj/localizedStrings.js:
810
811 2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
812
813         Web Inspector: Add a Setting Toggle for Source Maps
814         https://bugs.webkit.org/show_bug.cgi?id=193148
815
816         Reviewed by Devin Rousso.
817
818         * UserInterface/Controllers/NetworkManager.js:
819         (WI.NetworkManager.prototype.downloadSourceMap):
820         Don't download source maps if the setting is disabled.
821
822         * UserInterface/Base/Setting.js:
823         * UserInterface/Views/SettingsTabContentView.js:
824         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
825         Settings toggle for source maps. Enabled by default.
826
827         * Localizations/en.lproj/localizedStrings.js:
828
829 2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
830
831         Web Inspector: Include `globalThis` in default JavaScript completions
832         https://bugs.webkit.org/show_bug.cgi?id=193147
833
834         Reviewed by Devin Rousso.
835
836         * UserInterface/Controllers/CodeMirrorCompletionController.js:
837         Add `globalThis` which is a new global value.
838
839 2019-01-03  Devin Rousso  <drousso@apple.com>
840
841         Web Inspector: conic-gradient color picker doesn't accurately show color when saturation value is not 100%
842         https://bugs.webkit.org/show_bug.cgi?id=192729
843         <rdar://problem/46746815>
844
845         Reviewed by Joseph Pecoraro.
846
847         Rework `WI.ColorWheel` to use similar canvas drawing logic as `WI.LegacyColorWheel` so that
848         it's able to adjust the saturation value as the pixels gets closer to the center.
849
850         * UserInterface/Models/Color.js:
851         (WI.Color.rgb2hsl): Added.
852         (WI.Color.hsl2rgb): Added.
853         (WI.Color.cmyk2rgb):
854         (WI.Color.prototype.isKeyword):
855         (WI.Color.prototype._toRGBString):
856         (WI.Color.prototype._toRGBAString):
857         (WI.Color.prototype._toHSLString):
858         (WI.Color.prototype._toHSLAString):
859         (WI.Color.prototype._rgbaToHSLA):
860         (WI.Color.prototype._hslaToRGBA):
861         (WI.Color.rgb2hsv): Deleted.
862         (WI.Color.hsv2rgb): Deleted.
863         (WI.Color.prototype._rgbToHSL): Deleted.
864         (WI.Color.prototype._hslToRGB): Deleted.
865         Adjust the conversion functions of `WI.Color` to be more accurate.
866
867         * UserInterface/Views/ColorWheel.js:
868         (WI.ColorWheel):
869         (WI.ColorWheel.prototype.set dimension):
870         (WI.ColorWheel.prototype.set brightness):
871         (WI.ColorWheel.prototype.get tintedColor):
872         (WI.ColorWheel.prototype.set tintedColor):
873         (WI.ColorWheel.prototype._updateColorForMouseEvent):
874         (WI.ColorWheel.prototype._updateCanvas): Added.
875         (WI.ColorWheel.prototype._updateGradient): Deleted.
876         * UserInterface/Views/ColorWheel.css:
877         (.color-wheel > canvas): Added.
878         (.color-wheel > .gradient): Deleted.
879
880         * UserInterface/Views/ColorPicker.js:
881         (WI.ColorPicker):
882         (WI.ColorPicker.prototype.set color):
883         (WI.ColorPicker.prototype.sliderValueDidChange):
884         (WI.ColorPicker.prototype._updateSliders):
885         (WI.ColorPicker.prototype._showColorComponentInputs):
886         (WI.ColorPicker.supportsConicGradient): Deleted.
887
888         * UserInterface/Main.html:
889
890         * UserInterface/Views/LegacyColorWheel.js: Removed.
891
892 2019-01-02  Nikita Vasilyev  <nvasilyev@apple.com>
893
894         Web Inspector: Styles: selection lost when inspector is blurred
895         https://bugs.webkit.org/show_bug.cgi?id=192124
896         <rdar://problem/46800965>
897
898         Reviewed by Devin Rousso.
899
900         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
901         (body:matches(.window-docked-inactive, .window-inactive) .spreadsheet-style-declaration-editor .property.selected):
902         Selection should be gray when Web Inspector window isn't focused.
903
904         * UserInterface/Views/SpreadsheetStyleProperty.js:
905
906 2019-01-02  Nikita Vasilyev  <nvasilyev@apple.com>
907
908         Web Inspector: Styles: it shouldn't be possible to delete read-only properties
909         https://bugs.webkit.org/show_bug.cgi?id=193099
910         <rdar://problem/47016335>
911
912         Reviewed by Devin Rousso.
913
914         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
915         (WI.SpreadsheetCSSStyleDeclarationEditor):
916         Drive-by: Forward Delete should work the same way as Delete (Backspace).
917
918 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
919
920         Web Inspector: Implement `queryObjects` Command Line API
921         https://bugs.webkit.org/show_bug.cgi?id=176766
922         <rdar://problem/34890689>
923
924         Reviewed by Joseph Pecoraro.
925
926         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
927         (WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
928         Add `queryObjects` to the list of command line functions.
929
930 2018-12-21  Devin Rousso  <drousso@apple.com>
931
932         Web Inspector: Styles Redesign: remove unused CSS style icons
933         https://bugs.webkit.org/show_bug.cgi?id=192999
934         <rdar://problem/46912094>
935
936         Reviewed by Matt Baker.
937
938         * UserInterface/Main.html:
939         * UserInterface/Views/StyleRuleIcons.css: Removed.
940         * UserInterface/Images/StyleRule.svg: Removed.
941         * UserInterface/Images/StyleRuleInheritedElement.svg: Removed.
942         * UserInterface/Images/StyleRulePseudoElement.svg: Removed.
943
944         * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
945         * WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
946
947 2018-12-21  Nikita Vasilyev  <nvasilyev@apple.com>
948
949         Web Inspector: Styles: editing focus lost when inspector is blurred
950         https://bugs.webkit.org/show_bug.cgi?id=192123
951         <rdar://problem/46800966>
952
953         Reviewed by Devin Rousso.
954
955         * UserInterface/Views/SpreadsheetSelectorField.js:
956         (WI.SpreadsheetSelectorField.prototype._handleBlur):
957         * UserInterface/Views/SpreadsheetTextField.js:
958         (WI.SpreadsheetTextField.prototype._handleBlur):
959
960 2018-12-21  Devin Rousso  <drousso@apple.com>
961
962         Web Inspector: Settings: experimental setting editors are misaligned in other locales
963         https://bugs.webkit.org/show_bug.cgi?id=192971
964         <rdar://problem/46718451>
965
966         Reviewed by Joseph Pecoraro.
967
968         * UserInterface/Views/SettingsTabContentView.css:
969         (.content-view.settings > .settings-view > .container):
970         (.content-view.settings > .settings-view > .container > .title):
971
972 2018-12-21  Devin Rousso  <drousso@apple.com>
973
974         Web Inspector: update scroll position when revealing a virtualized WI.DataGridNode
975         https://bugs.webkit.org/show_bug.cgi?id=192992
976         <rdar://problem/46886427>
977
978         Reviewed by Joseph Pecoraro.
979
980         When `reveal`ing a `WI.DataGridNode`, if it is not currently in the DOM tree (e.g. it's been
981         virtualized by it's owner `WI.DataGrid`), we need to scroll to it's position so that it gets
982         added to the DOM tree before it can be revealed/selected.
983
984         * UserInterface/Views/DataGrid.js:
985         (WI.DataGrid.prototype.layout):
986         (WI.DataGrid.prototype.updateVisibleRows):
987         (WI.DataGrid.prototype._updateVisibleRows): Deleted.
988
989         * UserInterface/Views/DataGridNode.js:
990         (WI.DataGridNode.prototype.reveal):
991
992 2018-12-20  Nikita Vasilyev  <nvasilyev@apple.com>
993
994         Web Inspector: Dark Mode: Type profiler popovers have black text on dark background
995         https://bugs.webkit.org/show_bug.cgi?id=192916
996         <rdar://problem/46863518>
997
998         Reviewed by Devin Rousso.
999
1000         * UserInterface/Views/SourceCodeTextEditor.css:
1001         (.popover .debugger-popover-content > .body):
1002         * UserInterface/Views/TypeTreeElement.css:
1003         (.item.type-tree-element.prototype):
1004         (.item.type-tree-element.prototype:hover,):
1005         * UserInterface/Views/TypeTreeView.css:
1006         (.type-tree):
1007         * UserInterface/Views/Variables.css:
1008         (:root):
1009
1010 2018-12-20  Nikita Vasilyev  <nvasilyev@apple.com>
1011
1012         Web Inspector: Styles: Pressing Esc when editing name/value should select entire property
1013         https://bugs.webkit.org/show_bug.cgi?id=192919
1014
1015         Reviewed by Devin Rousso.
1016
1017         - Esc still hides the completion popover.
1018         - Esc still discards changes.
1019         - When there's no completion popover, Esc selects outer scope.
1020           I.e., it goes from editing name/value to selecting the entire property.
1021         - Pressing Esc for newly added properties discards those properties.
1022
1023         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
1024         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved):
1025         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyDidPressEsc):
1026         * UserInterface/Views/SpreadsheetStyleProperty.js:
1027         (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidPressEsc):
1028         * UserInterface/Views/SpreadsheetTextField.js:
1029         (WI.SpreadsheetTextField.prototype._discardChange):
1030         (WI.SpreadsheetTextField.prototype._handleKeyDown):
1031
1032 2018-12-20  Joseph Pecoraro  <pecoraro@apple.com>
1033
1034         Web Inspector: Charles Proxy errors opening har files exported from Safari (invalid startedDateTime)
1035         https://bugs.webkit.org/show_bug.cgi?id=192959
1036         <rdar://problem/46863411>
1037
1038         Reviewed by Brian Burg.
1039
1040         * UserInterface/Views/NetworkTableContentView.js:
1041         (WI.NetworkTableContentView.prototype.tableCellContextMenuClicked):
1042         (WI.NetworkTableContentView.prototype._updateExportButton):
1043         (WI.NetworkTableContentView.prototype._canExportHAR):
1044         Disallow HAR export if we don't have load data, such as the requestSentDate for
1045         the main resource or sub-resources.
1046
1047         (WI.NetworkTableContentView.prototype._HARResources):
1048         Only export resources that have load data.
1049
1050 2018-12-20  Joseph Pecoraro  <pecoraro@apple.com>
1051
1052         Web Inspector: Autoformat doesn't work on icloud.com (javascript-packed.js)
1053         https://bugs.webkit.org/show_bug.cgi?id=192946
1054         <rdar://problem/42546126>
1055
1056         Rubber-stamped by Devin Rousso.
1057
1058         * UserInterface/Base/Utilities.js:
1059         (whitespaceRatio):
1060         (isTextLikelyMinified):
1061         Check the first 2500 and the last 2500 characters whitespace ratio.
1062         If either is below 20% then treat as minified.
1063
1064 2018-12-20  Joseph Pecoraro  <pecoraro@apple.com>
1065
1066         ITMLKit Inspector: Elements tab does not show DOM Tree
1067         https://bugs.webkit.org/show_bug.cgi?id=192910
1068         <rdar://problem/46680585>
1069
1070         Reviewed by Brian Burg.
1071
1072         * UserInterface/Protocol/Connection.js:
1073         (InspectorBackend.Connection.prototype._dispatchEvent):
1074         Better logging for errors.
1075
1076         * UserInterface/Base/Main.js:
1077         * UserInterface/Controllers/AppController.js:
1078         (WI.AppController.prototype.activateExtraDomains):
1079         Let Targets get a chance to activate extra domains.
1080         Perform a little more work in these cases.
1081
1082         * UserInterface/Protocol/Target.js:
1083         (WI.Target):
1084         (WI.Target.prototype.activateExtraDomain):
1085         Expose agents for domains that are active.
1086         Expose agents for extra domains when they are activated.
1087
1088 2018-12-20  Joseph Pecoraro  <pecoraro@apple.com>
1089
1090         ITMLKit Inspector: Computed Style Box Model section throws exceptions
1091         https://bugs.webkit.org/show_bug.cgi?id=192911
1092         <rdar://problem/46861112>
1093
1094         Reviewed by Matt Baker.
1095
1096         * UserInterface/Views/BoxModelDetailsSectionRow.js:
1097         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement):
1098         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement):
1099         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics):
1100         ITMLKit doesn't always provide a display/position/width/height etc properties.
1101         Protect against this, and just show an empty message in the box model section
1102         if those properties do not exist.
1103
1104 2018-12-20  Devin Rousso  <drousso@apple.com>
1105
1106         Web Inspector: UIString should take an optional key and description to aid localization
1107         https://bugs.webkit.org/show_bug.cgi?id=153962
1108         <rdar://problem/24542505>
1109
1110         Reviewed by Brian Burg.
1111
1112         * UserInterface/Base/LoadLocalizedStrings.js:
1113         (WI.UIString):
1114
1115         * UserInterface/Test/Test.js:
1116         (WI.UIString):
1117
1118         * UserInterface/Views/AuditTestGroupContentView.js:
1119         (WI.AuditTestGroupContentView.prototype.initialLayout):
1120
1121 2018-12-20  Devin Rousso  <drousso@apple.com>
1122
1123         Web Inspector: Audits: don't cache default audits
1124         https://bugs.webkit.org/show_bug.cgi?id=192918
1125         <rdar://problem/46626543>
1126
1127         Reviewed by Brian Burg.
1128
1129         Instead of adding the default audits to the "audits" `WI.ObjectStore`, which preserves them
1130         across WebInspector sessions, load them every time WebInspector is opened (unless there are
1131         existing audits) so that the localized strings are able to respond to locale changes.
1132
1133         * UserInterface/Controllers/AuditManager.js:
1134         (WI.AuditManager.prototype.removeTest):
1135         (WI.AuditManager.prototype.addDefaultTestsIfNeeded):
1136
1137 2018-12-20  Devin Rousso  <drousso@apple.com>
1138
1139         Web Inspector: Dark Mode: unreadable background color for tables containing object previews
1140         https://bugs.webkit.org/show_bug.cgi?id=192887
1141         <rdar://problem/46855270>
1142
1143         Reviewed by Brian Burg.
1144
1145         * UserInterface/Views/LogContentView.css:
1146         (.console-messages:focus .console-item .data-grid tr.selected td:not(:last-child)): Added.
1147         (@media (prefers-dark-interface) .console-item .data-grid tr.selected): Added.
1148         (@media (prefers-dark-interface) .console-messages:focus .console-item.selected .data-grid tr.selected): Added.
1149         (@media (prefers-dark-interface) .console-messages:focus .console-item .data-grid tr.selected td:not(:last-child)): Added.
1150
1151         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.css:
1152         (.content-view.indexed-database-object-store > .data-grid tr.selected):
1153         (.content-view.indexed-database-object-store > .data-grid:focus tr.selected): Added.
1154         (@media (prefers-dark-interface) .content-view.indexed-database-object-store > .data-grid tr.selected): Added.
1155         (@media (prefers-dark-interface) .content-view.indexed-database-object-store > .data-grid:focus tr.selected): Added.
1156         (@media (prefers-dark-interface) .content-view.indexed-database-object-store > .data-grid:focus tr.selected td:not(:last-child)): Added.
1157
1158 2018-12-19  Devin Rousso  <drousso@apple.com>
1159
1160         Web Inspector: Audit: fix descriptions for default tests
1161         https://bugs.webkit.org/show_bug.cgi?id=192764
1162         <rdar://problem/46729437>
1163
1164         Reviewed by Matt Baker.
1165
1166         * UserInterface/Controllers/AuditManager.js:
1167         (WI.AuditManager.prototype.addDefaultTestsIfNeeded):
1168
1169         * Localizations/en.lproj/localizedStrings.js:
1170
1171 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
1172
1173         Web Inspector: "E" icon on debugger dashboard is too close to current function name
1174         https://bugs.webkit.org/show_bug.cgi?id=192915
1175
1176         Reviewed by Matt Baker.
1177
1178         * UserInterface/Views/DebuggerDashboardView.css:
1179         (.dashboard.debugger > .location):
1180         (body[dir=ltr] .dashboard.debugger > .location :matches(.function-icon, .event-listener-icon)):
1181         (body[dir=rtl] .dashboard.debugger > .location :matches(.function-icon, .event-listener-icon)):
1182         (.dashboard.debugger > .location .function-icon): Deleted.
1183         (body[dir=ltr] .dashboard.debugger > .location .function-icon): Deleted.
1184         (body[dir=rtl] .dashboard.debugger > .location .function-icon): Deleted.
1185
1186 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
1187
1188         Web Inspector: Dark Mode: ThreadTreeElement status icon is hard to see when hovered
1189         https://bugs.webkit.org/show_bug.cgi?id=192097
1190         <rdar://problem/46318421>
1191
1192         Reviewed by Matt Baker.
1193
1194         * UserInterface/Views/ThreadTreeElement.css:
1195         (.tree-outline > .item.thread .status-button.resume):
1196         (.tree-outline > .item.thread .status-button.resume:active):
1197
1198 2018-12-19  Devin Rousso  <drousso@apple.com>
1199
1200         Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'effectiveDOMNode.enabledPseudoClasses')
1201         https://bugs.webkit.org/show_bug.cgi?id=192783
1202
1203         Reviewed by Joseph Pecoraro.
1204
1205         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
1206         (WI.GeneralStyleDetailsSidebarPanel.prototype._forcedPseudoClassCheckboxChanged):
1207         (WI.GeneralStyleDetailsSidebarPanel.prototype._updatePseudoClassCheckboxes):
1208
1209 2018-12-19  Devin Rousso  <drousso@apple.com>
1210
1211         Web Inspector: REGRESSION (r237195): Timelines: selecting a rendering frame row moves the time selection
1212         https://bugs.webkit.org/show_bug.cgi?id=192773
1213         <rdar://problem/46782446>
1214
1215         Reviewed by Joseph Pecoraro.
1216
1217         * UserInterface/Views/TimelineOverview.js:
1218         (WI.TimelineOverview.prototype._recordSelected):
1219         The Frames timeline uses `frameIndex` instead of `startTime`/`endTime`, so when trying to
1220         ensure that the selected record is within the filtered range, use `frameIndex` instead.
1221         The associated `WI.TimelineRuler` will already be using an index-based approach for
1222         selection, so this will match.
1223
1224 2018-12-19  Devin Rousso  <drousso@apple.com>
1225
1226         Web Inspector: Canvas: the recording auto-capture input shouldn't start focused
1227         https://bugs.webkit.org/show_bug.cgi?id=192454
1228
1229         Reviewed by Joseph Pecoraro.
1230
1231         * UserInterface/Views/CanvasOverviewContentView.js:
1232         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel):
1233         (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged):
1234
1235 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
1236
1237         Web Inspector: Styles: shift-clicking a color-swatch to change formats starts editing the color
1238         https://bugs.webkit.org/show_bug.cgi?id=192784
1239         <rdar://problem/46801028>
1240
1241         Reviewed by Devin Rousso.
1242
1243         * UserInterface/Views/SpreadsheetStyleProperty.js:
1244         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
1245
1246 2018-12-19  Matt Baker  <mattbaker@apple.com>
1247
1248         Web Inspector: Elements tab: arrow key after undoing a DOM node delete selects the wrong element
1249         https://bugs.webkit.org/show_bug.cgi?id=192871
1250         <rdar://problem/46849060>
1251
1252         Reviewed by Devin Rousso.
1253
1254         Undoing a DOM node removal reinserts the node into the DOMTreeOutline.
1255         When the reinserted node precedes the selected node in the tree, the
1256         SelectionController should update `_lastSelectedIndex`.
1257
1258         * UserInterface/Controllers/SelectionController.js:
1259         (WI.SelectionController.prototype.didInsertItem):
1260
1261 2018-12-19  Devin Rousso  <drousso@apple.com>
1262
1263         Web Inspector: Audit: provide localization support for % pass display
1264         https://bugs.webkit.org/show_bug.cgi?id=192870
1265         <rdar://problem/46779245>
1266
1267         Reviewed by Brian Burg.
1268
1269         * UserInterface/Views/AuditTestGroupContentView.js:
1270         (WI.AuditTestGroupContentView.prototype.initialLayout):
1271         (WI.AuditTestGroupContentView.prototype.layout):
1272         * UserInterface/Views/AuditTestGroupContentView.css:
1273         (.content-view.audit-test-group > header > .percentage-pass):
1274         (.content-view.audit-test-group > header > .percentage-pass > span): Added.
1275         (@media (prefers-dark-interface) .content-view.audit-test-group > header > .percentage-pass): Added.
1276         (@media (prefers-dark-interface) .content-view.audit-test-group > header > .percentage-pass > span): Added.
1277         (.content-view.audit-test-group > header > .percentage-pass:not(:empty)::after): Deleted.
1278
1279         * Localizations/en.lproj/localizedStrings.js:
1280
1281 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
1282
1283         Web Inspector: Computed: make UI more usable when the panel is narrow
1284         https://bugs.webkit.org/show_bug.cgi?id=192578
1285         <rdar://problem/46615753>
1286
1287         Reviewed by Devin Rousso.
1288
1289         * UserInterface/Views/ComputedStyleSection.css:
1290         (.computed-style-section .computed-property-item .property-traces):
1291         (.computed-style-section .computed-property-item.expanded .disclosure-button):
1292         (.computed-style-section .computed-property-item .property-trace-item):
1293         (.computed-style-section .computed-property-item .property-trace-item::before):
1294         (.computed-style-section .computed-property-item .property):
1295         (.computed-style-section .computed-property-item .property-trace-item .selector):
1296         Allow CSS property values and selectors to take more than one line.
1297
1298         (.computed-style-section .property-trace-item .property .name,):
1299         * UserInterface/Views/ComputedStyleSection.js:
1300         (WI.ComputedStyleSection.prototype._createTrace):
1301         * UserInterface/Views/SpreadsheetStyleProperty.js:
1302         (WI.SpreadsheetStyleProperty.prototype.update):
1303
1304 2018-12-18  Simon Fraser  <simon.fraser@apple.com>
1305
1306         Web Inspector: Timelines: correctly label Intersection Observer callbacks
1307         https://bugs.webkit.org/show_bug.cgi?id=192669
1308         <rdar://problem/46702490>
1309
1310         Reviewed by Joseph Pecoraro.
1311
1312         Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
1313         to Intersection Observer, Performance Observer and Mutation Observer callbacks so 
1314         that they get correctly labeled in the Inspector timeline.
1315
1316         * Localizations/en.lproj/localizedStrings.js:
1317         * UserInterface/Controllers/TimelineManager.js:
1318         (WI.TimelineManager.prototype._processRecord):
1319         * UserInterface/Models/ScriptTimelineRecord.js:
1320         (WI.ScriptTimelineRecord.EventType.displayName):
1321         * UserInterface/Views/TimelineTabContentView.js:
1322         (WI.TimelineTabContentView.iconClassNameForRecord):
1323
1324 2018-12-19  Devin Rousso  <drousso@apple.com>
1325
1326         Web Inspector: Audit: "Clear Filters" button gets clipped when window is vertically small
1327         https://bugs.webkit.org/show_bug.cgi?id=192868
1328         <rdar://problem/46780400>
1329
1330         Reviewed by Matt Baker.
1331
1332         * UserInterface/Views/Main.css:
1333         (.message-text-view):
1334
1335 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
1336
1337         Web Inspector: Dark Mode: selected text is too light when Inspector window is inactive
1338         https://bugs.webkit.org/show_bug.cgi?id=190542
1339         <rdar://problem/45238712>
1340
1341         Reviewed by Devin Rousso.
1342
1343         * UserInterface/Views/CodeMirrorOverrides.css:
1344         (.CodeMirror .CodeMirror-selected):
1345
1346 2018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
1347
1348         Web Inspector: column sort controls in Layers tab sidebar don't render correctly in dark mode
1349         https://bugs.webkit.org/show_bug.cgi?id=192845
1350
1351         Reviewed by Devin Rousso.
1352
1353         * UserInterface/Views/DataGrid.css:
1354         (@media (prefers-dark-interface)):
1355         (.data-grid th.sortable:active):
1356         Drive-by: replace obnoxiously light background of the pressed header with a more subtle gray.
1357
1358         (.data-grid th.sort-ascending > div:first-child::after, .data-grid th.sort-descending > div:first-child::after):
1359         Invert colors of the arrow glyph.
1360
1361 2018-12-18  Devin Rousso  <drousso@apple.com>
1362
1363         Web Inspector: Layers: increase default column width for other localizations
1364         https://bugs.webkit.org/show_bug.cgi?id=192812
1365         <rdar://problem/46628625>
1366
1367         Reviewed by Brian Burg.
1368
1369         * UserInterface/Views/LayerDetailsSidebarPanel.js:
1370         (WI.LayerDetailsSidebarPanel.prototype._buildDataGrid):
1371         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
1372         (WI.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
1373
1374 2018-12-18  Joseph Pecoraro  <pecoraro@apple.com>
1375
1376         Web Inspector: m3u8 content not shown, it should be text
1377         https://bugs.webkit.org/show_bug.cgi?id=192731
1378         <rdar://problem/46747728>
1379
1380         Reviewed by Devin Rousso.
1381
1382         * UserInterface/Base/MIMETypeUtilities.js:
1383         (WI.shouldTreatMIMETypeAsText):
1384         Support m3u8/m3u files as text.
1385
1386 2018-12-17  Devin Rousso  <drousso@apple.com>
1387
1388         Web Inspector: Canvas: path view is misaligned
1389         https://bugs.webkit.org/show_bug.cgi?id=192761
1390
1391         Reviewed by Joseph Pecoraro.
1392
1393         * UserInterface/Views/RecordingContentView.css:
1394         (.content-view:not(.tab).recording :matches(img, canvas)):
1395         (.content-view:not(.tab).recording canvas.path):
1396
1397 2018-12-17  Devin Rousso  <drousso@apple.com>
1398
1399         Web Inspector: Audit: add plural result strings
1400         https://bugs.webkit.org/show_bug.cgi?id=192769
1401         <rdar://problem/46628680>
1402
1403         Reviewed by Brian Burg.
1404
1405         * UserInterface/Views/AuditTestContentView.js:
1406         (WI.AuditTestContentView.prototype.showNoResultDataPlaceholder):
1407
1408         * UserInterface/Views/AuditTestGroupContentView.js:
1409         (WI.AuditTestGroupContentView.prototype.layout):
1410
1411         * Localizations/en.lproj/localizedStrings.js:
1412
1413 2018-12-17  Devin Rousso  <drousso@apple.com>
1414
1415         Web Inspector: Settings: add singular "space" UIString
1416         https://bugs.webkit.org/show_bug.cgi?id=192766
1417         <rdar://problem/46776948>
1418
1419         Reviewed by Brian Burg.
1420
1421         * UserInterface/Views/SettingEditor.js:
1422         (WI.SettingEditor):
1423         (WI.SettingEditor.prototype.get label):
1424         (WI.SettingEditor.prototype.set label): Added.
1425
1426         * UserInterface/Views/SettingsTabContentView.js:
1427         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
1428         (WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting): Added.
1429         (WI.SettingsTabContentView.prototype._createGeneralSettingsView.addSpacesSetting.updateLabel): Added.
1430
1431         * Localizations/en.lproj/localizedStrings.js:
1432
1433 2018-12-15  Nikita Vasilyev  <nvasilyev@apple.com>
1434
1435         Web Inspector: Styles: toggling selected properties may cause data corruption
1436         https://bugs.webkit.org/show_bug.cgi?id=192396
1437         <rdar://problem/46478383>
1438
1439         Reviewed by Devin Rousso.
1440
1441         Uncommenting a property after a commented out property used to insert an unnecessary semicolon,
1442         and not updating ranges of the following properties.
1443
1444         For example:
1445
1446             /* color: red; */
1447             /* font-size: 12px */
1448
1449         Uncommenting `font-size` would result in something like this:
1450
1451             /* color: red; */; font-size: 12px
1452                              ^
1453                              unnecessary semicolon
1454
1455         Now the semicolon doesn't get inserted and the white space is preserved better:
1456
1457             /* color: red; */
1458             font-size: 12px
1459
1460         * UserInterface/Models/CSSProperty.js:
1461         (WI.CSSProperty.prototype._updateOwnerStyleText):
1462         (WI.CSSProperty.prototype._appendSemicolonIfNeeded): Removed.
1463         (WI.CSSProperty.prototype._prependSemicolonIfNeeded): Added.
1464
1465         * UserInterface/Views/SpreadsheetStyleProperty.js:
1466         (WI.SpreadsheetStyleProperty.prototype.remove):
1467         (WI.SpreadsheetStyleProperty.prototype.update):
1468         (WI.SpreadsheetStyleProperty.prototype._handleNameChange):
1469         (WI.SpreadsheetStyleProperty.prototype._handleValueChange):
1470         Style declaration should be locked while editing. Add asserts to ensure this.
1471
1472 2018-12-14  Matt Baker  <mattbaker@apple.com>
1473
1474         Web Inspector: REGRESSION(r238599): Uncaught Exception: TypeError: null is not an object (evaluating 'treeElement.listItemElement.classList')
1475         https://bugs.webkit.org/show_bug.cgi?id=192090
1476         <rdar://problem/46318614>
1477
1478         Reviewed by Devin Rousso.
1479
1480         * UserInterface/Views/TreeOutline.js:
1481         (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
1482         Check that `listItemElement` is valid before accessing it to update class
1483         names. The selection can change before the TreeElement has been attached.
1484
1485 2018-12-14  Matt Baker  <mattbaker@apple.com>
1486
1487         Web Inspector: Cookies view should use model objects instead of raw payload data
1488         https://bugs.webkit.org/show_bug.cgi?id=189533
1489         <rdar://problem/44364183>
1490
1491         Reviewed by Joseph Pecoraro and Devin Rousso.
1492
1493         * UserInterface/Models/Cookie.js:
1494         (WI.Cookie):
1495         (WI.Cookie.fromPayload):
1496         (WI.Cookie.parseSetCookieResponseHeader):
1497         (WI.Cookie.prototype.get type):
1498         (WI.Cookie.prototype.get name):
1499         (WI.Cookie.prototype.get value):
1500         (WI.Cookie.prototype.get header):
1501         (WI.Cookie.prototype.get expires):
1502         (WI.Cookie.prototype.get maxAge):
1503         (WI.Cookie.prototype.get path):
1504         (WI.Cookie.prototype.get domain):
1505         (WI.Cookie.prototype.get secure):
1506         (WI.Cookie.prototype.get httpOnly):
1507         (WI.Cookie.prototype.get sameSite):
1508         (WI.Cookie.prototype.get size):
1509         (WI.Cookie.prototype.get url):
1510         (WI.Cookie.prototype.expirationDate):
1511         Cleanup Cookie object; add pubic getters for data, `url` property,
1512         static `fromPayload` method, and calculate `_size` if missing.
1513
1514         * UserInterface/Views/CookieStorageContentView.js:
1515         (WI.CookieStorageContentView.prototype.tableDidRemoveRows):
1516         (WI.CookieStorageContentView.prototype._reloadCookies):
1517         Create Cookie objects from the payload instead of using raw payload data.
1518
1519 2018-12-13  Devin Rousso  <drousso@apple.com>
1520
1521         Web Inspector: remove DOM.BackendNodeId and associated commands/events
1522         https://bugs.webkit.org/show_bug.cgi?id=192478
1523
1524         Reviewed by Matt Baker.
1525
1526         * Versions/Inspector-iOS-8.0.json:
1527         * Versions/Inspector-iOS-9.0.json:
1528         * Versions/Inspector-iOS-9.3.json:
1529         * Versions/Inspector-iOS-10.0.json:
1530         * Versions/Inspector-iOS-10.3.json:
1531         * Versions/Inspector-iOS-11.0.json:
1532         * Versions/Inspector-iOS-11.3.json:
1533         * Versions/Inspector-iOS-12.0.json:
1534         * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
1535         * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
1536         * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
1537         * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
1538         * UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js:
1539         * UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js:
1540         * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
1541         * UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
1542
1543 2018-12-13  Devin Rousso  <drousso@apple.com>
1544
1545         Web Inspector: experimental settings reload button disappears after changing more than one setting
1546         https://bugs.webkit.org/show_bug.cgi?id=192645
1547         <rdar://problem/46626204>
1548
1549         Reviewed by Joseph Pecoraro.
1550
1551         * UserInterface/Views/SettingsTabContentView.js:
1552         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView.listenForChange):
1553         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
1554
1555 2018-12-13  Matt Baker  <mattbaker@apple.com>
1556
1557         Web Inspector: REGRESSION(r238602): Elements: deleting multiple DOM nodes doesn't select the nearest node after deletion
1558         https://bugs.webkit.org/show_bug.cgi?id=192116
1559         <rdar://problem/46344339>
1560
1561         Reviewed by Devin Rousso.
1562
1563         * UserInterface/Controllers/SelectionController.js:
1564         (WI.SelectionController.prototype.removeSelectedItems):
1565         Finding a new index to select should go through the delegate instead of
1566         naively advancing the index.
1567
1568         * UserInterface/Views/DOMTreeElement.js:
1569         (WI.DOMTreeElement.prototype._populateNodeContextMenu):
1570         (WI.DOMTreeElement.prototype.ondelete): Deleted.
1571         The menu item for removing the DOM node is now managed by the parent
1572         DOMTreeOutline, since its UI and behavior now depend on whether there
1573         are multiple elements selected.
1574
1575         * UserInterface/Views/DOMTreeOutline.js:
1576         (WI.DOMTreeOutline.prototype.populateContextMenu):
1577         (WI.DOMTreeOutline.prototype.ondelete.level):
1578         (WI.DOMTreeOutline.prototype.ondelete):
1579         Implement `ondelete` to remove selected DOM nodes using the delete and
1580         backspace keys. Also used by the DOMTreeOutline's context menu handler.
1581
1582 2018-12-13  Matt Baker  <mattbaker@apple.com>
1583
1584         Web Inspector: Table selection becomes corrupted when deleting selected cookies
1585         https://bugs.webkit.org/show_bug.cgi?id=192388
1586         <rdar://problem/46472364>
1587
1588         Reviewed by Devin Rousso.
1589
1590         * UserInterface/Controllers/SelectionController.js:
1591         (WI.SelectionController):
1592         (WI.SelectionController.prototype.didRemoveItems):
1593         (WI.SelectionController.prototype._updateSelectedItems):
1594         (WI.SelectionController.prototype.didRemoveItem): Deleted.
1595         Replace `didRemoveItem` with a method taking an IndexSet. Calling the
1596         single-index version while iterating over multiple rows in ascending
1597         order is unsafe, a detail best left to the SelectionController.
1598
1599         * UserInterface/Views/Table.js:
1600         (WI.Table.prototype.removeRow):
1601         (WI.Table.prototype._removeRows):
1602         Notify SelectionController of removed rows.
1603
1604         * UserInterface/Views/TreeOutline.js:
1605         (WI.TreeOutline.prototype.insertChild):
1606         (WI.TreeOutline.prototype.removeChildAtIndex):
1607         Remove the child from the element's `children` after calling `_forgetTreeElement`,
1608         which needs to calculate the child's index to pass to the SelectionController.
1609
1610         (WI.TreeOutline.prototype.removeChildren):
1611         Remove child items during iteration so that `children` doesn't contain
1612         detached TreeElements while calling `_forgetTreeElement`.
1613
1614         (WI.TreeOutline.prototype._rememberTreeElement):
1615         (WI.TreeOutline.prototype._forgetTreeElement):
1616
1617 2018-12-10  Matt Baker  <mattbaker@apple.com>
1618
1619         Web Inspector: REGRESSION (r238599): unable to select specific timeline
1620         https://bugs.webkit.org/show_bug.cgi?id=192443
1621         <rdar://problem/46608087>
1622
1623         Reviewed by Joseph Pecoraro.
1624
1625         When determining the trailing horizontal edge for TreeElement mouse
1626         events, TreeOutline should not assume that its containing DOM element
1627         is only as wide as its <ol> element.
1628
1629         * UserInterface/Views/TreeOutline.js:
1630         (WI.TreeOutline.prototype.treeElementFromEvent):
1631
1632 2018-12-10  Matt Baker  <mattbaker@apple.com>
1633
1634         Web Inspector: Move TreeOutlineGroup coordination out of TreeElement
1635         https://bugs.webkit.org/show_bug.cgi?id=192487
1636         <rdar://problem/46543431>
1637
1638         Reviewed by Devin Rousso.
1639
1640         * UserInterface/Views/TreeElement.js:
1641         (WI.TreeElement.prototype.select):
1642         (WI.TreeElement.prototype.deselect):
1643
1644         * UserInterface/Views/TreeOutlineGroup.js:
1645         (WI.TreeOutlineGroup):
1646         (WI.TreeOutlineGroup.prototype.itemAdded):
1647         (WI.TreeOutlineGroup.prototype.itemRemoved):
1648         (WI.TreeOutlineGroup.prototype._removeConflictingTreeSelections):
1649         (WI.TreeOutlineGroup.prototype._treeOutlineSelectionDidChange):
1650         (WI.TreeOutlineGroup.groupForTreeOutline): Deleted.
1651         (WI.TreeOutlineGroup.prototype.didSelectTreeElement): Deleted.
1652         make the group responsible for listening to selection changes from the
1653         TreeOutlines it manages, and synchronizing the selection between them.
1654
1655 2018-12-10  Dean Jackson  <dino@apple.com>
1656
1657         Use text/javascript as recommended by the HTML specification
1658         https://bugs.webkit.org/show_bug.cgi?id=192525
1659         <rdar://problem/46569636>
1660
1661         Reviewed by Jon Lee.
1662
1663         The HTML specification says we should use text/javascript for
1664         JavaScript files:
1665         https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type
1666
1667         * UserInterface/Base/MIMETypeUtilities.js:
1668         (WI.mimeTypeForFileExtension):
1669         * UserInterface/Views/TextEditor.js:
1670         (WI.TextEditor.prototype._attemptToDetermineMIMEType):
1671
1672 2018-12-06  Matt Baker  <mattbaker@apple.com>
1673
1674         Web Inspector: REGRESSION(r238602): Elements: collapsing a DOM node with the left arrow doesn't work
1675         https://bugs.webkit.org/show_bug.cgi?id=192353
1676         <rdar://problem/46455019>
1677
1678         Reviewed by Devin Rousso.
1679
1680         * UserInterface/Views/TreeElement.js:
1681         (WI.TreeElement.prototype.deselect):
1682         Don't early return when the element is not the selected tree element.
1683         This condition no longer holds now that TreeOutline supports multiple selection.
1684
1685 2018-12-05  Matt Baker  <mattbaker@apple.com>
1686
1687         Web Inspector: SelectionController should not extend the selection when allowsMultipleSelection is false
1688         https://bugs.webkit.org/show_bug.cgi?id=192390
1689         <rdar://problem/46473624>
1690
1691         Reviewed by Devin Rousso.
1692
1693         * UserInterface/Controllers/SelectionController.js:
1694         (WI.SelectionController.prototype.selectItem):
1695
1696 2018-12-04  Nikita Vasilyev  <nvasilyev@apple.com>
1697
1698         Web Inspector: Add style editing debug mode
1699         https://bugs.webkit.org/show_bug.cgi?id=192282
1700         <rdar://problem/46399176>
1701
1702         Reviewed by Matt Baker.
1703
1704         Introduce a style editing debug mode to help to troubleshoot complex bugs in the style editor.
1705
1706           - Log CSS changes;
1707           - Display red border for locked style declarations.
1708
1709         * UserInterface/Base/Setting.js:
1710         * UserInterface/Models/CSSProperty.js:
1711         (WI.CSSProperty.prototype._updateOwnerStyleText):
1712         * UserInterface/Views/SettingsTabContentView.js:
1713         (WI.SettingsTabContentView.prototype._createDebugSettingsView):
1714         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
1715         (.spreadsheet-style-declaration-editor.debug-style-locked::after):
1716         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
1717         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
1718         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._updateStyleLock):
1719         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._updateDebugLockStatus):
1720
1721 2018-12-04  Matt Baker  <mattbaker@apple.com>
1722
1723         Web Inspector: REGRESSION(r238602): Elements: changing selection no longer highlights the selected node
1724         https://bugs.webkit.org/show_bug.cgi?id=192354
1725         <rdar://problem/46444438>
1726
1727         Reviewed by Joseph Pecoraro.
1728
1729         * UserInterface/Views/TreeOutline.js:
1730         (WI.TreeOutline.prototype._treeKeyDown):
1731         (WI.TreeOutline.prototype._handleMouseDown):
1732
1733 2018-12-04  Joseph Pecoraro  <pecoraro@apple.com>
1734
1735         Web Inspector: REGRESSION(r238330): Timeline auto-capture does not work after page transition
1736         https://bugs.webkit.org/show_bug.cgi?id=192248
1737         <rdar://problem/46390199>
1738
1739         Reviewed by Devin Rousso.
1740
1741         * UserInterface/Base/Main.js:
1742         (WI.transitionPageTarget):
1743         Let the TimelineManager perform work on page transitions.
1744
1745         * UserInterface/Controllers/TimelineManager.js:
1746         (WI.TimelineManager.prototype.initializeTarget):
1747         Initialize the autocapture state of the target.
1748
1749         (WI.TimelineManager.prototype.transitionPageTarget):
1750         When transitioning pages perform a legacy (frontend based) timeline capture.
1751
1752 2018-12-04  Matt Baker  <mattbaker@apple.com>
1753
1754         Web Inspector: Elements: $0 is shown for all selected elements
1755         https://bugs.webkit.org/show_bug.cgi?id=192119
1756         <rdar://problem/46327554>
1757
1758         Reviewed by Devin Rousso.
1759
1760         * UserInterface/Views/ContentBrowserTabContentView.js:
1761         (WI.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObject):
1762         * UserInterface/Views/DOMTreeContentView.js:
1763         (WI.DOMTreeContentView):
1764         (WI.DOMTreeContentView.prototype.layout):
1765         (WI.DOMTreeContentView.prototype._domTreeSelectionDidChange):
1766         Update the selected DOM node using the TreeOutline's selection change
1767         event, instead of in `onselect`, which wasn't always called.
1768
1769         * UserInterface/Views/DOMTreeElement.js:
1770         (WI.DOMTreeElement.prototype.onselect): Deleted.
1771         (WI.DOMTreeElement.prototype.ondeselect): Deleted.
1772         Eliminate `onselect` and `ondeselect`. TreeOutline clients should use
1773         the TreeOutline.Event.SelectedDidChange event instead.
1774
1775         * UserInterface/Views/DOMTreeOutline.css:
1776         (.tree-outline.dom li.last-selected > span::after):
1777         (.tree-outline.dom:focus li.last-selected > span::after):
1778         (.tree-outline.dom li.selected > span::after): Deleted.
1779         (.tree-outline.dom:focus li.selected > span::after): Deleted.
1780         * UserInterface/Views/DOMTreeOutline.js:
1781         (WI.DOMTreeOutline.prototype.updateSelection): Deleted.
1782
1783         * UserInterface/Views/DebuggerSidebarPanel.js:
1784         (WI.DebuggerSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):
1785         * UserInterface/Views/FolderizedTreeElement.js:
1786         (WI.FolderizedTreeElement.prototype._addTreeElement):
1787         * UserInterface/Views/NavigationSidebarPanel.js:
1788         (WI.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
1789         (WI.NavigationSidebarPanel.prototype._treeElementWasFiltered):
1790         (WI.NavigationSidebarPanel):
1791         * UserInterface/Views/OpenResourceDialog.js:
1792         (WI.OpenResourceDialog.prototype._populateResourceTreeOutline):
1793         (WI.OpenResourceDialog.prototype._handleKeydownEvent):
1794         * UserInterface/Views/SourceCodeTreeElement.js:
1795         (WI.SourceCodeTreeElement.prototype.descendantResourceTreeElementTypeDidChange):
1796         * UserInterface/Views/TreeElement.js:
1797         (WI.TreeElement.prototype.select):
1798         (WI.TreeElement.prototype.revealAndSelect):
1799         (WI.TreeElement.prototype.deselect):
1800         Remove `suppressOnDeselect` and rename `suppressOnSelect` to `suppressNotification`.
1801         Now that `ondeselect` has been removed `suppressOnDeselect` is no longer
1802         meaningful, as TreeOutline generates a single `SelectedDidChange` event
1803         when the selected item changes. In the case of `revealAndSelect`, both
1804         arguments had the same value.
1805
1806         * UserInterface/Views/TreeOutline.js:
1807         (WI.TreeOutline):
1808         (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
1809         Add a unique class name to the last selected TreeElement to distinguish
1810         it from other selected elements.
1811
1812 2018-12-04  Matt Baker  <mattbaker@apple.com>
1813
1814         Web Inspector: Elements: ⌘-A should select all visible nodes
1815         https://bugs.webkit.org/show_bug.cgi?id=192120
1816         <rdar://problem/46344435>
1817
1818         Reviewed by Devin Rousso.
1819
1820         * UserInterface/Views/TreeOutline.js:
1821         (WI.TreeOutline.prototype._treeKeyDown):
1822         Remove an early return, allowing `WI.SelectionController` to handle ⌘-A
1823         and select all items.
1824
1825 2018-12-04  Devin Rousso  <drousso@apple.com>
1826
1827         Web Inspector: Audit: tests should support async operations
1828         https://bugs.webkit.org/show_bug.cgi?id=192171
1829         <rdar://problem/46423562>
1830
1831         Reviewed by Joseph Pecoraro.
1832
1833         * UserInterface/Controllers/RuntimeManager.js:
1834         (WI.RuntimeManager.supportsAwaitPromise): Added.
1835
1836         * UserInterface/Models/AuditTestCase.js:
1837         (WI.AuditTestCase.prototype.async run.async parseResponse.checkResultProperty.addErrorForValueType): Deleted.
1838         (WI.AuditTestCase.prototype.async run.async parseResponse.checkResultProperty): Deleted.
1839         (WI.AuditTestCase.prototype.async run.async parseResponse.async resultArrayForEach): Deleted.
1840         (WI.AuditTestCase.prototype.async run.async parseResponse): Added.
1841         (WI.AuditTestCase.prototype.async run):
1842         (WI.AuditTestCase.prototype.async run.checkResultProperty.addErrorForValueType): Deleted.
1843         (WI.AuditTestCase.prototype.async run.checkResultProperty): Deleted.
1844         (WI.AuditTestCase.prototype.async run.async resultArrayForEach): Deleted.
1845
1846         * UserInterface/Models/AuditTestCaseResult.js:
1847         (WI.AuditTestCaseResult.async fromPayload):
1848         (WI.AuditTestCaseResult.prototype.toJSON):
1849
1850         * UserInterface/Views/AuditTestCaseContentView.js:
1851         (WI.AuditTestCaseContentView.prototype.layout):
1852
1853 2018-12-03  Devin Rousso  <drousso@apple.com>
1854
1855         Web Inspector: Audit: save the expanded state of test groups
1856         https://bugs.webkit.org/show_bug.cgi?id=192346
1857         <rdar://problem/46440704>
1858
1859         Reviewed by Matt Baker.
1860
1861         * UserInterface/Views/AuditTreeElement.js:
1862         (WI.AuditTreeElement):
1863         (WI.AuditTreeElement.prototype.onattach):
1864         (WI.AuditTreeElement.prototype.onexpand): Added.
1865         (WI.AuditTreeElement.prototype.oncollapse): Added.
1866
1867 2018-12-03  Devin Rousso  <drousso@apple.com>
1868
1869         Web Inspector: Audit: sidebar briefly shows "No Filter Results" before populating default audits
1870         https://bugs.webkit.org/show_bug.cgi?id=192341
1871         <rdar://problem/46436550>
1872
1873         Reviewed by Matt Baker.
1874
1875         * UserInterface/Views/AuditNavigationSidebarPanel.js:
1876         (WI.AuditNavigationSidebarPanel.prototype.initialLayout):
1877         (WI.AuditNavigationSidebarPanel.prototype._addTest):
1878         (WI.AuditNavigationSidebarPanel.prototype._addResult):
1879         (WI.AuditNavigationSidebarPanel.prototype.applyFiltersToTreeElement): Deleted.
1880         Delay the construction of the "Results" folder until it's needed, since adding a hidden
1881         `WI.TreeElement` will cause the placeholder to appear.
1882
1883 2018-12-03  Devin Rousso  <drousso@apple.com>
1884
1885         Web Inspector: Audit: navigating while tests are running should stop and clear all results
1886         https://bugs.webkit.org/show_bug.cgi?id=192317
1887         <rdar://problem/46435222>
1888
1889         Reviewed by Joseph Pecoraro.
1890
1891         * UserInterface/Controllers/AuditManager.js:
1892         (WI.AuditManager.prototype.async start):
1893         (WI.AuditManager.prototype._handleFrameMainResourceDidChange):
1894
1895         * UserInterface/Views/AuditNavigationSidebarPanel.js:
1896         (WI.AuditNavigationSidebarPanel.prototype.initialLayout):
1897         Drive-by: pass the index of the saved result.
1898
1899 2018-12-03  Devin Rousso  <drousso@apple.com>
1900
1901         Web Inspector: Audit: "Add Default Audits" shown when there are no filter results
1902         https://bugs.webkit.org/show_bug.cgi?id=192105
1903
1904         Reviewed by Matt Baker.
1905
1906         * UserInterface/Views/NavigationSidebarPanel.js:
1907         (WI.NavigationSidebarPanel):
1908         (WI.NavigationSidebarPanel.prototype.get hasActiveFilters): Added.
1909         (WI.NavigationSidebarPanel.prototype.suppressFilteringOnTreeElements):
1910         (WI.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder):
1911         (WI.NavigationSidebarPanel.prototype.hideEmptyContentPlaceholder):
1912         (WI.NavigationSidebarPanel.prototype.updateEmptyContentPlaceholder):
1913         (WI.NavigationSidebarPanel.prototype.updateFilter):
1914         (WI.NavigationSidebarPanel.prototype._checkForEmptyFilterResults.checkTreeOutlineForEmptyFilterResults):
1915         (WI.NavigationSidebarPanel.prototype._filterDidChange):
1916         (WI.NavigationSidebarPanel.prototype._updateFilter): Deleted.
1917         (WI.NavigationSidebarPanel.prototype._createEmptyContentPlaceholderIfNeeded): Deleted.
1918
1919         * UserInterface/Views/AuditNavigationSidebarPanel.js:
1920         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
1921         Drive-by: change capitalization for consistency with other navigation sidebars.
1922
1923         * Localizations/en.lproj/localizedStrings.js:
1924
1925 2018-12-03  Devin Rousso  <drousso@apple.com>
1926
1927         Web Inspector: Canvas: add singular localized string for "Record first %s frames"
1928         https://bugs.webkit.org/show_bug.cgi?id=192189
1929
1930         Reviewed by Joseph Pecoraro.
1931
1932         * UserInterface/Views/CanvasOverviewContentView.js:
1933         (WI.CanvasOverviewContentView):
1934         (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount):
1935         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel): Added.
1936         (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput):
1937         (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged):
1938         (WI.CanvasOverviewContentView.prototype.initialLayout): Deleted.
1939         Drive-by: update the auto-capture navigation item when the view is first created so there is
1940         no flashing of in the navigation bar (before `initialLayout` is called).
1941
1942         * UserInterface/Views/CheckboxNavigationItem.js:
1943         (WI.CheckboxNavigationItem):
1944         (WI.CheckboxNavigationItem.prototype.set label): Added.
1945
1946         * Localizations/en.lproj/localizedStrings.js:
1947
1948 2018-12-03  Matt Baker  <mattbaker@apple.com>
1949
1950         Web Inspector: REGRESSION(r238599): Multiple Selection: restoring selection when opening WebInspector puts the TreeElement into a permanent selected state
1951         https://bugs.webkit.org/show_bug.cgi?id=192091
1952         <rdar://problem/46321795>
1953
1954         Reviewed by Devin Rousso.
1955
1956         * UserInterface/Controllers/SelectionController.js:
1957         (WI.SelectionController.prototype.didInsertItem):
1958         Fix a bug where selected indexes were overwritten by the inserted index.
1959
1960         * UserInterface/Views/TreeOutline.js:
1961         (WI.TreeOutline):
1962         (WI.TreeOutline.prototype.insertChild):
1963         Update the SelectionController with the newly inserted index before
1964         attaching the TreeElement. Attaching the TreeElement can cause it to
1965         become selected, which would add the index to the SelectionController,
1966         only to have it immediately incremented by the call to `didInsertItem`.
1967         Additionally, change `insertionIndex` to be the index of the inserted
1968         item instead of the inserted item's previous sibling.
1969
1970         (WI.TreeOutline.prototype._rememberTreeElement):
1971         (WI.TreeOutline.prototype._forgetTreeElement):
1972         (WI.TreeOutline.prototype._indexOfTreeElement.previousElement): Deleted.
1973         Eliminate TreeElement index caching, which could become stale and cause
1974         the wrong index to be calculated. Additionally, instead of walking up the
1975         parent chain to determine the index, start at the root and use existing
1976         method `traverseNextTreeElement`.
1977
1978 2018-12-03  Devin Rousso  <drousso@apple.com>
1979
1980         Web Inspector: Audit: test tree elements should start out collapsed
1981         https://bugs.webkit.org/show_bug.cgi?id=192107
1982
1983         Reviewed by Matt Baker.
1984
1985         * UserInterface/Views/AuditTreeElement.js:
1986         (WI.AuditTreeElement.prototype.onattach):
1987
1988 2018-12-03  Nikita Vasilyev  <nvasilyev@apple.com>
1989
1990         Web Inspector: Styles: can't select properties of read-only rules
1991         https://bugs.webkit.org/show_bug.cgi?id=192266
1992
1993         Reviewed by Devin Rousso.
1994
1995         Implement multiple properties selection for read-only rules (such as User Agent Stylesheets)
1996         in the Styles panel.
1997
1998         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
1999         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
2000         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
2001         Keep selection on layout.
2002
2003         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingFirstProperty):
2004         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingLastProperty):
2005         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyBlur):
2006         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseEnter):
2007         SpreadsheetCSSStyleDeclarationEditor is used by ComputedStyleDetailsPanel, which doesn't have:
2008           - spreadsheetCSSStyleDeclarationEditorPropertyBlur
2009           - spreadsheetCSSStyleDeclarationEditorPropertyMouseEnter
2010
2011         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyFocusMoved):
2012         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
2013         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2014         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
2015         * UserInterface/Views/SpreadsheetStyleProperty.js:
2016         (WI.SpreadsheetStyleProperty.prototype.startEditingName):
2017         (WI.SpreadsheetStyleProperty.prototype.startEditingValue):
2018
2019 2018-11-30  Brian Burg  <bburg@apple.com>
2020
2021         Web Inspector: resource combining should be more robust against missing WebKitAdditions
2022         https://bugs.webkit.org/show_bug.cgi?id=192255
2023         <rdar://problem/46042879>
2024
2025         Reviewed by Joseph Pecoraro.
2026
2027         * Scripts/copy-user-interface-resources.pl:
2028         (combineOrStripResourcesForWebKitAdditions):
2029
2030 2018-11-30  Nikita Vasilyev  <nvasilyev@apple.com>
2031
2032         Web Inspector: Jumping from Computed to Styles should select property
2033         https://bugs.webkit.org/show_bug.cgi?id=192198
2034
2035         Reviewed by Devin Rousso.
2036
2037         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
2038         (.spreadsheet-style-declaration-editor .property.highlighted): Deleted.
2039         (@keyframes style-property-highlight): Deleted.
2040         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
2041         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty):
2042         Remove unnecessary `__propertyView` property.
2043
2044         * UserInterface/Views/SpreadsheetStyleProperty.js:
2045         (WI.SpreadsheetStyleProperty.prototype.detached):
2046         (WI.SpreadsheetStyleProperty.prototype.highlight): Deleted.
2047
2048 2018-11-30  Matt Baker  <mattbaker@apple.com>
2049
2050         Web Inspector: REGRESSION(r238599): Multiple Selection: selecting a breakpoint will change the selection to it's parent on the first click
2051         https://bugs.webkit.org/show_bug.cgi?id=192093
2052         <rdar://problem/46318466>
2053
2054         Reviewed by Devin Rousso.
2055
2056         * UserInterface/Views/TreeElement.js:
2057         (WI.TreeElement.prototype.select):
2058         TreeElement shouldn't manage the TreeOutline's selection barrier.
2059
2060         * UserInterface/Views/TreeOutline.js:
2061         (WI.TreeOutline):
2062         (WI.TreeOutline.prototype.get processingSelectionChange):
2063         (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
2064         (WI.TreeOutline.prototype.selectTreeElementInternal):
2065         The selection re-entry barrier `processingSelectionChange` should be
2066         managed internally by TreeOutline, and exposed as a read-only property.
2067         Fix a bug where the barrier was cleared before dispatching the change
2068         notification, which can cause re-entry as a side effect.
2069
2070 2018-11-30  Devin Rousso  <drousso@apple.com>
2071
2072         Web Inspector: Settings: reload button needs horizontal spacing
2073         https://bugs.webkit.org/show_bug.cgi?id=192231
2074         <rdar://problem/46274363>
2075
2076         Reviewed by Matt Baker.
2077
2078         * UserInterface/Views/SettingsTabContentView.css:
2079         (.content-view.settings > .settings-view > .container button):
2080         (.content-view.settings > .settings-view > .container > .title):
2081         (.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]):
2082         (body[dir=ltr] .content-view.settings > .settings-view > .container > .title): Deleted.
2083         (body[dir=rtl] .content-view.settings > .settings-view > .container > .title): Deleted.
2084         (body[dir=ltr] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]): Deleted.
2085         (body[dir=rtl] .content-view.settings > .settings-view > .container > .editor-group > .editor input[type="checkbox"]): Deleted.
2086         Drive-by: replace `dir=*` attribute rules with `-webkit-margin-*` properties.
2087
2088 2018-11-30  Joseph Pecoraro  <pecoraro@apple.com>
2089
2090         Web Inspector: Uncaught Exception opening Web Inspector to Debugger Tab
2091         https://bugs.webkit.org/show_bug.cgi?id=192174
2092
2093         Reviewed by Devin Rousso.
2094
2095         * UserInterface/Protocol/InspectorBackend.js:
2096         (InspectorBackendClass.prototype.runAfterPendingDispatches):
2097         Dispatch the callback with a timeout if there is no backend target yet
2098         so it doesn't get lost.
2099
2100         * UserInterface/Protocol/Connection.js:
2101         (InspectorBackend.Connection.prototype.runAfterPendingDispatches):
2102         Change the ambiguous name "script" to the more familiar "callback".
2103
2104 2018-11-30  Devin Rousso  <drousso@apple.com>
2105
2106         Web Inspector: replace all unicode characters with the escaped character code
2107         https://bugs.webkit.org/show_bug.cgi?id=192216
2108         <rdar://problem/46275637>
2109
2110         Reviewed by Brian Burg.
2111
2112         * Localizations/en.lproj/localizedStrings.js:
2113         * UserInterface/Controllers/BreakpointPopoverController.js:
2114         * UserInterface/Debug/UncaughtExceptionReporter.js:
2115         * UserInterface/Models/AuditTestCase.js:
2116         * UserInterface/Models/Canvas.js:
2117         * UserInterface/Models/RecordingAction.js:
2118         * UserInterface/Models/ScriptTimelineRecord.js:
2119         * UserInterface/Views/AuditTestCaseContentView.js:
2120         * UserInterface/Views/AuditTestContentView.js:
2121         * UserInterface/Views/AuditTestGroupContentView.js:
2122         * UserInterface/Views/CallFrameView.js:
2123         * UserInterface/Views/CanvasContentView.js:
2124         * UserInterface/Views/CanvasOverviewContentView.css:
2125         * UserInterface/Views/ConsoleMessageView.css:
2126         * UserInterface/Views/ContextMenuUtilities.js:
2127         * UserInterface/Views/DOMEventsBreakdownView.js:
2128         * UserInterface/Views/DataGrid.css:
2129         * UserInterface/Views/DataGrid.js:
2130         * UserInterface/Views/DatabaseTableContentView.js:
2131         * UserInterface/Views/DebuggerDashboardView.css:
2132         * UserInterface/Views/DebuggerSidebarPanel.js:
2133         * UserInterface/Views/ErrorObjectView.js:
2134         * UserInterface/Views/EventBreakpointPopover.js:
2135         * UserInterface/Views/InlineSwatch.js:
2136         * UserInterface/Views/LayerTreeDataGridNode.js:
2137         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
2138         * UserInterface/Views/Layers3DContentView.js:
2139         * UserInterface/Views/LayoutTimelineDataGridNode.js:
2140         * UserInterface/Views/NetworkTableContentView.css:
2141         * UserInterface/Views/NetworkTableContentView.js:
2142         * UserInterface/Views/ObjectPreviewView.js:
2143         * UserInterface/Views/ProfileDataGridNode.js:
2144         * UserInterface/Views/ResourceTimelineDataGridNode.js:
2145         * UserInterface/Views/ScriptDetailsTimelineView.css:
2146         * UserInterface/Views/TextEditor.css:
2147         * UserInterface/Views/TreeOutline.css:
2148
2149 2018-11-29  Matt Baker  <mattbaker@apple.com>
2150
2151         Web Inspector: RTL: disclosure triangles should be flipped and aligned right
2152         https://bugs.webkit.org/show_bug.cgi?id=192089
2153         <rdar://problem/46316753>
2154
2155         Reviewed by Devin Rousso.
2156
2157         * UserInterface/Views/ComputedStyleSection.css:
2158         (.computed-style-section .computed-property-item .disclosure-button):
2159         (body[dir=rtl] .computed-style-section .computed-property-item .disclosure-button):
2160
2161         * UserInterface/Views/ConsoleMessageView.css:
2162         (.console-message.expandable .console-top-level-message::before):
2163         (body[dir=rtl] .console-message.expandable .console-top-level-message::before):
2164
2165         * UserInterface/Views/ErrorObjectView.css:
2166         (.error-object > .formatted-error::before):
2167         (body[dir=rtl] .error-object > .formatted-error::before):
2168         (.error-object .content):
2169
2170         * UserInterface/Views/LogContentView.css:
2171         (.console-group-title::before):
2172         (body[dir=ltr] .console-group-title::before):
2173         (body[dir=rtl] .console-group-title::before):
2174
2175         * UserInterface/Views/ObjectTreeView.css:
2176         (body[dir=rtl] .object-tree > :matches(.title, .object-preview)::before):
2177
2178         * UserInterface/Views/TypeTreeElement.css:
2179         (body[dir=rtl] .item.type-tree-element.parent > .disclosure-button):
2180
2181 2018-11-28  Dean Jackson  <dino@apple.com>
2182
2183         [ES Modules] Allow .mjs content when loaded from file://
2184         https://bugs.webkit.org/show_bug.cgi?id=192100
2185         <rdar://problem/46320065>
2186
2187         Reviewed by Sam Weinig.
2188
2189         Add a mapping from .mjs to application/javascript.
2190
2191         * UserInterface/Base/MIMETypeUtilities.js:
2192         (WI.mimeTypeForFileExtension):
2193
2194 2018-11-29  Matt Baker  <mattbaker@apple.com>
2195
2196         Web Inspector: Elements: selecting more than one DOM node causes the scope highlight to contrast
2197         https://bugs.webkit.org/show_bug.cgi?id=192118
2198         <rdar://problem/46325664>
2199
2200         Reviewed by Devin Rousso.
2201
2202         Use an alpha blended border for the "selected" DOM scope highlight,
2203         matching the "hovered" scope highlight.
2204
2205         * UserInterface/Views/DOMTreeOutline.css:
2206         (.tree-outline.dom li.selected + ol.children.expanded):
2207
2208 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
2209
2210         Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash
2211         https://bugs.webkit.org/show_bug.cgi?id=192016
2212         <rdar://problem/46284417>
2213
2214         Reviewed by Devin Rousso.
2215
2216         * UserInterface/Base/Main.js:
2217         (WI.loaded):
2218         (WI.initializeBackendTarget):
2219         (WI.contentLoaded):
2220         (WI.whenTargetsAvailable):
2221         Don't evaluate any InspectorFrontendAPI commands until the frontend
2222         has initialized a main target and the user interface.
2223
2224 2018-11-28  Nikita Vasilyev  <nvasilyev@apple.com>
2225
2226         Web Inspector: Styles: enable selection of multiple properties by default
2227         https://bugs.webkit.org/show_bug.cgi?id=192109
2228         <rdar://problem/46323565>
2229
2230         Reviewed by Devin Rousso.
2231
2232         * UserInterface/Base/Setting.js:
2233         * UserInterface/Views/SettingsTabContentView.js:
2234         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2235         Remove the checkbox.
2236
2237         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
2238         (.spreadsheet-style-declaration-editor .property):
2239         (.spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)):
2240         (.spreadsheet-style-declaration-editor .property.selected):
2241         (.spreadsheet-style-declaration-editor .property.selected:focus):
2242         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property): Deleted.
2243         (.multiple-properties-selection .spreadsheet-style-declaration-editor :matches(.name, .value):not(.editing)): Deleted.
2244         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected): Deleted.
2245         (.multiple-properties-selection .spreadsheet-style-declaration-editor .property.selected:focus): Deleted.
2246         Remove `.multiple-properties-selection` class.
2247
2248         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
2249         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
2250         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2251         (WI.SpreadsheetCSSStyleDeclarationSection):
2252         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
2253         * UserInterface/Views/SpreadsheetStyleProperty.js:
2254         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
2255         * UserInterface/Views/SpreadsheetTextField.js:
2256         (WI.SpreadsheetTextField):
2257         (WI.SpreadsheetTextField.prototype._handleFocus): Deleted.
2258
2259 2018-11-28  Devin Rousso  <drousso@apple.com>
2260
2261         Web Inspector: Audit: empty results folder is shown after clearing filters
2262         https://bugs.webkit.org/show_bug.cgi?id=192106
2263
2264         Reviewed by Matt Baker.
2265
2266         * UserInterface/Views/AuditNavigationSidebarPanel.js:
2267         (WI.AuditNavigationSidebarPanel.prototype.applyFiltersToTreeElement): Added.
2268
2269 2018-11-28  Matt Baker  <mattbaker@apple.com>
2270
2271         Web Inspector: Remove unused DataGrid and TreeOutline code
2272         https://bugs.webkit.org/show_bug.cgi?id=191622
2273         <rdar://problem/46052014>
2274
2275         Reviewed by Devin Rousso.
2276
2277         * UserInterface/Views/CanvasDetailsSidebarPanel.js:
2278         (WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
2279
2280         * UserInterface/Views/DOMTreeElement.js:
2281         (WI.DOMTreeElement.prototype.insertChildElement):
2282
2283         * UserInterface/Views/DOMTreeOutline.js:
2284         (WI.DOMTreeOutline):
2285         (WI.DOMTreeOutline.prototype.update):
2286
2287         * UserInterface/Views/DataGrid.js:
2288         (WI.DataGrid.prototype.removeChildrenRecursive): Deleted.
2289
2290         * UserInterface/Views/DataGridNode.js:
2291         (WI.DataGridNode.prototype.removeChildren):
2292         (WI.DataGridNode.prototype.removeChildrenRecursive): Deleted.
2293
2294         * UserInterface/Views/ErrorObjectView.css:
2295         (.error-object:not(.expanded) .content):
2296         (.error-object .content):
2297         (.error-object:not(.expanded) .tree-outline): Deleted.
2298         (.error-object .tree-outline): Deleted.
2299
2300         * UserInterface/Views/ErrorObjectView.js:
2301         (WI.ErrorObjectView):
2302         (WI.ErrorObjectView.prototype.get treeOutline): Deleted.
2303         Use a simple container since TreeOutline features aren't used,
2304         and remove unused property `treeOutline`.
2305
2306         * UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
2307         (WI.RecordingTraceDetailsSidebarPanel):
2308
2309         * UserInterface/Views/TreeElement.js:
2310         (WI.TreeElement.prototype.removeChildren):
2311         (WI.TreeElement.prototype.removeChildrenRecursive): Deleted.
2312
2313         * UserInterface/Views/TreeOutline.js:
2314         (WI.TreeOutline):
2315         (WI.TreeOutline.prototype.removeChildrenRecursive): Deleted.
2316         (WI.TreeOutline.prototype.reattachIfIndexChanged): Deleted.
2317         Removed `element` parameter now that the only use case has been removed.
2318
2319 2018-11-27  Matt Baker  <mattbaker@apple.com>
2320
2321         Web Inspector: Elements tab should allow selecting/deleting multiple DOM nodes
2322         https://bugs.webkit.org/show_bug.cgi?id=192059
2323         <rdar://problem/46294827>
2324
2325         Reviewed by Devin Rousso.
2326
2327         Enable multiple DOM node selection in the DOMTreeContentView.
2328
2329         * UserInterface/Controllers/SelectionController.js:
2330         (WI.SelectionController):
2331         (WI.SelectionController.prototype.get allowsEmptySelection):
2332         (WI.SelectionController.prototype.set allowsEmptySelection):
2333         Allow clients to control whether the last selected item can be deselected.
2334         (WI.SelectionController.prototype.deselectItem):
2335         (WI.SelectionController.prototype.didInsertItem):
2336         Rewritten to prevent infinite loop.
2337         (WI.SelectionController.prototype.didRemoveItem):
2338         (WI.SelectionController.prototype._updateSelectedItems):
2339         (WI.SelectionController.prototype._adjustIndexesAfter): Deleted.
2340
2341         * UserInterface/Views/DOMTreeContentView.js:
2342         (WI.DOMTreeContentView):
2343
2344         * UserInterface/Views/DOMTreeElement.js:
2345         (WI.DOMTreeElement.prototype.updateSelectionArea):
2346         * UserInterface/Views/DOMTreeOutline.js:
2347         (WI.DOMTreeOutline.prototype.updateSelection):
2348         Updating the selection area DOM element should not assume that only one
2349         TreeElement is selected at a time.
2350
2351         * UserInterface/Views/TreeOutline.js:
2352         (WI.TreeOutline.prototype.get allowsEmptySelection):
2353         (WI.TreeOutline.prototype.set allowsEmptySelection):
2354         (WI.TreeOutline.prototype.set selectedTreeElement):
2355         (WI.TreeOutline.prototype.get selectedTreeElements):
2356         (WI.TreeOutline.prototype._treeKeyDown):
2357
2358         * UserInterface/Views/TreeOutlineGroup.js:
2359         (WI.TreeOutlineGroup):
2360         (WI.TreeOutlineGroup.prototype._removeConflictingTreeSelections):
2361         Eliminate use of `TreeElement.prototype.deselect`.
2362
2363 2018-11-27  Matt Baker  <mattbaker@apple.com>
2364
2365         Web Inspector: TreeOutline should re-use multiple-selection logic from Table
2366         https://bugs.webkit.org/show_bug.cgi?id=191483
2367         <rdar://problem/45953305>
2368
2369         Reviewed by Devin Rousso.
2370
2371         Update TreeOutline to use SelectionController. Adopting SelectionController
2372         in TreeOutline is not as straightforward as it was in Table. Selected items
2373         are tracked by index, and TreeElement lacks an explicit index. As a consequence
2374         TreeElement indexes are calcualted as needed and cached. The cache is cleared
2375         whenever an element is added or removed.
2376
2377         * UserInterface/Controllers/SelectionController.js:
2378         (WI.SelectionController.prototype.didInsertItem):
2379         (WI.SelectionController.prototype.didRemoveItem):
2380         (WI.SelectionController.prototype.handleKeyDown):
2381         Drive-by syntax error fix.
2382         (WI.SelectionController.prototype._adjustIndexesAfter):
2383         (WI.SelectionController):
2384
2385         * UserInterface/Views/DOMTreeElement.js:
2386         (WI.DOMTreeElement.prototype.canSelectOnMouseDown):
2387         (WI.DOMTreeElement.prototype.selectOnMouseDown): Deleted.
2388
2389         * UserInterface/Views/DOMTreeOutline.js:
2390         (WI.DOMTreeOutline.prototype._onmousedown):
2391         Item selection is now handled by SelectionController.
2392
2393         * UserInterface/Views/ShaderProgramTreeElement.js:
2394         (WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
2395         (WI.ShaderProgramTreeElement.prototype.selectOnMouseDown): Deleted.
2396
2397         * UserInterface/Views/TreeElement.js:
2398         (WI.TreeElement.prototype.canSelectOnMouseDown):
2399         (WI.TreeElement.prototype._attach):
2400         (WI.TreeElement.prototype.select):
2401         (WI.TreeElement.prototype.deselect):
2402         Route item selection through the parent TreeOutline, in order to go though
2403         the TreeOutline's SelectionController.
2404
2405         (WI.TreeElement.treeElementMouseDown): Deleted.
2406         Moved handler to TreeOutline, which owns the SelectionController that
2407         needs to respond to mouse events.
2408
2409         * UserInterface/Views/TreeOutline.js:
2410         (WI.TreeOutline):
2411         (WI.TreeOutline.prototype.get allowsMultipleSelection):
2412         (WI.TreeOutline.prototype.set allowsMultipleSelection):
2413         (WI.TreeOutline.prototype.get selectedTreeElement):
2414         (WI.TreeOutline.prototype.set selectedTreeElement):
2415         (WI.TreeOutline.prototype.insertChild):
2416         (WI.TreeOutline.prototype.removeChildAtIndex):
2417         (WI.TreeOutline.prototype._rememberTreeElement):
2418         (WI.TreeOutline.prototype._forgetTreeElement):
2419         (WI.TreeOutline.prototype._treeKeyDown):
2420         (WI.TreeOutline.prototype.selectionControllerNumberOfItems):
2421         (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
2422         (WI.TreeOutline.prototype.selectionControllerNextSelectableIndex):
2423         (WI.TreeOutline.prototype.selectionControllerPreviousSelectableIndex):
2424         (WI.TreeOutline.prototype.selectTreeElementInternal):
2425         (WI.TreeOutline._generateStyleRulesIfNeeded._indexOfTreeElement.previousElement):
2426         (WI.TreeOutline._generateStyleRulesIfNeeded):
2427
2428 2018-11-27  Nikita Vasilyev  <nvasilyev@apple.com>
2429
2430         Web Inspector: Experimental Computed panel is unreadable in Dark Mode
2431         https://bugs.webkit.org/show_bug.cgi?id=192053
2432
2433         Reviewed by Matt Baker.
2434
2435         * UserInterface/Views/ComputedStyleDetailsPanel.css:
2436         (@media (prefers-dark-interface)):
2437         (.computed-with-traces .details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)):
2438         * UserInterface/Views/ComputedStyleSection.css:
2439         (.computed-style-section .computed-property-item.expanded):
2440         (.computed-style-section .computed-property-item.expanded + .computed-property-item):
2441         (@media (prefers-dark-interface)):
2442
2443 2018-11-27  Nikita Vasilyev  <nvasilyev@apple.com>
2444
2445         Web Inspector: Computed panel: allow to expand properties to show list of overridden values
2446         https://bugs.webkit.org/show_bug.cgi?id=191984
2447
2448         Reviewed by Devin Rousso.
2449
2450         Introduce the new experimental Computed Style Cascades.
2451
2452         Each property now can expand to show a list of overridden values, their corresponding
2453         selectors, and source locations.
2454
2455         * Localizations/en.lproj/localizedStrings.js:
2456         * UserInterface/Base/Setting.js:
2457         * UserInterface/Main.html:
2458         * UserInterface/Models/DOMNodeStyles.js:
2459         (WI.DOMNodeStyles.prototype.get uniqueOrderedStyles):
2460         Move `uniqueOrderedStyles` function unmodified from SpreadsheetRulesStyleDetailsPanel so it can be used by ComputedStyleDetailsPanel, too.
2461
2462         * UserInterface/Views/ComputedStyleDetailsPanel.css:
2463         (.computed-with-traces .computed-style-properties):
2464         (.computed-with-traces .details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)):
2465         (.computed-with-traces .details-section.computed-style-properties > .content):
2466         (.computed-with-traces .computed-style-properties .property .go-to-arrow):
2467
2468         * UserInterface/Views/ComputedStyleDetailsPanel.js:
2469         (WI.ComputedStyleDetailsPanel.prototype.refresh):
2470         (WI.ComputedStyleDetailsPanel.prototype.applyFilter):
2471         (WI.ComputedStyleDetailsPanel.prototype.focusFirstSection):
2472         (WI.ComputedStyleDetailsPanel.prototype.initialLayout):
2473         (WI.ComputedStyleDetailsPanel.prototype._computePropertyTraces):
2474         (WI.ComputedStyleDetailsPanel.prototype._computedStyleShowAllCheckboxValueChanged):
2475         (WI.ComputedStyleDetailsPanel.prototype._handlePropertiesSectionCollapsedStateChanged):
2476         (WI.ComputedStyleDetailsPanel.prototype._handleEditorFilterApplied):
2477         (WI.ComputedStyleDetailsPanel):
2478         Use the new Computed section (WI.ComputedStyleSection) only when it's enabled in the experimental settings.
2479         Otherwise, use the current Computed section.
2480
2481         * UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
2482         (WI.ComputedStyleDetailsSidebarPanel):
2483
2484         * UserInterface/Views/ComputedStyleSection.css: Added.
2485         (.computed-style-section):
2486         (.computed-style-section .computed-property-item):
2487         (.computed-style-section .computed-property-item.expanded):
2488         (.computed-style-section .computed-property-item.expanded + .computed-property-item):
2489         (.computed-style-section .computed-property-item .disclosure-button):
2490         (.computed-style-section .computed-property-item .property-traces):
2491         (.computed-style-section .computed-property-item.expanded .property-traces):
2492         (.computed-style-section .computed-property-item.expanded .disclosure-button):
2493         (.computed-style-section .computed-property-item .property-trace-item):
2494         (.computed-style-section .computed-property-item .property-trace-item .property.overridden .value):
2495         (.computed-style-section .property-trace-item-left,):
2496         (.computed-style-section .property-trace-item-right):
2497         (.computed-style-section .computed-property-item .property-trace-item .value):
2498         (.computed-style-section .property .value):
2499         (.computed-style-section .computed-property-item .property):
2500         (.computed-style-section .computed-property-item .property .name):
2501         (.computed-style-section .computed-property-item .property-trace-item .selector):
2502         (.computed-style-section .computed-property-item .origin):
2503         (.computed-style-section .computed-property-item .go-to-link):
2504         (.computed-style-section .property-trace-item .property .name,):
2505         (.computed-style-section .property-trace-item .property .value + span):
2506         (.computed-style-properties.details-section > .content,):
2507
2508         * UserInterface/Views/ComputedStyleSection.js: Added.
2509         (WI.ComputedStyleSection):
2510         (WI.ComputedStyleSection.prototype.get style):
2511         (WI.ComputedStyleSection.prototype.set style):
2512         (WI.ComputedStyleSection.prototype.get styleTraces):
2513         (WI.ComputedStyleSection.prototype.set styleTraces):
2514         (WI.ComputedStyleSection.prototype.set showsImplicitProperties):
2515         (WI.ComputedStyleSection.prototype.set alwaysShowPropertyNames):
2516         (WI.ComputedStyleSection.prototype.set propertyVisibilityMode):
2517         (WI.ComputedStyleSection.prototype.set hideFilterNonMatchingProperties):
2518         (WI.ComputedStyleSection.prototype.get propertiesToRender):
2519         (WI.ComputedStyleSection.prototype.layout):
2520         (WI.ComputedStyleSection.prototype.detached):
2521         (WI.ComputedStyleSection.prototype.hidden):
2522         (WI.ComputedStyleSection.prototype.applyFilter):
2523         (WI.ComputedStyleSection.prototype.spreadsheetStylePropertyShowProperty):
2524         (WI.ComputedStyleSection.prototype._createTrace):
2525         (WI.ComputedStyleSection.prototype._handlePropertiesChanged):
2526
2527         * UserInterface/Views/ExpandableView.js: Added.
2528         (WI.ExpandableView):
2529         (WI.ExpandableView.prototype.get element):
2530         (WI.ExpandableView.prototype._onDisclosureButtonClick):
2531         (WI.ExpandableView.prototype._update):
2532
2533         * UserInterface/Views/SettingsTabContentView.js:
2534         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2535
2536         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2537         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
2538         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.layout):
2539         Replace `_renderOrigin` with WI.StyleOriginView so it could be used by WI.ComputedStyleSection.
2540
2541         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
2542         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
2543
2544         * UserInterface/Views/SpreadsheetStyleProperty.js:
2545         (WI.SpreadsheetStyleProperty.prototype.update):
2546         (WI.SpreadsheetStyleProperty.prototype._isEditable):
2547         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
2548         Introduce `readOnly` option so WI.SpreadsheetStyleProperty could be used by WI.ComputedStyleSection.
2549
2550         * UserInterface/Views/StyleOriginView.js: Added.
2551         (WI.StyleOriginView):
2552
2553 2018-11-27  Timothy Hatcher  <timothy@apple.com>
2554
2555         Web Inspector: Add support for forcing color scheme appearance in DOM tree.
2556         https://bugs.webkit.org/show_bug.cgi?id=191820
2557         rdar://problem/46153172
2558
2559         Reviewed by Devin Rousso.
2560
2561         * Localizations/en.lproj/localizedStrings.js: Updated.
2562         * UserInterface/Controllers/CSSManager.js:
2563         (WI.CSSManager):
2564         (WI.CSSManager.prototype.get defaultAppearance): Added.
2565         (WI.CSSManager.prototype.get forcedAppearance): Added.
2566         (WI.CSSManager.prototype.set forcedAppearance): Added.
2567         (WI.CSSManager.prototype.canForceAppearance): Added.
2568         (WI.CSSManager.prototype.defaultAppearanceDidChange): Added.
2569         * UserInterface/Images/Appearance.svg: Added.
2570         * UserInterface/Protocol/PageObserver.js:
2571         (WI.PageObserver.prototype.defaultAppearanceChanged): Added.
2572         * UserInterface/Views/DOMTreeContentView.js:
2573         (WI.DOMTreeContentView):
2574         (WI.DOMTreeContentView.prototype.get navigationItems):
2575         (WI.DOMTreeContentView.prototype._defaultAppearanceDidChange): Added.
2576         (WI.DOMTreeContentView.prototype._toggleAppearance): Added.
2577
2578 2018-11-27  Matt Baker  <mattbaker@apple.com>
2579
2580         Web Inspector: Cookies table needs copy keyboard shortcut and context menu support
2581         https://bugs.webkit.org/show_bug.cgi?id=191482
2582         <rdar://problem/45953002>
2583
2584         Reviewed by Joseph Pecoraro.
2585
2586         * UserInterface/Views/CookieStorageContentView.js:
2587         (WI.CookieStorageContentView.prototype.handleCopyEvent):
2588         (WI.CookieStorageContentView.prototype.tableCellContextMenuClicked):
2589         As with Delete, if the target row is selected, all selected rows are copied.
2590         Otherwise only the target row is copied. This distinction will be surfaced
2591         in the UI in https://webkit.org/b/191095.
2592
2593         (WI.CookieStorageContentView.prototype.tablePopulateCell):
2594         (WI.CookieStorageContentView.prototype._cookiesAtIndexes):
2595         (WI.CookieStorageContentView.prototype._formatCookiesAsText):
2596         (WI.CookieStorageContentView.prototype._formatCookiePropertyForColumn):
2597         (WI.CookieStorageContentView):
2598         Break Cookie property formatting into a helper method, which is used for
2599         formatting Table cells and creating plain text for the clipboard.
2600
2601         * UserInterface/Views/Table.js:
2602         (WI.Table.prototype.get columns):
2603
2604 2018-11-27  Matt Baker  <mattbaker@apple.com>
2605
2606         Web Inspector: Table selection should be handled by a SelectionController
2607         https://bugs.webkit.org/show_bug.cgi?id=191977
2608         <rdar://problem/46253093>
2609
2610         Reviewed by Devin Rousso.
2611
2612         Add a SelectionController class, which manages an IndexSet of selected
2613         items, and provides operations for adding and removing items from the
2614         selection. Complex behaviors such as shift-clicking to select a range of
2615         items, and updating the selection using the keyboard, are forwarded to
2616         the controller using special-purpose methods that accept DOM Event objects.
2617
2618         * UserInterface/Base/Utilities.js:
2619
2620         * UserInterface/Controllers/SelectionController.js: Added.
2621         (WI.SelectionController):
2622         (WI.SelectionController.prototype.get delegate):
2623         (WI.SelectionController.prototype.get lastSelectedItem):
2624         (WI.SelectionController.prototype.get selectedItems):
2625         (WI.SelectionController.prototype.get allowsMultipleSelection):
2626         (WI.SelectionController.prototype.set allowsMultipleSelection):
2627         (WI.SelectionController.prototype.get numberOfItems):
2628         (WI.SelectionController.prototype.hasSelectedItem):
2629         (WI.SelectionController.prototype.selectItem):
2630         (WI.SelectionController.prototype.deselectItem):
2631         (WI.SelectionController.prototype.selectAll):
2632         (WI.SelectionController.prototype.deselectAll):
2633         (WI.SelectionController.prototype.removeSelectedItems):
2634         (WI.SelectionController.prototype.reset):
2635         (WI.SelectionController.prototype.didRemoveItem):
2636         (WI.SelectionController.prototype.handleKeyDown):
2637         (WI.SelectionController.prototype.handleItemMouseDown.normalizeRange):
2638         (WI.SelectionController.prototype.handleItemMouseDown):
2639         (WI.SelectionController.prototype._deselectAllAndSelect):
2640         (WI.SelectionController.prototype._selectItemsFromArrowKey):
2641         (WI.SelectionController.prototype._nextSelectableIndex):
2642         (WI.SelectionController.prototype._previousSelectableIndex):
2643         (WI.SelectionController.prototype._updateSelectedItems):
2644
2645         * UserInterface/Main.html:
2646         * UserInterface/Test.html:
2647
2648         * UserInterface/Views/Table.js:
2649         (WI.Table):
2650         (WI.Table.prototype.get selectedRow):
2651         (WI.Table.prototype.get selectedRows):
2652         (WI.Table.prototype.get allowsMultipleSelection):
2653         (WI.Table.prototype.set allowsMultipleSelection):
2654         (WI.Table.prototype.isRowSelected):
2655         (WI.Table.prototype.reloadData):
2656         (WI.Table.prototype.selectRow):
2657         (WI.Table.prototype.deselectRow):
2658         (WI.Table.prototype.selectAll):
2659         (WI.Table.prototype.deselectAll):
2660         (WI.Table.prototype.removeRow):
2661         (WI.Table.prototype.removeSelectedRows):
2662         (WI.Table.prototype.selectionControllerSelectionDidChange):
2663         (WI.Table.prototype.selectionControllerNumberOfItems):
2664         (WI.Table.prototype.selectionControllerNextSelectableIndex):
2665         (WI.Table.prototype.selectionControllerPreviousSelectableIndex):
2666         (WI.Table.prototype._handleKeyDown):
2667         (WI.Table.prototype._handleMouseDown):
2668         (WI.Table.prototype._removeRows):
2669         (WI.Table.prototype._toggleSelectedRowStyle):
2670         (WI.Table.prototype._selectRowsFromArrowKey): Deleted.
2671         (WI.Table.prototype._handleMouseDown.normalizeRange): Deleted.
2672         (WI.Table.prototype._deselectAllAndSelect): Deleted.
2673         (WI.Table.prototype._notifySelectionDidChange): Deleted.
2674         (WI.Table.prototype._updateSelectedRows): Deleted.
2675
2676 2018-11-26  Devin Rousso  <drousso@apple.com>
2677
2678         Web Inspector: "No Filter Results" in navigation sidebar should have a button to clear filters
2679         https://bugs.webkit.org/show_bug.cgi?id=191916
2680
2681         Reviewed by Joseph Pecoraro.
2682
2683         * UserInterface/Views/NavigationSidebarPanel.js:
2684         (WI.NavigationSidebarPanel.prototype.resetFilter): Added.
2685         (WI.NavigationSidebarPanel.prototype._checkForEmptyFilterResults.checkTreeOutlineForEmptyFilterResults):
2686
2687         * UserInterface/Views/FilterBar.js:
2688         (WI.FilterBar.prototype.clear):
2689
2690         * UserInterface/Views/FilterBarButton.js:
2691         (WI.FilterBarButton.prototype.toggle):
2692
2693         * UserInterface/Views/ResourceSidebarPanel.js:
2694         (WI.ResourceSidebarPanel.prototype.resetFilter): Added.
2695         * UserInterface/Views/StorageSidebarPanel.js:
2696         (WI.StorageSidebarPanel.prototype.resetFilter): Added.
2697
2698         * UserInterface/Views/AuditTestContentView.js:
2699         (WI.AuditTestContentView.prototype.showFilteredPlaceholder):
2700         * UserInterface/Views/NetworkTableContentView.js:
2701         (WI.NetworkTableContentView.prototype._showEmptyFilterResultsMessage):
2702
2703         * UserInterface/Views/Main.css:
2704         (.message-text-view > .message + button): Added.
2705
2706         * Localizations/en.lproj/localizedStrings.js:
2707
2708 2018-11-26  Devin Rousso  <drousso@apple.com>
2709
2710         Web Inspector: Audit: automatically add to tab bar when the experimental setting is enabled
2711         https://bugs.webkit.org/show_bug.cgi?id=191659
2712
2713         Reviewed by Joseph Pecoraro.
2714
2715         * UserInterface/Views/SettingsTabContentView.js:
2716         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2717
2718         * UserInterface/Base/Main.js:
2719         (WI.loaded):
2720         Drive-by: use existing constants instead of hard-coded strings for consistency.
2721
2722 2018-11-25  Devin Rousso  <drousso@apple.com>
2723
2724         Web Inspector: Timelines: add Media timeline
2725         https://bugs.webkit.org/show_bug.cgi?id=191625
2726
2727         Reviewed by Matt Baker.
2728
2729         Add a new timeline to Timelines for media related events (e.g. event/fullscreen/low-power).
2730         Mimics what is visible by using the same instrumentation points as the Network tab when
2731         "Group Media Requests" is enabled.
2732
2733         * UserInterface/Models/MediaInstrument.js: Added.
2734         (WI.MediaInstrument):
2735         (WI.MediaInstrument.supported):
2736         (WI.MediaInstrument.prototype.get timelineRecordType):
2737         (WI.MediaInstrument.prototype.startInstrumentation):
2738         (WI.MediaInstrument.prototype.stopInstrumentation):
2739
2740         * UserInterface/Models/MediaTimelineRecord.js: Added.
2741         (WI.MediaTimelineRecord):
2742         (WI.MediaTimelineRecord.prototype.get eventType):
2743         (WI.MediaTimelineRecord.prototype.get domNode):
2744         (WI.MediaTimelineRecord.prototype.get domEvent):
2745         (WI.MediaTimelineRecord.prototype.get isLowPower):
2746         (WI.MediaTimelineRecord.prototype.get displayName):
2747         (WI.MediaTimelineRecord.prototype.saveIdentityToCookie):
2748
2749         * UserInterface/Views/MediaTimelineDataGridNode.js: Added.
2750         (WI.MediaTimelineDataGridNode):
2751         (WI.MediaTimelineDataGridNode.prototype.get records):
2752         (WI.MediaTimelineDataGridNode.prototype.get data):
2753         (WI.MediaTimelineDataGridNode.prototype.createCellContent):
2754         (WI.MediaTimelineDataGridNode.prototype.iconClassNames):
2755         (WI.MediaTimelineDataGridNode.prototype.filterableDataForColumn):
2756
2757         * UserInterface/Views/MediaTimelineOverviewGraph.js: Added.
2758         (WI.MediaTimelineOverviewGraph):
2759         (WI.MediaTimelineOverviewGraph.prototype.reset):
2760         (WI.MediaTimelineOverviewGraph.prototype.shown):
2761         (WI.MediaTimelineOverviewGraph.prototype.hidden):
2762         (WI.MediaTimelineOverviewGraph.prototype.layout):
2763         (WI.MediaTimelineOverviewGraph.prototype.updateSelectedRecord):
2764         (WI.MediaTimelineOverviewGraph.prototype._handleRecordAdded):
2765         * UserInterface/Views/MediaTimelineOverviewGraph.css: Added.
2766         (.timeline-overview-graph.media > .timeline-record-bar):
2767         (.timeline-overview-graph.media > .timeline-record-bar > .segment):
2768
2769         * UserInterface/Views/MediaTimelineView.js: Added.
2770         (WI.MediaTimelineView):
2771         (WI.MediaTimelineView.prototype.get secondsPerPixel):
2772         (WI.MediaTimelineView.prototype.get selectionPathComponents):
2773         (WI.MediaTimelineView.prototype.closed):
2774         (WI.MediaTimelineView.prototype.reset):
2775         (WI.MediaTimelineView.prototype.dataGridSortComparator.compareDOMNodes):
2776         (WI.MediaTimelineView.prototype.dataGridSortComparator.):
2777         (WI.MediaTimelineView.prototype.dataGridSortComparator):
2778         (WI.MediaTimelineView.prototype.layout):
2779         (WI.MediaTimelineView.prototype._processPendingRecords):
2780         (WI.MediaTimelineView.prototype._handleRecordAdded):
2781         (WI.MediaTimelineView.prototype._handleSelectionPathComponentSiblingSelected):
2782         * UserInterface/Views/MediaTimelineView.css: Added.
2783         (.timeline-view.media > .data-grid):
2784
2785         * UserInterface/Views/DOMEventsBreakdownView.js:
2786         (WI.DOMEventsBreakdownView.prototype.layout):
2787         * UserInterface/Views/DOMNodeEventsContentView.js:
2788         (WI.DOMNodeEventsContentView.prototype.initialLayout):
2789         * UserInterface/Views/NetworkDOMNodeDetailView.js:
2790         (WI.NetworkDOMNodeDetailView):
2791         (WI.NetworkDOMNodeDetailView.prototype.showContentViewForIdentifier):
2792         * UserInterface/Views/NetworkTableContentView.js:
2793         (WI.NetworkTableContentView):
2794         (WI.NetworkTableContentView.prototype.get filterNavigationItems):
2795         (WI.NetworkTableContentView.prototype._populateWaterfallGraph):
2796         (WI.NetworkTableContentView.prototype._showDetailView):
2797         (WI.NetworkTableContentView.prototype._waterfallPopoverContentForNodeEntry):
2798         Remove passing of `startTimestamp` to `WI.DOMEventsBreakdownView`, as we should be showing
2799         absolute timestamps for each event, not relative to the start of the recording.
2800
2801         * UserInterface/Views/TimelineIcons.css:
2802         (.media-icon .icon): Added.
2803         (.dom-event-record .icon): Added.
2804         (.dom-event-record.fullscreen .icon): Added.
2805         (.low-power-record .icon): Added.
2806
2807         * UserInterface/Controllers/TimelineManager.js:
2808         (WI.TimelineManager.availableTimelineTypes):
2809         (WI.TimelineManager.prototype.capturingStarted):
2810         (WI.TimelineManager.prototype.capturingStopped):
2811         (WI.TimelineManager.prototype._updateAutoCaptureInstruments):
2812         (WI.TimelineManager.prototype._handleDOMNodeDidFireEvent): Added.
2813         (WI.TimelineManager.prototype._handleDOMNodeLowPowerChanged): Added.
2814
2815         * UserInterface/Views/TimelineRuler.js:
2816         (WI.TimelineRuler.prototype.clearMarkers):
2817         (WI.TimelineRuler.prototype._handleClick):
2818         * UserInterface/Views/TimelineOverview.js:
2819         (WI.TimelineOverview.prototype._timelineRulerMouseClicked):
2820         * UserInterface/Models/TimelineRecording.js:
2821         (WI.TimelineRecording.prototype.reset):
2822         (WI.TimelineRecording.prototype.addEventMarker):
2823         (WI.TimelineRecording.prototype.addRecord):
2824         (WI.TimelineRecording.prototype._keyForRecord):
2825         Drive-by: rework the logic for "click" event pass-through to the graph underneath.
2826
2827         * UserInterface/Models/Instrument.js:
2828         (WI.Instrument.createForTimelineType):
2829
2830         * UserInterface/Models/TimelineRecord.js:
2831
2832         * UserInterface/Views/TimelineTabContentView.js:
2833         (WI.TimelineTabContentView.displayNameForTimelineType):
2834         (WI.TimelineTabContentView.iconClassNameForTimelineType):
2835         (WI.TimelineTabContentView.genericClassNameForTimelineType):
2836         (WI.TimelineTabContentView.iconClassNameForRecord):
2837         (WI.TimelineTabContentView.displayNameForRecord):
2838         * UserInterface/Views/TimelineRecordBar.css:
2839         (.timeline-record-bar.timeline-record-type-media > .segment): Added.
2840
2841         * UserInterface/Views/ContentView.js:
2842         (WI.ContentView.createFromRepresentedObject):
2843         * UserInterface/Views/TimelineOverviewGraph.js:
2844         (WI.TimelineOverviewGraph.createForTimeline):
2845
2846         * UserInterface/Models/ScriptTimelineRecord.js:
2847         (WI.ScriptTimelineRecord.EventType.displayName):
2848
2849         * UserInterface/Main.html:
2850         * UserInterface/Test.html:
2851         * Localizations/en.lproj/localizedStrings.js:
2852         * UserInterface/Images/DOMEvent.svg: Added.
2853         * UserInterface/Images/DOMEventFullscreen.svg: Added.
2854         * UserInterface/Images/LowPower.svg: Added.
2855         * UserInterface/Images/MediaInstrument.svg: Added.
2856
2857 2018-11-25  Matt Baker  <mattbaker@apple.com>
2858
2859         Web Inspector: Remove parameters from TreeOutline SelectionDidChange event
2860         https://bugs.webkit.org/show_bug.cgi?id=191770
2861
2862         Reviewed by Devin Rousso.
2863
2864         * UserInterface/Controllers/CallFrameTreeController.js:
2865         (WI.CallFrameTreeController.prototype._treeSelectionDidChange):
2866         * UserInterface/Views/AuditNavigationSidebarPanel.js:
2867         (WI.AuditNavigationSidebarPanel.prototype._treeSelectionDidChange):
2868         * UserInterface/Views/CanvasSidebarPanel.js:
2869         (WI.CanvasSidebarPanel):
2870         (WI.CanvasSidebarPanel.prototype._treeSelectionDidChange):
2871         (WI.CanvasSidebarPanel.prototype._treeOutlineSelectionDidChange): Deleted.
2872         * UserInterface/Views/CanvasTabContentView.js:
2873         (WI.CanvasTabContentView.prototype._canvasTreeOutlineSelectionDidChange):
2874         * UserInterface/Views/DebuggerSidebarPanel.js:
2875         (WI.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
2876         * UserInterface/Views/OpenResourceDialog.js:
2877         (WI.OpenResourceDialog.prototype._treeSelectionDidChange):
2878         * UserInterface/Views/ResourceSidebarPanel.js:
2879         (WI.ResourceSidebarPanel.prototype._treeSelectionDidChange):
2880         * UserInterface/Views/SearchSidebarPanel.js:
2881         (WI.SearchSidebarPanel.prototype._treeSelectionDidChange):
2882         * UserInterface/Views/StorageSidebarPanel.js:
2883         (WI.StorageSidebarPanel._treeSelectionDidChange):
2884         * UserInterface/Views/TimelineDataGrid.js:
2885         (WI.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
2886         (WI.TimelineDataGrid):
2887         * UserInterface/Views/TimelineTabContentView.js:
2888         (WI.TimelineTabContentView.prototype._recordingsTreeSelectionDidChange):
2889         Use `event.target.selectedTreeElement` instead of `event.data.selectedElement`.
2890
2891         * UserInterface/Views/TimelineOverview.js:
2892         (WI.TimelineOverview.prototype._timelinesTreeSelectionDidChange):
2893         (WI.TimelineOverview.prototype._timelinesTreeSelectionDidChange.updateGraphSelectedState): Deleted.
2894         Refactor away the single place `event.data.deselectedElement` was used.
2895
2896         * UserInterface/Views/TreeElement.js:
2897         (WI.TreeElement.prototype.select):
2898         (WI.TreeElement.prototype.deselect):
2899         Remove `selectedElement` and `deselectedElement` from event data.
2900
2901 2018-11-19  Devin Rousso  <drousso@apple.com>
2902
2903         Web Inspector: Audit: removing and re-adding the tab will duplicate tests
2904         https://bugs.webkit.org/show_bug.cgi?id=191843
2905
2906         Reviewed by Matt Baker.
2907
2908         * UserInterface/Controllers/AuditManager.js:
2909         (WI.AuditManager.prototype.loadStoredTests):
2910         If we already have tests, don't attempt to load any stored tests.
2911
2912 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
2913
2914         Web Inspector: "Reload Web Inspector" button no longer partially works
2915         https://bugs.webkit.org/show_bug.cgi?id=191773
2916         <rdar://problem/46139932>
2917
2918         Reviewed by Devin Rousso.
2919
2920         * UserInterface/Base/Main.js:
2921         * UserInterface/Debug/UncaughtExceptionReporter.js:
2922         (sheetElement.innerHTML):
2923         * UserInterface/Views/SettingsTabContentView.js:
2924
2925 2018-11-17  Devin Rousso  <drousso@apple.com>
2926
2927         Web Inspector: Network: add button to show system certificate dialog
2928         https://bugs.webkit.org/show_bug.cgi?id=191458
2929         <rdar://problem/45977019>
2930
2931         Reviewed by Joseph Pecoraro.
2932
2933         * UserInterface/Controllers/NetworkManager.js:
2934         (WI.NetworkManager.supportsShowCertificate): Added.
2935
2936         * UserInterface/Models/Resource.js:
2937         (WI.Resource.prototype.showCertificate): Added.
2938
2939         * UserInterface/Views/ResourceSecurityContentView.js:
2940         (WI.ResourceSecurityContentView.prototype._refreshCetificateSection):
2941         * UserInterface/Views/ResourceSecurityContentView.css:
2942         (.resource-security .details > .show-certificate > .key): Added.
2943         (.resource-security .details > .show-certificate > .key > .error): Added.
2944
2945         * Localizations/en.lproj/localizedStrings.js:
2946
2947 2018-11-16  Devin Rousso  <drousso@apple.com>
2948
2949         Web Inspector: Audit: add default tests
2950         https://bugs.webkit.org/show_bug.cgi?id=191758
2951
2952         Reviewed by Matt Baker.
2953
2954         * UserInterface/Controllers/AuditManager.js:
2955         (WI.AuditManager.prototype.loadStoredTests):
2956         (WI.AuditManager.prototype.addDefaultTestsIfNeeded): Added.
2957         If there are no previously saved tests in the database, automatically add the default set.
2958
2959         * UserInterface/Views/AuditNavigationSidebarPanel.js:
2960         (WI.AuditNavigationSidebarPanel.prototype._addTest):
2961         (WI.AuditNavigationSidebarPanel.prototype._addResult):
2962         (WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
2963         * UserInterface/Views/AuditNavigationSidebarPanel.css:
2964         (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view): Added.
2965         (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > .message): Added.
2966         (.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > button): Added.
2967         When the last test is removed, show a placeholder message that allows the user to re-add the
2968         default set of tests.
2969
2970         * UserInterface/Views/NavigationSidebarPanel.js:
2971         (WI.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder):
2972         (WI.NavigationSidebarPanel.prototype._createEmptyContentPlaceholderIfNeeded):
2973
2974         * Localizations/en.lproj/localizedStrings.js:
2975
2976 2018-11-16  Devin Rousso  <drousso@apple.com>
2977
2978         Web Inspector: Audit: minor style improvements
2979         https://bugs.webkit.org/show_bug.cgi?id=191727
2980
2981         Reviewed by Joseph Pecoraro.
2982
2983         * UserInterface/Controllers/AuditManager.js:
2984         (WI.AuditManager):
2985         (WI.AuditManager.prototype._handleFrameMainResourceDidChange): Added.
2986         Clear test results when the main frame navigates, but don't clear the saved results.
2987
2988         * UserInterface/Models/AuditTestCase.js:
2989         (WI.AuditTestCase.prototype.async run):
2990         * UserInterface/Models/AuditTestCaseResult.js:
2991         (WI.AuditTestCaseResult):
2992         (WI.AuditTestCaseResult.async fromPayload):
2993         (WI.AuditTestCaseResult.prototype.get resolvedDOMNodes): Added.
2994         (WI.AuditTestCaseResult.prototype.toJSON):
2995         Capture the full CSS path for any returned DOM nodes when the test finishes running, so that
2996         if the node moves around the path isn't modified as well.
2997
2998         * UserInterface/Views/AuditTestCaseContentView.js:
2999         (WI.AuditTestCaseContentView.prototype.layout):
3000         Always show the URL for the test when viewing a saved result.
3001
3002         * UserInterface/Views/AuditTestContentView.css:
3003         (.content-view-container > .content-view.audit-test > header p):
3004         (.content-view.audit-test > header):
3005         * UserInterface/Views/AuditTestCaseContentView.css:
3006         (.content-view.audit-test-case > header): Added.
3007         (.content-view.audit-test-case > header h1 > img):
3008         (.content-view.audit-test-case > header > .metadata > .source): Added.
3009         (.content-view.audit-test-case > header > .metadata > .duration):
3010         (.content-view.audit-test-case > section table > tr > td:first-child):
3011         * UserInterface/Views/AuditTestGroupContentView.css:
3012         (.content-view.audit-test-group > header):
3013         Horizontally align items in the header for visual consistency.
3014
3015 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
3016
3017         Web Inspector: Include default filtering of InspectorBackend.dumpInspectorProtocolMessages with multi target backend
3018         https://bugs.webkit.org/show_bug.cgi?id=191785
3019
3020         Reviewed by Matt Baker.
3021
3022         * UserInterface/Debug/Bootstrap.js:
3023         (dumpMessagesCurrentState):
3024         (applyDumpMessagesState):
3025         (WI.runBootstrapOperations):
3026         Include tri-state for the logs button.
3027
3028         * UserInterface/Protocol/InspectorBackend.js:
3029         (InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages):
3030         (InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages):
3031         (InspectorBackendClass.prototype._startOrStopAutomaticTracing):
3032         Add new filtering state (the Setting already got added in the past).
3033
3034         * UserInterface/Protocol/LoggingProtocolTracer.js:
3035         (WI.LoggingProtocolTracer):
3036         (WI.LoggingProtocolTracer.prototype.set filterMultiplexingBackend):
3037         (WI.LoggingProtocolTracer.prototype.get filterMultiplexingBackend):
3038         (WI.LoggingProtocolTracer.prototype._processEntry):
3039         Perform new filtering.
3040
3041 2018-11-16  Joseph Pecoraro  <pecoraro@apple.com>
3042
3043         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Local Inspector)
3044         https://bugs.webkit.org/show_bug.cgi?id=191740
3045         <rdar://problem/45470897>
3046
3047         Reviewed by Timothy Hatcher.
3048
3049         * UserInterface/Protocol/Connection.js:
3050         (InspectorBackend.Connection.prototype._dispatchResponse):
3051         Hide the TargetAgent does not exist message. This is necessary so that WebKitLegacy
3052         tests don't include this line in output each test.
3053
3054         * UserInterface/Test.html:
3055         * UserInterface/Test/Test.js:
3056         (WI.loaded):
3057         (WI.resetMainExecutionContext):
3058         (WI.performOneTimeFrontendInitializationsUsingTarget):
3059         Behave more like Main.js and initialize a MultiplexingBackendTarget when the
3060         TargetAgent is available.
3061
3062         * UserInterface/Protocol/InspectorBackend.js:
3063         (InspectorBackendClass.prototype.runAfterPendingDispatches):
3064         Use the main target, a.k.a. the page connection. The backend target's
3065         messages don't have any responses, so this was effectively not waiting
3066         at all.
3067
3068 2018-11-16  Matt Baker  <mattbaker@apple.com>
3069
3070         Web Inspector: TreeOutline shouldn't select first child of an expanded element on right arrow key
3071         https://bugs.webkit.org/show_bug.cgi?id=191766
3072
3073         Reviewed by Devin Rousso.
3074
3075         * UserInterface/Views/TreeOutline.js:
3076         (WI.TreeOutline.prototype._treeKeyDown):
3077
3078 2018-11-14  Matt Baker  <mattbaker@apple.com>
3079
3080         Web Inspector: Table should recalculate scrollable height when resized
3081         https://bugs.webkit.org/show_bug.cgi?id=191328
3082         <rdar://problem/45854412>
3083
3084         Reviewed by Devin Rousso.
3085
3086         * UserInterface/Views/NetworkTableContentView.js:
3087         (WI.NetworkTableContentView.prototype._hideDetailView):
3088         Force table columns to layout after hiding the detail view.
3089
3090         * UserInterface/Views/Table.js:
3091         (WI.Table):
3092         (WI.Table.prototype.showColumn):
3093         Call `_resizeColumnsAndFiller` instead of `resize`. The latter also cleared
3094         `_cachedWidth`, which isn't unnecessary since the width hasn't changed.
3095
3096         (WI.Table.prototype.layout):
3097         previously `_resizeColumnsAndFiller` always occurred after `_updateVisibleRows`,
3098         it was just a matter of whether the cached width and height were cleared first.
3099         That now happens in `sizeDidChange`.
3100
3101         (WI.Table.prototype.sizeDidChange):
3102         (WI.Table.prototype._updateVisibleRows):
3103         (WI.Table.prototype.resize): Deleted.
3104         Internally this cleared the cached width and height, which moved to `sizeDidChange`.
3105         Externally this was used by NetworkTableContentView to force columns to
3106         layout after hiding the details view. Calling `updateLayout` on the table
3107         accomplishes the same thing using the standard View API.
3108
3109         (WI.Table.prototype._resizeColumnsAndFiller):
3110         Only update the cached width, since the height will already have been
3111         updated. The number of rows doesn't change during this method, so that
3112         check was removed.
3113
3114 2018-11-14  Devin Rousso  <drousso@apple.com>
3115
3116         Web Inspector: REGRESSION(r236540): Debugger: breakpoints are sorted alphabetically instead of numerically
3117         https://bugs.webkit.org/show_bug.cgi?id=191560
3118
3119         Reviewed by Joseph Pecoraro.
3120
3121         When sorting breakpoints, if the `WI.TreeElement`s being compared both contain instances of
3122         `WI.Breakpoint`, sort by `WI.SourceCodeLocation` instead of title.
3123
3124         We only do this for `WI.Breakpoint` because they are the only debuggable item that has a
3125         `WI.SourceCodeLocation` (e.g. `WI.EventBreakpoint` is just an event name string).
3126
3127         * UserInterface/Views/DebuggerSidebarPanel.js:
3128         (WI.DebuggerSidebarPanel.prototype._addTreeElement):
3129         (WI.DebuggerSidebarPanel.prototype._compareBreakpointTreeElements): Added.
3130         (WI.DebuggerSidebarPanel.prototype._addIssue):
3131         (WI.DebuggerSidebarPanel.prototype._addTreeElement.comparator): Deleted.
3132         (WI.DebuggerSidebarPanel.prototype._compareTreeElements): Deleted.
3133
3134 2018-11-14  Nikita Vasilyev  <nvasilyev@apple.com>
3135
3136         Web Inspector: Styles: shift-clicking on a property should extend selection
3137         https://bugs.webkit.org/show_bug.cgi?id=191575
3138         <rdar://problem/46012855>
3139
3140         Reviewed by Devin Rousso.
3141
3142         When there's at least one property is selected, Shift-clicking another property should extend the selection.
3143         Pressing Up or Down keys while holding Shift also extends the selection.
3144
3145         Remove unnecessary `_startedSelection`. Use `hasSelectedProperties` and `_isMousePressed` instead.
3146
3147         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
3148         `_isMousePressed` was set to `true` by mistake, causing numerous assertion fails.
3149
3150         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.set focusIndex):
3151         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.hasSelectedProperties): Renamed from _hasSelectedProperties.
3152         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.extendSelectedProperties): Added.
3153         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyMouseLeave): Removed.
3154         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy):
3155
3156         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
3157         Implement Shift-ArrowUp/ArrowDown keys.
3158
3159         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
3160         (WI.SpreadsheetCSSStyleDeclarationSection):
3161         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyBlur):
3162         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorPropertyMouseLeave): Removed.
3163         This was only used to set _startedSelection.
3164
3165         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleMouseDown):
3166         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleWindowClick):
3167         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleClick):
3168         Remove _startedSelection and use hasSelectedProperties method instead.
3169
3170         * UserInterface/Views/SpreadsheetStyleProperty.js:
3171         (WI.SpreadsheetStyleProperty):
3172         Remove spreadsheetStylePropertyMouseLeave since it is no longer used.
3173
3174 2018-11-14  Devin Rousso  <drousso@apple.com>
3175
3176         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
3177         https://bugs.webkit.org/show_bug.cgi?id=191628
3178
3179         Reviewed by Dean Jackson.
3180
3181         * UserInterface/Models/Recording.js:
3182         (WI.Recording.prototype.async swizzle):
3183
3184         * UserInterface/Models/RecordingAction.js:
3185         (WI.RecordingAction.fromPayload):
3186         (WI.RecordingAction.prototype.async swizzle):
3187
3188 2018-11-14  Devin Rousso  <drousso@apple.com>
3189
3190         Web Inspector: add drag+drop for importing Audits and Recordings
3191         https://bugs.webkit.org/show_bug.cgi?id=191566
3192
3193         Reviewed by Joseph Pecoraro.
3194
3195         Reorganize the file loading logic for the Audit and Canvas tabs/managers. Add "drop" event
3196         handlers to the tabs that add and show the corresponding object for the imported data.
3197
3198         * UserInterface/Views/AuditTabContentView.js:
3199         (WI.AuditTabContentView):
3200         (WI.AuditTabContentView.prototype._handleDragOver): Added.
3201         (WI.AuditTabContentView.prototype._handleDrop): Added.
3202         * UserInterface/Views/CanvasTabContentView.js:
3203         (WI.CanvasTabContentView):
3204         (WI.CanvasTabContentView.prototype._addCanvas):
3205         (WI.CanvasTabContentView.prototype._recordingImportedOrStopped):
3206         (WI.CanvasTabContentView.prototype._handleDragOver): Added.
3207         (WI.CanvasTabContentView.prototype._handleDrop): Added.
3208
3209         * UserInterface/Controllers/AuditManager.js:
3210         (WI.AuditManager.prototype.async processJSON): Added.
3211         (WI.AuditManager.prototype.export):
3212         (WI.AuditManager.prototype.import): Deleted.
3213         * UserInterface/Controllers/CanvasManager.js:
3214         (WI.CanvasManager.prototype.processJSON): Added.
3215         (WI.CanvasManager.prototype.importRecording): Deleted.
3216
3217         * UserInterface/Views/AuditNavigationSidebarPanel.js:
3218         (WI.AuditNavigationSidebarPanel):
3219         (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
3220         (WI.AuditNavigationSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
3221         * UserInterface/Views/CanvasSidebarPanel.js:
3222         (WI.CanvasSidebarPanel):
3223         (WI.CanvasSidebarPanel.prototype._handleImportButtonNavigationItemClicked): Added.
3224         (WI.CanvasSidebarPanel.prototype._recordingChanged):
3225         (WI.CanvasSidebarPanel.prototype._updateRecordNavigationItem):
3226
3227         * UserInterface/Views/CanvasOverviewContentView.js:
3228         (WI.CanvasOverviewContentView):
3229         (WI.CanvasOverviewContentView.prototype._handleImportButtonNavigationItemClicked): Added.
3230
3231         * UserInterface/Base/FileUtilities.js:
3232         (WI.FileUtilities.save): Added.
3233         (WI.FileUtilities.importText): Added.
3234         (WI.FileUtilities.importJSON): Added.
3235         (WI.FileUtilities.async readText): Added.
3236         (WI.FileUtilities.async readJSON): Added.
3237         (WI.saveDataToFile): Deleted.
3238         (WI.loadDataFromFile): Deleted.
3239         * UserInterface/Base/Main.js:
3240         (WI._contextMenuRequested):
3241         (WI._save):
3242         (WI._saveAs):
3243         * UserInterface/Views/ContextMenuUtilities.js:
3244         (WI.appendContextMenuItemsForSourceCode):
3245         * UserInterface/Views/LogContentView.js:
3246         (WI.LogContentView.prototype._handleContextMenuEvent):
3247         * UserInterface/Views/NetworkTableContentView.js:
3248         (WI.NetworkTableContentView.prototype._exportHAR):
3249         * UserInterface/Views/RecordingContentView.js:
3250         (WI.RecordingContentView.prototype._exportRecording):
3251         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
3252         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._save):
3253         Move file related functions into a static class container.
3254
3255         * Localizations/en.lproj/localizedStrings.js:
3256
3257 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
3258
3259         Web Inspector: Include target identifier in protocol logging
3260         https://bugs.webkit.org/show_bug.cgi?id=191478
3261
3262         Reviewed by Devin Rousso.
3263
3264         * UserInterface/Protocol/Connection.js:
3265         (InspectorBackend.Connection.prototype._dispatchResponse):
3266         (InspectorBackend.Connection.prototype._dispatchEvent):
3267         (InspectorBackend.Connection.prototype._sendMessageToBackend):
3268         Call tracer log methods with the connection.
3269
3270         * UserInterface/Debug/CapturingProtocolTracer.js:
3271         * UserInterface/Protocol/ProtocolTracer.js:
3272         * UserInterface/Protocol/LoggingProtocolTracer.js:
3273         (WI.LoggingProtocolTracer):
3274         (WI.LoggingProtocolTracer.prototype.logFrontendException):
3275         (WI.LoggingProtocolTracer.prototype.logFrontendRequest):
3276         (WI.LoggingProtocolTracer.prototype.logWillHandleResponse):
3277         (WI.LoggingProtocolTracer.prototype.logDidHandleResponse):
3278         (WI.LoggingProtocolTracer.prototype.logDidHandleEvent):
3279         Include the connection in log methods.
3280
3281         (WI.LoggingProtocolTracer.prototype.logProtocolError):
3282         Removed, this is never called.
3283                 
3284         (WI.LoggingProtocolTracer.prototype._processEntry):
3285         Include the target identifier in entry messages.
3286
3287 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
3288
3289         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
3290         https://bugs.webkit.org/show_bug.cgi?id=191494
3291         <rdar://problem/45469854>
3292
3293         Reviewed by Devin Rousso.
3294
3295         This starts introducing multi-target support into the Web Inspector frontend.
3296         Specifically a backend connection that is persistent, but has the ability to
3297         connect to and transition between Page targets received through that backend
3298         connection.
3299
3300         This patch introduces the concept of a "Backend Target" which is the single
3301         connection that the frontend contains to a backend. The old way of connecting
3302         directly to a target is still supported. In that case the frontend constructs
3303         a DirectBackendTarget for the debuggable type the frontend was spawns for.
3304         However, if the frontend opens and has a TargetAgent, then it is likely
3305         connected to a multi-target supporting backend and instead constructs a
3306         MultiplexingBackendTarget, and will receive further information about
3307         sub-targets to connect to. The only sub-target at the moment is a Page
3308         sub-target.
3309
3310         As part of bringing up multi-target support this adds a few measures to
3311         handle situations where the frontend is playing fast and loose with agents.
3312         When the frontend does `FooAgent.method` it intends that to be performed
3313         on the "main" target being debugged. Likewise when the frontend loops
3314         over targets it expects them to be the debuggable targets. This patch
3315         profiles a new implementation of `WI.mainTarget` and `WI.targets` to
3316         match the assumptions being made by the frontend.
3317
3318           - In a direct-target world, there is a single target which
3319             should be used for global agents and in WI.targets.
3320
3321           - In a multi-target world, the page target is the one that
3322             should be used for global agents and WI.targets is the list
3323             of sub-targets (excluding the MultiplexingBackendTarget).
3324
3325         In a multi-target world, there are now commonly two Targets. The
3326         MultiplexingBackendTarget and a PageTarget sub-target. In the future
3327         this may include more targets, such as ServiceWorkers, DedicatedWorkers,
3328         and perhaps even frames.
3329
3330         In a multi-target world, the frontend is immediately told about targets
3331         as soon as it opens (via Target.targetCreated). In order to support
3332         this, frontend initialization happens without a main target being available.
3333         So this makes a few small changes to frontend initialization to perform
3334         a bit of work once we know what the main target is.
3335
3336         During a page transition the frontend is told to destroy existing targets
3337         and is soon after told about any new page targets (via Target.targetDestroyed
3338         and Target.targetCreated). The frontend special cases this page transition.
3339         It expects only one Page target to be alive at any time, accessible through
3340         WI.pageTarget. When a page transition happens the WI.pageTarget changes, and
3341         the frontend performs a bit of work to prepare the UI to handle the transition:
3342         `<Manager>.transitionPageTarget` / WI.Notification.TransitionPageTarget.
3343         For the most part the UI behaves fine as long once there are main frame
3344         change and main resource change events, but those other events allow
3345         the frontend to respond to the specific page transition cases.
3346
3347         * UserInterface/Base/Main.js:
3348         (WI.loaded):
3349         (WI.initializeBackendTarget):
3350         (WI.initializePageTarget):
3351         (WI.transitionPageTarget):
3352         (WI.terminatePageTarget):
3353         (WI.resetMainExecutionContext):
3354         (WI.redirectGlobalAgentsToConnection):
3355         (WI.contentLoaded):
3356         New global functions for target initialization
3357         and page transitioning.
3358
3359         * UserInterface/Test/Test.js:
3360         (WI.loaded):
3361         (WI.initializeBackendTarget):
3362         (WI.initializePageTarget):
3363         (WI.transitionPageTarget):
3364         (WI.terminatePageTarget):
3365         (WI.resetMainExecutionContext):
3366         (WI.redirectGlobalAgentsToConnection):
3367         New global functions for target initialization.
3368         Tests continue to be a direct connection to the Page.
3369
3370         * UserInterface/Protocol/TargetObserver.js:
3371         (WI.TargetObserver.prototype.targetCreated):
3372         (WI.TargetObserver.prototype.targetDestroyed):
3373         (WI.TargetObserver.prototype.dispatchMessageFromTarget):
3374         New observer goes to the manager.