c2c41ab18be7702f68ba82cdd963a8d6c38718a5
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2020-01-06  Nikita Vasilyev  <nvasilyev@apple.com>
2
3         Web Inspector: Color picker: make it keyboard accessible
4         https://bugs.webkit.org/show_bug.cgi?id=205572
5         <rdar://problem/58169943>
6
7         Reviewed by Brian Burg.
8
9         For the color square, make up, down, left, and right keys move the crosshair.
10
11         For the hue and opacity sliders:
12         - Pressing up and down keys should adjust the value by 1%.
13         - When holding Shift, up and down keys adjust the value by 10%.
14
15         * UserInterface/Views/ColorPicker.js:
16         (WI.ColorPicker.prototype.focus):
17         * UserInterface/Views/ColorSquare.css:
18         (.color-square):
19         Match the border of the hue and opacity sliders.
20
21         * UserInterface/Views/ColorSquare.js:
22         (WI.ColorSquare):
23         Make the color square focusable.
24
25         (WI.ColorSquare.prototype._handleMousedown):
26         (WI.ColorSquare.prototype._handleKeyDown):
27         * UserInterface/Views/InlineSwatch.js:
28         * UserInterface/Views/Slider.css:
29         (.slider:focus):
30         * UserInterface/Views/Slider.js:
31         (WI.Slider):
32         (WI.Slider.prototype._handleMousedown):
33         Drive-by: right clicking the slider shouldn't move the thumb.
34
35         (WI.Slider.prototype._handleKeyDown):
36
37 2020-01-06  Nikita Vasilyev  <nvasilyev@apple.com>
38
39         REGRESSION(r218839): Web Inspector: Color picker: pressing Esc should hide color picker
40         https://bugs.webkit.org/show_bug.cgi?id=205570
41         <rdar://problem/58169820>
42
43         Reviewed by Brian Burg.
44
45         * UserInterface/Views/QuickConsole.js:
46         (WI.QuickConsole.prototype.set keyboardShortcutDisabled):
47         (WI.QuickConsole.prototype._toggleOrFocus):
48         Restore keyboardShortcutDisabled setter, which was removed in r218839 without any explanation.
49
50 2020-01-06  Devin Rousso  <drousso@apple.com>
51
52         Web Inspector: Canvas: unable to see recording actions for WebGL canvases that have lots of shader programs
53         https://bugs.webkit.org/show_bug.cgi?id=205659
54
55         Reviewed by Brian Burg.
56
57         Limit the height of the canvas and shader program tree a recording is selected.
58
59         * UserInterface/Views/CanvasSidebarPanel.js:
60         (WI.CanvasSidebarPanel.prototype._updateRecordingScopeBar):
61         * UserInterface/Views/CanvasSidebarPanel.css:
62         (.sidebar > .panel.navigation.canvas.showing-recording > .content > .tree-outline.canvas): Added.
63
64 2019-12-21  Brian Burg  <bburg@apple.com>
65
66         Web Inspector: add InspectedTargetTypes diagnostic event and related hooks
67         https://bugs.webkit.org/show_bug.cgi?id=205174
68         <rdar://problem/57887953>
69
70         Reviewed by Devin Rousso.
71
72         This change adds a new diagnostic recorder that reports information about
73         inspected targets and their type / version information.
74
75         * UserInterface/Base/DebuggableType.js:
76         (WI.DebuggableType.fromString):
77         Move the static parsing factory method to DebuggableType class.
78
79         * UserInterface/Main.html: Add new files.
80         * UserInterface/Base/Main.js:
81         (WI.contentLoaded): Add new diagnostic recorder.
82
83         * UserInterface/Protocol/InspectorBackend.js:
84         (InspectorBackendClass.prototype.activateDomain):
85         Adapt to InspectorFrontendHost changes.
86
87         * UserInterface/Test/TestAppController.js:
88         (WI.TestAppController):
89         * UserInterface/Controllers/AppController.js:
90         (WI.AppController):
91         Adapt to InspectorFrontendHost changes.
92
93 2019-12-20  Nikita Vasilyev  <nvasilyev@apple.com>
94
95         Web Inspector: Gradient editor: opacity slider is too close to the right edge of the popover
96         https://bugs.webkit.org/show_bug.cgi?id=203643
97         <rdar://problem/56762879>
98
99         Reviewed by Devin Rousso.
100
101         Replace absolute positioning in the color picker with static layout.
102
103         * UserInterface/Views/ColorPicker.css:
104         (.color-picker .wrapper):
105         (.color-picker :matches(.color-square, .slider)):
106         (.color-picker .slider):
107         (.color-picker .hue):
108         (@media (color-gamut: p3) .color-picker.gamut-p3 > .hue):
109         (.color-picker > .color-inputs):
110         (.color-picker > .color-inputs > div):
111         (.color-picker > .color-inputs > div:not([hidden]) + div):
112         The 1st visible div should have no left margin even if it's preceded by a hidden div.
113
114         * UserInterface/Views/ColorPicker.js:
115         (WI.ColorPicker):
116         (WI.ColorPicker.prototype._updateOpacitySlider):
117         * UserInterface/Views/GradientEditor.css:
118         (.gradient-editor.editing-color):
119         (.gradient-editor > .color-picker .slider):
120         * UserInterface/Views/GradientEditor.js:
121         (WI.GradientEditor):
122         * UserInterface/Views/Slider.css:
123         (.slider):
124         (.slider > img):
125         (body[dir=ltr] .slider > img):
126         (body[dir=rtl] .slider > img):
127         * UserInterface/Views/Slider.js:
128         (WI.Slider):
129         (WI.Slider.prototype.set value):
130         (WI.Slider.prototype.set knobY):
131         (WI.Slider.prototype.get maxY):
132         (WI.Slider.prototype.recalculateKnobY):
133         (WI.Slider.prototype._handleMousedown):
134         (WI.Slider.prototype._handleMousemove):
135         * UserInterface/Views/Variables.css:
136         (:root):
137         Convert WI.Slider to be vertical by default. WI.Slider used to define a hozirontal slider.
138         It is only used by the color picker, where it's vertical. The slider was rotated with CSS
139         transformation. This made it problematic to use in the static layout.
140
141 2019-12-20  Brian Burg  <bburg@apple.com>
142
143         Web Inspector: convert some InspectorFrontendHost methods to getters
144         https://bugs.webkit.org/show_bug.cgi?id=205475
145
146         Reviewed by Devin Rousso.
147
148         No reason for these to be method calls, so expose as getters / attributes instead.
149
150         * UserInterface/Base/LoadLocalizedStrings.js:
151         * UserInterface/Base/Main.js:
152         * UserInterface/Base/ObjectStore.js:
153         (WI.ObjectStore.get _databaseName):
154         * UserInterface/Base/Platform.js:
155         * UserInterface/Base/Setting.js:
156         (WI.Setting._localStorageKey):
157         * UserInterface/Debug/Bootstrap.js:
158         (WI.runBootstrapOperations):
159         * UserInterface/Protocol/LoadInspectorBackendCommands.js:
160
161 2019-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
162
163         Web Inspector: Enable p3 color picker by default
164         https://bugs.webkit.org/show_bug.cgi?id=203931
165         <rdar://problem/56965236>
166
167         Reviewed by Devin Rousso.
168
169         * UserInterface/Base/Setting.js:
170         * UserInterface/Views/InlineSwatch.js:
171
172 2019-12-19  Devin Rousso  <drousso@apple.com>
173
174         Web Inspector: Console: the clear console button is hidden at smaller widths
175         https://bugs.webkit.org/show_bug.cgi?id=205438
176
177         Reviewed by Brian Burg.
178
179         Ever since r242604, we no longer "need" to show the text filter bar or message type scope
180         bar since new messages will show a warning banner that there's an active filter. Instead, we
181         should prefer showing the navigation items that control functionality that cannot be reached
182         anywhere else (visually), such as clearing the console or evaluating as a user gesture.
183
184         * UserInterface/Views/LogContentView.js:
185         (WI.LogContentView):
186         Make the text find banner and type scope bar both low priority, the preserve log and
187         evaluate as user gesture toggles normal priority, and the clear log high priority.
188
189 2019-12-19  Devin Rousso  <drousso@apple.com>
190
191         Web Inspector: Audit: exiting edit mode with the same selection as before entering edit mode doesn't reselect
192         https://bugs.webkit.org/show_bug.cgi?id=205435
193
194         Reviewed by Brian Burg.
195
196         * UserInterface/Views/AuditNavigationSidebarPanel.js:
197         (WI.AuditNavigationSidebarPanel.prototype.initialLayout):
198         Set `allowsRepeatSelection` so that selecting the previously selected tree element after
199         leaving edit mode will actually work.
200
201 2019-12-19  Devin Rousso  <drousso@apple.com>
202
203         Web Inspector: Elements: Styles: bezier keywords don't show a swatch
204         https://bugs.webkit.org/show_bug.cgi?id=205436
205
206         Reviewed by Brian Burg.
207
208         * UserInterface/Views/SpreadsheetStyleProperty.js:
209         (WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
210         Check if the current token is a direct match with one of the timing function keywords.
211
212 2019-12-19  Devin Rousso  <drousso@apple.com>
213
214         Web Inspector: Audit: importing a result with DOM nodes that don't match the inspected page appear as empty lines
215         https://bugs.webkit.org/show_bug.cgi?id=205437
216
217         Reviewed by Brian Burg.
218
219         * UserInterface/Views/AuditTestCaseContentView.js:
220         (WI.AuditTestCaseContentView.prototype.layout):
221         Call `refresh` on the `CodeMirror` instance after a timeout to give it a chance to be added
222         to the DOM tree.
223
224 2019-12-18  Devin Rousso  <drousso@apple.com>
225
226         Web Inspector: Elements: restrict showing paint flashing and compositing borders to the Web Inspector session
227         https://bugs.webkit.org/show_bug.cgi?id=205201
228
229         Reviewed by Timothy Hatcher.
230
231         We often get bugs from users who turn on paint flashing or compositing borders, close Web
232         Inspector, reopen Web Inspector, and are then surprised when the page flashes red or these
233         borders exist all over the page.
234
235         Given that the dark mode and print styles toggles are limited to the Web Inspector session,
236         we should make these have the same behavior.
237
238         * UserInterface/Base/Main.js:
239         (WI.initializeTarget):
240         * UserInterface/Base/Setting.js:
241         * UserInterface/Controllers/LayerTreeManager.js:
242         (WI.LayerTreeManager): Added.
243         (WI.LayerTreeManager.prototype.initializeTarget):
244         (WI.LayerTreeManager.supportsShowingPaintRects): Added.
245         (WI.LayerTreeManager.supportsVisibleCompositingBorders): Added.
246         (WI.LayerTreeManager.prototype.get showPaintRects): Added.
247         (WI.LayerTreeManager.prototype.set showPaintRects): Added.
248         (WI.LayerTreeManager.prototype.get compositingBordersVisible): Added.
249         (WI.LayerTreeManager.prototype.set compositingBordersVisible): Added.
250         (WI.LayerTreeManager.prototype.updateCompositingBordersVisibleFromPageIfNeeded): Added.
251         Use `WI.LayerTreeManager` to control the state of paint flashing and compositing borders, as
252         they're both related to the concept of layers.
253
254         * UserInterface/Views/DOMTreeContentView.js:
255         (WI.DOMTreeContentView):
256         (WI.DOMTreeContentView.prototype.shown):
257         (WI.DOMTreeContentView.prototype.closed):
258         (WI.DOMTreeContentView.prototype.attached): Added.
259         (WI.DOMTreeContentView.prototype.detached): Added.
260         (WI.DOMTreeContentView.prototype._handleCompositingBordersVisibleChanged): Added.
261         (WI.DOMTreeContentView.prototype._handleCompositingBordersButtonClicked): Added.
262         (WI.DOMTreeContentView.prototype._handleShowPaintRectsChanged): Added.
263         (WI.DOMTreeContentView.prototype._handlePaingFlashingButtonClicked): Added.
264         (WI.DOMTreeContentView.prototype._toggleCompositingBorders): Deleted.
265         (WI.DOMTreeContentView.prototype._togglePaintFlashing): Deleted.
266         (WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings): Deleted.
267         (WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged): Deleted.
268
269         * UserInterface/Views/Layers3DContentView.js:
270         (WI.Layers3DContentView):
271         (WI.Layers3DContentView.prototype.shown):
272         (WI.Layers3DContentView.prototype.hidden):
273         (WI.Layers3DContentView.prototype.attached): Added.
274         (WI.Layers3DContentView.prototype.detached): Added.
275         (WI.Layers3DContentView.prototype._handleCompositingBordersVisibleChanged): Added.
276         (WI.Layers3DContentView.prototype._handleCompositingBordersButtonClicked): Added.
277         (WI.Layers3DContentView.prototype._handleShowPaintRectsChanged): Added.
278         (WI.Layers3DContentView.prototype._handlePaingFlashingButtonClicked): Added.
279         (WI.Layers3DContentView.prototype.closed): Deleted.
280         (WI.Layers3DContentView.prototype._showPaintRectsSettingChanged): Deleted.
281         (WI.Layers3DContentView.prototype._togglePaintFlashing): Deleted.
282         (WI.Layers3DContentView.prototype._updateCompositingBordersButtonState): Deleted.
283         (WI.Layers3DContentView.prototype._toggleCompositingBorders): Deleted.
284
285 2019-12-18  Yury Semikhatsky  <yurys@chromium.org>
286
287         Web Inspector: Runtime.enable reports duplicates (non existent) contexts
288         https://bugs.webkit.org/show_bug.cgi?id=204859
289
290         Reviewed by Devin Rousso.
291
292         Assert that all contexts added to the list are unique.
293
294         * UserInterface/Models/ExecutionContextList.js:
295         (WI.ExecutionContextList.prototype.add):
296
297 2019-12-18  Devin Rousso  <drousso@apple.com>
298
299         Web Inspector: Elements: remove the "Show/Hide Shadow DOM" navigation item
300         https://bugs.webkit.org/show_bug.cgi?id=205199
301
302         Reviewed by Timothy Hatcher.
303
304         There's really no good reason to hide shadow DOM, especially for non-user-agent shadow trees.
305         The user has full control over whether to expand/collapse shadow trees (and their hosts), so
306         having a setting that entirely removes the shadow trees from view throughout Web Inspector
307         seems overkill.
308
309         * UserInterface/Base/Setting.js:
310
311         * UserInterface/Models/DOMNode.js:
312         (WI.DOMNode):
313         (WI.DOMNode.prototype.get nextSibling):
314         (WI.DOMNode.prototype.get previousSibling):
315         (WI.DOMNode.prototype.get children):
316         (WI.DOMNode.prototype.get childNodeCount):
317
318         * UserInterface/Views/DOMTreeContentView.js:
319         (WI.DOMTreeContentView):
320         (WI.DOMTreeContentView.prototype.get navigationItems):
321         (WI.DOMTreeContentView.prototype.closed):
322         (WI.DOMTreeContentView.prototype._showShadowDOMSettingChanged): Deleted.
323         (WI.DOMTreeContentView.prototype._toggleShowsShadowDOMSetting): Deleted.
324
325         * UserInterface/Views/DOMTreeOutline.js:
326         (WI.DOMTreeOutline.prototype.close):
327         (WI.DOMTreeOutline.prototype._revealAndSelectNode):
328         (WI.DOMTreeOutline.prototype._showShadowDOMSettingChanged): Deleted.
329
330         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
331         (WI.LayerTreeDetailsSidebarPanel.prototype.initialLayout):
332         (WI.LayerTreeDetailsSidebarPanel.prototype._updateDisplayWithLayers):
333         (WI.LayerTreeDetailsSidebarPanel.prototype._showShadowDOMSettingChanged): Deleted.
334
335         * UserInterface/Images/ShadowDOM.svg: Removed.
336         * Localizations/en.lproj/localizedStrings.js:
337
338 2019-12-11  Brian Burg  <bburg@apple.com>
339
340         Web Inspector: add TabNavigation diagnostic event and related hooks
341         https://bugs.webkit.org/show_bug.cgi?id=205138
342         <rdar://problem/57855456>
343
344         Reviewed by Devin Rousso.
345
346         This patch adds a new recorder for the TabNavigation diagnostic event.
347
348         The bulk of this patch is to find all callsites that can possibly change the active
349         tab and annotate them with the type of interaction (tab click, link click,
350         keyboard shortcut, inspect, and others). This patch was developed through
351         trial and error by logging the diagnostic events and debugging any scenarios
352         where a tab navigation is not correctly annotated with the initiating interaction.
353
354         * UserInterface/Main.html: Add new file.
355         * UserInterface/Base/Main.js:
356         (WI.contentLoaded): Register new recorder.
357         (WI._handleSettingsKeyboardShortcut): Annotate as keyboard shortcut.
358         - Add options argument to most WI.show*Tab functions, and forward to the underlying
359         TabBrowser or TabBar calls. This allows initiatorHint to be used in these cases.
360         - Add other annotations to linkifyElement
361
362         * UserInterface/Views/TabBrowser.js:
363         (WI.TabBrowser.prototype.showTabForContentView):
364         (WI.TabBrowser.prototype._tabBarItemSelected):
365         - Try to infer an initiator for the tab navigation from TabBrowser API arguments or from TabBar's event.
366         - Add an enum with TabNavigationInitiator values.
367
368         * UserInterface/Base/DOMUtilities.js:
369         Clickable element links should be reported as link clicks. Add an annotation
370         so that it isn't reported as "Inspect" (due to going through DOMManager.inspectElement).
371
372         * UserInterface/Controllers/CallFrameTreeController.js:
373         (WI.CallFrameTreeController):
374         (WI.CallFrameTreeController.prototype._showSourceCodeLocation):
375         This is mainly used by Canvas tab. Annotate call frame links as link clicks.
376
377         * UserInterface/Controllers/DOMManager.js:
378         (WI.DOMManager.prototype.inspectElement):
379         Accept an options argument. This is used to forward the initiatorHint to
380         the listener of this event, WI._domNodeWasInspected, so it can forward the
381         initiatorHint further on.
382
383         * UserInterface/Protocol/InspectorFrontendAPI.js:
384         (InspectorFrontendAPI.setTimelineProfilingEnabled):
385         (InspectorFrontendAPI.showConsole):
386         (InspectorFrontendAPI.showResources):
387         (InspectorFrontendAPI.showTimelines):
388         (InspectorFrontendAPI.showMainResourceForFrame):
389         Annotate these as FrontendAPI calls. Mainly used by Develop menu items in Safari.
390
391         * UserInterface/Views/ContextMenuUtilities.js:
392         (WI.appendContextMenuItemsForSourceCode):
393         (WI.appendContextMenuItemsForURL):
394         Annotate as context menu.
395
396         * UserInterface/Views/DOMNodeTreeElement.js:
397         (WI.DOMNodeTreeElement):
398         (WI.DOMNodeTreeElement.prototype.populateContextMenu):
399         Annotate as context menu.
400
401         * UserInterface/Views/DOMTreeElement.js:
402         (WI.DOMTreeElement.prototype._buildTagDOM):
403
404
405         * UserInterface/Views/DefaultDashboardView.js:
406         (WI.DefaultDashboardView.prototype._resourcesItemWasClicked):
407         (WI.DefaultDashboardView.prototype._networkItemWasClicked):
408         (WI.DefaultDashboardView.prototype._timelineItemWasClicked):
409         (WI.DefaultDashboardView.prototype._consoleItemWasClicked):
410         Annotate as dashboard.
411
412         * UserInterface/Views/LegacyTabBar.js:
413         (WI.LegacyTabBar.prototype.set selectedTabBarItem):
414         Include the inferred initiator in the event that is dispatched.
415
416         (WI.LegacyTabBar.prototype.selectTabBarItemWithInitiator):
417         Added. This is a convenience method that temporarily sets the
418         initiator before invoking the setter (which reads the initator).
419
420         (WI.LegacyTabBar.prototype._handleMouseDown):
421         (WI.LegacyTabBar.prototype._handleClick):
422         (WI.LegacyTabBar.prototype._handleNewTabClick):
423         Treat these as "tab clicks".
424
425         * UserInterface/Views/TabBar.js:
426         (WI.TabBar.prototype.set selectedTabBarItem):
427         (WI.TabBar.prototype.selectTabBarItemWithInitiator):
428         (WI.TabBar.prototype._handleMouseDown):
429         (WI.TabBar.prototype._handleClick):
430         Changes from LegacyTabBar have been copied to this version, as it's a
431         drop-in replacement.
432
433         * UserInterface/Views/LogContentView.js:
434         (WI.LogContentView.prototype._showConsoleTab):
435         Treat the console chevron as a "button click".
436
437         * UserInterface/Views/NewTabContentView.js:
438         (WI.NewTabContentView.prototype._createNewTabWithType):
439         Treat each tab button as a "button click".
440
441         * UserInterface/Views/RecordingActionTreeElement.js:
442         (WI.RecordingActionTreeElement.prototype.populateContextMenu):
443         Annotate as context menu.
444
445         * UserInterface/Views/ResourceTimelineDataGridNode.js:
446         (WI.ResourceTimelineDataGridNode.prototype._dataGridNodeGoToArrowClicked):
447         Annotate as link click.
448
449         * UserInterface/Views/SearchResultTreeElement.js:
450         (WI.SearchResultTreeElement):
451         (WI.SearchResultTreeElement.prototype.populateContextMenu):
452         Annotate as context menu.
453
454         * UserInterface/Views/SourceCodeTextEditor.js:
455         (WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
456         Annotate as context menu.
457
458         (WI.SourceCodeTextEditor.prototype._showPopoverForObject.):
459         (WI.SourceCodeTextEditor.prototype._showPopoverForObject):
460         Annotate elements in popover as link click.
461
462         * UserInterface/Views/SourceCodeTreeElement.js:
463         (WI.SourceCodeTreeElement):
464         (WI.SourceCodeTreeElement.prototype._handleToggleBlackboxedImageElementClicked):
465         Annotate as context menu.
466
467         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
468         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu):
469         Annotate as context menu.
470
471         * UserInterface/Views/SpreadsheetStyleProperty.js:
472         (WI.SpreadsheetStyleProperty.prototype._setupJumpToSymbol):
473         Annotate as link click.
474
475 2019-12-15  Emilio Cobos Álvarez  <emilio@crisal.io>
476
477         Remove -webkit-marquee.
478         https://bugs.webkit.org/show_bug.cgi?id=117769
479
480         Reviewed by Simon Fraser.
481
482         * UserInterface/Models/CSSKeywordCompletions.js:
483
484 2019-12-12  Yury Semikhatsky  <yurys@chromium.org>
485
486         Web Inspector: Error: Can't make a ContentView for an unknown representedObject of type: CallFrame
487         https://bugs.webkit.org/show_bug.cgi?id=204823
488
489         Reviewed by Devin Rousso.
490
491         If no type is stored in the cookie matching by type should fail.
492
493         * UserInterface/Views/NavigationSidebarPanel.js:
494         (WI.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie.treeElementMatchesCookie):
495         (WI.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
496
497 2019-12-12  Devin Rousso  <drousso@apple.com>
498
499         Web Inspector: REGRESSION(r251227): Uncaught Exception: undefined is not an object (evaluating 'target.DOMAgent.setInspectModeEnabled')
500         https://bugs.webkit.org/show_bug.cgi?id=205148
501
502         Reviewed by Joseph Pecoraro.
503
504         * UserInterface/Protocol/InspectorFrontendAPI.js:
505         (InspectorFrontendAPI.setTimelineProfilingEnabled):
506         (InspectorFrontendAPI.setElementSelectionEnabled):
507         If there are no targets available yet (`WI.targetsAvailable()`), then wait for targets to
508         be available (`WI.whenTargetsAvailable()`) before performing the intended logic, as the
509         `InspectorFrontendAPI` only waits for the backend connection to be established before
510         dispatching, meaning that there may not be a page target yet. Other `InspectorFrontendAPI`
511         functions don't need to be changed because they don't cause commands to be invoked.
512
513         * UserInterface/Controllers/DOMManager.js:
514         (WI.DOMManager.prototype.set inspectModeEnabled):
515         Drive-by: don't assume that inspect mode is disabled if an error is thrown.
516
517         * UserInterface/Base/Main.js:
518         Drive-by: remove duplicate function `WI._toggleInspectMode` as it already exists.
519
520 2019-12-11  Devin Rousso  <drousso@apple.com>
521
522         Web Inspector: REGRESSION: Console: unable to switch execution contexts
523         https://bugs.webkit.org/show_bug.cgi?id=205102
524         <rdar://problem/57748393>
525
526         Reviewed by Brian Burg.
527
528         * UserInterface/Views/QuickConsole.js:
529         (WI.QuickConsole):
530         Wait to initialize the main execution context path component until we actually have a main
531         execution context.
532
533         (WI.QuickConsole.prototype._pageTargetTransitioned):
534         Remove unnecessary duplicate early return.
535
536         (WI.QuickConsole.prototype._initializeMainExecutionContextPathComponent):
537         Restore the link to the next path component if the main execution context path component is
538         recreated when there already exist other execution contexts.
539
540         (WI.QuickConsole.prototype._selectExecutionContext):
541         Remove unnecessary assertion.
542
543         (WI.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
544         When the execution context of the main frame changes, recreate the main execution context
545         path component so it has the right `representedObject`.
546
547         * UserInterface/Views/HierarchicalPathNavigationItem.js:
548         (WI.HierarchicalPathNavigationItem.prototype.update):
549         Only hide the tooltip if we're not `sizeToFit` as otherwise we never unhide it due to an
550         early return (`sizeToFit` just makes everything visible).
551
552 2019-12-11  Devin Rousso  <drousso@apple.com>
553
554         Web Inspector: Elements: Styles: hovering over an invalid value while holding ⌘ doesn't change the color of the text
555         https://bugs.webkit.org/show_bug.cgi?id=205039
556
557         Reviewed by Brian Burg.
558
559         Only apply a `color` or `-webkit-text-decoration-color` when either the ⌘ key is not pressed
560         or if the mouse is not actively hovering over the node when the ⌘ is pressed.
561
562         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
563         (body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .name:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .name:not(:hover, .editing)): Added.
564         (.spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value): Added.
565         (body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(:hover, .editing)): Added.
566         (.spreadsheet-style-declaration-editor .property.disabled):
567         (.spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > *:not(.name, .value-container), .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > .value-container > *:not(.value), body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > :matches(.name,  value-container):not(.editing), body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > .value-container >  value:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > :matches(.name,  value-container):not(:hover, .editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) > .content > .value-container > .value:not(:hover, .editing)): Added.
568         (.spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > *:not(.name, .value-container), .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > .value-container > *:not(.value), body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > :matches(.name, .value-container):not(.editing), body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > .value-container > .value:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > :matches(.name, .value-container):not(:hover, .editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property.invalid-name:not(.disabled) > .content > .value-container > .value:not(:hover, .editing)): Added.
569         (body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property.invalid-value:not(.disabled) > .content > .value:not(.editing), body.meta-key-pressed .spreadsheet-style-declaration-editor > .property.invalid-value:not(.disabled) > .content > .value:not(:hover, .editing)): Added.
570         (body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(.editing) .token-link, body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(:hover, .editing) .token-link): Added.
571         (body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(.editing) .token-string, body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(:hover, .editing) .token-string): Added.
572         (body.meta-key-pressed .spreadsheet-css-declaration:not(.locked) > .spreadsheet-style-declaration-editor > .property > .content :matches(.name, .value):not(.editing):hover): Added.
573         (body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(.editing) .token-comment, body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:not(.disabled) > .content > .value:not(:hover, .editing) .token-comment): Added.
574         (.spreadsheet-style-declaration-editor .property:not(.disabled) .name): Deleted.
575         (.spreadsheet-style-declaration-editor .property:not(.disabled) .value): Deleted.
576         (.spreadsheet-style-declaration-editor .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) .content > *): Deleted.
577         (.spreadsheet-style-declaration-editor .property.invalid-name:not(.disabled) .content > *): Deleted.
578         (.spreadsheet-style-declaration-editor .property.invalid-value:not(.disabled) .content .value): Deleted.
579         (.spreadsheet-style-declaration-editor .property:not(.disabled) .token-link): Deleted.
580         (.spreadsheet-style-declaration-editor .property:not(.disabled) .token-string): Deleted.
581         (.meta-key-pressed .spreadsheet-css-declaration:not(.locked) :matches(.name, .value):not(.editing):hover): Deleted.
582         (.spreadsheet-style-declaration-editor .property:not(.disabled) .token-comment): Deleted.
583
584 2019-12-11  Devin Rousso  <drousso@apple.com>
585
586         Web Inspector: REGRESSION(r253173): Console: evaluating a command should automatically scroll to it's result
587         https://bugs.webkit.org/show_bug.cgi?id=205105
588
589         Reviewed by Brian Burg.
590
591         * UserInterface/Views/LogContentView.js:
592         (WI.LogContentView):
593         (WI.LogContentView.prototype.get scrollableElements):
594         (WI.LogContentView.prototype._updateMessagesSelection):
595         (WI.LogContentView.prototype._highlightSearchMatchAtIndex):
596         (WI.LogContentView.prototype.layout): Deleted.
597         (WI.LogContentView.prototype._ensureMessageIsVisible): Deleted.
598         (WI.LogContentView.prototype._positionForMessage): Deleted.
599         Now that this uses `display: flex;`, the actual scrollable element is the `messagesElement`,
600         so use that instead when manually setting the `scrollTop`. Use `scrollIntoViewIfNeeded` when
601         revealing search results instead of any custom scroll offset calculations.
602
603         * UserInterface/Views/LogContentView.css:
604         (.content-view.log > .hidden-messages-banner):
605         Drive-by: ensure that the hidden messages banner doesn't shrink.
606
607 2019-12-11  Devin Rousso  <drousso@apple.com>
608
609         Web Inspector: simplify the text of the script blackboxing context menu item
610         https://bugs.webkit.org/show_bug.cgi?id=205099
611
612         Reviewed by Brian Burg.
613
614         "Blackbox script to ignore it when debugging" is a bit too long for a context menu item.
615         We should use something simpler, like "Blackbox Script".
616
617         * UserInterface/Views/ContextMenuUtilities.js:
618         (WI.appendContextMenuItemsForSourceCode):
619
620         * Localizations/en.lproj/localizedStrings.js:
621
622 2019-12-11  Devin Rousso  <drousso@apple.com>
623
624         Web Inspector: replace all "Remove" context menu items with "Delete" to be consistent
625         https://bugs.webkit.org/show_bug.cgi?id=205098
626
627         Reviewed by Brian Burg.
628
629         * UserInterface/Views/BlackboxSettingsView.js:
630         (WI.BlackboxSettingsView.prototype._addRow):
631         * UserInterface/Views/BootstrapScriptTreeElement.js:
632         (WI.BootstrapScriptTreeElement.prototype.populateContextMenu):
633         * UserInterface/Views/BreakpointActionView.js:
634         (WI.BreakpointActionView):
635         * UserInterface/Views/ContextMenuUtilities.js:
636         (WI.appendContextMenuItemsForSourceCode):
637         Drive-by: if a local override exists for the given source code, add an item for
638                   enabling/disabling and deleting it.
639         * UserInterface/Views/LocalResourceOverrideTreeElement.js:
640         (WI.LocalResourceOverrideTreeElement.prototype.populateContextMenu):
641         * UserInterface/Views/ProbeSetDetailsSection.js:
642         (WI.ProbeSetDetailsSection):
643         * UserInterface/Views/ResourceContentView.js:
644         (WI.ResourceContentView):
645         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
646         (WI.ScopeChainDetailsSidebarPanel.prototype._objectTreeElementAddContextMenuItems):
647         * Localizations/en.lproj/localizedStrings.js:
648
649 2019-12-11  Devin Rousso  <drousso@apple.com>
650
651         Web Inspector: Uncaught Exception: Missing frame for given frameId (on techcrunch.com)
652         https://bugs.webkit.org/show_bug.cgi?id=205130
653         <rdar://problem/57847699>
654
655         Reviewed by Timothy Hatcher.
656
657         * UserInterface/Controllers/ApplicationCacheManager.js:
658         (WI.ApplicationCacheManager.prototype._manifestForFrameLoaded):
659         A frame can go away between `ApplicationCache.getManifestForFrame` being called and the
660         response being received, so don't re-throw the error if the frontend no longer has a
661         matching `WI.Frame` for the given `frameId`.
662
663 2019-12-10  Devin Rousso  <drousso@apple.com>
664
665         Web Inspector: REGRESSION(r251038): Elements: Computed: implicit shorthands are not shown when "Prefer Shorthands" is enabled
666         https://bugs.webkit.org/show_bug.cgi?id=205035
667         <rdar://problem/57773470>
668
669         Reviewed by Brian Burg.
670
671         The computed style treats most shorthand properties as "implicit", meaning that if "Prefer
672         Shorthands" is enabled, we won't show the shorthand properties unless "Show All" is also
673         enabled. The frontend can fix this by checking to see if there are any non-implicit longhand
674         values for each shorthand value, and therefore decide not to hide the "implicit" shorthand.
675
676         * UserInterface/Views/ComputedStyleSection.js:
677         (WI.ComputedStyleSection.prototype.get propertiesToRender):
678         (WI.ComputedStyleSection.prototype.get propertiesToRender.hasNonImplicitLonghand): Added.
679         Drive-by: filter the list of properties to render before sorting them for performance.
680
681 2019-12-10  Devin Rousso  <drousso@apple.com>
682
683         REGRESSION(r252523): Web Inspector: Styles: semicolon is wrongly positioned in multiline values
684         https://bugs.webkit.org/show_bug.cgi?id=205034
685         <rdar://problem/57772846>
686
687         Reviewed by Brian Burg.
688
689         Wrap the value node in another `<span class="value-container">` so that the semicolon can be
690         included as part of the `display: inline-block;` when there are multiple lines in the value.
691
692         * UserInterface/Views/SpreadsheetStyleProperty.js:
693         (WI.SpreadsheetStyleProperty.prototype.update):
694
695         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
696         (.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .value-container): Added.
697         (.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .value): Deleted.
698
699 2019-12-10  Devin Rousso  <drousso@apple.com>
700
701         Web Inspector: Elements: Styles: there is a double border between the last rule and the class list area or filter area
702         https://bugs.webkit.org/show_bug.cgi?id=205040
703
704         Reviewed by Brian Burg.
705
706         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
707         (.sidebar > .panel.details.css-style.style-rules > .content ~ :matches(.options-container, .class-list-container)): Added.
708         (.sidebar > .panel.details.css-style > .content ~ .options-container):
709         Use a CSS transform to move the class list area and filter area up when the Styles panel is
710         selected in the details sidebar of the Elements Tab.
711
712 2019-12-10  Devin Rousso  <drousso@apple.com>
713
714         Web Inspector: REGRESSION(r253167): Elements: class list toggle doesn't stay sticky to the bottom of the sidebar
715         https://bugs.webkit.org/show_bug.cgi?id=205033
716
717         Reviewed by Brian Burg.
718
719         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
720         (.sidebar > .panel.details.css-style > .content):
721         Ensure that the main content of the sidebar panel takes up as much space as possible.
722
723 2019-12-10  Devin Rousso  <drousso@apple.com>
724
725         Web Inspector: Uncaught Exception: this._objectTree.resetPropertyPath is not a function. (In 'this._objectTree.resetPropertyPath()', 'this._objectTree.resetPropertyPath' is undefined)
726         https://bugs.webkit.org/show_bug.cgi?id=205026
727
728         Reviewed by Brian Burg.
729
730         * UserInterface/Views/ConsoleMessageView.js:
731         (WI.ConsoleMessageView.prototype.clearSessionState):
732         The `_objectTree` can also be an `WI.ErrorObjectView`, which doesn't have a property path.
733
734 2019-12-06  Devin Rousso  <drousso@apple.com>
735
736         Web Inspector: Uncaught Exception: Missing node for given nodeId
737         https://bugs.webkit.org/show_bug.cgi?id=204519
738
739         Reviewed by Timothy Hatcher.
740
741         When a DOM node is removed from the main DOM tree, the `InspectorDOMAgent` invalidates the
742         `DOM.NodeId` that was previously assigned to that DOM node, meaning that any future commands
743         sent by the frontend with that `DOM.NodeId` will fail.
744
745         Add logic to mark `WI.DOMNode` as being `destroyed` when this happens so the frontend can
746         decide to not invoke any commands with that `DOM.NodeId`.
747
748         Many functions have also switched to expecting a `WI.DOMNode` instead of a `DOM.NodeId` or
749         have been moved to `WI.DOMNode.prototype` in order to also be able to use `destroyed`.
750
751         This issue will eventually be mitigated by <https://webkit.org/b/189687>.
752
753         * UserInterface/Models/DOMNode.js:
754         (WI.DOMNode):
755         (WI.DOMNode.prototype.get destroyed): Added.
756         (WI.DOMNode.prototype.get attached):
757         (WI.DOMNode.prototype.markDestroyed): Added.
758         (WI.DOMNode.prototype.setNodeName):
759         (WI.DOMNode.prototype.setNodeValue):
760         (WI.DOMNode.prototype.setAttribute):
761         (WI.DOMNode.prototype.setAttributeValue):
762         (WI.DOMNode.prototype.querySelector): Added.
763         (WI.DOMNode.prototype.querySelectorAll): Added.
764         (WI.DOMNode.prototype.highlight): Added.
765         (WI.DOMNode.prototype.getOuterHTML):
766         (WI.DOMNode.prototype.setOuterHTML):
767         (WI.DOMNode.prototype.removeNode):
768         (WI.DOMNode.prototype.getEventListeners):
769
770         * UserInterface/Base/DOMUtilities.js:
771         (WI.bindInteractionsForNodeToElement):
772         * UserInterface/Controllers/DOMManager.js:
773         (WI.DOMManager.buildHighlightConfig):
774         (WI.DOMManager.wrapClientCallback):
775         (WI.DOMManager.prototype._loadNodeAttributes):
776         (WI.DOMManager.prototype._setDocument):
777         (WI.DOMManager.prototype._unbind):
778         (WI.DOMManager.prototype.highlightDOMNodeList):
779         (WI.DOMManager.prototype.highlightSelector):
780         (WI.DOMManager.prototype.hideDOMNodeHighlight):
781         (WI.DOMManager.prototype.highlightDOMNodeForTwoSeconds):
782         (WI.DOMManager.prototype.set inspectModeEnabled):
783         (WI.DOMManager.prototype.setInspectedNode):
784         (WI.DOMManager.prototype.setEventListenerDisabled):
785         (WI.DOMManager.prototype._wrapClientCallback): Deleted.
786         (WI.DOMManager.prototype.querySelector): Deleted.
787         (WI.DOMManager.prototype.querySelectorAll): Deleted.
788         (WI.DOMManager.prototype.highlightDOMNode): Deleted.
789         (WI.DOMManager.prototype._buildHighlightConfig): Deleted.
790         * UserInterface/Models/AuditTestCaseResult.js:
791         (WI.AuditTestCaseResult.async fromPayload):
792         * UserInterface/Models/MediaTimelineRecord.js:
793         (WI.MediaTimelineRecord.async fromJSON):
794         * UserInterface/Protocol/RemoteObject.js:
795         (WI.RemoteObject.resolveNode):
796         * UserInterface/Views/BoxModelDetailsSectionRow.js:
797         (WI.BoxModelDetailsSectionRow.prototype._highlightDOMNode):
798         * UserInterface/Views/CanvasOverviewContentView.js:
799         (WI.CanvasOverviewContentView.prototype._contentViewMouseEnter):
800         * UserInterface/Views/CanvasTreeElement.js:
801         (WI.CanvasTreeElement.prototype._handleMouseOver):
802         * UserInterface/Views/ContextMenuUtilities.js:
803         (WI.appendContextMenuItemsForDOMNode):
804         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
805         (WI.DOMNodeDetailsSidebarPanel.prototype.layout):
806         * UserInterface/Views/DOMTreeContentView.js:
807         (WI.DOMTreeContentView.prototype._domTreeSelectionDidChange):
808         * UserInterface/Views/DOMTreeElement.js:
809         (WI.DOMTreeElement.prototype.get editable):
810         (WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
811         * UserInterface/Views/DOMTreeElementPathComponent.js:
812         (WI.DOMTreeElementPathComponent.prototype.mouseOver):
813         * UserInterface/Views/DOMTreeOutline.js:
814         (WI.DOMTreeOutline.prototype.get editable):
815         (WI.DOMTreeOutline.prototype.populateContextMenu):
816         (WI.DOMTreeOutline.prototype._onmousemove):
817         (WI.DOMTreeOutline.prototype._ondragstart):
818         (WI.DOMTreeOutline.prototype._ondragover):
819         (WI.DOMTreeOutline.prototype._ondragleave):
820         (WI.DOMTreeOutline.prototype._ondragend):
821         (WI.DOMTreeOutline.prototype._hideElements):
822         * UserInterface/Views/FormattedValue.js:
823         (WI.FormattedValue.createElementForNodePreview):
824         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
825         (WI.GeneralStyleDetailsSidebarPanel.prototype.layout):
826         * UserInterface/Views/LayerDetailsSidebarPanel.js:
827         (WI.LayerDetailsSidebarPanel.prototype._dataGridMouseMove):
828         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
829         (WI.LayerTreeDetailsSidebarPanel.prototype.layout):
830         (WI.LayerTreeDetailsSidebarPanel.prototype._highlightSelectedNode):
831         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
832         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._highlightNodesWithSelector):
833
834 2019-12-06  Devin Rousso  <drousso@apple.com>
835
836         Web Inspector: saving a file with the url "/" suggest the name "Untitled"
837         https://bugs.webkit.org/show_bug.cgi?id=204910
838
839         Reviewed by Timothy Hatcher.
840
841         * UserInterface/Base/FileUtilities.js:
842         (WI.FileUtilities.save):
843         Allow callers to specify a `suggestedName` that is used if possible.
844
845         * UserInterface/Views/ContextMenuUtilities.js:
846         (WI.appendContextMenuItemsForSourceCode):
847         (WI.appendContextMenuItemsForDOMNode):
848         * UserInterface/Views/TextResourceContentView.js:
849         (WI.TextResourceContentView.prototype.get saveData):
850         * UserInterface/Views/ResourceContentView.js:
851         (WI.ResourceContentView.prototype.get saveData):
852         If the path of the selected source code is just "/", set the `suggestedName` to "index" and
853         use an extension derived from the MIME type (if able).
854
855         * UserInterface/Controllers/AuditManager.js:
856         (WI.AuditManager.prototype.export):
857         * UserInterface/Views/ConsoleMessageView.js:
858         (WI.ConsoleMessageView.prototype._handleContextMenu):
859         * UserInterface/Views/HeapSnapshotContentView.js:
860         (WI.HeapSnapshotContentView.prototype._exportSnapshot):
861         * UserInterface/Views/LogContentView.js:
862         (WI.LogContentView.prototype.get saveData):
863         (WI.LogContentView.prototype._handleContextMenuEvent):
864         * UserInterface/Views/NetworkTableContentView.js:
865         (WI.NetworkTableContentView.prototype._exportHAR):
866         * UserInterface/Views/RecordingContentView.js:
867         (WI.RecordingContentView.prototype._exportRecording):
868         (WI.RecordingContentView.prototype._exportReduction):
869         * UserInterface/Views/ScriptContentView.js:
870         (WI.ScriptContentView.prototype.get saveData):
871         * UserInterface/Views/ShaderProgramContentView.js:
872         (WI.ShaderProgramContentView.prototype.get saveData):
873         * UserInterface/Views/TextContentView.js:
874         (WI.TextContentView.prototype.get saveData):
875         * UserInterface/Views/TimelineRecordingContentView.js:
876         (WI.TimelineRecordingContentView.prototype._exportTimelineRecording):
877         * UserInterface/Debug/ProtocolTrace.js:
878         (WI.ProtocolTrace.prototype.get saveData):
879         Prefer `suggestedName` vs `WI.FileUtilities.inspectorURLForFilename`, which is now always
880         called inside `WI.FileUtilities.save` anyways.
881
882 2019-12-06  Devin Rousso  <drousso@apple.com>
883
884         Web Inspector: REGRESSION(r252652): Local Overrides: creating a local override for a resource loaded before Web Inspector was opened shows NaN for the Status Code
885         https://bugs.webkit.org/show_bug.cgi?id=204965
886
887         Reviewed by Joseph Pecoraro.
888
889         * UserInterface/Views/LocalResourceOverridePopover.js:
890         (WI.LocalResourceOverridePopover.prototype.show):
891         Make sure to update the object that holds the resource's original data in addition to the
892         object that holds the current edited values.
893         Drive-by: update the popover once all of the `CodeMirror`s have updated to hide scrollbars.
894
895 2019-11-25  Brian Burg  <bburg@apple.com>
896
897         Web Inspector: TabActivity diagnostic event should sample the active tab uniformly
898         https://bugs.webkit.org/show_bug.cgi?id=204531
899
900         Reviewed by Devin Rousso.
901
902         Rewrite this class to use a uniform sampling approach. Every n seconds, a timer fires and
903         samples what the current tab is. If the last user interaction happened up to n seconds ago,
904         report a TabActivity diagnostic event. Keeping with the previous implementation, samples
905         are taken every n=60 seconds.
906
907         To account for bias in the initial sample when Web Inspector is open, wait m seconds for
908         the first sample. This accounts for the time between opening Web Inspector and choosing the
909         desired tab. In my testing, m=10 is enough time to load Web Inspector and switch
910         immediately to a different tab. In that case, the initial tab would not be sampled as the
911         active tab even if the last user interaction (clicking tab bar) happened while the initial
912         tab was displayed. If the recorder's setup() method is called some time after Web Inspector is
913         opened, then the initial delay will shrink to ensure at least 10s has elapsed since the frontend
914         finished loading.
915
916         * UserInterface/Base/Main.js:
917         (WI.contentLoaded): Keep a timestamp of when the frontend finished loading.
918
919         * UserInterface/Controllers/TabActivityDiagnosticEventRecorder.js:
920         (WI.TabActivityDiagnosticEventRecorder):
921         (WI.TabActivityDiagnosticEventRecorder.prototype.setup):
922         (WI.TabActivityDiagnosticEventRecorder.prototype.teardown):
923         (WI.TabActivityDiagnosticEventRecorder.prototype._startInitialDelayBeforeSamplingTimer):
924         (WI.TabActivityDiagnosticEventRecorder.prototype._stopInitialDelayBeforeSamplingTimer):
925         (WI.TabActivityDiagnosticEventRecorder.prototype._startEventSamplingTimer):
926         (WI.TabActivityDiagnosticEventRecorder.prototype._stopEventSamplingTimer):
927         (WI.TabActivityDiagnosticEventRecorder.prototype._sampleCurrentTabActivity):
928         (WI.TabActivityDiagnosticEventRecorder.prototype._didObserveUserInteraction):
929         (WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowFocus):
930         (WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowBlur):
931         (WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowKeyDown):
932         (WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowMouseDown):
933         (WI.TabActivityDiagnosticEventRecorder.prototype._didInteractWithTabContent): Deleted.
934         (WI.TabActivityDiagnosticEventRecorder.prototype._clearTabActivityTimeout): Deleted.
935         (WI.TabActivityDiagnosticEventRecorder.prototype._beginTabActivityTimeout): Deleted.
936         (WI.TabActivityDiagnosticEventRecorder.prototype._stopTrackingTabActivity): Deleted.
937         (WI.TabActivityDiagnosticEventRecorder.prototype._handleTabBrowserSelectedTabContentViewDidChange): Deleted.
938
939 2019-12-05  Devin Rousso  <drousso@apple.com>
940
941         Web Inspector: REGRESSION(r242604): Console: unread indicator overlaps selection background of previous scope bar item
942         https://bugs.webkit.org/show_bug.cgi?id=204630
943
944         Reviewed by Timothy Hatcher.
945
946         When a new message is added that is immediately filtered, such as from an existing filter or
947         previously selected scope bar items, rather than show a blinking circle next to the level of
948         the new message in the scope bar (which doesn't cover the case where there's a filter and
949         was often hard to notice), add a dismissable warning banner explaning that the message had
950         been filtered with a button to clear all filters.
951
952         * UserInterface/Views/LogContentView.js:
953         (WI.LogContentView):
954         (WI.LogContentView.prototype.didAppendConsoleMessageView):
955         (WI.LogContentView.prototype._previousMessageRepeatCountUpdated):
956         (WI.LogContentView.prototype._logCleared):
957         (WI.LogContentView.prototype._messageSourceBarSelectionDidChange):
958         (WI.LogContentView.prototype._scopeBarSelectionDidChange):
959         (WI.LogContentView.prototype._filterMessageElements):
960         (WI.LogContentView.prototype._showHiddenMessagesBannerIfNeeded): Added.
961         (WI.LogContentView.prototype._markScopeBarItemUnread): Deleted.
962         (WI.LogContentView.prototype._markScopeBarItemForMessageLevelUnread): Deleted.
963         * UserInterface/Views/LogContentView.css:
964         (.content-view.log):
965         (.content-view.log > .hidden-messages-banner): Added.
966         (.content-view.log > .hidden-messages-banner > button): Added.
967         (.content-view.log > .hidden-messages-banner > .dismiss): Added.
968         (body[dir=ltr] .content-view.log > .hidden-messages-banner > .dismiss): Added.
969         (body[dir=rtl] .content-view.log > .hidden-messages-banner > .dismiss): Added.
970         (.console-messages):
971         (.log-scope-bar > li:not(.unread) > .indicator): Deleted.
972         (.log-scope-bar > li.unread > .indicator): Deleted.
973         (.log-scope-bar > li.unread:hover > .indicator): Deleted.
974         (.log-scope-bar > li.unread.evaluations > .indicator): Deleted.
975         (.log-scope-bar > li.unread.errors > .indicator): Deleted.
976         (.log-scope-bar > li.unread.warnings > .indicator): Deleted.
977         (.log-scope-bar > li.unread.logs > .indicator): Deleted.
978         (@keyframes unread-background-pulse): Deleted.
979
980         * UserInterface/Views/FindBanner.js:
981         (WI.FindBanner):
982         (WI.FindBanner.prototype.clearAndBlur): Added.
983         (WI.FindBanner.prototype._clearAndBlur): Deleted.
984         Expose a public way to clear the find banner.
985
986         * Localizations/en.lproj/localizedStrings.js:
987
988 2019-12-05  Devin Rousso  <drousso@apple.com>
989
990         Web Inspector: add WI.EngineeringSetting and WI.DebugSetting to avoid callsite checking
991         https://bugs.webkit.org/show_bug.cgi?id=204785
992
993         Reviewed by Timothy Hatcher.
994
995         * UserInterface/Base/Setting.js:
996         (WI.Setting.prototype.get defaultValue): Added.
997         (WI.EngineeringSetting.prototype.get value): Added.
998         (WI.EngineeringSetting.prototype.set value): Added.
999         (WI.DebugSetting.prototype.get value): Added.
1000         (WI.DebugSetting.prototype.set value): Added.
1001         (WI.Setting.prototype.get valueRespectingDebugUIAvailability): Deleted.
1002         Only get/set the `_value` if the `WI.isEngineeringBuild`/`WI.isDebugUIEnabled()`.
1003
1004         * UserInterface/Base/Main.js:
1005         (WI.resolvedLayoutDirection):
1006         * UserInterface/Protocol/RemoteObject.js:
1007         (WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
1008         * UserInterface/Models/CSSProperty.js:
1009         (WI.CSSProperty.prototype._updateOwnerStyleText):
1010         * UserInterface/Models/CSSStyleDeclaration.js:
1011         (WI.CSSStyleDeclaration.prototype.update):
1012         * UserInterface/Proxies/HeapSnapshotEdgeProxy.js:
1013         (WI.HeapSnapshotEdgeProxy.prototype.isPrivateSymbol):
1014         * UserInterface/Controllers/DOMManager.js:
1015         (WI.DOMManager.prototype.supportsEditingUserAgentShadowTrees):
1016         * UserInterface/Controllers/DebuggerManager.js:
1017         (WI.DebuggerManager.prototype.get knownNonResourceScripts):
1018         (WI.DebuggerManager.prototype.debuggerDidPause):
1019         (WI.DebuggerManager.prototype.scriptDidParse):
1020         * UserInterface/Controllers/DiagnosticController.js:
1021         (WI.DiagnosticController):
1022         (WI.DiagnosticController.prototype._debugAutoLogDiagnosticEventsSettingDidChange):
1023         (WI.DiagnosticController.prototype._updateRecorderStates):
1024         * UserInterface/Views/ConsoleMessageView.js:
1025         (WI.ConsoleMessageView.prototype._appendLocationLink):
1026         * UserInterface/Views/HeapSnapshotDataGridTree.js:
1027         (WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
1028         * UserInterface/Views/OpenResourceDialog.js:
1029         (WI.OpenResourceDialog.prototype._addScriptsForTarget):
1030         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
1031         (WI.SpreadsheetCSSStyleDeclarationEditor):
1032         * UserInterface/Views/StackTraceView.js:
1033         (WI.StackTraceView):
1034         * UserInterface/Views/View.js:
1035         (WI.View.prototype._layoutSubtree):
1036         * UserInterface/Debug/UncaughtExceptionReporter.js:
1037         (handleUncaughtExceptionRecord):
1038
1039 2019-12-05  Devin Rousso  <drousso@apple.com>
1040
1041         Web Inspector: Console: copying an evaluation result shouldn't include the saved variable index
1042         https://bugs.webkit.org/show_bug.cgi?id=204906
1043
1044         Reviewed by Timothy Hatcher.
1045
1046         * UserInterface/Views/ConsoleMessageView.js:
1047         (WI.ConsoleMessageView.prototype.toClipboardString):
1048
1049 2019-12-05  Devin Rousso  <drousso@apple.com>
1050
1051         Web Inspector: Elements: the Classes toggle is drawn on top of other content with no other way of scrolling to it
1052         https://bugs.webkit.org/show_bug.cgi?id=204690
1053
1054         Reviewed by Timothy Hatcher.
1055
1056         Use a vertical flexbox for the contents of sidebar panels instead of absolute positioning so
1057         that the variable height Classes "drawer" can have it's own scroll area and doesn't take up
1058         any space from the rest of the panel's contents.
1059
1060         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
1061         (WI.GeneralStyleDetailsSidebarPanel.prototype.initialLayout):
1062         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
1063         (.sidebar > .panel.details.css-style > .content):
1064         (.sidebar > .panel.details.css-style > .content ~ :matches(.options-container, .class-list-container)):
1065         (.sidebar > .panel.details.css-style > .content ~ .options-container):
1066         (.sidebar > .panel.details.css-style > .content ~ .class-list-container):
1067         (.sidebar > .panel.details.css-style > .content.has-filter-bar): Deleted.
1068
1069         * UserInterface/Views/Sidebar.css:
1070         (.sidebar > .panel):
1071         (.sidebar > .panel.selected): Deleted.
1072
1073 2019-12-05  Devin Rousso  <drousso@apple.com>
1074
1075         Web Inspector: Search: there should be some default content when there is no search string
1076         https://bugs.webkit.org/show_bug.cgi?id=204631
1077
1078         Reviewed by Timothy Hatcher.
1079
1080         It's very odd to switch to the Search Tab and find it completely empty, especially if you've
1081         never used it before.
1082
1083         Add basic "No Search String" and "No Search Results" text with a clickable help navigation
1084         item that reveals and focuses the sidebar search input.
1085
1086         * UserInterface/Views/SearchSidebarPanel.js:
1087         (WI.SearchSidebarPanel.prototype.showDefaultContentView): Added.
1088         (WI.SearchSidebarPanel.prototype.performSearch):
1089         (WI.SearchSidebarPanel.prototype._handleDefaultContentViewSearchNavigationItemClicked): Added.
1090
1091         * Localizations/en.lproj/localizedStrings.js:
1092
1093 2019-12-05  Devin Rousso  <drousso@apple.com>
1094
1095         Web Inspector: move the "Add Breakpoint" context menu to be next to the blackboxing context menu item
1096         https://bugs.webkit.org/show_bug.cgi?id=204833
1097
1098         Reviewed by Timothy Hatcher.
1099
1100         Both items are related to JavaScript debugging, so they should be closer together.
1101
1102         * UserInterface/Views/ContextMenuUtilities.js:
1103         (WI.appendContextMenuItemsForSourceCode):
1104
1105 2019-12-05  Devin Rousso  <drousso@apple.com>
1106
1107         Web Inspector: Support search on IndexedDB stores and indexes
1108         https://bugs.webkit.org/show_bug.cgi?id=129208
1109         <rdar://problem/16142046>
1110
1111         Reviewed by Timothy Hatcher.
1112
1113         Add filter bars to the navigation bars for `IndexedDB`, `LocalStorage`, and `SessionStorage`.
1114
1115         * UserInterface/Views/StorageTabContentView.js:
1116         (WI.StorageTabContentView.prototype.get canHandleFindEvent): Added.
1117         (WI.StorageTabContentView.prototype.handleFindEvent): Added.
1118
1119         * UserInterface/Views/DOMStorageContentView.js:
1120         (WI.DOMStorageContentView):
1121         (WI.DOMStorageContentView.prototype.get navigationItems): Added.
1122         (WI.DOMStorageContentView.prototype.get canFocusFilterBar): Added.
1123         (WI.DOMStorageContentView.prototype.focusFilterBar): Added.
1124         (WI.DOMStorageContentView.prototype._handleFilterBarFilterDidChange): Added.
1125
1126         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
1127         (WI.IndexedDatabaseObjectStoreContentView):
1128         (WI.IndexedDatabaseObjectStoreContentView.prototype.get navigationItems):
1129         (WI.IndexedDatabaseObjectStoreContentView.prototype.get canFocusFilterBar): Added.
1130         (WI.IndexedDatabaseObjectStoreContentView.prototype.focusFilterBar): Added.
1131         (WI.IndexedDatabaseObjectStoreContentView.prototype.dataGridMatchNodeAgainstCustomFilters): Added.
1132         (WI.IndexedDatabaseObjectStoreContentView.prototype._handleFilterBarFilterDidChange): Added.
1133         Check against the `textContent` of each cell for a given `WI.DataGridNode` to see if it
1134         matches the filter text as all of the pieces of data are `WI.RemoteObject`s.
1135
1136         * UserInterface/Views/FilterBar.css:
1137         (.filter-bar):
1138         * UserInterface/Views/NetworkTableContentView.css:
1139         (.content-view.network .navigation-bar .filter-bar): Deleted.
1140         Remove the `background-color` to let it match the background content.
1141
1142 2019-12-05  Devin Rousso  <drousso@apple.com>
1143
1144         Web Inspector: Network: pressing ⌘F when no network item is selected should focus the filter bar
1145         https://bugs.webkit.org/show_bug.cgi?id=204862
1146
1147         Reviewed by Timothy Hatcher.
1148
1149         * UserInterface/Views/NetworkTabContentView.js:
1150         (WI.NetworkTabContentView.prototype.get canHandleFindEvent): Added.
1151         (WI.NetworkTabContentView.prototype.handleFindEvent): Added.
1152
1153         * UserInterface/Views/NetworkTableContentView.js:
1154         (WI.NetworkTableContentView.prototype.get canFocusFilterBar): Added.
1155         (WI.NetworkTableContentView.prototype.focusFilterBar): Added.
1156
1157 2019-12-05  Devin Rousso  <drousso@apple.com>
1158
1159         Web Inspector: Quick Console: pressing ⌘F shows a second find banner
1160         https://bugs.webkit.org/show_bug.cgi?id=204861
1161
1162         Reviewed by Timothy Hatcher.
1163
1164         * UserInterface/Views/LogContentView.js:
1165         (WI.LogContentView.prototype.get supportsCustomFindBanner):
1166
1167 2019-12-05  Simon Fraser  <simon.fraser@apple.com>
1168
1169         Fix inspector/css test assertions after r253158 
1170         https://bugs.webkit.org/show_bug.cgi?id=204924
1171
1172         Reviewed by Devin Rousso.
1173
1174         * UserInterface/Controllers/CSSManager.js:
1175         (WI.CSSManager.displayNameForPseudoId):
1176
1177 2019-12-04  Yury Semikhatsky  <yurys@chromium.org>
1178
1179         Web Inspector: allow inspector to pause provisional page load and restore its state
1180         https://bugs.webkit.org/show_bug.cgi?id=204170
1181
1182         Reviewed by Devin Rousso.
1183
1184         All new targets are now automatically paused on start. For such provisional targets target
1185         manager will run regular initilization code (enable agents etc.) and then resume loading of
1186         the target. Responses and events from the target are defferred until the target is committed
1187         and becomes current main target. When the target manager receives event that the provisional
1188         target has been committed all accumulated protocol messages are replayed and going forward all
1189         new missages will be dispatched as usual.
1190
1191         * UserInterface/Controllers/TargetManager.js:
1192         (WI.TargetManager):
1193         (WI.TargetManager.prototype.targetCreated):
1194         (WI.TargetManager.prototype.didCommitProvisionalTarget):
1195         (WI.TargetManager.prototype.targetDestroyed):
1196         (WI.TargetManager.prototype.dispatchMessageFromTarget):
1197         (WI.TargetManager.prototype._createTarget):
1198         (WI.TargetManager.prototype._checkAndHandlePageTargetTransition):
1199         (WI.TargetManager.prototype._checkAndHandlePageTargetTermination):
1200         * UserInterface/Protocol/Connection.js:
1201         (InspectorBackend.Connection):
1202         (InspectorBackend.Connection.prototype.addProvisionalMessage):
1203         (InspectorBackend.Connection.prototype.dispatchProvisionalMessages):
1204         * UserInterface/Protocol/MultiplexingBackendTarget.js:
1205         (WI.MultiplexingBackendTarget.prototype.initialize):
1206         * UserInterface/Protocol/PageTarget.js:
1207         (WI.PageTarget):
1208         * UserInterface/Protocol/Target.js:
1209         (WI.Target.prototype.initialize):
1210         (WI.Target.prototype.get isProvisional):
1211         (WI.Target.prototype.get isPaused):
1212         (WI.Target.prototype.didCommitProvisionalTarget):
1213         * UserInterface/Protocol/WorkerTarget.js:
1214
1215 2019-12-03  Devin Rousso  <drousso@apple.com>
1216
1217         Web Inspector: prefer non-blackboxed scripts when showing a source code location link
1218         https://bugs.webkit.org/show_bug.cgi?id=204811
1219
1220         Reviewed by Timothy Hatcher.
1221
1222         * UserInterface/Models/StackTrace.js:
1223         (WI.StackTrace.prototype.get firstNonNativeNonAnonymousNotBlackboxedCallFrame): Added.
1224         (WI.StackTrace.prototype.get firstNonNativeCallFrame): Deleted.
1225         (WI.StackTrace.prototype.get firstNonNativeNonAnonymousCallFrame): Deleted.
1226         Include logic to skip call frames that are blackboxed, unless there are no non-blackboxed
1227         call frames, in which case fall back to the first non-native non-anonymous call frame.
1228         Drive-by: remove unused function.
1229
1230         * UserInterface/Views/ConsoleMessageView.js:
1231         (WI.ConsoleMessageView.prototype.render):
1232         (WI.ConsoleMessageView.prototype.clearSessionState): Added.
1233         (WI.ConsoleMessageView.prototype._appendLocationLink):
1234         (WI.ConsoleMessageView.prototype._handleDebuggerBlackboxChanged): Added.
1235         (WI.ConsoleMessageView.prototype.clearSavedVariableState): Deleted.
1236         * UserInterface/Views/LogContentView.js:
1237         (WI.LogContentView.prototype._sessionStarted):
1238         (WI.LogContentView.prototype._logCleared):
1239         Listen for changes to the debugger blackbox to re-render the location link.
1240
1241         * UserInterface/Views/StackTraceView.js:
1242         (WI.StackTraceView):
1243         * UserInterface/Views/CallFrameView.js:
1244         (WI.CallFrameView):
1245         * UserInterface/Views/CallFrameView.css:
1246         (.call-frame.blackboxed > .title, .call-frame.blackboxed:not(:hover, :focus) > .subtitle): Added.
1247         Add a constructor option to control whether blackboxed frames are indicated visually.
1248
1249 2019-12-03  Devin Rousso  <drousso@apple.com>
1250
1251         Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'navigationItem.parentNavigationBar')
1252         https://bugs.webkit.org/show_bug.cgi?id=204830
1253
1254         Reviewed by Timothy Hatcher.
1255
1256         * UserInterface/Controllers/CSSManager.js:
1257         (WI.CSSManager.prototype._mainResourceDidChange):
1258         When the main resource changes, make sure to clear the `_forcedAppearance` member variable.
1259         This way, when the main `WI.DOMTreeContentView` reloads, it isn't left in an unknown state.
1260
1261         * UserInterface/Views/DOMTreeContentView.js:
1262         (WI.DOMTreeContentView):
1263         (WI.DOMTreeContentView.prototype._defaultAppearanceDidChange):
1264         (WI.DOMTreeContentView.prototype._toggleAppearance):
1265         Always create the Force Appearance navigation item, rather than destroying and recreating it
1266         each time the page navigates. Instead, just update the tooltip (which was all that really
1267         changed) whenever the default appearance changes. Depending on the timing of events during a
1268         page navigation, `_forceAppearanceButtonNavigationItem` could be `null`.
1269
1270         * UserInterface/Views/ActivateButtonNavigationItem.js:
1271         (WI.ActivateButtonNavigationItem.prototype.set defaultToolTip): Added.
1272         (WI.ActivateButtonNavigationItem.prototype.set activatedToolTip): Added.
1273         Allow the various tooltips to be updated after creation.
1274
1275 2019-12-03  Devin Rousso  <drousso@apple.com>
1276
1277         Web Inspector: Timelines: stopping time marker is permanently removed when the current recording is cleared
1278         https://bugs.webkit.org/show_bug.cgi?id=204827
1279
1280         Reviewed by Timothy Hatcher.
1281
1282         * UserInterface/Views/TimelineOverview.js:
1283         (WI.TimelineOverview.prototype._recordingReset):
1284         Re-add the marker (and ensure that it's hidden) when the active recording is reset.
1285
1286 2019-12-02  Nikita Vasilyev  <nvasilyev@apple.com>
1287
1288         Web Inspector: Provide UI to convert between sRGB and p3 color spaces
1289         https://bugs.webkit.org/show_bug.cgi?id=203534
1290         <rdar://problem/56688523>
1291
1292         Reviewed by Devin Rousso.
1293
1294         Add context menus:
1295         - "Convert to sRGB" and "Clamp to sRGB" for p3 colors, such as `color(display-p3 0 1 0)`.
1296         - "Convert to Display-P3" for sRGB colors, such as `rgb(0, 255, 0)`.
1297
1298         Shift-clicking the color swatch of sRGB colors now goes through the color function syntax as well.
1299         Shift-clicking the color swatch of Display-P3 colors converts the color to sRGB when it can be lossless.
1300         When the convertion cannot be lossless, Web Inspector beeps.
1301
1302         * Localizations/en.lproj/localizedStrings.js:
1303         * UserInterface/Base/Utilities.js:
1304         * UserInterface/Models/Color.js:
1305         (WI.Color):
1306         Introduce `_normalizedRGB` property, which stores rgb values from 0 to 1.
1307         Previously, `_rgba` stored values from 0 to 1 for color function format, and from 0 to 255 otherwise.
1308         That required format checks before every `rgb` value access and resulted in silent errors when
1309         the values were in the wrong format.
1310
1311         Store alpha as a separate property to simplify format conversion. Previously, alpha was duplicated between `_rgba` and `_hsla`.
1312
1313         (WI.Color.displayP3toSRGB):
1314         (WI.Color.srgbToDisplayP3): Added.
1315         (WI.Color.prototype.nextFormat):
1316         (WI.Color.prototype.get rgb):
1317         (WI.Color.prototype.get hsl):
1318         (WI.Color.prototype.get normalizedRGB):
1319         (WI.Color.prototype.get rgba):
1320         (WI.Color.prototype.get hsla):
1321         (WI.Color.prototype.get normalizedRGBA):
1322         (WI.Color.prototype.get gamut):
1323         (WI.Color.prototype.set gamut):
1324         (WI.Color.prototype.copy):
1325         (WI.Color.prototype.isKeyword):
1326         (WI.Color.prototype.isOutsideSRGB): Added.
1327         (WI.Color.prototype.canBeSerializedAsShortHEX):
1328         (WI.Color.prototype._toKeywordString):
1329         (WI.Color.prototype._toShortHEXString):
1330         (WI.Color.prototype._toHEXString):
1331         (WI.Color.prototype._toShortHEXAlphaString):
1332         (WI.Color.prototype._toHEXAlphaString):
1333         (WI.Color.prototype._toRGBString):
1334         (WI.Color.prototype._toRGBAString):
1335         (WI.Color.prototype._toFunctionString):
1336         Limit the values to 4 decimals.
1337
1338         (WI.Color.prototype._toHSLString):
1339         (WI.Color.prototype._toHSLAString):
1340         (WI.Color.prototype._hslToRGB):
1341         * UserInterface/Views/ColorPicker.js:
1342         (WI.ColorPicker.prototype._updateColor):
1343         (WI.ColorPicker.prototype._updateOpacitySlider):
1344         * UserInterface/Views/ColorSquare.css:
1345         (.color-square > .svg-root):
1346         (.color-square > .svg-root > .srgb-edge):
1347         (.color-square > .srgb-label):
1348         (.color-square > .srgb-label:hover):
1349         (.color-square > .srgb-label:hover + .svg-root > .srgb-edge):
1350         (@media (-webkit-device-pixel-ratio: 1)):
1351         (.color-square > .srgb-edge):
1352         * UserInterface/Views/ColorSquare.js:
1353         (WI.ColorSquare.prototype.set tintedColor):
1354         (WI.ColorSquare.prototype._drawSRGBOutline):
1355         (WI.ColorSquare):
1356
1357         * UserInterface/Views/InlineSwatch.js:
1358         (WI.InlineSwatch):
1359         (WI.InlineSwatch.prototype._updateSwatch):
1360         (WI.InlineSwatch.prototype._allowShiftClickColor): Added.
1361         (WI.InlineSwatch.prototype._handleContextMenuEvent):
1362
1363 2019-12-02  Devin Rousso  <drousso@apple.com>
1364
1365         Web Inspector: Console: the saved result value is still shown after page reload
1366         https://bugs.webkit.org/show_bug.cgi?id=204532
1367
1368         Reviewed by Brian Burg.
1369
1370         Add additional plumbing to remove any `.console-saved-variable` elements whenever a new
1371         session is created, as well as reset the base of the property path to `this`.
1372
1373         * UserInterface/Views/LogContentView.js:
1374         (WI.LogContentView.prototype._sessionStarted):
1375         (WI.LogContentView.prototype._logCleared):
1376
1377         * UserInterface/Views/ConsoleMessageView.js:
1378         (WI.ConsoleMessageView.prototype.clearSavedVariableState): Added.
1379         (WI.ConsoleMessageView.prototype.removeEventListeners): Deleted.
1380
1381         * UserInterface/Views/ObjectTreeView.js:
1382         (WI.ObjectTreeView.prototype.resetPropertyPath): Added.
1383
1384 2019-11-22  Devin Rousso  <drousso@apple.com>
1385
1386         Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'target.PageAgent.getCompositingBordersVisible')
1387         https://bugs.webkit.org/show_bug.cgi?id=204473
1388
1389         Reviewed by Brian Burg.
1390
1391         Change the definition of `WI.targetsAvailable` and `WI.whenTargetsAvailable` to instead
1392         resolve based on when a page target is created, not the backend target, as the latter can
1393         be a multiplexing target which only has a `Target` domain.
1394
1395         * UserInterface/Controllers/TargetManager.js:
1396         (WI.TargetManager.prototype._initializeBackendTarget):
1397         (WI.TargetManager.prototype._initializePageTarget):
1398
1399         * UserInterface/Base/Main.js:
1400         (WI.loaded):
1401         (WI.contentLoaded):
1402         (WI.targetsAvailable):
1403         (WI.whenTargetsAvailable):
1404         * UserInterface/Test/Test.js:
1405         (WI.loaded):
1406         (WI.contentLoaded):
1407         (WI.targetsAvailable):
1408         (WI.whenTargetsAvailable):
1409
1410         * UserInterface/Views/SearchSidebarPanel.js:
1411         (WI.SearchSidebarPanel.prototype.performSearch):
1412         Only wait for targets if inspecting a web debuggable, as non-web debuggables don't have a
1413         different page target vs the backend target (which is guaranteed to exist anyways).
1414
1415 2019-11-22  Devin Rousso  <drousso@apple.com>
1416
1417         Web Inspector: REGRESSION(r251227): dashboard no longer shows page weight
1418         https://bugs.webkit.org/show_bug.cgi?id=204528
1419
1420         Reviewed by Brian Burg.
1421
1422         `WI.contentLoaded` adds the debuggable type as a class to the `<body>`. In r251227, the
1423         "web" debuggable type was split into "page" and "web-page". Update the few selectors that
1424         used the debuggable type to show/hide parts of the UI.
1425
1426         * UserInterface/Views/DashboardContainerView.css:
1427         (body:matches(.page, .web-page) .toolbar .dashboard-container): Added.
1428         (body:not(.page, .web-page) .toolbar .dashboard-container): Added.
1429         (body.web .toolbar .dashboard-container): Deleted.
1430         (body:not(.web) .toolbar .dashboard-container): Deleted.
1431         * UserInterface/Views/DefaultDashboardView.css:
1432         (body:matches(.page, .web-page) .toolbar.collapsed .dashboard.default > :matches(.resourcesSize, .time, .logs)): Added.
1433         (body:not(.page, .web-page) .toolbar .dashboard.default > :matches(.resourcesCount, .resourcesSize, .time)): Added.
1434         (body.web .toolbar.collapsed .dashboard.default > :matches(.resourcesSize, .time, .logs)): Deleted.
1435         (body:not(.web) .toolbar .dashboard.default > :matches(.resourcesCount, .resourcesSize, .time)): Deleted.
1436
1437 2019-11-20  Brian Burg  <bburg@apple.com>
1438
1439         Web Inspector: add support for new kinds of diagnostic events
1440         https://bugs.webkit.org/show_bug.cgi?id=204430
1441
1442         Reviewed by Devin Rousso.
1443
1444         This patch restructures the existing DiagnosticController to support multiple
1445         self-contained event recorders. The first such recorder is for the TabActivity
1446         diagnostic event. More will be added later.
1447
1448         Add two engineering settings: one which auto-logs diagnostic events to Inspector^2 console,
1449         and another which forces DiagnosticController to be active or inactive regardless of
1450         whether a diagnostic logging delegate is actually installed. This is for manual testing.
1451
1452         This patch does not introduce any functionality changes to diagnostic event collection.
1453         The TabActivityDiagnosticeventRecorder still needs some changes for it to sample correctly. 
1454
1455         New Test: inspector/unit-tests/diagnostic-controller.html
1456
1457         * UserInterface/Base/Main.js:
1458         (WI.contentLoaded):
1459
1460         * UserInterface/Controllers/DiagnosticController.js:
1461         (WI.DiagnosticController):
1462         (WI.DiagnosticController.prototype.set diagnosticLoggingAvailable):
1463         (WI.DiagnosticController.prototype.addRecorder):
1464         (WI.DiagnosticController.prototype.logDiagnosticEvent):
1465         (WI.DiagnosticController.prototype._debugEnableDiagnosticLoggingSettingDidChange):
1466         (WI.DiagnosticController.prototype._debugAutoLogDiagnosticEventsSettingDidChange):
1467         (WI.DiagnosticController.prototype._updateRecorderStates):
1468         (WI.DiagnosticController.supportsDiagnosticLogging): Deleted.
1469         (WI.DiagnosticController.prototype.logDiagnosticMessage): Deleted.
1470         (WI.DiagnosticController.prototype._didInteractWithTabContent): Deleted.
1471         (WI.DiagnosticController.prototype._clearTabActivityTimeout): Deleted.
1472         (WI.DiagnosticController.prototype._beginTabActivityTimeout): Deleted.
1473         (WI.DiagnosticController.prototype._stopTrackingTabActivity): Deleted.
1474         (WI.DiagnosticController.prototype._handleWindowFocus): Deleted.
1475         (WI.DiagnosticController.prototype._handleWindowBlur): Deleted.
1476         (WI.DiagnosticController.prototype._handleWindowKeyDown): Deleted.
1477         (WI.DiagnosticController.prototype._handleWindowMouseDown): Deleted.
1478         (WI.DiagnosticController.prototype._handleTabBrowserSelectedTabContentViewDidChange): Deleted.
1479         Restructure DiagnosticController to be dumber. It holds on to a list of recorders and
1480         turns them on and off. All event logging goes through one funnel method, which does not
1481         use InspectorFrontendHost at all when running a Web Inspector layout test.
1482
1483         * UserInterface/Controllers/DiagnosticEventRecorder.js: Added.
1484         (WI.DiagnosticEventRecorder):
1485         (WI.DiagnosticEventRecorder.prototype.get name):
1486         (WI.DiagnosticEventRecorder.prototype.get active):
1487         (WI.DiagnosticEventRecorder.prototype.set active):
1488         (WI.DiagnosticEventRecorder.prototype.setup):
1489         (WI.DiagnosticEventRecorder.prototype.teardown):
1490         Add base class for all individual diagnostic event recorders.
1491
1492         * UserInterface/Controllers/TabActivityDiagnosticEventRecorder.js: Copied from Source/WebInspectorUI/UserInterface/Controllers/DiagnosticController.js.
1493         (WI.TabActivityDiagnosticEventRecorder):
1494         (WI.TabActivityDiagnosticEventRecorder.prototype.setup):
1495         (WI.TabActivityDiagnosticEventRecorder.prototype.teardown):
1496         (WI.TabActivityDiagnosticEventRecorder.prototype.handleEvent):
1497         (WI.TabActivityDiagnosticEventRecorder.prototype._didInteractWithTabContent):
1498         (WI.TabActivityDiagnosticEventRecorder.prototype._clearTabActivityTimeout):
1499         (WI.TabActivityDiagnosticEventRecorder.prototype._beginTabActivityTimeout):
1500         (WI.TabActivityDiagnosticEventRecorder.prototype._stopTrackingTabActivity):
1501         (WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowFocus):
1502         (WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowBlur):
1503         (WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowKeyDown):
1504         (WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowMouseDown):
1505         (WI.TabActivityDiagnosticEventRecorder.prototype._handleTabBrowserSelectedTabContentViewDidChange):
1506         Move all user activity tracking to here. Restructure so that the recorder can be
1507         turned on and off (this adds/removes its listeners and timers).
1508
1509         * UserInterface/Main.html: Add new files.
1510         * UserInterface/Protocol/InspectorFrontendAPI.js:
1511         (InspectorFrontendAPI.setDiagnosticLoggingAvailable):
1512         Adjust the name, as WI.diagnosticController is no longer underscore-prefixed.
1513
1514         * UserInterface/Base/Setting.js:
1515         Add new settings. Add getter 'valueRespectingDebugUIAvailability' which only
1516         returns default values for Debug/Engineering settings if DebugUI is not enabled.
1517
1518         * UserInterface/Views/SettingsTabContentView.js:
1519         (WI.SettingsTabContentView.prototype._createDebugSettingsView):
1520         Add new settings to Settings Tab UI.
1521
1522 2019-11-21  Nikita Vasilyev  <nvasilyev@apple.com>
1523
1524         Web Inspector: Outline sRGB-safe areas on P3 color picker
1525         https://bugs.webkit.org/show_bug.cgi?id=203533
1526         <rdar://problem/56688057>
1527
1528         Reviewed by Brian Burg.
1529
1530         Visualize the edge of sRGB gamut as a white line.
1531
1532         * Localizations/en.lproj/localizedStrings.js:
1533
1534         * UserInterface/Models/Color.js:
1535         (WI.Color.displayP3toSRGB.multiplyMatrixByVector):
1536         (WI.Color.displayP3toSRGB):
1537         (WI.Color._toLinearLight):
1538         (WI.Color._gammaCorrect):
1539         Use equations from CSS Color Module Level 4.
1540
1541         * UserInterface/Views/ColorSquare.css:
1542         (.color-square):
1543         (.color-square > .crosshair):
1544         Place the crosshair above the sRGB edge line.
1545
1546         (.color-square .svg-root):
1547         (.color-square .srgb-edge):
1548         (.color-square .srgb-label):
1549         (.color-square .srgb-label:hover):
1550         (.color-square .srgb-label:hover + .svg-root > .srgb-edge):
1551         (@media (-webkit-device-pixel-ratio: 1)):
1552         Make the optical weight of the line on non-retina screens the same as on retina screens.
1553
1554         * UserInterface/Views/ColorSquare.js:
1555         (WI.ColorSquare):
1556         (WI.ColorSquare.prototype.set tintedColor):
1557         (WI.ColorSquare.prototype._updateBaseColor):
1558         (WI.ColorSquare.prototype._drawSRGBOutline):
1559
1560 2019-11-21  Devin Rousso  <drousso@apple.com>
1561
1562         Web Inspector: call frames from blackboxed scripts should be visually distinct
1563         https://bugs.webkit.org/show_bug.cgi?id=204424
1564
1565         Reviewed by Timothy Hatcher.
1566
1567         Seeing "Deferred pause from blackboxed script" in the Pause Reason does indicate that
1568         something in the Call Stack was blackboxed, but it doesn't clarify what was blackboxed.
1569
1570         Given that the debugger effectively ignores blackboxed scripts, we should distinguish call
1571         frames that were ignored so that it's clear how the current pause location was reached.
1572
1573         * UserInterface/Views/CallFrameTreeElement.js:
1574         (WI.CallFrameTreeElement):
1575         (WI.CallFrameTreeElement.prototype.onattach):
1576         * UserInterface/Views/CallFrameTreeElement.css:
1577         (.tree-outline .item.call-frame.blackboxed:not(.selected)): Added.
1578         Make blackboxed call frames 50% opaque when not selected. Add additional explanatory text to
1579         the end of the tooltip when hovering blackboxed call frame tree elements.
1580
1581         * UserInterface/Views/ContextMenuUtilities.js:
1582         (WI.appendContextMenuItemsForSourceCode):
1583         * UserInterface/Views/SourceCodeTreeElement.js:
1584         (WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState):
1585         Update tooltip/contextmenu text to include "blacboxing" so functionality is clearer.
1586
1587         * UserInterface/Models/SourceCodeLocation.js:
1588         (WI.SourceCodeLocation.prototype.populateLiveDisplayLocationTooltip):
1589         Allow a suffix to be added to the end of the live location.
1590
1591         * Localizations/en.lproj/localizedStrings.js:
1592
1593 2019-11-20  Yury Semikhatsky  <yurys@chromium.org>
1594
1595         Web Inspector: REGRESSION(r250618): main resource view is empty when pausing on inline 'debugger' statement
1596         https://bugs.webkit.org/show_bug.cgi?id=204086
1597
1598         Reviewed by Devin Rousso.
1599
1600         SourceCodeRevision.currentRevision doesn't create new revisions under the hood anymore.
1601         This allows to avoid undesirable side effects when e.g. text editor tries to read current
1602         content of the SourceCode which results in a new revision (with empty content). 
1603         New method editableRevision is introduced for applying changes to the resource while
1604         keeping original content revision intact.
1605
1606         * UserInterface/Controllers/CSSManager.js:
1607         (WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
1608         (WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges):
1609         (WI.CSSManager.prototype._resourceContentDidChange):
1610         (WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
1611         * UserInterface/Models/SourceCode.js:
1612         (WI.SourceCode.prototype.get currentRevision):
1613         (WI.SourceCode.prototype.get editableRevision):
1614         (WI.SourceCode.prototype.get content):
1615         (WI.SourceCode.prototype.revisionContentDidChange):
1616         * UserInterface/Views/FontResourceContentView.js:
1617         (WI.FontResourceContentView.prototype.dropZoneHandleDrop):
1618         * UserInterface/Views/ImageResourceContentView.js:
1619         (WI.ImageResourceContentView.prototype.dropZoneHandleDrop):
1620         * UserInterface/Views/ResourceContentView.js:
1621         (WI.ResourceContentView.prototype._contentAvailable):
1622         (WI.ResourceContentView.prototype._handleImportLocalResourceOverride):
1623         * UserInterface/Views/ScriptContentView.js:
1624         (WI.ScriptContentView.prototype._handleTextEditorContentDidChange):
1625         * UserInterface/Views/TextResourceContentView.js:
1626         (WI.TextResourceContentView.prototype._textEditorContentDidChange):
1627
1628 2019-11-19  Devin Rousso  <drousso@apple.com>
1629
1630         Web Inspector: Local Overrides: the placeholder for the MIME type, status code, and status text is the same as the placeholder URL
1631         https://bugs.webkit.org/show_bug.cgi?id=204330
1632
1633         Reviewed by Joseph Pecoraro.
1634
1635         * UserInterface/Views/LocalResourceOverridePopover.js:
1636         (WI.LocalResourceOverridePopover.prototype.get serializedData):
1637         (WI.LocalResourceOverridePopover.prototype.show):
1638         (WI.LocalResourceOverridePopover.prototype._createEditor):
1639         * UserInterface/Views/LocalResourceOverridePopover.css:
1640         (.popover .local-resource-override-popover-content .data-grid tr.header-content-type > :matches(.name-column, .value-column)): Added.
1641         Replace the hardcoded `placeholder` with an optional `options` object that can include a
1642         `placeholder` value, allowing each caller to customize what is shown. Disallow selecting the
1643         "Content-Type" header since it's automatically populated, even if there is no set value for
1644         the MIME type or URL (e.g. inferred from placeholders).
1645         Drive-by: if a `CodeMirror` has no value, attempt to use it's placeholder instead.
1646         Drive-by: replace generic `dataGrid` with more specific `this._headersDataGrid`, which is
1647                   more clear given how many `WI.DataGrid` are created by this class.
1648
1649         * UserInterface/Views/DataGridNode.js:
1650         (WI.DataGridNode.prototype.get selectable):
1651         (WI.PlaceholderDataGridNode):
1652         * UserInterface/Views/DataGrid.js:
1653         (WI.DataGrid.createSortableDataGrid):
1654         * UserInterface/Views/DOMStorageContentView.js:
1655         (WI.DOMStorageContentView.prototype.itemAdded):
1656         (WI.DOMStorageContentView.prototype._populate):
1657         * UserInterface/Views/EditableDataGridNode.js:
1658         (WI.EditableDataGridNode): Deleted.
1659         * UserInterface/Views/HeapSnapshotClassDataGridNode.js:
1660         (WI.HeapSnapshotClassDataGridNode):
1661         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
1662         (WI.HeapSnapshotInstanceDataGridNode):
1663         * UserInterface/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js:
1664         (WI.HeapSnapshotInstanceFetchMoreDataGridNode):
1665         * UserInterface/Views/ProfileDataGridNode.js:
1666         (WI.ProfileDataGridNode):
1667         * UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
1668         (WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
1669         (WI.RecordingStateDetailsSidebarPanel):
1670         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
1671         (WI.ResourceDetailsSidebarPanel.prototype._createNameValueDataGrid.addDataGridNode):
1672         * UserInterface/Views/TimelineDataGridNode.js:
1673         (WI.TimelineDataGridNode):
1674         Rework constructor of `WI.DataGridNode` to accept an `options`-style object as its second
1675         parameter, instead of separate parameters for each configurable property. Now that this is
1676         able to be done via a single parameter, add support for marking a `WI.DataGridNode` as not
1677         being selectable.
1678
1679 2019-11-19  Brian Burg  <bburg@apple.com>
1680
1681         [Cocoa] Add _WKInspector SPI to set diagnostic logging delegate for a local Web Inspector
1682         https://bugs.webkit.org/show_bug.cgi?id=204323
1683
1684         Reviewed by Devin Rousso.
1685
1686         * UserInterface/Protocol/InspectorFrontendAPI.js:
1687         (InspectorFrontendAPI.setDiagnosticLoggingAvailable):
1688         Add a stub FrontendAPI method to be filled in later.
1689
1690 2019-11-18  Devin Rousso  <drousso@apple.com>
1691
1692         Web Inspector: Elements: copying multiple DOM nodes should copy more than just the last selected node
1693         https://bugs.webkit.org/show_bug.cgi?id=204266
1694
1695         Reviewed by Brian Burg.
1696
1697         * UserInterface/Views/DOMTreeContentView.js:
1698         (WI.DOMTreeContentView.prototype.async handleCopyEvent): Added.
1699         (WI.DOMTreeContentView.prototype.handleCopyEvent): Deleted.
1700         Call `DOM.getOuterHTML` for each selected DOM node and join the results with newlines.
1701
1702         * UserInterface/Models/DOMNode.js:
1703         (WI.DOMNode.prototype.getOuterHTML):
1704         (WI.DOMNode.prototype.copyNode): Deleted.
1705         (WI.DOMNode.prototype.copyNode.copy): Deleted.
1706         * UserInterface/Views/DOMTreeElement.js:
1707         (WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
1708         (WI.DOMTreeElement.prototype._copyHTML): Deleted.
1709         Simplify API surface.
1710
1711 2019-11-18  Devin Rousso  <drousso@apple.com>
1712
1713         Web Inspector: Local Resource Overrides: allow substitution based on a url pattern
1714         https://bugs.webkit.org/show_bug.cgi?id=202375
1715
1716         Reviewed by Brian Burg.
1717
1718         Often, websites will load content with a timestamp-based URL query parameter for
1719         cache-busting or logging purposes. If a developer is trying to override these resources (or
1720         is trying to have an existing override also match these resources), they'd need to edit the
1721         local override's URL to match in addition to editing the resource that loads it (e.g. change
1722         the <script> in an HTML file), which can sometimes be tricky of the content is dynamically
1723         loaded (e.g. an XHR with a non-hardcoded URL).
1724
1725         Allowing for local overrides to be set using a regular expression pattern would help resolve
1726         this limitation.
1727
1728         * UserInterface/Models/LocalResourceOverride.js:
1729         (WI.LocalResourceOverride):
1730         (WI.LocalResourceOverride.create):
1731         (WI.LocalResourceOverride.fromJSON):
1732         (WI.LocalResourceOverride.prototype.toJSON):
1733         (WI.LocalResourceOverride.prototype.get isCaseSensitive): Added.
1734         (WI.LocalResourceOverride.prototype.get isRegex): Added.
1735         (WI.LocalResourceOverride.prototype.matches): Added.
1736         (WI.LocalResourceOverride.prototype.saveIdentityToCookie):
1737
1738         * UserInterface/Controllers/NetworkManager.js:
1739         (WI.NetworkManager):
1740         (WI.NetworkManager.prototype.initializeTarget):
1741         (WI.NetworkManager.prototype.get localResourceOverrides):
1742         (WI.NetworkManager.prototype.addLocalResourceOverride):
1743         (WI.NetworkManager.prototype.removeLocalResourceOverride):
1744         (WI.NetworkManager.prototype.localResourceOverrideForURL):
1745         (WI.NetworkManager.prototype.responseIntercepted):
1746
1747         * UserInterface/Views/LocalResourceOverridePopover.js:
1748         (WI.LocalResourceOverridePopover):
1749         (WI.LocalResourceOverridePopover.prototype.get serializedData):
1750         (WI.LocalResourceOverridePopover.prototype.show):
1751         (WI.LocalResourceOverridePopover.prototype._createEditor):
1752
1753         * UserInterface/Views/LocalResourceOverrideTreeElement.js:
1754         (WI.LocalResourceOverrideTreeElement.prototype.get mainTitleText): Added.
1755         (WI.LocalResourceOverrideTreeElement.prototype.onattach):
1756         (WI.LocalResourceOverrideTreeElement.prototype.ondetach):
1757         (WI.LocalResourceOverrideTreeElement.prototype.populateContextMenu):
1758         (WI.LocalResourceOverrideTreeElement.prototype.willDismissPopover):
1759         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1760         (WI.SourcesNavigationSidebarPanel.prototype._willDismissLocalOverridePopover):
1761
1762 2019-11-15  Devin Rousso  <drousso@apple.com>
1763
1764         Web Inspector: Elements: Styles: support multiline CSS property values
1765         https://bugs.webkit.org/show_bug.cgi?id=203754
1766         <rdar://problem/56819044>
1767
1768         Reviewed by Brian Burg.
1769
1770         * UserInterface/Models/CSSProperty.js:
1771         (WI.CSSProperty.prototype.update):
1772         (WI.CSSProperty.prototype._updateStyleText):
1773         When the property is updated from the backend, find the first newline inside the value and
1774         preserve the indent string so it can be re-added when updating the backend.
1775
1776         * UserInterface/Views/SpreadsheetTextField.js:
1777         (WI.SpreadsheetTextField.prototype._handleKeyDown):
1778         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
1779         (.spreadsheet-style-declaration-editor .property:not(.disabled) .value):
1780         (.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .value): Added.
1781         (.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .semicolon): Added.
1782         * UserInterface/Views/SpreadsheetStyleProperty.js:
1783         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
1784         (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldAllowsNewlines): Added.
1785         (WI.SpreadsheetStyleProperty.prototype._handleValueChange):
1786         Support shift-enter when editing a CSS property's value to insert a newline.
1787
1788 2019-11-15  Devin Rousso  <drousso@apple.com>
1789
1790         Web Inspector: Sources: move the "Local Override..." creation context menu item from the Breakpoints section options menu to the Create Resource menu
1791         https://bugs.webkit.org/show_bug.cgi?id=204178
1792
1793         Reviewed by Joseph Pecoraro.
1794
1795         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1796         (WI.SourcesNavigationSidebarPanel):
1797         (WI.SourcesNavigationSidebarPanel.prototype._willDismissLocalOverridePopover):
1798         (WI.SourcesNavigationSidebarPanel.prototype._addLocalOverride):
1799         (WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
1800         (WI.SourcesNavigationSidebarPanel.prototype._populateCreateResourceContextMenu):
1801         If the Local Overrides section isn't already visible, show it. Use the Local Overrides title
1802         as the anchor for the configuration popover. If there are no existing Local Overrides, show
1803         placeholder "No Overrides" text temporarily.
1804
1805         * UserInterface/Views/EventBreakpointPopover.js:
1806         (WI.EventBreakpointPopover.prototype._showSuggestionsView):
1807         * UserInterface/Views/LocalResourceOverridePopover.js:
1808         (WI.LocalResourceOverridePopover.prototype._presentOverTargetElement):
1809         * UserInterface/Views/URLBreakpointPopover.js:
1810         (WI.URLBreakpointPopover.prototype._presentOverTargetElement):
1811         Add some padding around the popover's anchor so the arrow doesn't overlap it.
1812
1813         * Localizations/en.lproj/localizedStrings.js:
1814
1815 2019-11-15  Devin Rousso  <drousso@apple.com>
1816
1817         Web Inspector: Local Overrides: add context menu item to reveal the local override when a resource is loaded from it
1818         https://bugs.webkit.org/show_bug.cgi?id=204206
1819
1820         Reviewed by Joseph Pecoraro.
1821
1822         * UserInterface/Views/ContextMenuUtilities.js:
1823         (WI.appendContextMenuItemsForSourceCode):
1824
1825         * Localizations/en.lproj/localizedStrings.js:
1826
1827 2019-11-15  Devin Rousso  <drousso@apple.com>
1828
1829         Web Inspector: Sources: "Style Sheet" appears twice in the resource type scope bar
1830         https://bugs.webkit.org/show_bug.cgi?id=204172
1831
1832         Reviewed by Joseph Pecoraro.
1833
1834         * UserInterface/Models/Resource.js:
1835         (WI.Resource):
1836         (WI.Resource.prototype.updateForResponse):
1837         Remove compatibility `WI.Resource.Type.Stylesheet` (which previously existed since the
1838         protocol values for `Page.ResourceType` match the keys) and instead add compatibility cases
1839         at the necessary callsites.
1840
1841 2019-11-13  Nikita Vasilyev  <nvasilyev@apple.com>
1842
1843         Web Inspector: "aqua" and "fuchsia" aren't detected as colors
1844         https://bugs.webkit.org/show_bug.cgi?id=204085
1845
1846         Reviewed by Devin Rousso.
1847
1848         * UserInterface/Models/Color.js:
1849
1850 2019-11-13  Devin Rousso  <drousso@apple.com>
1851
1852         Web Inspector: Uncaught Exception: Invalid type of argument 'eventName' for command 'DOMDebugger.setEventBreakpoint' call. It must be 'string' but it is 'object'.
1853         https://bugs.webkit.org/show_bug.cgi?id=204176
1854
1855         Reviewed by Timothy Hatcher.
1856
1857         * UserInterface/Views/EventBreakpointPopover.js:
1858         (WI.EventBreakpointPopover.prototype.dismiss):
1859         Only create the `WI.EventBreakpoint` if the <input> has a value.
1860
1861         * UserInterface/Controllers/DOMDebuggerManager.js:
1862         (WI.DOMDebuggerManager.prototype.addEventBreakpoint):
1863         (WI.DOMDebuggerManager.prototype.addURLBreakpoint):
1864         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1865         (WI.SourcesNavigationSidebarPanel.prototype._willDismissEventBreakpointPopover):
1866         (WI.SourcesNavigationSidebarPanel.prototype._willDismissURLBreakpointPopover):
1867         Drive-by: if the configuration isn't valid (e.g. no breakpoint) or the breakpoint already
1868                   exists, beep.
1869
1870 2019-11-12  Devin Rousso  <drousso@apple.com>
1871
1872         Web Inspector: Local Overrides: drop zone overlay doesn't take up the full content area
1873         https://bugs.webkit.org/show_bug.cgi?id=204093
1874
1875         Reviewed by Joseph Pecoraro.
1876
1877         * UserInterface/Views/FontResourceContentView.css:
1878         (.content-view.resource.font > :matches(.local-resource-override-label-view, .local-resource-override-warning-view):not([hidden]) ~ .drop-zone): Added.
1879         (.content-view.resource.font > .drop-zone): Deleted.
1880         * UserInterface/Views/ImageResourceContentView.css:
1881         (.content-view.resource.image > :matches(.local-resource-override-label-view, .local-resource-override-warning-view):not([hidden]) ~ .drop-zone): Added.
1882         (.content-view.resource.image > .drop-zone): Deleted.
1883
1884 2019-11-12  Devin Rousso  <drousso@apple.com>
1885
1886         Web Inspector: Sources: create/update local override drop zone shown in image collection view
1887         https://bugs.webkit.org/show_bug.cgi?id=204097
1888
1889         Reviewed by Joseph Pecoraro.
1890
1891         * UserInterface/Views/CollectionContentView.js:
1892         (WI.CollectionContentView):
1893         (WI.CollectionContentView.prototype.get contentViewConstructorOptions): Added.
1894         (WI.CollectionContentView.prototype.addContentViewForItem):
1895         * UserInterface/Views/ResourceCollectionContentView.js:
1896         (WI.ResourceCollectionContentView.prototype.get contentViewConstructorOptions): Added.
1897         Provide a way to pass options when instantiating the content view from the constructor.
1898
1899         * UserInterface/Views/ImageResourceContentView.js:
1900         (WI.ImageResourceContentView.prototype.contentAvailable):
1901         Support an optional object parameter that can be used to disable the `WI.DropZone`.
1902
1903 2019-11-07  Devin Rousso  <drousso@apple.com>
1904
1905         Web Inspector: REGRESSION(r251958): console prompt is automatically focused when page is reloaded
1906         https://bugs.webkit.org/show_bug.cgi?id=203932
1907
1908         Reviewed by Timothy Hatcher.
1909
1910         * UserInterface/Base/Main.js:
1911         (WI._restoreCookieForOpenTabs):
1912         Only attempt to autofocus when Web Inspector is first opened.
1913
1914 2019-11-07  Devin Rousso  <drousso@apple.com>
1915
1916         Web Inspector: REGRESSION(r250087): inspector/model/remote-object.html is timing out
1917         https://bugs.webkit.org/show_bug.cgi?id=202934
1918         <rdar://problem/56270900>
1919
1920         Reviewed by Timothy Hatcher.
1921
1922         * UserInterface/Views/ObjectTreeView.js:
1923         (WI.ObjectTreeView.addShowMoreIfNeeded):
1924         Drive-by: ensure that the indeterminate progress spinner is added after the last button.
1925
1926 2019-11-07  Devin Rousso  <drousso@apple.com>
1927
1928         Web Inspector: REGRESSION(r249451): missing "Reveal in DOM Tree" on nodes logged to the console
1929         https://bugs.webkit.org/show_bug.cgi?id=203836
1930
1931         Reviewed by Timothy Hatcher.
1932
1933         * UserInterface/Views/ContextMenuUtilities.js:
1934         (WI.appendContextMenuItemsForDOMNode):
1935         * UserInterface/Views/DOMTreeOutline.js:
1936         (WI.DOMTreeOutline.prototype.populateContextMenu):
1937         DOM trees in the console are marked as being non-editable, which is intended to prevent
1938         modifications (e.g. changing an attribute) from being made in the console as the DOM tree
1939         there is not hooked up to the associated DOM agent. In r249451 however, this guard was over
1940         expanded to include non-editing actions, like "Reveal in DOM Tree" and DOM breakpoints.
1941
1942         * UserInterface/Views/LogContentView.js:
1943         (WI.LogContentView.prototype._handleContextMenuEvent):
1944         Drive-by: add a separator before "Copy Selected" so it doesn't end up in the same group as
1945                   any "Collapse All" from a `WI.TreeOutline`.
1946
1947 2019-11-07  Devin Rousso  <drousso@apple.com>
1948
1949         Web Inspector: Local Resource Overrides: automatically show a file picker when attempting to create an override for non-text resources
1950         https://bugs.webkit.org/show_bug.cgi?id=203917
1951
1952         Reviewed by Timothy Hatcher.
1953
1954         Since there's no way to edit non-text resources (e.g. images, fonts, etc.) in Web Inspector,
1955         when creating a local override for non-text resources, default to showing a file picker and
1956         creating a local override from the content and MIME type of whatever file is chosen.
1957
1958         Still provide a way (shift-click) to create a local override for non-text resources from the
1959         resource's contents, as that can be useful if the user just wants to change some headers.
1960
1961         * UserInterface/Models/Resource.js:
1962         (WI.Resource.prototype.async createLocalResourceOverride):
1963
1964         * UserInterface/Views/ResourceContentView.js:
1965         (WI.ResourceContentView):
1966         (WI.ResourceContentView.prototype.get createLocalResourceOverrideTooltip): Added.
1967         (WI.ResourceContentView.prototype.requestLocalResourceOverrideInitialContent): Added.
1968         (WI.ResourceContentView.prototype.async _getContentForLocalResourceOverrideFromFile): Added.
1969         (WI.ResourceContentView.prototype._handleCreateLocalResourceOverride):
1970         (WI.ResourceContentView.prototype._handleImportLocalResourceOverride):
1971         (WI.ResourceContentView.prototype.localResourceOverrideInitialContent): Deleted.
1972         (WI.ResourceContentView.prototype.async _handleCreateLocalResourceOverride): Deleted.
1973
1974         * UserInterface/Views/TextResourceContentView.js:
1975         (WI.TextResourceContentView.prototype.get createLocalResourceOverrideTooltip): Added.
1976         (WI.TextResourceContentView.prototype.requestLocalResourceOverrideInitialContent): Added.
1977         (WI.TextResourceContentView.prototype.localResourceOverrideInitialContent): Deleted.
1978
1979         * Localizations/en.lproj/localizedStrings.js:
1980
1981 2019-11-07  Devin Rousso  <drousso@apple.com>
1982
1983         Web Inspector: Timelines: add a marker for when a stop was requested
1984         https://bugs.webkit.org/show_bug.cgi?id=203935
1985
1986         Reviewed by Timothy Hatcher.
1987
1988         After r244195, the Web Inspector frontend doesn't stop updating the current time marker
1989         until after it receives all of the corresponding `*.trackingComplete` events. This means
1990         that sometimes, the current time marker can move far past the time at which the stop was
1991         requested, such as if there's a blocking script.
1992
1993         We should indicate where the stop was requested, as that is often right after a particular
1994         issue is reproduced during a timeline recording, rather than have the user try to figure out
1995         where they stopped.
1996
1997         Only keep a marker for the last stop request, and hide the marker once capturing resumes.
1998
1999         It's still useful to have the current time marker continue updating, as we should show all
2000         the information we have about captured things, such as blocking scripts.
2001
2002         * UserInterface/Views/TimelineOverview.js:
2003         (WI.TimelineOverview):
2004         (WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged):
2005
2006         * UserInterface/Models/TimelineMarker.js:
2007         * UserInterface/Views/TimelineRuler.js:
2008         (WI.TimelineRuler.prototype.addMarker):
2009         * UserInterface/Views/TimelineRuler.css:
2010         (.timeline-ruler > .markers > .marker.stopping-time): Added.
2011         (.timeline-ruler > .markers > .marker.current-time):
2012         (.timeline-ruler > .markers > .marker:matches(.stopping-time, .current-time)::after): Added.
2013         (@media (prefers-color-scheme: dark) .timeline-ruler > .markers > .marker.stopping-time): Added.
2014         (.timeline-ruler > .markers > .marker.current-time::after): Deleted.
2015         Make the current time marker always on top (`z-index`).
2016
2017         * Localizations/en.lproj/localizedStrings.js:
2018
2019 2019-11-07  Devin Rousso  <drousso@apple.com>
2020
2021         Web Inspector: REGRESSION(r251958): automatic console prompt focusing prevents any "space" shortcuts from working
2022         https://bugs.webkit.org/show_bug.cgi?id=203939
2023
2024         Reviewed by Timothy Hatcher.
2025
2026         * UserInterface/Base/Main.js:
2027         (WI.isShowingTimelineTab): Added.
2028         (WI.isShowingAuditTab): Added.
2029         (WI._restoreCookieForOpenTabs):
2030
2031 2019-11-07  Devin Rousso  <drousso@apple.com>
2032
2033         Web Inspector: Uncaught Exception: Unable to get object details - GlobalObject
2034         https://bugs.webkit.org/show_bug.cgi?id=203930
2035         <rdar://problem/56960937>
2036
2037         In r248286, calls to `Heap.snapshot`, `Heap.getPreview`, and `Heap.getRemoteObject` were
2038         moved to the `WI.HeapManager` instead of being inside view code. During this move, extra
2039         `WI.reportInternalError` calls were added, which wasn't entirely correct as it is fully
2040         possible (and expected) that any of these commands are invoked with old heap snapshot nodes
2041         that may no longer exist. As such, calling any error an "internal error" isn't strictly
2042         correct, and instead should just be a log. Also, the frontend code that calls these commands
2043         is able to handle errors, again because it is expected.
2044
2045         Reviewed by Brian Burg.
2046
2047         * UserInterface/Controllers/HeapManager.js:
2048         (WI.HeapManager.prototype.snapshot):
2049         (WI.HeapManager.prototype.getPreview):
2050         (WI.HeapManager.prototype.getRemoteObject):
2051
2052 2019-11-06  Nikita Vasilyev  <nvasilyev@apple.com>
2053
2054         Web Inspector: Display color picker for p3 colors
2055         https://bugs.webkit.org/show_bug.cgi?id=203436
2056         <rdar://problem/56635062>
2057
2058         Reviewed by Brian Burg.
2059
2060         For p3 colors, display ColorSquare with display-p3 gamut.
2061         Continue showing ColorSquare with sRGB gamut by default.
2062
2063         * UserInterface/Base/Setting.js:
2064         * UserInterface/Models/Color.js:
2065         (WI.Color):
2066         (WI.Color.rgb2hsv):
2067         (WI.Color.hsv2rgb.fraction):
2068         (WI.Color.hsv2rgb):
2069         (WI.Color.prototype.get hsla):
2070         (WI.Color.prototype.isKeyword):
2071
2072         * UserInterface/Views/ColorPicker.css:
2073         (.color-picker > .hue):
2074         (@media (color-gamut: p3)):
2075         (.color-picker.gamut-p3 > .hue):
2076
2077         * UserInterface/Views/ColorPicker.js:
2078         (WI.ColorPicker.prototype._updateColor):
2079         (WI.ColorPicker.prototype._updateOpacitySlider):
2080         (WI.ColorPicker.prototype._handleFormatChange):
2081         Introduce `gamut` parameter. Previously, the only available `gamut` was sRGB.
2082
2083         * UserInterface/Views/ColorSquare.css:
2084         (.color-square > .crosshair):
2085         Update the crosshair style to look better for both light and dark backgrounds.
2086
2087         * UserInterface/Views/ColorSquare.js:
2088         (WI.ColorSquare):
2089         (WI.ColorSquare.prototype.get tintedColor):
2090         (WI.ColorSquare.prototype.set tintedColor):
2091         (WI.ColorSquare.prototype._setCrosshairPosition):
2092         (WI.ColorSquare.prototype._updateBaseColor):
2093         (WI.ColorSquare.prototype._updateCrosshairBackground):
2094
2095         * UserInterface/Views/InlineSwatch.js:
2096         Make p3 color picker a preview (e.g. STP-only) feature.
2097
2098 2019-11-05  Ross Kirsling  <ross.kirsling@sony.com>
2099
2100         Web Inspector: Layers: enable tab by default
2101         https://bugs.webkit.org/show_bug.cgi?id=203833
2102
2103         Reviewed by Timothy Hatcher.
2104
2105         * Localizations/en.lproj/localizedStrings.js:
2106         * UserInterface/Base/Setting.js:
2107         * UserInterface/Views/ContextMenuUtilities.js:
2108         * UserInterface/Views/LayersTabContentView.js:
2109         (WI.LayersTabContentView.isTabAllowed):
2110         * UserInterface/Views/SettingsTabContentView.js:
2111         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2112
2113 2019-11-04  Devin Rousso  <drousso@apple.com>
2114
2115         Web Inspector: "Toggle Visibility" does not work for element inside Shadow DOM
2116         https://bugs.webkit.org/show_bug.cgi?id=202218
2117         <rdar://problem/55713078>
2118
2119         Reviewed by Brian Burg.
2120
2121         * UserInterface/Views/DOMTreeElement.js:
2122         (WI.DOMTreeElement.prototype.toggleElementVisibility.inspectedPage_node_injectStyleAndToggleClass):
2123         If the node is inside a shadow tree, store the `<style>` inside the shadow root instead of
2124         always using `document.head`.
2125
2126 2019-11-02  Devin Rousso  <drousso@apple.com>
2127
2128         Web Inspector: Add diagnostic logging for frontend feature usage
2129         https://bugs.webkit.org/show_bug.cgi?id=203579
2130         <rdar://problem/56717410>
2131
2132         Reviewed by Brian Burg.
2133
2134         Add a `DiagnosticController` class for reporting Web Inspector telemetry.
2135         The controller initially measures a single "TabActivity" data point,
2136         which logs the active tab during the specified time interval (one minute).
2137         If the UI is not active during the time interval, no logging takes place.
2138
2139         The UI is considered to be active if mouse/keyboard interaction occurs
2140         during the time interval, or the selected `TabContentView` changes.
2141
2142         Original patch by Matt Baker <mattbaker@apple.com>.
2143
2144         * UserInterface/Controllers/DiagnosticController.js: Added.
2145         (WI.DiagnosticController):
2146         (WI.DiagnosticController.supportsDiagnosticLogging):
2147         (WI.DiagnosticController.prototype.logDiagnosticMessage):
2148         (WI.DiagnosticController.prototype._didInteractWithTabContent):
2149         (WI.DiagnosticController.prototype._clearTabActivityTimeout):
2150         (WI.DiagnosticController.prototype._beginTabActivityTimeout):
2151         (WI.DiagnosticController.prototype._stopTrackingTabActivity):
2152         (WI.DiagnosticController.prototype._handleWindowFocus):
2153         (WI.DiagnosticController.prototype._handleWindowBlur):
2154         (WI.DiagnosticController.prototype._handleWindowKeyDown):
2155         (WI.DiagnosticController.prototype._handleWindowMouseDown):
2156         (WI.DiagnosticController.prototype._handleTabBrowserSelectedTabContentViewDidChange):
2157
2158         * UserInterface/Main.html:
2159         * UserInterface/Base/Main.js:
2160         (WI.contentLoaded):
2161
2162 2019-11-01  Devin Rousso  <drousso@apple.com>
2163
2164         Web Inspector: switching tabs should re-focus the previously focused element
2165         https://bugs.webkit.org/show_bug.cgi?id=203744
2166
2167         Reviewed by Brian Burg.
2168
2169         * UserInterface/Views/TabBrowser.js:
2170         (WI.TabBrowser.prototype._tabBarItemSelected):
2171         (WI.TabBrowser.prototype._saveFocusedNodeForTabContentView): Added.
2172         (WI.TabBrowser.prototype._restoreFocusedNodeForTabContentView): Added.
2173         Store the `document.activeElement` on the `WI.TabContentView` and `.focus()` it after we're
2174         done showing the newly selected tab, but only if there isn't already something focused.
2175
2176         * UserInterface/Views/TabBar.js:
2177         (WI.TabBar.prototype.set selectedTabBarItem):
2178         * UserInterface/Views/LegacyTabBar.js:
2179         (WI.LegacyTabBar.prototype.set selectedTabBarItem):
2180         Include the previously selected tab bar item when dispatching selection change events.
2181
2182         * UserInterface/Views/ContentBrowserTabContentView.js:
2183         (WI.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObject):
2184         Don't omit focus when revealing represented objects.
2185
2186 2019-11-01  Devin Rousso  <drousso@apple.com>
2187
2188         Web Inspector: Timelines: add a timeline that shows information about any recorded CSS animation/transition
2189         https://bugs.webkit.org/show_bug.cgi?id=203651
2190         <rdar://problem/56128726>
2191
2192         Reviewed by Brian Burg.
2193
2194         Unlike all other forms of Web Animations, CSS animations/transitions, are _not_ created by
2195         JavaScript, and therefore can seemingly appear out of nowhere. This patch expands the Media
2196         timeline to be the Media & Animations timeline, which tracks when CSS animations/transitions
2197         are created, started, delayed, iterated, canceled, or finished.
2198
2199         * UserInterface/Protocol/AnimationObserver.js: Added.
2200         (WI.AnimationObserver.prototype.trackingStart):
2201         (WI.AnimationObserver.prototype.trackingUpdate):
2202         (WI.AnimationObserver.prototype.trackingComplete):
2203         * UserInterface/Protocol/Target.js:
2204         (WI.Target.prototype.get AnimationAgent): Added.
2205         * UserInterface/Main.html:
2206         * UserInterface/Base/Main.js:
2207         (WI.loaded):
2208         * UserInterface/Test.html:
2209         * UserInterface/Test/Test.js:
2210         (WI.loaded):
2211         Add an Animation domain for handling the tracking of CSS Web Animations.
2212
2213         * UserInterface/Models/MediaInstrument.js:
2214         (WI.MediaInstrument.prototype.startInstrumentation):
2215         (WI.MediaInstrument.prototype.stopInstrumentation):
2216         (WI.MediaInstrument):
2217         * UserInterface/Models/MediaTimeline.js: Added.
2218         (WI.MediaTimeline.prototype.recordForTrackingAnimationId):
2219         (WI.MediaTimeline.prototype.recordForMediaElementEvents):
2220         (WI.MediaTimeline.prototype.reset):
2221         (WI.MediaTimeline.prototype.addRecord):
2222         * UserInterface/Models/MediaTimelineRecord.js:
2223         (WI.MediaTimelineRecord):
2224         (WI.MediaTimelineRecord.async fromJSON):
2225         (WI.MediaTimelineRecord.prototype.toJSON):
2226         (WI.MediaTimelineRecord.prototype.get trackingAnimationId): Added.
2227         (WI.MediaTimelineRecord.prototype.get timestamps): Added.
2228         (WI.MediaTimelineRecord.prototype.get activeStartTime): Added.
2229         (WI.MediaTimelineRecord.prototype.get updatesDynamically): Added.
2230         (WI.MediaTimelineRecord.prototype.get usesActiveStartTime): Added.
2231         (WI.MediaTimelineRecord.prototype.get displayName):
2232         (WI.MediaTimelineRecord.prototype.get subtitle): Added.
2233         (WI.MediaTimelineRecord.prototype.saveIdentityToCookie):
2234         (WI.MediaTimelineRecord.prototype.updateProgress): Added.
2235         (WI.MediaTimelineRecord.prototype.addDOMEvent): Added.
2236         (WI.MediaTimelineRecord.prototype.powerEfficientPlaybackStateChanged): Added.
2237         (WI.MediaTimelineRecord.prototype._updateTimes): Added.
2238         (WI.MediaTimelineRecord.fromJSON): Deleted.
2239         (WI.MediaTimelineRecord.prototype.get domEvent): Deleted.
2240         (WI.MediaTimelineRecord.prototype.get isPowerEfficient): Deleted.
2241         * UserInterface/Models/Timeline.js:
2242         (WI.Timeline.create):
2243         * UserInterface/Controllers/TimelineManager.js:
2244         (WI.TimelineManager):
2245         (WI.TimelineManager.prototype.async processJSON):
2246         (WI.TimelineManager.prototype.animationTrackingStarted): Added.
2247         (WI.TimelineManager.prototype.animationTrackingUpdated): Added.
2248         (WI.TimelineManager.prototype.animationTrackingCompleted): Added.
2249         (WI.TimelineManager.prototype._updateAutoCaptureInstruments):
2250         (WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
2251         (WI.TimelineManager.prototype._handleDOMNodePowerEfficientPlaybackStateChanged):
2252         Start/Stop tracking animations based on whether the Media & Animations timeline is enabled.
2253
2254         * UserInterface/Views/MediaTimelineOverviewGraph.js:
2255         (WI.MediaTimelineOverviewGraph):
2256         (WI.MediaTimelineOverviewGraph.get maximumRowCount): Added.
2257         (WI.MediaTimelineOverviewGraph.prototype.reset):
2258         (WI.MediaTimelineOverviewGraph.prototype.layout):
2259         (WI.MediaTimelineOverviewGraph.prototype.updateSelectedRecord):
2260         (WI.MediaTimelineOverviewGraph.prototype._processRecord): Added.
2261         (WI.MediaTimelineOverviewGraph.prototype._processRecord.compareByStartTime): Added.
2262         (WI.MediaTimelineOverviewGraph.prototype._handleRecordAdded):
2263         (WI.MediaTimelineOverviewGraph.prototype._handleTimesUpdated): Added.
2264         (WI.MediaTimelineOverviewGraph.prototype.shown): Deleted.
2265         (WI.MediaTimelineOverviewGraph.prototype.hidden): Deleted.
2266         * UserInterface/Views/MediaTimelineOverviewGraph.css:
2267         (.timeline-overview-graph.media): Added.
2268         (.timeline-overview-graph.media > .graph-row): Added.
2269         (.timeline-overview-graph.media > .graph-row > .timeline-record-bar): Added.
2270         (.timeline-overview-graph.media > .graph-row > .timeline-record-bar:not(.unfinished) > .segment:not(.inactive)): Added.
2271         (.timeline-overview-graph.media:nth-child(even) > .graph-row > .timeline-record-bar:not(.unfinished) > .segment:not(.inactive)): Added.
2272         (.timeline-overview-graph.media > .timeline-record-bar): Deleted.
2273         (.timeline-overview-graph.media > .timeline-record-bar > .segment): Deleted.
2274         * UserInterface/Views/MediaTimelineView.js:
2275         (WI.MediaTimelineView):
2276         (WI.MediaTimelineView.prototype.shown): Added.
2277         (WI.MediaTimelineView.prototype.hidden): Added.
2278         (WI.MediaTimelineView.prototype.closed):
2279         (WI.MediaTimelineView.prototype.reset):
2280         (WI.MediaTimelineView.prototype.dataGridSortComparator):
2281         (WI.MediaTimelineView.prototype.dataGridSortComparator.compareDOMNodes):
2282         (WI.MediaTimelineView.prototype._processPendingRecords):
2283         * UserInterface/Views/MediaTimelineDataGridNode.js:
2284         (WI.MediaTimelineDataGridNode):
2285         (WI.MediaTimelineDataGridNode.prototype.get data):
2286         (WI.MediaTimelineDataGridNode.prototype.createCellContent):
2287         (WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren): Added.
2288         (WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addReadySegment): ADded.
2289         (WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addDelaySegment): ADded.
2290         (WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addActiveSegment): ADded.
2291         (WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addFullScreenSegment): ADded.
2292         (WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addPowerEfficientPlaybackSegment): ADded.
2293         (WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addPausedSegment): ADded.
2294         (WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addPlayingSegment): ADded.
2295         (WI.MediaTimelineDataGridNode.prototype.filterableDataForColumn):
2296         (WI.MediaTimelineDataGridNode.prototype._createNameCellDocumentFragment): Added.
2297         (WI.MediaTimelineDataGridNode.prototype.iconClassNames): Deleted.
2298
2299          * UserInterface/Views/TimelineRecordBar.js:
2300         (WI.TimelineRecordBar):
2301         (WI.TimelineRecordBar.prototype.refresh):
2302         (WI.TimelineRecordBar.prototype._handleClick):
2303         * UserInterface/Views/TimelineRecordBar.css:
2304         (.timeline-record-bar):
2305         (.timeline-record-bar > :matches(img, .segment)):
2306         (.timeline-record-bar > img):
2307         (.timeline-record-bar > .segment):
2308         (body[dir=ltr] .timeline-record-bar > .segment):
2309         (body[dir=ltr] .timeline-record-bar > .segment:first-of-type):
2310         (body[dir=ltr] .timeline-record-bar > .segment:last-of-type):
2311         (body[dir=rtl] .timeline-record-bar > .segment):
2312         (body[dir=rtl] .timeline-record-bar > .segment:first-of-type):
2313         (body[dir=rtl] .timeline-record-bar > .segment:last-of-type):
2314         (.timeline-record-bar > .segment:not(:last-of-type)):
2315         (.timeline-record-bar.selected > .segment):
2316         (.timeline-record-bar > .segment.inactive,):
2317         (.timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
2318         (:focus .selected .timeline-record-bar:not(.has-custom-children) > .segment):
2319         (:focus .selected .timeline-record-bar:not(.has-custom-children) > .segment.inactive):
2320         (:focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
2321         (.timeline-record-bar.timeline-record-type-network > .segment):
2322         (.timeline-record-bar.timeline-record-type-network > .segment.inactive):
2323         (.timeline-record-bar.timeline-record-type-layout > .segment):
2324         (.timeline-record-bar.timeline-record-type-layout.paint > .segment,):
2325         (.timeline-record-bar.timeline-record-type-script > .segment):
2326         (.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment,):
2327         (.timeline-record-bar.timeline-record-type-media > .segment):
2328         (.timeline-record-bar.has-custom-children.timeline-record-type-media > .segment):
2329         (.timeline-record-bar.has-custom-children.timeline-record-type-media > .segment.css-animation-ready):
2330         (.timeline-record-bar.has-custom-children.timeline-record-type-media > .segment:matches(.css-animation-delay, .media-element-paused)):
2331         (.timeline-record-bar.has-custom-children.timeline-record-type-media.media-element > .segment):
2332         (.timeline-record-bar.has-custom-children.timeline-record-type-media.media-element > .segment.media-element-full-screen):
2333         (.timeline-record-bar.has-custom-children.timeline-record-type-media.media-element > .segment.media-element-power-efficient-playback):
2334         (body[dir=ltr] .timeline-record-bar > .segment.inactive,): Deleted.
2335         (body[dir=ltr] .timeline-record-bar.has-inactive-segment > .segment:not(.inactive),): Deleted.
2336         (:focus .selected .timeline-record-bar > .segment): Deleted.
2337         (:focus .selected .timeline-record-bar > .segment.inactive): Deleted.
2338         (body[dir=ltr] :focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.
2339         (body[dir=rtl] :focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.
2340         Allow timeline record bars to be customized through a delegate callback. If provided, it
2341         will be used instead of any default content. It is expected to return an array of objects,
2342         each having a `startTime` number, `classNames` array, and `title` string. It can also have a
2343         `endTime` number and an `image` string. If `endTime` is `NaN`, the record is unfinished. If
2344         `image` is provided, an `<img>` will be used instead of a segment, allowing for markers.
2345
2346         * UserInterface/Views/TimelineDataGridNode.js:
2347         (WI.TimelineDataGridNode.prototype.createCellContent):
2348         Add a default fallback for `WI.DOMNode` values.
2349
2350         * UserInterface/Views/TimelineTabContentView.js:
2351         (WI.TimelineTabContentView.displayNameForTimelineType):
2352         (WI.TimelineTabContentView.iconClassNameForRecord):
2353         (WI.TimelineTabContentView.displayNameForRecord):
2354         * UserInterface/Views/TimelineRecordTreeElement.js:
2355         * UserInterface/Views/TimelineIcons.css:
2356         (.animation-frame-record .icon):
2357         (.css-animation-record .icon): Added.
2358         (.css-transition-record .icon): Added.
2359         (.media-element-record .icon): Added.
2360         (.animation-record .icon): Deleted.
2361         (.dom-event-record .icon): Deleted.
2362         (.dom-event-record.fullscreen .icon): Deleted.
2363         (.power-efficient-playback-state-changed-record .icon): Deleted.
2364         * UserInterface/Images/DOMEventFullscreen.svg: Removed.
2365         * UserInterface/Images/EventCancel.svg: Added.
2366         * UserInterface/Images/EventIteration.svg: Added.
2367         * UserInterface/Images/EventPause.svg:
2368         * UserInterface/Images/EventPlay.svg:
2369         * UserInterface/Images/EventProcessing.svg:
2370         * UserInterface/Images/EventStop.svg:
2371         * UserInterface/Images/PowerEfficientPlaybackStateChanged.svg: Removed.
2372         * UserInterface/Images/TimelineRecordAnimationFrame.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/TimelineRecordAnimation.svg.
2373         * UserInterface/Images/TimelineRecordCSSAnimation.svg: Added.
2374         * UserInterface/Images/TimelineRecordCSSTransition.svg: Added.
2375         * UserInterface/Images/TimelineRecordMediaElement.svg: Added.
2376         Add new media icons.
2377
2378         * UserInterface/Models/TimelineRecording.js:
2379         (WI.TimelineRecording.async import): Added.
2380         (WI.TimelineRecording.import): Deleted.
2381         * UserInterface/Models/TimelineRecord.js:
2382         * UserInterface/Models/CPUTimelineRecord.js:
2383         * UserInterface/Models/HeapAllocationsTimelineRecord.js:
2384         (WI.HeapAllocationsTimelineRecord.async fromJSON): Added.
2385         (WI.HeapAllocationsTimelineRecord.fromJSON): Deleted.
2386         * UserInterface/Models/LayoutTimelineRecord.js:
2387         * UserInterface/Models/MemoryTimelineRecord.js:
2388         * UserInterface/Models/RenderingFrameTimelineRecord.js:
2389         * UserInterface/Models/ResourceTimelineRecord.js:
2390         * UserInterface/Models/ScriptTimelineRecord.js:
2391         Make the importing of timeline records `async` so we can attempt to rehydrate the DOM nodes
2392         of any media records (as well as wait for heap snapshots).
2393
2394         * UserInterface/Models/DOMNode.js:
2395         (WI.DOMNode):
2396         (WI.DOMNode.prototype.isMediaElement): Added.
2397         (WI.DOMNode.prototype._shouldListenForEventListeners): Deleted.
2398
2399         * Localizations/en.lproj/localizedStrings.js:
2400
2401 2019-11-01  Devin Rousso  <drousso@apple.com>
2402
2403         Web Inspector: default to focusing the console prompt if no other content is focused after opening Web Inspector
2404         https://bugs.webkit.org/show_bug.cgi?id=203743
2405
2406         Reviewed by Eric Carlson and Brian Burg.
2407
2408         * UserInterface/Base/Main.js:
2409         (WI.isContentAreaFocused): Added.
2410         (WI.isConsoleFocused):
2411         (WI._focusChanged):
2412         (WI._restoreCookieForOpenTabs):
2413
2414 2019-11-01  Nikita Vasilyev  <nvasilyev@apple.com>
2415
2416         Web Inspector: Display color swatches for p3 colors
2417         https://bugs.webkit.org/show_bug.cgi?id=203439
2418         <rdar://problem/56637250>
2419
2420         Reviewed by Devin Rousso.
2421
2422         Detect `color(display-p3 0 1 0)` as a color in the style editor.
2423
2424         * UserInterface/Models/Color.js:
2425         (WI.Color):
2426         (WI.Color.fromString):
2427         (WI.Color.prototype.copy):
2428         (WI.Color.prototype.toString):
2429         (WI.Color.prototype.isKeyword):
2430         (WI.Color.prototype._toFunctionString):
2431
2432 2019-11-01  Devin Rousso  <drousso@apple.com>
2433
2434         Web Inspector: REGRESSION(r249831): content view is empty if a breakpoint is hit in the main resource
2435         https://bugs.webkit.org/show_bug.cgi?id=203722
2436         <rdar://problem/56802409>
2437
2438         Reviewed by Joseph Pecoraro.
2439
2440         * UserInterface/Models/SourceCode.js:
2441         (WI.SourceCode.prototype.get currentRevision):
2442         (WI.SourceCode.prototype.revisionContentDidChange):
2443         (WI.SourceCode.prototype._initializeCurrentRevisionIfNeeded):
2444         (WI.SourceCode.prototype._processContent):
2445         Don't wait to lazily clone the `originalRevision` and use it as the `currentRevision`. Some
2446         listeners expect the `currentRevision` to already be set by the time this happens, so as
2447         soon as the original revision's content is changed, clone it into the `currentRevision`.
2448
2449 2019-11-01  Devin Rousso  <drousso@apple.com>
2450
2451         Web Inspector: Sources: tab isn't visible after removal of Debugger Tab and Resources Tab
2452         https://bugs.webkit.org/show_bug.cgi?id=203719
2453         <rdar://problem/56802389>
2454
2455         Reviewed by Timothy Hatcher.
2456
2457         * UserInterface/Base/Main.js:
2458         (WI.loaded):
2459         If the Debugger Tab identifier or Resources Tab identifier still exists in the list of open
2460         tabs, remove both and replace the first one with the Sources Tab identifier.
2461
2462 2019-11-01  Devin Rousso  <drousso@apple.com>
2463
2464         Web Inspector: make the default content of the Inspector Bootstrap Script a comment that explains how it works
2465         https://bugs.webkit.org/show_bug.cgi?id=203704
2466
2467         Reviewed by Timothy Hatcher.
2468
2469         * UserInterface/Controllers/NetworkManager.js:
2470         (WI.NetworkManager.prototype.async createBootstrapScript):
2471
2472         * Localizations/en.lproj/localizedStrings.js:
2473
2474 2019-11-01  Devin Rousso  <drousso@apple.com>
2475
2476         Web Inspector: Settings: Blackbox: hide icon is missing
2477         https://bugs.webkit.org/show_bug.cgi?id=203727
2478
2479         Reviewed by Timothy Hatcher.
2480
2481         * UserInterface/Images/Hide.svg:
2482         `WI.ImageUtilities.useSVGSymbol` links directly to a specific part of the SVG resource based
2483         on an `id` attribute (default to `#root` if not otherwise given). As a result, any `<style>`
2484         that are not a child of that specific part won't be included, meaning that any CSS variables
2485         used for controlling colors won't exist. Adding a fallback value to the `var()` for these
2486         cases allows a specific part to be used without needing any surrounding styles.
2487
2488         * UserInterface/Views/BlackboxSettingsView.css:
2489         (.settings-view.blackbox > p > .toggle-script-blackbox):
2490         Slightly adjust the size and vertical alignment to better match the surrounding text.
2491
2492 2019-11-01  Devin Rousso  <drousso@apple.com>
2493
2494         Web Inspector: enable line wrapping by default
2495         https://bugs.webkit.org/show_bug.cgi?id=203726
2496
2497         Reviewed by Timothy Hatcher.
2498
2499         * UserInterface/Base/Setting.js:
2500
2501 2019-10-31  Nikita Vasilyev  <nvasilyev@apple.com>
2502
2503         Web Inspector: Color picker: incorrect saturation when selecting color on color square
2504         https://bugs.webkit.org/show_bug.cgi?id=203695
2505         <rdar://problem/56793697>
2506
2507         Reviewed by Matt Baker.
2508
2509         The saturation component in HSV does NOT equal the saturation component in HSL.
2510         Use the proper HSV to HSL conversion.
2511
2512         * UserInterface/Models/Color.js:
2513         (WI.Color.hsv2hsl): Added.
2514         * UserInterface/Views/ColorSquare.js:
2515         (WI.ColorSquare.prototype.get tintedColor):
2516         (WI.ColorSquare.prototype.get _lightness): Deleted.
2517
2518 2019-10-31  Devin Rousso  <drousso@apple.com>
2519
2520         Web Inspector: REGRESSION(r251038): Elements: Computed: variables are shown in the Properties section instead of in the Variables section
2521         https://bugs.webkit.org/show_bug.cgi?id=203668
2522
2523         Reviewed by Matt Baker.
2524
2525         * UserInterface/Views/ComputedStyleDetailsPanel.js:
2526         (WI.ComputedStyleDetailsPanel.prototype.initialLayout):
2527         * UserInterface/Views/ComputedStyleSection.js:
2528         (WI.ComputedStyleSection):
2529         (WI.ComputedStyleSection.prototype.set propertyVisibilityMode): Added.
2530         (WI.ComputedStyleSection.prototype.get propertiesToRender):
2531         Reintroduce the `propertyVisibilityMode` concept to `WI.ComputedStyleSection` so that the
2532         Computed details panel can prevent CSS variables from being shown in the Properites section.
2533
2534         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2535         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.get propertiesToRender):
2536         Replace `variable` getter with `isVariable` to match r251038.
2537
2538 2019-10-31  Devin Rousso  <drousso@apple.com>
2539
2540         Web Inspector: DOMDebugger: Node Removed breakpoints should fire whenever the node is removed from the main DOM tree, not just when it's removed from it's parent
2541         https://bugs.webkit.org/show_bug.cgi?id=203349
2542
2543         Reviewed by Matt Baker.
2544
2545         Replace `targetNode` (which was a `Runtime.RemoteObject`) with a `targetNodeId` (which is a
2546         `DOM.NodeId`) when dispatching `DOMDebugger` pauses. Additionally, include the ancestor's
2547         `DOM.NodeId` as the `targetNodeId` whenever an ancestor is removed that has a descendant
2548         with a node removed DOM breakpoint.
2549
2550         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
2551         (WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
2552
2553         * Localizations/en.lproj/localizedStrings.js:
2554
2555 2019-10-31  Yury Semikhatsky  <yurys@chromium.org>
2556
2557         Web Inspector: CONSOLE ERROR Shown panel style-rules must be visible
2558         https://bugs.webkit.org/show_bug.cgi?id=203377
2559
2560         Reviewed by Devin Rousso.
2561
2562         Fix assertion failure when opening elements panel with hidden details sidebar.
2563
2564         * UserInterface/Views/ContentBrowserTabContentView.js:
2565         (WI.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels):
2566         * UserInterface/Views/Sidebar.js:
2567         (WI.Sidebar.prototype.set selectedSidebarPanel): Only call shown() if the Sidebar
2568         is not collapsed. It will anyway be called when the Sidebar is expanded.
2569
2570 2019-10-30  Yury Semikhatsky  <yurys@chromium.org>
2571
2572         Web Inspector: track WI.Script unique display name numbers per Page target
2573         https://bugs.webkit.org/show_bug.cgi?id=203427
2574
2575         Reviewed by Devin Rousso.
2576
2577         WI.Script now keeps track of last unique numbers via a static weak map keyed by
2578         the Script's root target. So whenever new Page target is created all its scripts
2579         will get unique display numbers from a new namespace.
2580
2581         Parent target is now passed to each target constructor and allow to find host
2582         page target for nested targets. Among other things WorkerConnection and
2583         TargetConnection use parentTarget for dispatching events instead of creating
2584         extra copy of the same data that is already stored in Target.
2585
2586         * UserInterface/Controllers/DebuggerManager.js:
2587         (WI.DebuggerManager.prototype.globalObjectCleared):
2588         * UserInterface/Controllers/TargetManager.js:
2589         (WI.TargetManager.prototype.targetCreated):
2590         (WI.TargetManager.prototype.didCommitProvisionalTarget):
2591         (WI.TargetManager.prototype.targetDestroyed):
2592         (WI.TargetManager.prototype.dispatchMessageFromTarget):
2593         (WI.TargetManager.prototype._connectToTarget):
2594         (WI.TargetManager.prototype._createTarget):
2595         * UserInterface/Controllers/WorkerManager.js:
2596         (WI.WorkerManager.prototype.workerCreated):
2597         * UserInterface/Models/Script.js:
2598         (WI.Script):
2599         (WI.Script.prototype.get displayName):
2600         (WI.Script.prototype._nextUniqueDisplayNameNumber):
2601         (WI.Script.prototype._nextUniqueConsoleDisplayNameNumber):
2602         (WI.Script.prototype._uniqueDisplayNameNumbersForRootTarget):
2603         * UserInterface/Protocol/Connection.js:
2604         (InspectorBackend.WorkerConnection.prototype.sendMessageToBackend):
2605         (InspectorBackend.WorkerConnection):
2606         (InspectorBackend.TargetConnection.prototype.sendMessageToBackend):
2607         (InspectorBackend.TargetConnection):
2608         * UserInterface/Protocol/DirectBackendTarget.js:
2609         (WI.DirectBackendTarget):
2610         * UserInterface/Protocol/MultiplexingBackendTarget.js:
2611         (WI.MultiplexingBackendTarget):
2612         * UserInterface/Protocol/PageTarget.js:
2613         (WI.PageTarget):
2614         * UserInterface/Protocol/Target.js:
2615         (WI.Target):
2616         (WI.Target.prototype.get parentTarget):
2617         (WI.Target.prototype.get rootTarget):
2618         * UserInterface/Protocol/WorkerTarget.js:
2619         (WI.WorkerTarget):
2620
2621 2019-10-30  Eike Rathke  <erack@redhat.com>
2622
2623         Covscan: remove stray semicolon
2624         https://bugs.webkit.org/show_bug.cgi?id=203622
2625
2626         Reviewed by Devin Rousso.
2627
2628         * UserInterface/Views/CheckboxNavigationItem.js:
2629         (WI.CheckboxNavigationItem.prototype.set label):
2630
2631 2019-10-29  Nikita Vasilyev  <nvasilyev@apple.com>
2632
2633         Web Inspector: Opacity slider background doesn't update when when hue slider moves
2634         https://bugs.webkit.org/show_bug.cgi?id=203593
2635         <rdar://problem/56723629>
2636
2637         Reviewed by Matt Baker.
2638
2639         * UserInterface/Views/ColorPicker.js:
2640         (WI.ColorPicker.prototype.set color):
2641         (WI.ColorPicker.prototype.colorSquareColorDidChange):
2642         Remove unused function arguments.
2643
2644         (WI.ColorPicker.prototype.sliderValueDidChange):
2645         Update the background of the opacity slider when the hue slider changes.
2646
2647         (WI.ColorPicker.prototype._updateOpacitySlider): Renamed from _updateSliders.
2648         Drive-by: replace `var` with `let`.
2649
2650 2019-10-28  Nikita Vasilyev  <nvasilyev@apple.com>
2651
2652         Web Inspector: Right-clicking in color picker should not select color
2653         https://bugs.webkit.org/show_bug.cgi?id=203434
2654
2655         Reviewed by Devin Rousso.
2656
2657         * UserInterface/Views/ColorSquare.js:
2658         (WI.ColorSquare.prototype._handleMousedown):
2659
2660 2019-10-28  Antoine Quint  <graouts@apple.com>
2661
2662         CSS Transitions and CSS Animations properties should treat unitless 0 as an invalid value for times
2663         https://bugs.webkit.org/show_bug.cgi?id=203484
2664
2665         Reviewed by Antti Koivisto.
2666
2667         Use 0s instead of 0 in places where unitless times were used but shouldn't have been.
2668
2669         * UserInterface/Views/FindBanner.css:
2670         (.no-find-banner-transition:matches(.find-banner, .supports-find-banner)):
2671         * UserInterface/Views/TabBar.css:
2672         (.tab-bar > .item > .close):
2673
2674 2019-10-25  Devin Rousso  <drousso@apple.com>
2675
2676         Web Inspector: Styles: un-experimentalize showing rule icons
2677         https://bugs.webkit.org/show_bug.cgi?id=203308
2678
2679         Reviewed by Joseph Pecoraro.
2680
2681         * Localizations/en.lproj/localizedStrings.js:
2682         * UserInterface/Base/Setting.js:
2683         * UserInterface/Views/SettingsTabContentView.js:
2684         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2685         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2686         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
2687         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
2688
2689 2019-10-24  Yury Semikhatsky  <yurys@chromium.org>
2690
2691         Web Inspector: assertion failure at GeneralStyleDetailsSidebarPanel.js:34:23
2692         https://bugs.webkit.org/show_bug.cgi?id=203376
2693
2694         Reviewed by Devin Rousso.
2695
2696         Use class's prototype instead of class itself when doing instanceof check.
2697
2698         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
2699         (WI.GeneralStyleDetailsSidebarPanel):
2700
2701 2019-10-24  Yury Semikhatsky  <yurys@chromium.org>
2702
2703         Web Inspector: CONSOLE ERROR removeEventListener cannot remove blackboxed-urls-changed because it doesn't exist.
2704         https://bugs.webkit.org/show_bug.cgi?id=203372
2705
2706         Reviewed by Devin Rousso.
2707
2708         Avoid console errors when opening source panel.
2709
2710         * UserInterface/Views/SourceCodeTreeElement.js:
2711         (WI.SourceCodeTreeElement.prototype._updateSourceCode): Only remove listener if it has
2712         been added before.
2713
2714 2019-10-23  Devin Rousso  <drousso@apple.com>
2715
2716         Web Inspector: provide a way to inject "bootstrap" JavaScript into the page as the first script executed
2717         https://bugs.webkit.org/show_bug.cgi?id=195847
2718         <rdar://problem/48950551>
2719
2720         Reviewed by Joseph Pecoraro.
2721
2722         When debugging webpages, it's often useful to be able to swizzle various functions in order
2723         to add extra logs for when they're called (e.g. `Event.prototype.preventDefault`). Sometimes
2724         this can be difficult, such as if the page saves a copy of the function and references that
2725         instead, in which case it would be helpful to have a way to guarantee that the swizzled code
2726         is the first thing evaluated after the context is created.
2727
2728         This change adds support for that concept, which has been named Inspector Bootstrap Script.
2729         Once created, it will be injected as the first user script to every new global object that
2730         is created afterwards. Modifications to the Inspector Bootstrap Script take effect for all
2731         new global objects created _after_ the modification happened.
2732
2733         * UserInterface/Controllers/NetworkManager.js:
2734         (WI.NetworkManager):
2735         (WI.NetworkManager.supportsBootstrapScript): Added.
2736         (WI.NetworkManager.get bootstrapScriptURL): Added.
2737         (WI.NetworkManager.get bootstrapScriptSourceObjectStoreKey): Added.
2738         (WI.NetworkManager.prototype.initializeTarget):
2739         (WI.NetworkManager.prototype.get bootstrapScript): Added.
2740         (WI.NetworkManager.prototype.get bootstrapScriptEnabled): Added.
2741         (WI.NetworkManager.prototype.set bootstrapScriptEnabled): Added.
2742         (WI.NetworkManager.prototype.async createBootstrapScript): Added.
2743         (WI.NetworkManager.prototype.destroyBootstrapScript): Added.
2744         (WI.NetworkManager.prototype._processServiceWorkerConfiguration):
2745         (WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange): Added.
2746
2747         * UserInterface/Models/LocalScript.js:
2748         (WI.LocalScript):
2749         (WI.LocalScript.prototype.get editable): Added.
2750         (WI.LocalScript.prototype.get supportsScriptBlackboxing): Added.
2751         (WI.LocalScript.prototype.requestContentFromBackend):
2752         (WI.LocalScript.prototype.handleCurrentRevisionContentChange): Added.
2753         * UserInterface/Views/ScriptContentView.js:
2754         (WI.ScriptContentView):
2755         (WI.ScriptContentView.prototype._contentWillPopulate):
2756         (WI.ScriptContentView.prototype._contentDidPopulate):
2757         (WI.ScriptContentView.prototype._handleTextEditorContentDidChange): Added.
2758         Support editing of `WI.LocalScript` that are specifically marked as such.
2759
2760         * UserInterface/Models/Script.js:
2761         (WI.Script):
2762         (WI.Script.prototype.get displayName):
2763         (WI.Script.prototype.get displayURL):
2764         (WI.Script.prototype.isMainResource):
2765         (WI.Script.prototype._resolveResource):
2766         * UserInterface/Views/SourceCodeTextEditor.js:
2767         (WI.SourceCodeTextEditor.prototype.customPerformSearch):
2768         (WI.SourceCodeTextEditor.prototype._createTypeTokenAnnotator):
2769         (WI.SourceCodeTextEditor.prototype._createBasicBlockAnnotator):
2770         Allow a `WI.Script` to not have an associated `WI.Target`, specifically for `WI.LocalScript`.
2771
2772         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
2773         (WI.SourcesNavigationSidebarPanel):
2774         (WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject):
2775         (WI.SourcesNavigationSidebarPanel.prototype.createContentTreeOutline):
2776         (WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
2777         (WI.SourcesNavigationSidebarPanel.prototype._addLocalOverride): Added.
2778         (WI.SourcesNavigationSidebarPanel.prototype._removeResourceOverride): Added.
2779         (WI.SourcesNavigationSidebarPanel.prototype._populateCreateResourceContextMenu):
2780         (WI.SourcesNavigationSidebarPanel.prototype._handleBootstrapScriptCreated): Added.
2781         (WI.SourcesNavigationSidebarPanel.prototype._handleBootstrapScriptDestroyed): Added.
2782         (WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideAdded):
2783         (WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideRemoved):
2784         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
2785         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
2786         (WI.SourcesNavigationSidebarPanel.prototype._addLocalResourceOverride): Removed.
2787         (WI.SourcesNavigationSidebarPanel.prototype._removeLocalResourceOverride): Removed.
2788         Add an item in the create resource context menu for creating/focusing the bootstrap script.
2789
2790         * UserInterface/Views/ScriptTreeElement.js:
2791         (WI.ScriptTreeElement):
2792         * UserInterface/Views/BootstrapScriptTreeElement.js: Added.
2793         (WI.BootstrapScriptTreeElement):
2794         (WI.BootstrapScriptTreeElement.prototype.onattach):
2795         (WI.BootstrapScriptTreeElement.prototype.ondetach):
2796         (WI.BootstrapScriptTreeElement.prototype.ondelete):
2797         (WI.BootstrapScriptTreeElement.prototype.onspace):
2798         (WI.BootstrapScriptTreeElement.prototype.canSelectOnMouseDown):
2799         (WI.BootstrapScriptTreeElement.prototype.populateContextMenu):
2800         (WI.BootstrapScriptTreeElement.prototype.updateStatus):
2801         (WI.BootstrapScriptTreeElement.prototype._handleNetworkManagerBootstrapScriptToggled):
2802         * UserInterface/Views/BootstrapScriptTreeElement.css: Added.
2803         (.item.script.bootstrap .status > input[type="checkbox"]):
2804         * UserInterface/Views/LocalResourceOverrideTreeElement.css:
2805         (.item.resource.override .status > input[type="checkbox"]): Added.
2806         (.item.resource.override .status > div): Removed.
2807         Don't show the full bootstrap script URL. Instead, show "Inspector Bootstrap Script".
2808
2809         * UserInterface/Views/OpenResourceDialog.js:
2810         (WI.OpenResourceDialog.prototype.didPresentDialog):
2811         Show the bootstrap script in the open resource dialog.
2812
2813         * UserInterface/Base/Utilities.js:
2814         (isWebInspectorBootstrapScript): Added.
2815
2816         * UserInterface/Controllers/DebuggerManager.js:
2817         (WI.DebuggerManager.prototype.scriptDidFail):
2818
2819         * UserInterface/Base/ObjectStore.js:
2820         (WI.ObjectStore.static _open):
2821         (WI.ObjectStore.prototype.async get): Added.
2822         Add a generalized object store that can be used for one-off values that need the larger
2823         storage capacity of `IndexedDB`.
2824
2825         * .eslintrc:
2826         * Localizations/en.lproj/localizedStrings.js:
2827
2828 2019-10-23  Yury Semikhatsky  <yurys@chromium.org>
2829
2830         Web Inspector: notify inspector when provisional page is created, committed and destroyed
2831         https://bugs.webkit.org/show_bug.cgi?id=202704
2832
2833         Reviewed by Devin Rousso.
2834
2835         Updated frontend code to understand provisional targets. For now there are
2836         no changes frontend behavior, it will wait for the provisional target to commit
2837         and will not send any commands to it before that.
2838
2839         * UserInterface/Base/Main.js: Moved a bunch of methods shared between Main.js and Test.js
2840         to TargetManager.js to keep them in sync.
2841         * UserInterface/Controllers/TargetManager.js:
2842         (WI.TargetManager):
2843         (WI.TargetManager.prototype.removeTarget):
2844         (WI.TargetManager.prototype.createMultiplexingBackendTarget):
2845         (WI.TargetManager.prototype.createDirectBackendTarget):
2846         (WI.TargetManager.prototype.targetCreated):
2847         (WI.TargetManager.prototype.didCommitProvisionalTarget):
2848         (WI.TargetManager.prototype.targetDestroyed):
2849         (WI.TargetManager.prototype.dispatchMessageFromTarget):
2850         (WI.TargetManager.prototype._checkAndHandlePageTargetTransition):
2851         (WI.TargetManager.prototype._checkAndHandlePageTargetTermination):
2852         (WI.TargetManager.prototype._initializeBackendTarget):
2853         (WI.TargetManager.prototype._initializePageTarget):
2854         (WI.TargetManager.prototype._transitionPageTarget):
2855         (WI.TargetManager.prototype._terminatePageTarget):
2856         (WI.TargetManager.prototype._resetMainExecutionContext):
2857         (WI.TargetManager.prototype._redirectGlobalAgentsToConnection):
2858         * UserInterface/Protocol/Connection.js:
2859         (InspectorBackend.WorkerConnection.sendMessageToBackend):
2860         (InspectorBackend.WorkerConnection):
2861         (InspectorBackend.TargetConnection.sendMessageToBackend):
2862         (InspectorBackend.TargetConnection):
2863         * UserInterface/Protocol/Target.js:
2864         (WI.Target.prototype.destroy): Mark target as destroyed to distinguish expected command errors from
2865         genuine failures.
2866
2867         (WI.Target.prototype.isDestroyed):
2868         * UserInterface/Protocol/TargetObserver.js: Since the front-end doesn't
2869         send commands to the provisional targets yet, it has to ignore all activities
2870         related to provisional pages. For that reason we need two sets to keep track of
2871         - provisional pages that were destroyed and never committed
2872         - old pages which were replaced by committed page and for which following targetDestroyed
2873         event should be ignored
2874         Better support for provisional targets will be added to frontend in a separate change.
2875         (WI.TargetObserver):
2876         (WI.TargetObserver.prototype.targetCreated):
2877         (WI.TargetObserver.prototype.didCommitProvisionalTarget): For now convert the event into a subsequence
2878         of targetDestroyed/targetCreated events which matches previous behavior.
2879
2880         (WI.TargetObserver.prototype.targetDestroyed):
2881         (WI.TargetObserver.prototype.dispatchMessageFromTarget):
2882         * UserInterface/Test/Test.js:
2883         (WI.transitionPageTarget):
2884         (WI.terminatePageTarget):
2885
2886 2019-10-23  Nikita Vasilyev  <nvasilyev@apple.com>
2887
2888         Web Inspector: Replace color wheel with square HSB color picker
2889         https://bugs.webkit.org/show_bug.cgi?id=203169
2890         <rdar://problem/56449832>
2891
2892         Reviewed by Devin Rousso.
2893
2894         Replace the color wheel with a square HSB color picker.
2895
2896         The square HSB color picker provides more precision for choosing saturation,
2897         and it's more familiar to most web developers.
2898
2899         * UserInterface/Main.html:
2900         * UserInterface/Views/ColorPicker.css:
2901         (.color-picker):
2902         (.color-picker > .hue):
2903         (body[dir=ltr] .color-picker > .hue):
2904         (body[dir=rtl] .color-picker > .hue):
2905         * UserInterface/Views/ColorPicker.js:
2906         (WI.ColorPicker):
2907         (WI.ColorPicker.prototype.get colorSquare):
2908         (WI.ColorPicker.prototype.set color):
2909         (WI.ColorPicker.prototype.colorSquareColorDidChange):
2910         (WI.ColorPicker.prototype.sliderValueDidChange):
2911         (WI.ColorPicker.prototype._updateColor):
2912         (WI.ColorPicker.prototype._updateSliders):
2913         Add a hue slider. The new color picker has the hue slider instead of the brightness slider.
2914
2915         * UserInterface/Views/ColorSquare.css: Renamed from Source/WebInspectorUI/UserInterface/Views/ColorWheel.css.
2916         (.color-square):
2917         (.color-square > .saturation-gradient):
2918         (.color-square > .lightness-gradient):
2919         (.color-square > .fill):
2920         (.color-square > .crosshair):
2921         * UserInterface/Views/ColorSquare.js: Added.
2922         (WI.ColorSquare):
2923         (WI.ColorSquare.prototype.get element):
2924         (WI.ColorSquare.prototype.set dimension):
2925         (WI.ColorSquare.prototype.get hue):
2926         (WI.ColorSquare.prototype.set hue):
2927         (WI.ColorSquare.prototype.get tintedColor):
2928         (WI.ColorSquare.prototype.set tintedColor):
2929         (WI.ColorSquare.prototype.get rawColor):
2930         (WI.ColorSquare.prototype.handleEvent):
2931         (WI.ColorSquare.prototype.get _saturation):
2932         (WI.ColorSquare.prototype.get _brightness):
2933         (WI.ColorSquare.prototype.get _lightness):
2934         (WI.ColorSquare.prototype._handleMousedown):
2935         (WI.ColorSquare.prototype._handleMousemove):
2936         (WI.ColorSquare.prototype._handleMouseup):
2937         (WI.ColorSquare.prototype._updateColorForMouseEvent):
2938         (WI.ColorSquare.prototype._setCrosshairPosition):
2939         (WI.ColorSquare.prototype._updateBaseColor):
2940         * UserInterface/Views/ColorWheel.js: Removed.
2941         * UserInterface/Views/GradientEditor.js:
2942         (WI.GradientEditor):
2943
2944 2019-10-23  Yury Semikhatsky  <yurys@chromium.org>
2945
2946         Web Inspector: frontend tests should clear output before resending results
2947         https://bugs.webkit.org/show_bug.cgi?id=203262
2948
2949         Reviewed by Devin Rousso.
2950
2951         Inspector front-end tests will clear output log before resending teset results. This avoids
2952         race between InspectorTest.testPageDidLoad event and TestPage.addResult calls that may have
2953         already be sent to the new page after navigation. The latter events otherwise would be added
2954         twice.
2955
2956         * UserInterface/Test/FrontendTestHarness.js:
2957         (FrontendTestHarness):
2958         (FrontendTestHarness.prototype.testPageDidLoad):
2959         (FrontendTestHarness.prototype.reloadPage):
2960         (FrontendTestHarness.prototype.reportUnhandledRejection):
2961         (FrontendTestHarness.prototype.reportUncaughtException):
2962         (FrontendTestHarness.prototype._resendResults): Don't resend the results when the page is loaded
2963         first time.
2964
2965 2019-10-22  Devin Rousso  <drousso@apple.com>
2966
2967         Web Inspector: Sources: keep the function/object name sticky in the object preview popover
2968         https://bugs.webkit.org/show_bug.cgi?id=203259
2969
2970         Reviewed by Matt Baker.
2971
2972         * UserInterface/Views/SourceCodeTextEditor.css:
2973         (.popover .debugger-popover-content):
2974         (.popover .debugger-popover-content.expandable): Added.
2975         (.popover .debugger-popover-content > .title):
2976         (.popover .debugger-popover-content > .body):
2977         (.popover .debugger-popover-content.formatted): Added.
2978         (.popover .expandable): Deleted.
2979         Use flexbox to ensure that only the function/object body is scrollable.
2980         Adjust the min/max width/height to take less space for smaller objects.
2981
2982         * UserInterface/Views/SourceCodeTextEditor.js:
2983         (WI.SourceCodeTextEditor.prototype._showPopoverWithFormattedValue):
2984         Wrap formatted values in a `<div>` so we can apply special styling to them.
2985
2986 2019-10-22  Devin Rousso  <drousso@apple.com>
2987
2988         Web Inspector: Sources: content of function definition popover sometimes cut off
2989         https://bugs.webkit.org/show_bug.cgi?id=203258
2990
2991         Reviewed by Matt Baker.
2992
2993         * UserInterface/Views/SourceCodeTextEditor.js:
2994         (WI.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
2995
2996 2019-10-22  Devin Rousso  <drousso@apple.com>
2997
2998         Web Inspector: REGRESSION: Sources: when editing style sheets, the content is sometimes suddenly replaced with the original content of the resource
2999         https://bugs.webkit.org/show_bug.cgi?id=203235
3000
3001         Reviewed by Timothy Hatcher.
3002
3003         Each `WI.CSSStyleSheet` manages it's own state about when it should ignore events from the
3004         backend telling it that it was modified, such as if the frontend caused the update. In these
3005         cases, the `WI.CSSStyleSheet` itself was early-returning, but the `WI.CSSManager` wasn't,
3006         meaning that the `WI.CSSManager` would then override the content even though the specific
3007         `WI.CSSStyleSheet` knows that its content shouldn't update. To compound this issue, the
3008         `WI.CSSManager` updates any `WI.CSSStyleSheet` using a `Throttler`, so any updates would be
3009         further delayed (first by the protocol travel time) by this, leading to the timing based
3010         intermittent issue. `WI.CSSStyleSheet` already exposes when it should be updated or not via
3011         `WI.CSSStyleSheet.prototype.noteContentDidChange`. Rather than have `WI.CSSManager` just
3012         call that function, it should examine the returned boolean to see if it should continue to
3013         process the update, or if the `WI.CSSStyleSheet` knows that it should be ignored.
3014
3015         * UserInterface/Controllers/CSSManager.js:
3016         (WI.CSSManager.prototype.styleSheetChanged):
3017
3018 2019-10-21  Devin Rousso  <drousso@apple.com>
3019
3020         Web Inspector: REGRESSION(r251227): Uncaught Exception: undefined is not an object (evaluating 'agent.enable')
3021         https://bugs.webkit.org/show_bug.cgi?id=203208
3022
3023         Reviewed by Joseph Pecoraro.
3024
3025         * UserInterface/Controllers/AppController.js:
3026         (WI.AppController.prototype.activateExtraDomains):
3027
3028 2019-10-21  Joseph Pecoraro  <pecoraro@apple.com>
3029
3030         Web Inspector: Provide a flag for technology preview builds
3031         https://bugs.webkit.org/show_bug.cgi?id=203164
3032         <rdar://problem/56202164>
3033
3034         Reviewed by Devin Rousso.
3035
3036         * Localizations/en.lproj/localizedStrings.js:
3037
3038         * UserInterface/Test/Test.js:
3039         * UserInterface/Base/Main.js:
3040         * UserInterface/Base/Setting.js:
3041         (WI.isTechnologyPreviewBuild):
3042         (WI.arePreviewFeaturesEnabled):
3043         * UserInterface/Views/SettingsTabContentView.js:
3044         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
3045         In non-TechnologyPreview builds, if there are Preview Features provide a
3046         setting switch that can be used to match the TechnologyPreview features.
3047
3048 2019-10-21  Devin Rousso  <drousso@apple.com>
3049
3050         Web Inspector: replace all uses of `window.*Agent` with a target-specific call
3051         https://bugs.webkit.org/show_bug.cgi?id=201149
3052
3053         Reviewed by Matt Baker.
3054
3055         Most of these were changed in r251227, but a few appear to have slipped through the cracks.
3056
3057         * UserInterface/Controllers/DebuggerManager.js:
3058         (WI.DebuggerManager.prototype.debuggerDidResume):
3059         * UserInterface/Views/SourceCodeTextEditor.js:
3060         (WI.SourceCodeTextEditor.prototype._createTypeTokenAnnotator):
3061         (WI.SourceCodeTextEditor.prototype._createBasicBlockAnnotator):
3062
3063 2019-10-18  Devin Rousso  <drousso@apple.com>
3064
3065         Web Inspector: Elements: allow WebKit engineers to edit UserAgent shadow trees
3066         https://bugs.webkit.org/show_bug.cgi?id=203159
3067
3068         Reviewed by Brian Burg.
3069
3070         * UserInterface/Controllers/DOMManager.js:
3071         (WI.DOMManager.prototype.initializeTarget):
3072         (WI.DOMManager.supportsEditingUserAgentShadowTrees): Added.
3073         * UserInterface/Models/CSSStyleDeclaration.js:
3074         (WI.CSSStyleDeclaration.prototype.get editable):
3075         * UserInterface/Views/ContextMenuUtilities.js:
3076         (WI.appendContextMenuItemsForDOMNode):
3077         * UserInterface/Views/DOMTreeElement.js:
3078         (WI.DOMTreeElement.prototype.get editable):
3079         (WI.DOMTreeElement.prototype._startEditingTarget):
3080         (WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
3081
3082         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
3083         (WI.GeneralStyleDetailsSidebarPanel):
3084         (WI.GeneralStyleDetailsSidebarPanel.prototype._showPanel):
3085         (WI.GeneralStyleDetailsSidebarPanel.prototype._handleNodeChanged): Added.
3086         * UserInterface/Views/StyleDetailsPanel.js:
3087         (WI.StyleDetailsPanel.prototype.get supportsNewRule): Added.
3088         (WI.StyleDetailsPanel.prototype.markAsNeedsRefresh):
3089         (WI.StyleDetailsPanel.prototype.refresh):
3090         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
3091         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.get supportsNewRule): Added.
3092         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.newRuleButtonClicked):
3093         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.newRuleButtonContextMenu):
3094         Don't show the "Add Rule" button if the selected node is inside a UserAgent shadow tree.
3095
3096         * UserInterface/Base/Setting.js:
3097         * UserInterface/Views/SettingsTabContentView.js:
3098         (WI.SettingsTabContentView.prototype._createEngineeringSettingsView):
3099
3100 2019-10-18  Devin Rousso  <drousso@apple.com>
3101
3102         Web Inspector: Elements: $0 is shown for the wrong node when selecting elements in a user agent shadow tree
3103         https://bugs.webkit.org/show_bug.cgi?id=203155
3104
3105         Reviewed by Matt Baker.
3106
3107         Rather than naively using the last selected node (from `WI.TreeOutline`), we should wait
3108         to see if the inspected page's DOM agent allows the selected node to be used as the
3109         inspected node, and if so then to show the `$0`.
3110
3111         * UserInterface/Controllers/DOMManager.js:
3112         (WI.DOMManager.prototype.setInspectedNode):
3113
3114         * UserInterface/Views/DOMTreeContentView.js:
3115         (WI.DOMTreeContentView):
3116         * UserInterface/Views/DOMTreeOutline.js:
3117         (WI.DOMTreeOutline.prototype._handleInspectedNodeChanged): Added.
3118         * UserInterface/Views/DOMTreeOutline.css:
3119         (.tree-outline.dom li.inspected-node > span::after): Added.
3120         (.tree-outline.dom:focus li.inspected-node.selected > span::after): Added.
3121         (.tree-outline.dom.show-last-selected li.last-selected > span::after): Deleted.
3122         (.tree-outline.dom.show-last-selected:focus li.last-selected > span::after): Deleted.
3123
3124         * UserInterface/Views/TreeOutline.js:
3125         (WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
3126
3127 2019-10-18  Devin Rousso  <drousso@apple.com>
3128
3129         Web Inspector: REGRESSION(r251254): Elements: forced pseudo-class indicator isn't visible for selected nodes
3130         https://bugs.webkit.org/show_bug.cgi?id=203158
3131
3132         Reviewed by Matt Baker.
3133
3134         * UserInterface/Views/DOMTreeOutline.css:
3135         (.tree-outline.dom li > :not(.selection-area)): Added.
3136         (.tree-outline.dom li > span): Deleted.
3137
3138 2019-10-17  Devin Rousso  <drousso@apple.com>
3139
3140         Web Inspector: Elements: selection shouldn't be dimmed by shadow trees
3141         https://bugs.webkit.org/show_bug.cgi?id=203057
3142
3143         Reviewed by Joseph Pecoraro.
3144
3145         * UserInterface/Views/DOMTreeOutline.css:
3146         (.tree-outline.dom li .selection-area):
3147         (.tree-outline.dom li > span): Added.
3148         Don't force the `.selection-area` to be behind (`z-index: -1;`) the rest of the content, as
3149         that also puts it behind any `background-color`. Instead, we should make all the content in
3150         every `WI.DOMTreeElement` be above (`z-index: 1;`) the rest of the content, including the
3151         `.selection-area` and any parent's `background-color`.
3152
3153 2019-10-17  Devin Rousso  <drousso@apple.com>
3154
3155         Web Inspector: Network: updates when toggling resource caching should be sent to every connected target
3156         https://bugs.webkit.org/show_bug.cgi?id=203025
3157
3158         Reviewed by Joseph Pecoraro.
3159
3160         * UserInterface/Base/Main.js:
3161         (WI._resourceCachingDisabledSettingChanged):
3162
3163 2019-10-17  Devin Rousso  <drousso@apple.com>
3164
3165         Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
3166         https://bugs.webkit.org/show_bug.cgi?id=200384
3167         <rdar://problem/53850352>
3168
3169         Reviewed by Joseph Pecoraro.
3170
3171         `InspectorBackend.domains.${domain}` isn't a truly valid way to feature check, as it
3172         indicates what's supported by the WebKit framework underlying whatever's currently being
3173         inspected, not what the current inspection target supports.
3174
3175         As an example, inspecting an iOS `JSContext` will still show `InspectorBackend.domains.DOM`
3176         as the `DOMAgent` is supported by WebKit, even though `JSContext`s have no concept of the
3177         DOM. In this example, however, `window.DOMAgent` would NOT exist, as the `availability`
3178         check for the `DOM` domain wouldn't pass, meaning that the agent never gets connected.
3179
3180         In order to do proper feature checking, `InspectorBackend.domains` needs to be accurate
3181         depending on the debuggable type. Furthermore, each target underneath that debuggable needs
3182         to be able to "choose" what commands/events are supported based on that target's type.
3183
3184         This patch modifies how InspectorBackendCommands.js ties into `InspectorBackend`. Rather
3185         than directly creating an `InspectorBackend.Agent` for each domain, we now create more of a
3186         "blueprint" of the domain, and wait to actually create an `InspectorBackend.Agent` until we
3187         have a `WI.Target` (and therefore an `InspectorBackend.Connection`). Each "concept" of the
3188         protocol now directly maps to an object.
3189          - InspectorBackend.Domain
3190          - InspectorBackend.Command
3191          - InspectorBackend.Event
3192          - InspectorBackend.Dispatcher
3193         When a `WI.Target` is created, it gets the list of `InspectorBackend.Domain` that support
3194         that `WI.Target`'s type (specified in the protocol JSON files) and generates an
3195         `InspectorBackend.Agent` for each, which in turn generates an `InspectorBackend.Callable`
3196         for each supported `InspectorBackend.Command` and instantiates `InspectorBackend.Dispatcher`.
3197
3198         Activating a `InspectorBackend.Domain` means it's visible for `InspectorBackend` feature
3199         checking. This must be done this way for older ITML backends that will still appear as
3200         "JSContext" targets and therefore go through the "extra domains" path. Ideally, the process
3201         of registering a domain should be enough to activate it. <https://webkit.org/b/201150>
3202
3203         Feature checking can now only be done via `hasDomain`, `hasCommand`, and `hasEvent` on
3204         `InspectorBackend` or a specific `WI.Target`, and there are different implications for each:
3205          - `InspectorBackend.hasDomain(DOM)` asks whether the `DOM` domain is supported by the
3206            current debuggable, but says nothing about whether any `WI.Target` support `DOM`.
3207          - `target.hasDomain("DOM")` asks whether the given `target` supports `DOM`, which is
3208            limited by `InspectorBackend.hasDomain("DOM")`.
3209
3210         Now that `InspectorBackend.Agent` is only created by a `WI.Target`, it's no longer valid to
3211         write `window.DOMAgent`, as there is no "global" agent. All protocol logic _must_ go through
3212         a `WI.Target`. <https://webkit.org/b/201149>
3213
3214         Debuggable Types:
3215          - JavaScript (JSC::JSGlobalObject)
3216          - Page (WebCore::Page)
3217          - ServiceWorker (WebCore::ServiceWorkerThreadProxy)
3218          - WebPage (WebKit::WebPageProxy)
3219
3220         Target Types:
3221          - JavaScript (direct connection)
3222          - Page (multi-target connection to any Worker)
3223          - ServiceWorker (direct connection)
3224          - WebPage (multi-target connection to 1+ Page)
3225          - Worker (direct connection, only available for Page debuggables)
3226
3227         * UserInterface/Base/DebuggableType.js:
3228         * UserInterface/Base/TargetType.js: Copied from Source/WebInspectorUI/UserInterface/Base/DebuggableType.js.
3229         * UserInterface/Protocol/Connection.js:
3230         * UserInterface/Protocol/InspectorBackend.js:
3231
3232         * UserInterface/Protocol/ApplicationCacheObserver.js:
3233         * UserInterface/Protocol/CPUProfilerObserver.js:
3234         * UserInterface/Protocol/CSSObserver.js:
3235         * UserInterface/Protocol/CanvasObserver.js:
3236         * UserInterface/Protocol/ConsoleObserver.js:
3237         * UserInterface/Protocol/DOMObserver.js:
3238         * UserInterface/Protocol/DOMStorageObserver.js:
3239         * UserInterface/Protocol/DatabaseObserver.js:
3240         * UserInterface/Protocol/DebuggerObserver.js:
3241         * UserInterface/Protocol/HeapObserver.js:
3242         * UserInterface/Protocol/InspectorObserver.js:
3243         * UserInterface/Protocol/LayerTreeObserver.js:
3244         * UserInterface/Protocol/MemoryObserver.js:
3245         * UserInterface/Protocol/NetworkObserver.js:
3246         * UserInterface/Protocol/PageObserver.js:
3247         * UserInterface/Protocol/RuntimeObserver.js:
3248         * UserInterface/Protocol/ScriptProfilerObserver.js:
3249         * UserInterface/Protocol/TargetObserver.js:
3250         * UserInterface/Protocol/TimelineObserver.js:
3251         * UserInterface/Protocol/WorkerObserver.js:
3252         All observers now extend from `InspectorBackend.Dispatcher` and have a separate instance for
3253         each `InspectorBackend.Agent`, each having their own `_target`.
3254
3255         * UserInterface/Protocol/Target.js:
3256         * UserInterface/Protocol/DirectBackendTarget.js:
3257         * UserInterface/Protocol/JavaScriptContextTarget.js: Removed.
3258         * UserInterface/Protocol/MultiplexingBackendTarget.js:
3259         * UserInterface/Protocol/PageTarget.js:
3260         * UserInterface/Protocol/WorkerTarget.js:
3261         Agents are now created per-target instead of copied from the "global" list. This means that
3262         agents can have a different set of commands/events depending on the associated target.
3263
3264         * UserInterface/Base/Main.js:
3265         * UserInterface/Base/Utilities.js:
3266         * UserInterface/Controllers/AppController.js:
3267         * UserInterface/Controllers/AppControllerBase.js:
3268         * UserInterface/Controllers/ApplicationCacheManager.js:
3269         * UserInterface/Controllers/AuditManager.js:
3270         * UserInterface/Controllers/BreakpointPopoverController.js:
3271         * UserInterface/Controllers/CSSManager.js:
3272         * UserInterface/Controllers/CanvasManager.js:
3273         * UserInterface/Controllers/ConsoleManager.js:
3274         * UserInterface/Controllers/DOMDebuggerManager.js:
3275         * UserInterface/Controllers/DOMManager.js:
3276         * UserInterface/Controllers/DOMStorageManager.js:
3277         * UserInterface/Controllers/DatabaseManager.js:
3278         * UserInterface/Controllers/DebuggerManager.js:
3279         * UserInterface/Controllers/HeapManager.js:
3280         * UserInterface/Controllers/IndexedDBManager.js:
3281         * UserInterface/Controllers/JavaScriptLogViewController.js:
3282         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
3283         * UserInterface/Controllers/LayerTreeManager.js:
3284         * UserInterface/Controllers/MemoryManager.js:
3285         * UserInterface/Controllers/NetworkManager.js:
3286         * UserInterface/Controllers/RuntimeManager.js:
3287         * UserInterface/Controllers/TargetManager.js:
3288         * UserInterface/Controllers/TimelineManager.js:
3289         * UserInterface/Controllers/WorkerManager.js:
3290         * UserInterface/Main.html:
3291         * UserInterface/Models/AuditTestBase.js:
3292         * UserInterface/Models/AuditTestCase.js:
3293         * UserInterface/Models/AuditTestCaseResult.js:
3294         * UserInterface/Models/CPUInstrument.js:
3295         * UserInterface/Models/CPUTimelineRecord.js:
3296         * UserInterface/Models/CSSCompletions.js:
3297         * UserInterface/Models/CSSStyleSheet.js:
3298         * UserInterface/Models/Canvas.js:
3299         * UserInterface/Models/DOMNode.js:
3300         * UserInterface/Models/DOMNodeStyles.js:
3301         * UserInterface/Models/DOMStorageObject.js:
3302         * UserInterface/Models/DOMTree.js:
3303         * UserInterface/Models/DatabaseObject.js:
3304         * UserInterface/Models/FPSInstrument.js:
3305         * UserInterface/Models/GarbageCollection.js:
3306         * UserInterface/Models/HeapAllocationsInstrument.js:
3307         * UserInterface/Models/Instrument.js:
3308         * UserInterface/Models/MediaInstrument.js:
3309         * UserInterface/Models/MemoryInstrument.js:
3310         * UserInterface/Models/MemoryPressureEvent.js:
3311         * UserInterface/Models/MemoryTimelineRecord.js:
3312         * UserInterface/Models/Recording.js:
3313         * UserInterface/Models/Resource.js:
3314         * UserInterface/Models/ScriptInstrument.js:
3315         * UserInterface/Models/ScriptSyntaxTree.js:
3316         * UserInterface/Models/ScriptTimelineRecord.js:
3317         * UserInterface/Models/ShaderProgram.js:
3318         * UserInterface/Models/SourceMapResource.js:
3319         * UserInterface/Models/TimelineRecording.js:
3320         * UserInterface/Protocol/RemoteObject.js:
3321         * UserInterface/Test.html:
3322         * UserInterface/Test/FrontendTestHarness.js:
3323         * UserInterface/Test/Test.js:
3324         * UserInterface/Test/TestAppController.js:
3325         * UserInterface/Views/AuditNavigationSidebarPanel.js:
3326         * UserInterface/Views/AuditTabContentView.js:
3327         * UserInterface/Views/CanvasTabContentView.js:
3328         * UserInterface/Views/ContextMenuUtilities.js:
3329         * UserInterface/Views/CookieStorageContentView.js:
3330         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
3331         * UserInterface/Views/DOMTreeContentView.js:
3332         * UserInterface/Views/ElementsTabContentView.js:
3333         * UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
3334         * UserInterface/Views/Layers3DContentView.js:
3335         * UserInterface/Views/LayersTabContentView.js:
3336         * UserInterface/Views/LayoutTimelineView.js:
3337         * UserInterface/Views/LogContentView.js:
3338         * UserInterface/Views/NetworkTabContentView.js:
3339         * UserInterface/Views/NetworkTableContentView.js:
3340         * UserInterface/Views/NetworkTimelineView.js:
3341         * UserInterface/Views/ObjectTreeView.js:
3342         * UserInterface/Views/QuickConsole.js:
3343         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
3344         * UserInterface/Views/ScriptClusterTimelineView.js:
3345         * UserInterface/Views/ScriptDetailsTimelineView.js:
3346         * UserInterface/Views/ScriptTreeElement.js:
3347         * UserInterface/Views/SearchSidebarPanel.js:
3348         * UserInterface/Views/SearchTabContentView.js:
3349         * UserInterface/Views/SettingsTabContentView.js:
3350         * UserInterface/Views/SourceCodeTextEditor.js:
3351         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
3352         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
3353         * UserInterface/Views/SpreadsheetStyleProperty.js:
3354         * UserInterface/Views/StorageTabContentView.js:
3355         * UserInterface/Views/TimelineRecordingContentView.js:
3356         * UserInterface/Views/TimelineTabContentView.js:
3357         * UserInterface/Views/Toolbar.js:
3358         * UserInterface/Views/WebSocketContentView.js:
3359         * UserInterface/Views/WorkerTreeElement.js:
3360         Replace all instances of `window.DomainAgent` with `target.DomainAgent`, where `target` is
3361         either derived from an associated model object or `WI.assumingMainTarget()`.
3362         Split the `WI.DebuggableType.Web` debuggable type into `WI.DebuggableType.Page` (WebCore::Page)
3363         and `WI.DebuggableType.WebPage` (WebKit::WebPageProxy).
3364
3365         * UserInterface/Protocol/Legacy/*:
3366         * Versions/*:
3367         Update protocol files for older versions of iOS.
3368
3369         * .eslintrc:
3370         * Localizations/en.lproj/localizedStrings.js:
3371
3372 2019-10-15  Devin Rousso  <drousso@apple.com>
3373
3374         Web Inspector: Debugger: prevent source mapped resources from being blackboxed
3375         https://bugs.webkit.org/show_bug.cgi?id=203007
3376
3377         Reviewed by Matt Baker.
3378
3379         Since source mapped resources are entirely a frontend concept, it doesn't make sense to
3380         allow them to be blackboxed.
3381
3382         * UserInterface/Models/SourceMapResource.js:
3383         (WI.SourceMapResource.prototype.get supportsScriptBlackboxing):
3384
3385 2019-10-15  Nikita Vasilyev  <nvasilyev@apple.com>
3386
3387         Web Inspector: Convert CSSRule selectorText setter to setSelectorText method because it's asynchronous
3388         https://bugs.webkit.org/show_bug.cgi?id=202840
3389
3390         Reviewed by Matt Baker.
3391
3392         * UserInterface/Models/CSSRule.js:
3393         (WI.CSSRule.prototype.setSelectorText):
3394         (WI.CSSRule.prototype._selectorRejected):
3395         (WI.CSSRule.prototype._selectorResolved):
3396         Remove WI.CSSRule.Event.SelectorChanged event and since it wasn't used anywhere else.
3397
3398         (WI.CSSRule):
3399         (WI.CSSRule.prototype.set selectorText): Deleted.
3400         (WI.CSSRule.prototype.setSelectorText): Added.
3401         (WI.CSSRule.prototype._selectorRejected): Deleted.
3402         (WI.CSSRule.Event.SelectorChanged): Deleted.
3403         Remove `{valid: ...}` object since it wasn't used.
3404
3405         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
3406         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit):
3407
3408 2019-10-15  Devin Rousso  <drousso@apple.com>
3409
3410         Web Inspector: Local Resource Overrides: automatically create an image/font local override when dragging content over a non-overridden resource
3411         https://bugs.webkit.org/show_bug.cgi?id=202957
3412
3413         Reviewed by Joseph Pecoraro.
3414
3415         Since non-text resources aren't editable, some users of local resource overrides kept trying
3416         to drag image/font files over the actual resource content view (not the local override),
3417         which didn't do anything. Rather than having to click "Create Local Override" and then do a
3418         drag/drop, we should support the "shorter" workflow of drag/drop over the actual resource.
3419
3420         * UserInterface/Base/FileUtilities.js:
3421         (WI.FileUtilities.import): Added.
3422         (WI.FileUtilities.importText):
3423         (WI.FileUtilities.importJSON):
3424         (WI.FileUtilities.importData): Added.
3425         (WI.FileUtilities.async readText):
3426         (WI.FileUtilities.async readJSON):
3427         (WI.FileUtilities.async readData): Added.
3428         (WI.FileUtilities.async _read): Added.
3429         Create utility functions for importing non-text content as data.
3430         Drive-by: fix a bug in the `import*` functions where the `callback` would be bound on the
3431                   first call, meaning that since the `<input>` was cached for all calls, we'd only
3432                   ever use the first `callback` in subsequent calls.
3433
3434         * UserInterface/Views/DropZoneView.js:
3435         (WI.DropZoneView):
3436         (WI.DropZoneView.prototype.set text): Added.
3437         Support the text content of the drop zone changing after it's initialized.
3438
3439         * UserInterface/Views/FontResourceContentView.js:
3440         (WI.FontResourceContentView):
3441         (WI.FontResourceContentView.prototype.contentAvailable):
3442         (WI.FontResourceContentView.prototype.dropZoneHandleDragEnter): Added.
3443         (WI.FontResourceContentView.prototype.dropZoneHandleDrop):
3444         (WI.FontResourceContentView.prototype._handleLocalResourceContentDidChange): Added.
3445         * UserInterface/Views/ImageResourceContentView.js:
3446         (WI.ImageResourceContentView):
3447         (WI.ImageResourceContentView.prototype.contentAvailable):
3448         (WI.ImageResourceContentView.prototype.dropZoneHandleDragEnter): Added.
3449         (WI.ImageResourceContentView.prototype.dropZoneHandleDrop):
3450         (WI.ImageResourceContentView.prototype._handleLocalResourceContentDidChange): Added.
3451         Support drag/drop on non-override image/font content views, which will create/update the
3452         local resource override for that resource.
3453
3454         * UserInterface/Views/ResourceContentView.js:
3455         (WI.ResourceContentView):
3456         (WI.ResourceContentView.prototype.get navigationItems):
3457         (WI.ResourceContentView.prototype._handleImportLocalResourceOverride): Added.
3458         When viewing a local resource override, add an "Import" navigation item for non-drag/drop
3459         updating of the contents of the local resource override. This is also exposed for text-based
3460         local resource overrides, since drag/drop inserts the contents of the file (if it's text),
3461         which attempts to determine whether the dropped file is text or data based on the MIME type.
3462
3463         * UserInterface/Views/AuditNavigationSidebarPanel.js:
3464         (WI.AuditNavigationSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
3465         * UserInterface/Views/CanvasOverviewContentView.js:
3466         (WI.CanvasOverviewContentView.prototype._handleImportButtonNavigationItemClicked):
3467         * UserInterface/Views/CanvasSidebarPanel.js:
3468         (WI.CanvasSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
3469         * UserInterface/Views/HeapAllocationsTimelineView.js:
3470         (WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
3471         * UserInterface/Views/NetworkTableContentView.js:
3472         (WI.NetworkTableContentView.prototype._importHAR):
3473         * UserInterface/Views/TimelineRecordingContentView.js:
3474         (WI.TimelineRecordingContentView.prototype._importButtonNavigationItemClicked):
3475         Explicitly allow multiple files to be imported at the same time.
3476
3477         * UserInterface/Base/BlobUtilities.js:
3478         (WI.BlobUtilities.blobForContent):
3479         Drive-by: remove extra `base64Encoded` argument when calling `decodeBase64ToBlob`, which
3480                   caused SVG-based image local resource overrides to show a broken image when
3481                   closing and reopening Web Inspector.
3482
3483         * Localizations/en.lproj/localizedStrings.js:
3484
3485 2019-10-14  Devin Rousso  <drousso@apple.com>
3486
3487         Web Inspector: REGRESSION(r250991): Sources: local resource overrides should be enabled when not in tests
3488         https://bugs.webkit.org/show_bug.cgi?id=202944
3489
3490         Reviewed by Joseph Pecoraro.
3491
3492         * UserInterface/Controllers/NetworkManager.js:
3493         (WI.NetworkManager):
3494
3495 2019-10-11  Devin Rousso  <drousso@apple.com>
3496
3497         Web Inspector: Debugger: support pattern blackboxing
3498         https://bugs.webkit.org/show_bug.cgi?id=198855
3499
3500         Reviewed by Timothy Hatcher.
3501
3502         Allow scripts to be blackboxed based on URL patterns (in addition to individual URLs) which
3503         can be extremely useful when trying to step through unminified library/framework code.
3504
3505         * UserInterface/Controllers/DebuggerManager.js:
3506         (WI.DebuggerManager):
3507         (WI.DebuggerManager.prototype.initializeTarget):
3508         (WI.DebuggerManager.prototype.blackboxTypeForSourceCode): Added.
3509         (WI.DebuggerManager.prototype.get blackboxPatterns): Added.
3510         (WI.DebuggerManager.prototype.setShouldBlackboxScript):
3511         (WI.DebuggerManager.prototype.setShouldBlackboxPattern): Added.
3512         (WI.DebuggerManager.prototype.isScriptBlackboxed): Deleted.
3513         Provide a separate path for setting URL pattern blackboxes, rather than an exact/given URL.
3514
3515         * UserInterface/Views/SettingsTabContentView.js:
3516         (WI.SettingsTabContentView):
3517         (WI.SettingsTabContentView.prototype.selectBlackboxPattern): Added.
3518         (WI.SettingsTabContentView.prototype.initialLayout):
3519         (WI.SettingsTabContentView.prototype._createSourcesSettingsView):
3520         * UserInterface/Views/BlackboxSettingsView.js: Added.
3521         (WI.BlackboxSettingsView):
3522         (WI.BlackboxSettingsView.prototype.selectBlackboxPattern):
3523         (WI.BlackboxSettingsView.prototype.initialLayout):
3524         (WI.BlackboxSettingsView.prototype._addRow):
3525         * UserInterface/Views/BlackboxSettingsView.css: Added.
3526         (.settings-view.blackbox > :matches(p, table)):
3527         (.settings-view.blackbox > p):
3528         (.settings-view.blackbox > * + p):
3529         (.settings-view.blackbox > p:last-child):
3530         (.settings-view.blackbox > p > .toggle-script-blackbox):
3531         (.settings-view.blackbox > table):
3532         (.settings-view.blackbox > table > thead th):
3533         (.settings-view.blackbox > table > tbody td):
3534         (.settings-view.blackbox > table > tbody td:not(.remove-blackbox)):
3535         (.settings-view.blackbox > table :matches(th, td).url):
3536         (.settings-view.blackbox > table > tbody td.url > .CodeMirror):
3537         (.settings-view.blackbox > table :matches(th, td):matches(.case-sensitive, .remove-blackbox)):
3538         (.settings-view.blackbox > table > tbody > tr:not(:hover) > td.remove-blackbox):
3539         (.settings-view.blackbox > table > tbody td.remove-blackbox > .remove-blackbox-button):
3540         Add a "Blackbox" pane that contains an editable table of pattern blackboxes, each having its
3541         own row (code mirror for the URL regular expression and a checkbox for case sensitivity).
3542
3543         * UserInterface/Views/SourceCodeTreeElement.js:
3544         (WI.SourceCodeTreeElement.prototype.updateStatus):
3545         (WI.SourceCodeTreeElement.prototype._updateSourceCode):
3546         (WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState):
3547         (WI.SourceCodeTreeElement.prototype._handleToggleBlackboxedImageElementClicked):
3548         * UserInterface/Views/SourceCodeTreeElement.css:
3549         (.tree-outline .item .status > .toggle-script-blackbox, .tree-outline:focus .item.selected .status > .toggle-script-blackbox.pattern-blackboxed): Added.
3550         (.tree-outline .item .status > .toggle-script-blackbox.pattern-blackboxed): Added.
3551         (.tree-outline .item .status > .toggle-script-blackbox): Added.
3552         (.tree-outline .item .status > .toggle-script-blackbox:not(.pattern-blackboxed)): Added.
3553         (.tree-outline .item .status > .toggle-script-blackbox:not(.url-blackboxed, .pattern-blackboxed)): Added.
3554         (.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackbox, .tree-outline .item:not(:hover) .status > .toggle-script-blackbox:not(.pattern-blackboxed, .url-blackboxed)): Added.
3555         (@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackbox): Added.
3556         (@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackbox.pattern-blackboxed): Added.
3557         (@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackbox:not(.pattern-blackboxed)): Added.
3558         (.tree-outline .item .status > .toggle-script-blackboxed): Deleted.
3559         (.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed, .tree-outline .item:not(:hover) .status > .toggle-script-blackboxed:not(.blackboxed)): Deleted.
3560         (.tree-outline:focus .item.selected .status > .toggle-script-blackboxed): Deleted.
3561         (.tree-outline .item .status > .toggle-script-blackboxed.blackboxed): Deleted.
3562         (@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackboxed): Deleted.
3563         * UserInterface/Views/ShaderProgramTreeElement.css:
3564         (.tree-outline .item.shader-program .status > img):
3565         (.tree-outline .item.shader-program:not(:hover, .disabled) .status > img): Added.
3566         (.tree-outline .item.shader-program:not(.disabled) .status > img): Added.
3567         (@media (prefers-color-scheme: dark) .tree-outline .item.shader-program .status > img):
3568         (.tree-outline .item.shader-program:not(:hover, .selected, .disabled) .status > img): Deleted.
3569         (.tree-outline:focus .item.shader-program.selected .status > img): Deleted.
3570         (.tree-outline .item.shader-program.disabled .status > img): Deleted.
3571         * UserInterface/Views/ContextMenuUtilities.js:
3572         (WI.appendContextMenuItemsForSourceCode):
3573         * UserInterface/Images/Hide.svg:
3574         Use a slightly different style for the blackbox icon if the source code's URL matches a
3575         blackbox pattern. Clicking on the blackbox icon in this state will show the Settings Tab.
3576
3577         * UserInterface/Base/Main.js:
3578         (WI.contentLoaded):
3579         (WI._handleSettingsKeyboardShortcut): Added.
3580         (WI.showSettingsTab): Added.
3581         (WI._showSettingsTab): Deleted.
3582
3583         * Localizations/en.lproj/localizedStrings.js:
3584
3585 2019-10-11  Devin Rousso  <drousso@apple.com>
3586
3587         Web Inspector: Elements: Computed: show shorthand properties in addition to longhand ones
3588         https://bugs.webkit.org/show_bug.cgi?id=200554
3589
3590         Reviewed by Matt Baker.
3591
3592         Replace the "Show All [ ]" checkbox header option in the "Properties" section with a filter
3593         icon that controls both "Show All" and "Prefer Shorthands", the latter of which will cause
3594         any longhand properties to be hidden and their respective shorthands to be shown.
3595
3596         * UserInterface/Models/CSSProperty.js:
3597         (WI.CSSProperty):
3598         (WI.CSSProperty.prototype.update):
3599         (WI.CSSProperty.prototype.get isVariable): Added.
3600         (WI.CSSProperty.prototype.get isShorthand): Added.
3601         (WI.CSSProperty.prototype.get shorthandPropertyNames): Added.
3602         (WI.CSSProperty.prototype.get variable): Deleted.
3603
3604         * UserInterface/Views/ComputedStyleDetailsPanel.js:
3605         (WI.ComputedStyleDetailsPanel):
3606         (WI.ComputedStyleDetailsPanel.prototype.applyFilter):
3607         (WI.ComputedStyleDetailsPanel.prototype.initialLayout):
3608         (WI.ComputedStyleDetailsPanel.prototype._computedStyleShowAllCheckboxValueChanged): Deleted.
3609         * UserInterface/Views/ComputedStyleDetailsPanel.css:
3610         (.sidebar > .panel.details.css-style > .content > .computed > .details-section): Added.
3611         (.sidebar > .panel.details.css-style > .content > .computed > .details-section > .content): Added.
3612         (.sidebar > .panel.details.css-style > .content > .computed .spreadsheet-style-declaration-editor): Added.
3613         (.sidebar > .panel.details.css-style > .content > .computed .property): Added.
3614         (.sidebar > .panel.details.css-style > .content > .computed .property .go-to-arrow): Added.
3615         (.sidebar > .panel.details.css-style > .content > .computed .property:not(:hover) .go-to-arrow): Added.
3616         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables)): Deleted.
3617         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property): Deleted.
3618         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property .go-to-arrow): Deleted.
3619         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property:not(:hover) .go-to-arrow): Deleted.
3620         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) > .content): Deleted.
3621
3622         * UserInterface/Views/ComputedStyleSection.js:
3623         (WI.ComputedStyleSection):
3624         (WI.ComputedStyleSection.prototype.set showsShorthandsInsteadOfLonghands): Added.
3625         (WI.ComputedStyleSection.prototype.get propertiesToRender):
3626         (WI.ComputedStyleSection.prototype.set propertyVisibilityMode): Deleted.
3627
3628         * UserInterface/Views/SpreadsheetStyleProperty.js:
3629         (WI.SpreadsheetStyleProperty.prototype.update):
3630         (WI.SpreadsheetStyleProperty.prototype._replaceSpecialTokens):
3631
3632         * Localizations/en.lproj/localizedStrings.js:
3633
3634 2019-10-10  Joseph Pecoraro  <pecoraro@apple.com>
3635
3636         Web Inspector: Local Resource Overrides: UI for overriding image and font resource content
3637         https://bugs.webkit.org/show_bug.cgi?id=202016
3638         <rdar://problem/55541475>
3639
3640         Reviewed by Devin Rousso.
3641
3642         Extend SourceCodeRevision to be a (content, base64Encoded, mimeType) tuple and
3643         make clients update the revision content more explicitly (`updateRevisionContent`).
3644         This also includes `blobContent` as a more explicit way to get the content as
3645         a Blob, which may not always be desired.
3646
3647         Switch LocalResource use the originalRevision / currentRevision instead of
3648         keeping its own localContent / localContentIsBase64Encoded properties.
3649
3650         Introduce a `DropZoneView` to simplify handling of presenting a drop zone
3651         over a specific element. And use it for the ImageResourceContentView for local
3652         resource overrides to accept new content.
3653
3654         * Localizations/en.lproj/localizedStrings.js:
3655         * UserInterface/Main.html:
3656         New strings and resources.
3657
3658         * .eslintrc:
3659         * UserInterface/Base/BlobUtilities.js: Added.
3660         (WI.BlobUtilities.blobForContent):
3661         (WI.BlobUtilities.decodeBase64ToBlob):
3662         (WI.BlobUtilities.textToBlob):
3663         (WI.BlobUtilities.blobAsText):
3664         (WI.BlobUtilities):
3665         * UserInterface/Base/FileUtilities.js:
3666         (WI.FileUtilities.async.readDataURL):
3667         (WI.FileUtilities):
3668         * UserInterface/Base/MIMETypeUtilities.js:
3669         (WI.fileExtensionForFilename):
3670         (WI.fileExtensionForURL):
3671         * UserInterface/Base/Utilities.js:
3672         Move around or introduce some minor utilities.
3673
3674         * UserInterface/Models/SourceCodeRevision.js:
3675         (WI.SourceCodeRevision):
3676         (WI.SourceCodeRevision.prototype.get sourceCode):
3677         (WI.SourceCodeRevision.prototype.get content):
3678         (WI.SourceCodeRevision.prototype.get base64Encoded):
3679         (WI.SourceCodeRevision.prototype.get mimeType):
3680         (WI.SourceCodeRevision.prototype.get blobContent):
3681         (WI.SourceCodeRevision.prototype.updateRevisionContent):
3682         (WI.SourceCodeRevision.prototype.copy):
3683         (WI.SourceCodeRevision.prototype.set content): Deleted.
3684         Data is now a (content, base64Encoded, mimeType) tuple.
3685
3686         * UserInterface/Controllers/NetworkManager.js:
3687         (WI.NetworkManager.prototype.responseIntercepted):
3688         (WI.NetworkManager.prototype._handleResourceContentDidChange):
3689         (WI.NetworkManager.prototype._persistLocalResourceOverrideSoonAfterContentChange): Deleted.
3690         This is now a unified resource content change path without anything special for
3691         local resource overrides.
3692
3693         * UserInterface/Models/LocalResource.js:
3694         (WI.LocalResource.prototype.toJSON):
3695         (WI.LocalResource.prototype.requestContentFromBackend):
3696         (WI.LocalResource.prototype.handleCurrentRevisionContentChange):
3697         (WI.LocalResource):
3698         (WI.LocalResource.prototype.get localContent): Deleted.
3699         (WI.LocalResource.prototype.get localContentIsBase64Encoded): Deleted.
3700         (WI.LocalResource.prototype.hasContent): Deleted.
3701         (WI.LocalResource.prototype.setContent): Deleted.
3702         (WI.LocalResource.prototype.updateOverrideContent): Deleted.
3703         Use originalRevision / currentRevision as appropriate.
3704
3705         * UserInterface/Views/DropZoneView.css: Added.
3706         (.drop-zone):
3707         (.drop-zone.visible):
3708         (@media (prefers-color-scheme: dark)):
3709         * UserInterface/Views/DropZoneView.js: Added.
3710         (WI.DropZoneView):
3711         (WI.DropZoneView.prototype.get delegate):
3712         (WI.DropZoneView.prototype.get targetElement):
3713         (WI.DropZoneView.prototype.set targetElement):
3714         (WI.DropZoneView.prototype.initialLayout):
3715         (WI.DropZoneView.prototype._startActiveDrag):
3716         (WI.DropZoneView.prototype._stopActiveDrag):
3717         (WI.DropZoneView.prototype._handleDragEnter):
3718         (WI.DropZoneView.prototype._handleDragLeave):
3719         (WI.DropZoneView.prototype._handleDragOver):
3720         (WI.DropZoneView.prototype._handleDrop):
3721         Simplified handling of a drop zone.
3722
3723         * UserInterface/Views/ResourceContentView.js:
3724         (WI.ResourceContentView.prototype.removeLoadingIndicator):
3725         More safely remove children and subviews.
3726
3727         (WI.ResourceContentView):
3728         (WI.ResourceContentView.prototype.get resource):
3729         (WI.ResourceContentView.prototype.get navigationItems):
3730         (WI.ResourceContentView.prototype.localResourceOverrideInitialContent):
3731         (WI.ResourceContentView.prototype.closed):
3732         (WI.ResourceContentView.prototype.removeLoadingIndicator):
3733         (WI.ResourceContentView.prototype._contentAvailable):
3734         (WI.ResourceContentView.prototype._issueWasAdded):
3735         (WI.ResourceContentView.prototype.async._handleCreateLocalResourceOverride):
3736         (WI.ResourceContentView.prototype._handleRemoveLocalResourceOverride):
3737         (WI.ResourceContentView.prototype._handleLocalResourceOverrideChanged):
3738         (WI.ResourceContentView.prototype._mouseWasClicked):
3739         * UserInterface/Views/TextResourceContentView.js:
3740         (WI.TextResourceContentView):
3741         (WI.TextResourceContentView.prototype.get navigationItems):
3742         (WI.TextResourceContentView.prototype.localResourceOverrideInitialContent):
3743         (WI.TextResourceContentView.prototype._contentWillPopulate):
3744         (WI.TextResourceContentView.prototype._contentDidPopulate):
3745         (WI.TextResourceContentView.prototype._textEditorContentDidChange):
3746         (WI.TextResourceContentView.prototype._shouldBeEditable):
3747         (WI.TextResourceContentView.prototype.async._handleCreateLocalResourceOverride): Deleted.
3748         (WI.TextResourceContentView.prototype._handleRemoveLocalResourceOverride): Deleted.
3749         (WI.TextResourceContentView.prototype._handleLocalResourceOverrideChanged): Deleted.
3750         Extract generalized local resource override properties into the ResourceContentView base class.
3751
3752         * UserInterface/Views/FontResourceContentView.css:
3753         (.content-view.resource.font):
3754         (.content-view.resource.font > .drop-zone):
3755         (.content-view.resource.font > .preview-container):
3756         (.content-view.resource.font .preview):
3757         * UserInterface/Views/FontResourceContentView.js:
3758         (WI.FontResourceContentView):
3759         (WI.FontResourceContentView.prototype.contentAvailable):
3760         (WI.FontResourceContentView.prototype.shown):
3761         (WI.FontResourceContentView.prototype.hidden):
3762         (WI.FontResourceContentView.prototype.closed):
3763         (WI.FontResourceContentView.prototype.layout):
3764         (WI.FontResourceContentView.prototype._updatePreviewElement.createMetricElement):
3765         (WI.FontResourceContentView.prototype._updatePreviewElement):
3766         (WI.FontResourceContentView.prototype.dropZoneShouldAppearForDragEvent):
3767         (WI.FontResourceContentView.prototype.dropZoneHandleDrop):
3768         Create a drop zone that will update the font local resource override content.
3769
3770         * UserInterface/Views/ImageResourceContentView.css:
3771         (.content-view.resource.image):
3772         (.content-view.resource.image > .drop-zone):
3773         (.content-view.resource.image > .img-container):
3774         (.content-view.resource.image img):
3775         * UserInterface/Views/ImageResourceContentView.js:
3776         (WI.ImageResourceContentView):
3777         (WI.ImageResourceContentView.prototype.get navigationItems):
3778         (WI.ImageResourceContentView.prototype.contentAvailable):
3779         (WI.ImageResourceContentView.prototype.closed):
3780         (WI.ImageResourceContentView.prototype.dropZoneShouldAppearForDragEvent):
3781         (WI.ImageResourceContentView.prototype.dropZoneHandleDrop):
3782         Create a drop zone that will update the image local resource override content.
3783
3784         * UserInterface/Models/Script.js:
3785         (WI.Script.prototype.get mimeType):
3786         Seems like this should have a default value given there may not be a resource.
3787
3788         * UserInterface/Views/LocalResourceOverridePopover.js:
3789         (WI.LocalResourceOverridePopover.prototype.show):
3790         Better handling here, since the utilities expects a number not a string.
3791
3792         * UserInterface/Models/Resource.js: