Web Inspector: REGRESSION (r248873): Debugger: pressing delete on a breakpoint will...
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2019-08-29  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: REGRESSION (r248873): Debugger: pressing delete on a breakpoint will also delete any resource/element parent immediately before it in the list
4         https://bugs.webkit.org/show_bug.cgi?id=200939
5
6         Reviewed by Joseph Pecoraro.
7
8         * UserInterface/Views/DebuggerSidebarPanel.js:
9         (WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
10         (WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
11         (WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement.checkIfSelectionAdjustmentNeeded): Deleted.
12         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
13         (WI.SourcesNavigationSidebarPanel):
14         (WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
15         (WI.SourcesNavigationSidebarPanel.this._breakpointsTreeOutline.ondelete.checkIfSelectionAdjustmentNeeded): Deleted.
16         When the `WI.TreeOutline`'s own `ondelete` is called, that means we must be handling a
17         delete that was _not_ handled by a `WI.TreeElement`. This means that the `selectedTreeElement`
18         has to be a resource/script, the `window` object, or one of the non-deletable breakpoints.
19
20         In the case of a non-deletable breakpoint, since they're never removed from their parent
21         `WI.TreeOutline`, we just shift the selection to the next selectable `WI.TreeElement`.
22
23         Otherwise, wait for the `WI.TreeOutline.Event.ElementRemoved` event to be fired, and adjust
24         the selection then based on whether the new `selectedTreeElement` is one of the "top" items,
25         namely the "All Exceptions", "Uncaught Exceptions", and "Assertion Failures" breakpoints.
26
27         * UserInterface/Views/BreakpointTreeElement.js:
28         (WI.BreakpointTreeElement.prototype.ondelete):
29         * UserInterface/Views/DOMBreakpointTreeElement.js:
30         (WI.DOMBreakpointTreeElement.prototype.ondelete):
31         * UserInterface/Views/DOMNodeTreeElement.js:
32         (WI.DOMNodeTreeElement.prototype.ondelete):
33         * UserInterface/Views/EventBreakpointTreeElement.js:
34         (WI.EventBreakpointTreeElement.prototype.ondelete):
35         * UserInterface/Views/URLBreakpointTreeElement.js:
36         (WI.URLBreakpointTreeElement.prototype.ondelete):
37         Add `return true;` to let the parent `WI.TreeOutline` know that the delete event was handled.
38         This prevents the parent `WI.TreeOutline`'s own `ondelete` from being called, which would
39         cause a double-delete as there would be a different `selectedTreeElement`.
40
41 2019-08-29  Keith Rollin  <krollin@apple.com>
42
43         Remove support for macOS < 10.13 (part 3)
44         https://bugs.webkit.org/show_bug.cgi?id=201224
45         <rdar://problem/54795934>
46
47         Reviewed by Darin Adler.
48
49         Remove symbols in WebKitTargetConditionals.xcconfig related to macOS
50         10.13, including WK_MACOS_1013 and WK_MACOS_BEFORE_1013, and suffixes
51         like _MACOS_SINCE_1013.
52
53         Also added some macOS target numbers.
54
55         * Configurations/WebKitTargetConditionals.xcconfig:
56
57 2019-08-29  Joseph Pecoraro  <pecoraro@apple.com>
58
59         Web Inspector: Import file pickers sometimes do not import
60         https://bugs.webkit.org/show_bug.cgi?id=201290
61         <rdar://problem/54826117>
62
63         Reviewed by Devin Rousso.
64
65         * UserInterface/Base/FileUtilities.js:
66         (WI.FileUtilities.importText):
67         (WI.FileUtilities.importJSON):
68         Keep the input element alive so it doesn't get garbage collected,
69         which makes the file chooser do nothing.
70
71         (WI.FileUtilities.save):
72         (WI.FileUtilities.async.readText):
73         Place read operations after event handlers are setup in case the
74         read operations can happen synchronously and events may not fire.
75
76 2019-08-28  Devin Rousso  <drousso@apple.com>
77
78         Web Inspector: REGRESSION(r249078): JavaScript autocomplete doesn't work when evaluating properties of values
79         https://bugs.webkit.org/show_bug.cgi?id=201226
80
81         Reviewed by Joseph Pecoraro.
82
83         r249078 modified `WI.JavaScriptRuntimeCompletionProvider` to use arrays of property names
84         instead of objects for completion, but a few code paths were missed.
85
86         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
87         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
88         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNamesFromEvaluate):
89         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedObjectPropertyNames): Added.
90         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedArrayPropertyNames):
91
92         * UserInterface/Models/CallFrame.js:
93         (WI.CallFrame.prototype.collectScopeChainVariableNames):
94         (WI.CallFrame.prototype.collectScopeChainVariableNames.propertiesCollected):
95
96 2019-08-27  Devin Rousso  <drousso@apple.com>
97
98         Web Inspector: replace uses of added utility `Array.prototype.keySet` with an actual `Set`
99         https://bugs.webkit.org/show_bug.cgi?id=201194
100
101         Reviewed by Ross Kirsling.
102
103         They both have basically the same functionality, with one difference being that a `Set` can
104         work with arrays that have non-string values.
105
106         * UserInterface/Base/Utilities.js:
107         (Array.prototype.keySet): Deleted.
108         * UserInterface/Controllers/CodeMirrorCompletionController.js:
109         (WI.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions):
110         (WI.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions.matchKeywords):
111         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
112         (WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
113
114 2019-08-27  Devin Rousso  <drousso@apple.com>
115
116         Web Inspector: change the styling of the special log "bubble" to match WI.ScopeBar
117         https://bugs.webkit.org/show_bug.cgi?id=201152
118
119         Reviewed by Joseph Pecoraro.
120
121         * UserInterface/Views/ConsoleMessageView.css:
122         (.console-user-command.special-user-log > .console-message-body):
123
124 2019-08-26  Devin Rousso  <drousso@apple.com>
125
126         Web Inspector: decrease horizontal padding of `WI.ScopeBar` to have more room
127         https://bugs.webkit.org/show_bug.cgi?id=201090
128
129         Reviewed by Joseph Pecoraro.
130
131         There's a lot of "wasted" padding space around each item that we could reuse (or "move") for
132         other navigation items.
133
134         * UserInterface/Views/FilterBar.css:
135         (.filter-bar > .navigation-bar > .item.scope-bar):
136         * UserInterface/Views/RadioButtonNavigationItem.css:
137         (.navigation-bar .item.radio.button.text-only):
138         * UserInterface/Views/ScopeBar.css:
139         (.scope-bar):
140         (body[dir=ltr] .scope-bar > li.multiple > select):
141         (body[dir=rtl] .scope-bar > li.multiple > select):
142         (.scope-bar > li.multiple > .arrows):
143
144         * UserInterface/Views/RadioButtonNavigationItem.js:
145         (WI.RadioButtonNavigationItem):
146         (WI.RadioButtonNavigationItem.prototype.update): Deleted.
147         There's no reason to forcibly set the `min-width` since all instances are just text.
148
149         * UserInterface/Views/AuditTestGroupContentView.js:
150         (WI.AuditTestGroupContentView.prototype.initialLayout):
151         * UserInterface/Views/AuditTestGroupContentView.css:
152         (.content-view.audit-test-group > header > nav:not(:empty):before): Deleted.
153         Remove the unnecessary "Showing: " prefix before the `WI.ScopeBar`.
154
155         * UserInterface/Views/ScopeRadioButtonNavigationItem.js: Removed.
156         * UserInterface/Views/ScopeRadioButtonNavigationItem.css: Removed.
157         These classes were never used.
158
159         * Localizations/en.lproj/localizedStrings.js:
160
161 2019-08-24  Devin Rousso  <drousso@apple.com>
162
163         Web Inspector: "Copy Rule" menu item does not propagate comments properly
164         https://bugs.webkit.org/show_bug.cgi?id=201095
165
166         Reviewed by Joseph Pecoraro.
167
168         * UserInterface/Models/CSSProperty.js:
169         (WI.CSSProperty.prototype.commentOut):
170         (WI.CSSProperty.prototype.get formattedText):
171         Wrap the `text` in `/* ${text} */` if the `WI.CSSProperty` isn't `enabled` (e.g. commented out).
172
173 2019-08-23  Devin Rousso  <drousso@apple.com>
174
175         Web Inspector: create additional command line api functions for other console methods
176         https://bugs.webkit.org/show_bug.cgi?id=200971
177
178         Reviewed by Joseph Pecoraro.
179
180         Expose all `console.*` functions in the command line API, since they're all already able to
181         be referenced via the `console` object.
182
183         Provide a simpler interface for other injected scripts to modify the command line API.
184
185         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
186         (WI.JavaScriptRuntimeCompletionProvider.prototype.get _commandLineAPIKeys): Added.
187         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.updateLastPropertyNames):
188         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNames):
189
190 2019-08-23  Devin Rousso  <drousso@apple.com>
191
192         Web Inspector: transparency checkerboard is too bright in dark mode
193         https://bugs.webkit.org/show_bug.cgi?id=201067
194
195         Reviewed by Joseph Pecoraro.
196
197         * UserInterface/Views/Main.css:
198         (@media (prefers-color-scheme: dark) :matches(img, canvas).show-grid):
199         * UserInterface/Views/ConsoleMessageView.css:
200         (.console-message-body > .show-grid):
201
202 2019-08-22  Devin Rousso  <drousso@apple.com>
203
204         Web Inspector: Console: automatically select the "Evaluations" filter whenever running commands
205         https://bugs.webkit.org/show_bug.cgi?id=201060
206
207         Reviewed by Timothy Hatcher.
208
209         If the Console is actively being filtered (e.g. not "All"), it can be confusing to run a
210         command, only to not see any results. We should automatically enable the "Evaluations"
211         filter in addition to any other existing filters in these cases.
212
213         * UserInterface/Views/LogContentView.js:
214         (WI.LogContentView.prototype.didAppendConsoleMessageView):
215         * UserInterface/Views/ScopeBarItem.js:
216         (WI.ScopeBarItem.prototype.set selected):
217         (WI.ScopeBarItem.prototype.toggle): Added.
218
219 2019-08-22  Devin Rousso  <drousso@apple.com>
220
221         Web Inspector: REGRESSION(r248485): stack overflow when viewing a source map generated from inline content
222         https://bugs.webkit.org/show_bug.cgi?id=201042
223         <rdar://problem/54509750>
224
225         Reviewed by Antoine Quint.
226
227         In r248485, `WI.ResourceClusterContentView` was changed to `requestContent` whenever the
228         given resource finished loading (by listening for `WI.Resource.Event.LoadingDidFinish`).
229
230         Even though retrieving a source map's contents uses `Promise`s, in the case that the content
231         was inlined in the "original" source code, the code path would mark the source map as being
232         finished (which would fire a `WI.Resource.Event.LoadingDidFinish`) _before_ it could return
233         a `Promise`, which would've been cached (`WI.SourceCode.prototype.requestContent`) and
234         preventend any reentrancy.
235
236         Wrapping the inline code path in a `Promise.resolve()` gives the `WI.SourceCode` a chance to
237         cache the `Promise` before any events are fired.
238
239         * UserInterface/Models/SourceMapResource.js:
240         (WI.SourceMapResource.prototype.requestContentFromBackend):
241
242 2019-08-22  Nikita Vasilyev  <nvasilyev@apple.com>
243
244         Web Inspector: console.dir should expand objects
245         https://bugs.webkit.org/show_bug.cgi?id=152039
246         <rdar://problem/23816853>
247
248         Reviewed by Joseph Pecoraro.
249
250         Expand objects logged by console.dir but keep them collapsed when logged by console.log.
251
252         * UserInterface/Views/ConsoleMessageView.js:
253         (WI.ConsoleMessageView.prototype.render):
254
255 2019-08-22  Joseph Pecoraro  <pecoraro@apple.com>
256
257         Web Inspector: Cleanup some unused code
258         https://bugs.webkit.org/show_bug.cgi?id=201041
259
260         Reviewed by Alex Christensen.
261
262         * UserInterface/Views/CPUUsageCombinedView.css:
263         (.cpu-usage-combined-view > .graph > .stacked-area-chart):
264         * UserInterface/Views/CPUUsageCombinedView.js:
265         (WI.CPUUsageCombinedView):
266         * UserInterface/Views/MediaTimelineOverviewGraph.js:
267         (WI.MediaTimelineOverviewGraph):
268
269 2019-08-22  Joseph Pecoraro  <pecoraro@apple.com>
270
271         Web Inspector: Provide an engineering option to log protocol traffic as text
272         https://bugs.webkit.org/show_bug.cgi?id=200969
273
274         Reviewed by Devin Rousso.
275
276         * UserInterface/Base/Setting.js:
277         * UserInterface/Protocol/LoggingProtocolTracer.js:
278         (WI.LoggingProtocolTracer.prototype._processEntry):
279         (WI.LoggingProtocolTracer):
280         * UserInterface/Views/SettingsTabContentView.js:
281         (WI.SettingsTabContentView.prototype._createDebugSettingsView):
282
283 2019-08-21  Nikita Vasilyev  <nvasilyev@apple.com>
284
285         Web Inspector: RTL: DOM outline in Elements tab should be LTR
286         https://bugs.webkit.org/show_bug.cgi?id=200601
287
288         Reviewed by Timothy Hatcher.
289
290         Make DOM outlines in Console and Elements tab always LTR,
291         and unsure that Left and Right arrow keys continue working correctly.
292
293         * UserInterface/Base/Main.js:
294         (WI.resolveLayoutDirectionForElement): Added.
295         The existing WI.resolvedLayoutDirection function returns the value of the root DOM element.
296         The newly added resolveLayoutDirectionForElement function returns the correct value for any element,
297         including elements with `dir=ltr` inside of `<body dir=rtl>`.
298
299         * UserInterface/Views/DOMTreeOutline.css:
300         (.tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded):
301         (.tree-outline.dom li:not(.editing)):
302         (.tree-outline.dom li.editing):
303         (.tree-outline.dom li .pseudo-class-indicator):
304         (.tree-outline.dom.single-node li):
305         (.tree-outline.dom li.parent):
306         (.tree-outline.dom li .html-tag.close):
307         (.tree-outline.dom li.parent::before):
308         (.tree-outline.dom li.parent.shadow::after):
309         Remove RTL logic.
310
311         * UserInterface/Views/DOMTreeOutline.js:
312         * UserInterface/Views/TreeOutline.js:
313         (WI.TreeOutline.prototype._treeKeyDown):
314         Make Left and Right arrow keys work correctly for LTR DOM outlines inside of the global RTL.
315
316 2019-08-21  Devin Rousso  <drousso@apple.com>
317
318         Web Inspector: Page: re-add enable/disable after r248454
319         https://bugs.webkit.org/show_bug.cgi?id=200947
320
321         Reviewed by Joseph Pecoraro.
322
323         We shouldn't design the agent system with only Web Inspector in mind. Other clients may want
324         to have different functionality, not being told about frames creation/updates/destruction.
325         In these cases, we should have graceful error message failures for other agents that rely on
326         the Page agent.
327
328         * UserInterface/Controllers/NetworkManager.js:
329         (WI.NetworkManager.prototype.initializeTarget):
330
331 2019-08-21  Devin Rousso  <drousso@apple.com>
332
333         Web Inspector: Sources: increase the filter bar's width when it's focused if a resource type filter is active
334         https://bugs.webkit.org/show_bug.cgi?id=200940
335
336         Reviewed by Joseph Pecoraro.
337
338         * UserInterface/Views/FilterBar.js:
339         (WI.FilterBar.prototype._handleFilterChanged):
340         (WI.FilterBar.prototype.get indicatingProgress): Deleted.
341         (WI.FilterBar.prototype.set indicatingProgress): Deleted.
342         (WI.FilterBar.prototype.get indicatingActive): Deleted.
343         (WI.FilterBar.prototype.set indicatingActive): Deleted.
344         If escape is pressed when the <input> is empty, unfocus (blur) the <input>.
345         Drive-by: remove unused/unnecessary functions.
346
347         * UserInterface/Views/FilterBar.css:
348         (.filter-bar > input[type="search"]):
349         (:matches(.filter-bar, .search-bar) > input[type="search"]): Added.
350         (:matches(.filter-bar, .search-bar) > input[type="search"]:matches(:focus, :not(:placeholder-shown))): Added.
351         (:matches(.filter-bar, .search-bar) > input[type="search"]::-webkit-search-decoration): Added.
352         (:matches(.filter-bar, .search-bar) > input[type="search"]::-webkit-search-results-button): Added.
353         (:matches(.filter-bar, .search-bar) > input[type="search"]::placeholder): Added.
354         (:matches(.filter-bar, .search-bar) > input[type="search"]:matches(:not(:focus), :placeholder-shown)::-webkit-search-cancel-button): Added.
355         (:matches(.filter-bar, .search-bar) > .navigation-bar + input[type="search"]): Added.
356         (:matches(.filter-bar, .search-bar) > input[type="search"]:focus): Added.
357         (:matches(.filter-bar, .search-bar) > input[type="search"] + :empty): Added.
358         (:matches(.filter-bar, .search-bar) > input[type="search"]:focus ~ *): Added.
359         (:matches(.filter-bar, .search-bar) > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Added.
360         (.filter-bar > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Deleted.
361         (.filter-bar > .navigation-bar + input[type="search"]): Deleted.
362         (.filter-bar > input[type="search"]::placeholder): Deleted.
363         (.filter-bar > input[type="search"]:focus): Deleted.
364         (.filter-bar > input[type="search"]::-webkit-search-decoration): Deleted.
365         (.filter-bar.active > input[type="search"]::-webkit-search-decoration): Deleted.
366         (.filter-bar.indicating-progress > input[type="search"]::-webkit-search-decoration): Deleted.
367         (.filter-bar > input[type="search"] + .navigation-bar:empty): Deleted.
368         When the <input> is `:focus`, hide the following `WI.NavigationBar` (if it's being used) so
369         that there's more room to show the filter text.
370         Drive-by: fix background, border, and text color styling when `:focus`.
371
372         * UserInterface/Views/SearchBar.css:
373         (.search-bar > input[type="search"]):
374         (.search-bar > input[type="search"]::placeholder): Deleted.
375         (.search-bar > input[type="search"]:focus): Deleted.
376         (.search-bar > input[type="search"]:not(:placeholder-shown)): Deleted.
377         (.search-bar > input[type="search"]:placeholder-shown::-webkit-search-cancel-button): Deleted.
378         (@media (prefers-color-scheme: dark)): Deleted.
379         (:matches(.search-bar, .filter-bar) > input[type="search"],): Deleted.
380         (:matches(.search-bar, .filter-bar) > input[type="search"]::placeholder): Deleted.
381         (:matches(.search-bar, .filter-bar) > input[type="search"]:focus): Deleted.
382         * UserInterface/Views/SearchSidebarPanel.css:
383         (.sidebar > .panel.navigation.search > .search-bar):
384         (.sidebar > .panel.navigation.search > .search-bar > input[type="search"]):
385         (.sidebar > .panel.navigation.search > .search-bar > .search-settings): Added.
386         (.sidebar > .panel.navigation.search > .search-bar > input[type="search"]::-webkit-search-results-button): Deleted.
387         * UserInterface/Views/Toolbar.css:
388         (.toolbar .search-bar > input[type="search"]::-webkit-textfield-decoration-container): Deleted.
389         Move shared styles to FilterBar.css as `WI.FilterBar` are more common.
390
391         * UserInterface/Views/Variables.css:
392         (:root):
393         (@media (prefers-color-scheme: dark) :root):
394         Expose some CSS variables in light mode that were previously only defined in dark mode.
395
396         * UserInterface/Views/NetworkTableContentView.js:
397         (WI.NetworkTableContentView.prototype._updateFilteredEntries):
398         (WI.NetworkTableContentView.prototype._updateURLFilterActiveIndicator): Deleted.
399         * UserInterface/Images/FilterFieldActiveGlyph.svg: Removed.
400
401 2019-08-21  Joseph Pecoraro  <pecoraro@apple.com>
402
403         Web Inspector: Remove unnecessary properties on SVGs
404         https://bugs.webkit.org/show_bug.cgi?id=200968
405
406         Reviewed by Devin Rousso.
407
408         * UserInterface/Images/EventPause.svg:
409         * UserInterface/Images/EventPlay.svg:
410         * UserInterface/Images/EventProcessing.svg:
411         * UserInterface/Images/EventStop.svg:
412         * UserInterface/Images/MediaInstrument.svg:
413
414 2019-08-20  Devin Rousso  <drousso@apple.com>
415
416         Web Inspector: Implement `queryHolders` Command Line API
417         https://bugs.webkit.org/show_bug.cgi?id=200458
418
419         Reviewed by Joseph Pecoraro.
420
421         Call `queryHolders(object)` from the Console to return an array of objects that strongly
422         reference the given `object`. This could be very useful for finding JavaScript "leaks".
423
424         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
425
426 2019-08-20  Joseph Pecoraro  <pecoraro@apple.com>
427
428         Web Inspector: Address a few Esprima issues preventing pretty printing of resources
429         https://bugs.webkit.org/show_bug.cgi?id=200935
430
431         Reviewed by Timothy Hatcher.
432
433         Address a few Esprima issues:
434
435             Issue #1991 - Failure to parse template literal with destructuring assignment expression
436             https://github.com/jquery/esprima/issues/1991
437
438             Issue #1920 - Invalid Left Hand Side in for-in
439             https://github.com/jquery/esprima/issues/1920
440
441         * UserInterface/External/Esprima/esprima.js:
442
443 2019-08-20  Joseph Pecoraro  <pecoraro@apple.com>
444
445         Web Inspector: Update CodeMirror to support numeric separators in JavaScript numbers
446         https://bugs.webkit.org/show_bug.cgi?id=200942
447
448         Cherry-pick a few CodeMirror changes:
449         
450             [javascript mode] Support numeric separators
451             https://github.com/codemirror/CodeMirror/commit/beab8ed123683416bfec934df73d13401ec086b5#diff-9812850bb71d31e8dd60b476abb2bae8
452
453             [javascript mode] fix tokenizing of underscore properties
454             https://github.com/codemirror/CodeMirror/commit/463ea2c34ab442c0cae1d9732305219ca9b04dfe#diff-9812850bb71d31e8dd60b476abb2bae8
455
456         Reviewed by Timothy Hatcher.
457
458         * UserInterface/External/CodeMirror/javascript.js:
459
460 2019-08-20  Devin Rousso  <drousso@apple.com>
461
462         Web Inspector: Sources: move the resource type scope bar to be next to the filter
463         https://bugs.webkit.org/show_bug.cgi?id=200891
464
465         Reviewed by Joseph Pecoraro.
466
467         It's odd to have UI for controlling the active filters in two different places. Move the
468         resource type `WI.ScopeBar` to the filter bar area, and "promote" the resource grouping mode
469         items from a context menu to an always visible `WI.ScopeBar` in the space left by the
470         resource type `WI.ScopeBar` (switching between grouping modes quickly is a useful workflow).
471
472         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
473         (WI.SourcesNavigationSidebarPanel):
474         (WI.SourcesNavigationSidebarPanel.prototype.hasCustomFilters):
475         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeScopeBarSelectionChanged): Added.
476         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
477         (WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu.addOption): Deleted.
478         (WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu): Deleted.
479         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
480         (.sidebar > .panel.navigation.sources > .filter-bar .sources-resource-type-scope-bar.default-item-selected:not(:hover)): Added.
481         (.sidebar > .panel.navigation.sources > .filter-bar .sources-resource-type-scope-bar.default-item-selected:hover): Added.
482
483         * UserInterface/Views/FilterBar.js:
484         (WI.FilterBar.prototype.addFilterNavigationItem): Added.
485         (WI.FilterBar.prototype.addFilterBarButton):
486         * UserInterface/Views/FilterBar.css:
487         (.filter-bar > .navigation-bar > .item):
488         (.filter-bar > .navigation-bar > .item.button): Added.
489         (.filter-bar > .navigation-bar > .item.scope-bar): Added.
490         (.filter-bar > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Added.
491         Provide a way to add arbitrary `WI.NavigationItem` to the contained `WI.NavigationBar`.
492         Slightly adjust the spacing of the items (depending on their type) in the `WI.NavigationBar`
493         so they are all centered.
494
495         * UserInterface/Views/ScopeBar.css:
496         (.scope-bar):
497         (.scope-bar > li):
498         (.scope-bar > li::after):
499         (.scope-bar > li:not(.selected):hover): Added.
500         (body[dir=ltr] .scope-bar > li.multiple > select):
501         (body[dir=rtl] .scope-bar > li.multiple > select):
502         (.scope-bar > li:not(.selected):hover::after): Added.
503         Introduce CSS variables for `margin`, `padding`, and `opacity` that callers can override to
504         customize the appearance of the `WI.ScopeBar`.
505
506         * Localizations/en.lproj/localizedStrings.js:
507
508 2019-08-20  Joseph Pecoraro  <pecoraro@apple.com>
509
510         Web Inspector: Sources: Give Origins their own icon in the Sources sidebar
511         https://bugs.webkit.org/show_bug.cgi?id=200683
512         <rdar://problem/54269044>
513
514         Reviewed by Devin Rousso.
515
516         * UserInterface/Images/Origin.svg: Added.
517         * UserInterface/Main.html:
518         New resources.
519
520         * UserInterface/Views/FolderIcon.css:
521         (.origin-icon .icon):
522         Light and Dark appearances for Origin icons.
523
524         (@media (prefers-color-scheme: dark)):
525         * UserInterface/Views/OriginTreeElement.js:
526         (WI.OriginTreeElement):
527         Very much like a folder with different classes.
528
529         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
530         (WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
531         (WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
532         (WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
533         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
534         Use OriginTreeElement in a few places.
535
536 2019-08-20  Joseph Pecoraro  <pecoraro@apple.com>
537
538         Web Inspector: Support for JavaScript BigInt
539         https://bugs.webkit.org/show_bug.cgi?id=180731
540         <rdar://problem/36298748>
541
542         Reviewed by Devin Rousso.
543
544         * UserInterface/External/CodeMirror/javascript.js:
545         (expressionAllowed):
546         Cherry-pick BigInt JavaScript mode support from CodeMirror:
547         https://github.com/codemirror/CodeMirror/pull/5411
548
549         * UserInterface/Images/TypeBigInt.svg: Added.
550         * UserInterface/Views/Variables.css:
551         (:root):
552         (@media (prefers-color-scheme: dark)):
553         * UserInterface/Views/CodeMirrorAdditions.js:
554         * UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
555         (.cm-s-default .cm-number.cm-bigint,):
556         * UserInterface/Views/ObjectTreePropertyTreeElement.css:
557         (.object-tree-property.bigint > .icon):
558         * UserInterface/Views/HeapSnapshotInstancesContentView.css:
559         (.heap-snapshot .icon.bigint):
560         Style BigInt similiar but different from numbers but with
561         a [B] icon instead of [N].
562
563         * UserInterface/Views/FormattedValue.css:
564         (.formatted-bigint):
565         * UserInterface/Views/FormattedValue.js:
566         (WI.FormattedValue.hasSimpleDisplay):
567         * UserInterface/Views/SourceCodeTextEditor.js:
568         (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
569         (WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
570         Simple value formatting for the new type.
571
572         * UserInterface/Models/TypeSet.js:
573         (WI.TypeSet):
574         (WI.TypeSet.prototype.get primitiveTypeNames):
575         * UserInterface/Views/TypeTokenView.css:
576         (.type-token-bigint):
577         * UserInterface/Views/TypeTokenView.js:
578         (WI.TypeTokenView.prototype._displayTypeName):
579         (WI.TypeTokenView):
580         New type handling for the Type profiler.
581
582         * UserInterface/Protocol/RemoteObject.js:
583         (WI.RemoteObject):
584         (WI.RemoteObject.createBigIntFromDescriptionString):
585         * UserInterface/Views/HeapSnapshotClusterContentView.js:
586         (WI.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
587         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
588         (WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
589         BigInt values are not tied to a GlobalObject, so do some special casing
590         in the Heap output (like Strings) so we get a preview.
591
592 2019-08-20  Devin Rousso  <drousso@apple.com>
593
594         Web Inspector: Use URL constructor to better handle all kinds of URLs
595         https://bugs.webkit.org/show_bug.cgi?id=165155
596
597         Reviewed by Joseph Pecoraro.
598
599         * UserInterface/Base/URLUtilities.js:
600         (parseURL):
601
602 2019-08-19  Devin Rousso  <drousso@apple.com>
603
604         Web Inspector: Debugger: add a global breakpoint for pausing in the next microtask
605         https://bugs.webkit.org/show_bug.cgi?id=200652
606
607         Reviewed by Joseph Pecoraro.
608
609         * UserInterface/Controllers/DebuggerManager.js:
610         (WI.DebuggerManager):
611         (WI.DebuggerManager.prototype.initializeTarget):
612         (WI.DebuggerManager.prototype.get allMicrotasksBreakpoint): ADded.
613         (WI.DebuggerManager.prototype.isBreakpointSpecial):
614         (WI.DebuggerManager.prototype._pauseReasonFromPayload):
615         (WI.DebuggerManager.prototype._breakpointDisabledStateDidChange):
616
617         * UserInterface/Views/DebuggerSidebarPanel.js:
618         (WI.DebuggerSidebarPanel):
619         (WI.DebuggerSidebarPanel.prototype.saveStateToCookie):
620         (WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
621         (WI.DebuggerSidebarPanel.prototype._addBreakpoint):
622         (WI.DebuggerSidebarPanel.prototype._addTreeElement):
623         (WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
624         (WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
625         (WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu):
626         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
627         (WI.SourcesNavigationSidebarPanel):
628         (WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
629         (WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
630         (WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
631         (WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
632         (WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
633
634         * UserInterface/Views/BreakpointTreeElement.css:
635         (.breakpoint-microtask-icon .icon): Added.
636         * UserInterface/Images/Microtask.svg: Added.
637
638         * UserInterface/Base/Setting.js:
639         * Localizations/en.lproj/localizedStrings.js:
640
641 2019-08-19  Devin Rousso  <drousso@apple.com>
642
643         Web Inspector: REGRESSION(r248682): Elements: Computed: go-to arrows in the Variables section are misaligned
644         https://bugs.webkit.org/show_bug.cgi?id=200841
645
646         Reviewed by Joseph Pecoraro.
647
648         The Variables section uses a different CSS class since it's identifier changed in r248682.
649
650         * UserInterface/Views/ComputedStyleDetailsPanel.css:
651         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables)): Added.
652         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property): Added.
653         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property .go-to-arrow): Added.
654         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property:not(:hover) .go-to-arrow): Added.
655         (.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties): Deleted.
656         (.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property .go-to-arrow): Deleted.
657         (.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property:hover .go-to-arrow): Deleted.
658
659 2019-08-19  Devin Rousso  <drousso@apple.com>
660
661         Web Inspector: have more aggressive checks for dataURLs provided to `console.screenshot`
662         https://bugs.webkit.org/show_bug.cgi?id=200747
663
664         Reviewed by Joseph Pecoraro.
665
666         Always send any /data:*+/ strings to the frontend and have it render there. If that doesn't
667         work, have the frontend "spoof" an error message look and feel.
668
669         * UserInterface/Views/ConsoleMessageView.js:
670         (WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
671
672         * Localizations/en.lproj/localizedStrings.js:
673
674 2019-08-19  Nikita Vasilyev  <nvasilyev@apple.com>
675
676         Web Inspector: RTL: Network headers values should be preserved
677         https://bugs.webkit.org/show_bug.cgi?id=200873
678
679         Reviewed by Joseph Pecoraro.
680
681         Replace spans with bdi elements, which have `unicode-bidi: isolate` User Agent style.
682         This works well with both LTR and RTL values.
683
684         * UserInterface/Views/ResourceDetailsSection.js:
685         (WI.ResourceDetailsSection.prototype.appendKeyValuePair):
686         Drive-by: remove unnecessary if/else statement and use `append` instead.
687
688 2019-08-19  Devin Rousso  <drousso@apple.com>
689
690         Web Inspector: REGRESSION: Debugger: pressing delete when the all/uncaught exceptions breakpoint is selected should select the next tree element
691         https://bugs.webkit.org/show_bug.cgi?id=200876
692
693         Reviewed by Joseph Pecoraro.
694
695         Removing the `return true;` from the various `WI.TreeElement` breakpoint classes allows the
696         owner `WI.TreeOutline` to also handle the delete event. In the Debugger/Sources navigation
697         sidebar, the owner `WI.TreeOutline` checks to see if the currently selected `WI.TreeElement`
698         is one of the "top" items ("All Exceptions", "Uncaught Exceptions", "Assertion Failures")
699         and if so, select the next tree element (if able) instead of the previous one.
700
701         This is a preferred experience because the "top" items can only be disabled, not deleted, so
702         trying to delete them wouldn't actually change the selection. They should only ever be
703         selected if there's nothing else that can be selected.
704
705         * UserInterface/Views/DebuggerSidebarPanel.js:
706         (WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
707         (WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement.checkIfSelectionAdjustmentNeeded): Added.
708         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
709         (WI.SourcesNavigationSidebarPanel):
710         (WI.SourcesNavigationSidebarPanel.checkIfSelectionAdjustmentNeeded): Added.
711
712         * UserInterface/Views/BreakpointTreeElement.js:
713         (WI.BreakpointTreeElement.prototype.ondelete):
714         * UserInterface/Views/DOMBreakpointTreeElement.js:
715         (WI.DOMBreakpointTreeElement.prototype.ondelete):
716         * UserInterface/Views/DOMNodeTreeElement.js:
717         (WI.DOMNodeTreeElement.prototype.ondelete):
718         * UserInterface/Views/EventBreakpointTreeElement.js:
719         (WI.EventBreakpointTreeElement.prototype.ondelete):
720         * UserInterface/Views/URLBreakpointTreeElement.js:
721         (WI.URLBreakpointTreeElement.prototype.ondelete):
722
723 2019-08-19  Devin Rousso  <drousso@apple.com>
724
725         Web Inspector: Debugger: don't show the All Requests breakpoint by default
726         https://bugs.webkit.org/show_bug.cgi?id=200892
727
728         Reviewed by Joseph Pecoraro.
729
730         * UserInterface/Base/Setting.js:
731
732 2019-08-17  Devin Rousso  <drousso@apple.com>
733
734         Web Inspector: Sources: gear icons moves to 2nd line when sidebar is narrow
735         https://bugs.webkit.org/show_bug.cgi?id=198017
736
737         Reviewed by Joseph Pecoraro.
738
739         * UserInterface/Views/NavigationBar.js:
740         (WI.NavigationBar):
741         (WI.NavigationBar.prototype.layout):
742         (WI.NavigationBar.prototype.layout.forceItemHidden): Added.
743         (WI.NavigationBar.prototype.layout.isDivider): Added.
744         (WI.NavigationBar.prototype.layout.calculateVisibleItemWidth): Added.
745         (WI.NavigationBar.prototype.needsLayout): Deleted.
746         (WI.NavigationBar.prototype.sizeDidChange): Deleted.
747         (WI.NavigationBar.prototype._updateContent): Deleted.
748         (WI.NavigationBar.prototype._updateContent.forceItemHidden): Deleted.
749         (WI.NavigationBar.prototype._updateContent.isDivider): Deleted.
750         (WI.NavigationBar.prototype._updateContent.calculateVisibleItemWidth): Deleted.
751         Reset the cached `_minimumWidth` whenever updating in `layout()`.
752
753         * UserInterface/Views/NavigationItem.js:
754         (WI.NavigationItem.prototype.get width):
755         (WI.NavigationItem.prototype.update): Added.
756         (WI.NavigationItem.prototype.updateLayout): Deleted.
757         (WI.NavigationItem.prototype.get totalMargin): Added.
758         * UserInterface/Views/ButtonNavigationItem.js:
759         (WI.ButtonNavigationItem.prototype.get totalMargin): Added.
760         * UserInterface/Views/ButtonNavigationItem.css:
761         * UserInterface/Views/TextNavigationItem.js:
762         (WI.TextNavigationItem.prototype.get totalMargin): Added.
763         * UserInterface/Views/TextNavigationItem.css:
764         `Element.prototype.getBoundingClientRect` doesn't include the `margin` box of an element.
765         Rather than create a CSS variable and parse a computed style, save the total `margin` amount
766         to a getter that can then be added when computing the minimum width.
767
768         * UserInterface/Views/Sidebar.js:
769         (WI.Sidebar):
770         (WI.Sidebar.prototype._recalculateWidth):
771         * UserInterface/Views/FlexibleSpaceNavigationItem.js:
772         (WI.FlexibleSpaceNavigationItem.prototype.update): Added.
773         (WI.FlexibleSpaceNavigationItem.prototype.updateLayout): Deleted.
774         * UserInterface/Views/GroupNavigationItem.js:
775         (WI.GroupNavigationItem.prototype.update): Added.
776         (WI.GroupNavigationItem.prototype.updateLayout): Deleted.
777         * UserInterface/Views/HierarchicalPathNavigationItem.js:
778         (WI.HierarchicalPathNavigationItem.prototype.update): Added.
779         (WI.HierarchicalPathNavigationItem.prototype.updateLayout): Deleted.
780         * UserInterface/Views/RadioButtonNavigationItem.js:
781         (WI.RadioButtonNavigationItem.prototype.update): Added.
782         (WI.RadioButtonNavigationItem.prototype.updateLayout): Deleted.
783         Rename `updateLayout` to `update` so it doesn't clash with `WI.View` naming.
784
785         * UserInterface/Views/SidebarNavigationBar.js: Removed.
786         * UserInterface/Main.html:
787         * UserInterface/Views/NavigationBar.css:
788         (.navigation-bar .item): Added.
789         (.navigation-bar .item, .sidebar-navigation-bar > .holder .item): Deleted.
790         (.sidebar-navigation-bar): Deleted.
791         (.sidebar-navigation-bar .holder): Deleted.
792         Remove unnecessary class.
793
794 2019-08-16  Joseph Pecoraro  <pecoraro@apple.com>
795
796         Web Inspector: Syntax Highlight more CSS media queries
797         https://bugs.webkit.org/show_bug.cgi?id=200824
798
799         Reviewed by Devin Rousso.
800
801         * UserInterface/Views/CodeMirrorAdditions.js:
802         Special case CSS "error" tokenized values from CodeMirror inside @ rules
803         to treat some as properties.
804
805 2019-08-16  Joseph Pecoraro  <pecoraro@apple.com>
806
807         Web Inspector: JavaScript formatting of single statement arrow function can be poor
808         https://bugs.webkit.org/show_bug.cgi?id=200800
809
810         Reviewed by Ross Kirsling.
811
812         * UserInterface/Workers/Formatter/EsprimaFormatter.js:
813         (EsprimaFormatter.prototype._isLikelyToHaveNewline):
814         (EsprimaFormatter.prototype._handleTokenAtNode):
815         Better heuristic for single statement arrow functions.
816
817 2019-08-16  Devin Rousso  <drousso@apple.com>
818
819         Web Inspector: there should be an opposite icon for Eye.svg when we want to hide things instead of showing them
820         https://bugs.webkit.org/show_bug.cgi?id=200736
821
822         Reviewed by Joseph Pecoraro.
823
824         We currently use Eye.svg for disabling, or turning "off", Shader Programs, but it's not very
825         clear that clicking on the eye (which looks like "show me this", not "hide this") will do
826         that. Furthermore, a greyed out version also isn't clear that the Shader Program is disabled,
827         instead making the user think that the disable toggle is somehow "not working".
828
829         The new hide icon is clearer, as it uses a strikethrough, rather than some shading/greying.
830
831         * UserInterface/Views/ShaderProgramTreeElement.css:
832         (.item.shader-program .status > img):
833         (.item.shader-program.disabled:matches:hover .status > img): Added.
834         (.item.shader-program.disabled > :not(.status)): Added.
835         (.item.shader-program.disabled > *): Deleted.
836         * UserInterface/Images/Hide.svg: Added.
837
838         * UserInterface/Views/ObjectTreePropertyTreeElement.css:
839         (.object-tree-property .getter):
840         * UserInterface/Images/Show.svg: Renamed from UserInterface/Images/Eye.svg.
841
842 2019-08-16  Devin Rousso  <drousso@apple.com>
843
844         Web Inspector: rename "Invalid Characters" to "Invisible Characters" for clarity
845         https://bugs.webkit.org/show_bug.cgi?id=200808
846
847         Reviewed by Joseph Pecoraro.
848
849         * UserInterface/Base/Setting.js:
850         * UserInterface/Views/SettingsTabContentView.js:
851         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
852
853         * UserInterface/Base/Main.js:
854         (setInvisibleCharacterClassName): Added.
855         (setInvalidCharacterClassName): Deleted.
856         * UserInterface/Views/CodeMirrorOverrides.css:
857         (.show-invisible-characters .CodeMirror .cm-invalidchar): Added.
858         (.show-invalid-characters .CodeMirror .cm-invalidchar): Deleted.
859
860         * Localizations/en.lproj/localizedStrings.js:
861
862 2019-08-16  Nikita Vasilyev  <nvasilyev@apple.com>
863
864         Web Inspector: RTL: Console should be always LTR
865         https://bugs.webkit.org/show_bug.cgi?id=200482
866
867         Reviewed by Joseph Pecoraro.
868
869         * UserInterface/Views/ConsoleCommandView.js:
870         (WI.ConsoleCommandView.prototype.render):
871         * UserInterface/Views/ConsoleMessageView.css:
872         * UserInterface/Views/ConsoleMessageView.js:
873         (WI.ConsoleMessageView.prototype.render):
874         Make console messages always LTR.
875
876         * UserInterface/Views/LogContentView.js:
877         (WI.LogContentView.prototype._keyDown):
878         Since the console is always LTR now, we can remove code that flips left and right
879         arrow keys.
880
881         * UserInterface/Views/ObjectTreeView.css:
882         JS objects should always be LTR.
883
884         * UserInterface/Views/TreeElement.js:
885         Look at "direction" CSS property because Element's text direction can be LTR even
886         when `WI.resolvedLayoutDirection()` is RTL.
887
888         (WI.TreeElement.prototype.isEventWithinDisclosureTriangle):
889         * UserInterface/Views/TreeOutline.css:
890         (body[dir=ltr] .tree-outline .item :matches(.disclosure-button, .icon),):
891         (body[dir=rtl] [dir=ltr] .tree-outline .item .disclosure-button):
892
893 2019-08-16  Devin Rousso  <drousso@apple.com>
894
895         Web Inspector: Elements: setting a breakpoint on a specific listener should enable the event listener
896         https://bugs.webkit.org/show_bug.cgi?id=200551
897
898         Reviewed by Joseph Pecoraro.
899
900         * UserInterface/Views/EventListenerSectionGroup.js:
901         (WI.EventListenerSectionGroup):
902
903 2019-08-15  Joseph Pecoraro  <pecoraro@apple.com>
904
905         Web Inspector: Update Esprima to support modern JavaScript language features
906         https://bugs.webkit.org/show_bug.cgi?id=200796
907
908         Reviewed by Ross Kirsling.
909
910         Use a fork of Esprima to support modern JavaScript language features
911         while going through the process to upstream support:
912
913           ES2018 Feature: Async Iteration (for-await-of)
914           https://github.com/jquery/esprima/issues/1990
915
916           ES2019 Feature: Numeric Separator
917           https://github.com/jquery/esprima/issues/1989
918
919           ES2019 Feature: Optional catch binding
920           https://github.com/jquery/esprima/issues/1953
921
922           ES2020 Feature: BigInt
923           https://github.com/jquery/esprima/issues/1988
924
925         ESTree compatible AST changes are summarized as:
926
927           - CatchClause `param` property is now nullable
928           - ForOfStatement now has a boolean `await` property
929           - Literal can be a `"bigint"` type (works if the environment has BigInt or not)
930
931         The pretty printer only needed to have additional handling for `for-await-of`.
932
933         * UserInterface/External/Esprima/esprima.js:
934         New version. Typescript output expects a modern JavaScript environment
935         instead of just ES6.
936
937         * Tools/Formatting/index.html:
938         Update the formatting tool for easier use in case of errors.
939
940         * UserInterface/Models/ScriptSyntaxTree.js:
941         (WI.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
942
943         * UserInterface/Test/TestHarness.js:
944         (TestHarness.prototype.passOrFail):
945         Convenience for pass/fail with the same message based on a condition.
946
947         * UserInterface/Workers/Formatter/EsprimaFormatter.js:
948         (EsprimaFormatter.prototype._handleTokenAtNode):
949         Ensure a space after `await` in `for await` syntax.
950
951 2019-08-15  Devin Rousso  <drousso@apple.com>
952
953         Web Inspector: REGRESSION(r244268): "Show Scope Chain on pause" setting has no effect
954         https://bugs.webkit.org/show_bug.cgi?id=200797
955
956         Reviewed by Joseph Pecoraro.
957
958         * UserInterface/Views/DebuggerTabContentView.js:
959         (WI.DebuggerTabContentView.prototype.showDetailsSidebarPanels):
960         * UserInterface/Views/SourcesTabContentView.js:
961         (WI.SourcesTabContentView.prototype.showDetailsSidebarPanels):
962         When the sidebar panel isn't visible `parentSidebar` is `null`. Use `WI.DetailsSidebar` instead.
963
964 2019-08-15  Devin Rousso  <drousso@apple.com>
965
966         Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'this._resource.initiatorSourceCodeLocation')
967         https://bugs.webkit.org/show_bug.cgi?id=200798
968
969         Reviewed by Joseph Pecoraro.
970
971         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
972         (WI.ResourceDetailsSidebarPanel.prototype.set resource):
973         (WI.ResourceDetailsSidebarPanel.prototype.layout):
974         Cancel the `Throttler` whenever the `_resource` is updated, as otherwise the `Throttler` may
975         fire later on with an unset `_resource`.
976
977 2019-08-15  Devin Rousso  <drousso@apple.com>
978
979         Web Inspector: Sources: provide a way to create an arbitrary Inspector Style Sheet
980         https://bugs.webkit.org/show_bug.cgi?id=200425
981
982         Reviewed by Joseph Pecoraro.
983
984         Right now, the only way to create an Inspector Style Sheet is by creating a new rule in the
985         Styles sidebar of the Elements Tab. This is unnecessarily restrictive, especially for those
986         who don't use the Elements tab.
987
988         Add a + button after the filter bar in the Navigation sidebar. Clicking on the + button will
989         show a menu with the following (more likely to be added later):
990          - Inspector Style Sheet
991          - Frames (if there are subframes)
992            - (name of subframe)
993               - Inspector Style Sheet
994
995         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
996         (WI.SourcesNavigationSidebarPanel):
997         (WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject): Added.
998         (WI.SourcesNavigationSidebarPanel.prototype._filterByResourcesWithIssues): Added.
999         (WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
1000         (WI.SourcesNavigationSidebarPanel.prototype._updateMainFrameTreeElement):
1001         (WI.SourcesNavigationSidebarPanel.prototype._addResource):
1002         (WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
1003         (WI.SourcesNavigationSidebarPanel.prototype._populateCreateResourceContextMenu): Added.
1004         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
1005         (WI.SourcesNavigationSidebarPanel.prototype._handleFrameWasAdded): Added.
1006         (WI.SourcesNavigationSidebarPanel.prototype._handleMainFrameDidChange): Deleted.
1007         * UserInterface/Views/GeneralTreeElement.js:
1008         (WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath):
1009         Drive-by: sort `WI.ResourceTreeElement`s alongside `WI.FolderTreeElement`s for easier readability.
1010
1011         * UserInterface/Views/FrameTreeElement.js:
1012         (WI.FrameTreeElement.prototype.onpopulate):
1013         Add all `inspectorStyleSheetsForFrame` instead of just the preferred one so that they all
1014         are visible/selectable for editing.
1015
1016         * UserInterface/Views/FilterBar.js:
1017         (WI.FilterBar):
1018         * UserInterface/Views/FilterBar.css:
1019         (.filter-bar > .navigation-bar > .item):
1020         (.filter-bar > input[type="search"]):
1021         (.filter-bar > .navigation-bar + input[type="search"]): Added.
1022         (.filter-bar > input[type="search"] + .navigation-bar:empty): Added.
1023         Move the position of the filter bar buttons to be after the filter bar itself, so that other
1024         parents can add action items before the filter bar to keep a consistent positioning.
1025          - to the left of the filter bar are action items (e.g. "+")
1026          - the filter bar itself
1027          - to the right of the filter bar are filter buttons (e.g. "filter by resoure with issue")
1028
1029         * UserInterface/Controllers/NetworkManager.js:
1030         (WI.NetworkManager.prototype.get frames):
1031         Drive-by: use `Array.from`, instead of `[...map.values()]`.
1032
1033         * UserInterface/Models/Frame.js:
1034         (WI.Frame.prototype.get url):
1035         (WI.Frame.prototype.get urlComponents): Added.
1036
1037         * UserInterface/Base/URLUtilities.js.js:
1038         (parseURL):
1039         Calculate and include the `origin` string with the output.
1040
1041         * UserInterface/Controllers/CSSManager.js:
1042         (WI.CSSManager.prototype.preferredInspectorStyleSheetForFrame):
1043         Remove `doNotCreateIfMissing` now that the last caller has been removed.
1044
1045         * Localizations/en.lproj/localizedStrings.js:
1046
1047 2019-08-15  Devin Rousso  <drousso@apple.com>
1048
1049         Web Inspector: CodeMirror still inserts a tab even when "Prefer indent using" is set to "Spaces"
1050         https://bugs.webkit.org/show_bug.cgi?id=200770
1051
1052         Reviewed by Ross Kirsling.
1053
1054         * UserInterface/Views/CodeMirrorAdditions.js:
1055         Remap the `insertTab` command to use `insertSoftTab` when "Prefer indent using" is set to
1056         "Spaces" so that CodeMirror inserts the number of spaces that would match a tab ("\t") being
1057         inserted at the same spot.
1058
1059 2019-08-15  Devin Rousso  <drousso@apple.com>
1060
1061         Web Inspector: Sources: the "No Filter Results" message sits on top of all of the content, preventing any interaction
1062         https://bugs.webkit.org/show_bug.cgi?id=200755
1063
1064         Reviewed by Joseph Pecoraro.
1065
1066         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1067         (WI.SourcesNavigationSidebarPanel):
1068         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
1069         (.sidebar > .panel.navigation.sources > .content > .resources-container): Added.
1070         (@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container)): Added.
1071         (@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .call-stack-container):
1072         (@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .breakpoints-container):
1073         (@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .resources-container): Added.
1074         (@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources)): Deleted.
1075         (@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .resources): Deleted.
1076         Wrap the resources `WI.TreeOutline` in a <div> so the empty message placeholder that gets
1077         inserted after it can be constrained to the size of the `WI.TreeOutline`.
1078
1079 2019-08-15  Devin Rousso  <drousso@apple.com>
1080
1081         Web Inspector: Layers: background of 3D area doesn't update when transitioning to/from Dark mode
1082         https://bugs.webkit.org/show_bug.cgi?id=200775
1083
1084         Reviewed by Ross Kirsling.
1085
1086         * UserInterface/Views/Layers3DContentView.js:
1087         (WI.Layers3DContentView.prototype.initialLayout):
1088         Add a `matchMedia` listener for `(prefers-color-scheme: dark)` and update the clear color
1089         of the WebGL renderer whenever it changes.
1090
1091         * UserInterface/Views/ErrorObjectView.css:
1092         (@media (prefers-color-scheme: dark)): Added.
1093         (@media (prefers-dark-interface)): Deleted.
1094         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
1095         (@media (prefers-color-scheme: dark)): Added.
1096         (@media (prefers-dark-interface)): Deleted.
1097         Drive-by: replace older `prefers-dark-interface` with modern `prefers-color-scheme: dark`.
1098
1099 2019-08-15  Joseph Pecoraro  <pecoraro@apple.com>
1100
1101         Web Inspector: Update Esprima to trunk (minor fixes)
1102         https://bugs.webkit.org/show_bug.cgi?id=200691
1103         <rdar://problem/54276170>
1104
1105         Rubber-stamped by Devin Rousso.
1106
1107         * UserInterface/External/Esprima/esprima.js:
1108         Updated to jquery/esprima@5e55171feb5adbc2b1d28ef4b2628d5ea9af0848.
1109
1110         * UserInterface/Models/ScriptSyntaxTree.js:
1111         (WI.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration.gatherIdentifiers):
1112         (WI.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration):
1113         (WI.ScriptSyntaxTree.prototype._recurse):
1114         (WI.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
1115         (WI.ScriptSyntaxTree):
1116         * UserInterface/Workers/Formatter/ESTreeWalker.js:
1117         (ESTreeWalker.prototype._walkChildren):
1118         (ESTreeWalker):
1119         * UserInterface/Workers/Formatter/EsprimaFormatter.js:
1120         (EsprimaFormatter.prototype._handleTokenAtNode):
1121         - SpreadProperty => SpreadElement.
1122         - RestProperty => RestElement.
1123
1124 2019-08-15  Devin Rousso  <drousso@apple.com>
1125
1126         Web Inspector: Uncaught Exception: Content request failed.
1127         https://bugs.webkit.org/show_bug.cgi?id=200704
1128         <rdar://problem/54279372>
1129
1130         Reviewed by Brian Burg.
1131
1132         * UserInterface/Models/WebSocketResource.js:
1133         (WI.WebSocketResource.prototype.requestContentFromBackend): Added.
1134         Add an "assert not reached", as WebSocket resources don't really have "content", instead
1135         having a list of send/receive frames.
1136
1137         * UserInterface/Views/ResourceClusterContentView.js:
1138         (WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
1139         Don't attempt to request the content of any `WI.WebSocketResource` for the reason above.
1140
1141 2019-08-14  Devin Rousso  <drousso@apple.com>
1142
1143         Web Inspector: Elements: Computed: move the Box Model section to the top
1144         https://bugs.webkit.org/show_bug.cgi?id=200555
1145
1146         Reviewed by Joseph Pecoraro.
1147
1148         For nodes that use a lot of different CSS properties, having the Box Model section all the
1149         way at the bottom isn't as useful for taking a quick glance at the node's box model data.
1150
1151         * UserInterface/Views/ComputedStyleDetailsPanel.js:
1152         (WI.ComputedStyleDetailsPanel.prototype.initialLayout):
1153
1154 2019-08-14  Devin Rousso  <drousso@apple.com>
1155
1156         Web Inspector: Elements: Computed: the collapsed state of the Variables section should be separate from the collapsed state of the Properties section
1157         https://bugs.webkit.org/show_bug.cgi?id=200725
1158
1159         Reviewed by Joseph Pecoraro.
1160
1161         * UserInterface/Views/ComputedStyleDetailsPanel.js:
1162         (WI.ComputedStyleDetailsPanel.prototype.initialLayout):
1163         Use a different identifier string for the Variable section so it preserves its own collapsed
1164         collapsed state independent of the Properties section.
1165
1166 2019-08-14  Devin Rousso  <drousso@apple.com>
1167
1168         Web Inspector: Elements: Computed: the background of the Properties/Variables sections should match the Box Model section when expanded
1169         https://bugs.webkit.org/show_bug.cgi?id=200724
1170
1171         Reviewed by Joseph Pecoraro.
1172
1173         * UserInterface/Views/ComputedStyleDetailsPanel.css:
1174         (.sidebar > .panel.details.css-style > .content > .computed > .details-section:not(.collapsed) > :matches(.header, .content)): Added.
1175         (.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties): Added.
1176         (.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property .go-to-arrow): Added.
1177         (.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property:hover .go-to-arrow): Added.
1178         (.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) > .content): Added.
1179         (.details-section:matches(.computed-style-properties, .computed-style-box-model):not(.collapsed) > :matches(.header, .content)): Deleted.
1180         (.computed-style-properties): Deleted.
1181         (.computed-style-properties .property .go-to-arrow): Deleted.
1182         (.computed-style-properties .property:hover .go-to-arrow): Deleted.
1183         (.details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)): Deleted.
1184         (.details-section.computed-style-properties > .content): Deleted.
1185         (@media (prefers-color-scheme: dark)): Deleted.
1186         Use more specific selectors to match overall Web Inspector style.
1187
1188         * UserInterface/Views/ComputedStyleSection.css:
1189         (.computed-style-section .computed-property-item.expanded):
1190         Darken the background of any expanded computed property in light mode.
1191
1192 2019-08-13  Joseph Pecoraro  <pecoraro@apple.com>
1193
1194         Uncaught Exception: content.isJSON is not a function selecting image resource
1195         https://bugs.webkit.org/show_bug.cgi?id=200680
1196
1197         Reviewed by Devin Rousso.
1198
1199         * UserInterface/Views/ResourceClusterContentView.js:
1200         (WI.ResourceClusterContentView.prototype._canUseJSONContentViewForContent):
1201         Protect against non-string data, such as Blob response content.
1202
1203 2019-08-13  Devin Rousso  <drousso@apple.com>
1204
1205         Web Inspector: Styles: show @supports CSS groupings
1206         https://bugs.webkit.org/show_bug.cgi?id=200419
1207         <rdar://problem/53971948>
1208
1209         Reviewed by Joseph Pecoraro.
1210
1211         * UserInterface/Models/CSSGrouping.js: Renamed from Source/WebInspectorUI/UserInterface/Models/CSSMedia.js.
1212         (WI.CSSGrouping):
1213         (WI.CSSGrouping.prototype.get type):
1214         (WI.CSSGrouping.prototype.get text):
1215         (WI.CSSGrouping.prototype.get sourceCodeLocation):
1216         (WI.CSSGrouping.prototype.get isMedia): Added.
1217         (WI.CSSGrouping.prototype.get isSupports): Added.
1218         (WI.CSSGrouping.prototype.get prefix): Added.
1219
1220         * UserInterface/Models/CSSStyleDeclaration.js:
1221         (WI.CSSStyleDeclaration.prototype.get groupings): Added.
1222         (WI.CSSStyleDeclaration.prototype.generateCSSRuleString):
1223         (WI.CSSStyleDeclaration.prototype.get mediaList): Deleted.
1224
1225         * UserInterface/Models/CSSRule.js:
1226         (WI.CSSRule):
1227         (WI.CSSRule.prototype.get groupings): Added.
1228         (WI.CSSRule.prototype.update):
1229         (WI.CSSRule.prototype._selectorResolved):
1230         (WI.CSSRule.prototype.get mediaList): Deleted.
1231
1232         * UserInterface/Models/DOMNodeStyles.js:
1233         (WI.DOMNodeStyles.prototype._parseRulePayload):
1234         (WI.DOMNodeStyles.prototype.rulesForSelector): Deleted.
1235
1236         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
1237         (WI.SpreadsheetCSSStyleDeclarationSection):
1238         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
1239         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleEditorFilterApplied):
1240         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._createMediaHeader): Deleted.
1241         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
1242         (.spreadsheet-css-declaration :matches(.header, .header-groupings)): Added.
1243         (.spreadsheet-css-declaration :matches(.header, .header-groupings):first-child): Added.
1244         (.spreadsheet-css-declaration .header-groupings > .grouping): Added.
1245         (.spreadsheet-css-declaration :matches(.header, .header-media)): Deleted.
1246         (.spreadsheet-css-declaration :matches(.header, .header-media):first-child): Deleted.
1247         (.spreadsheet-css-declaration .media-label): Deleted.
1248
1249         * UserInterface/Controllers/CSSManager.js:
1250         (WI.CSSManager.protocolGroupingTypeToEnum): Added.
1251         (WI.CSSManager.protocolMediaSourceToEnum): Deleted.
1252
1253         * UserInterface/Main.html:
1254         * UserInterface/Test.html:
1255
1256 2019-08-12  Devin Rousso  <drousso@apple.com>
1257
1258         REGRESSION(r248391): Web Inspector: changing Layout Direction Debug setting no longer adds dir="ltr" to body element
1259         https://bugs.webkit.org/show_bug.cgi?id=200564
1260
1261         Reviewed by Joseph Pecoraro.
1262
1263         `WI.resolvedLayoutDirection` was called before `WI.runBootstrapOperations`, which is what
1264         instantiates `WI.showDebugUISetting`. Without it, `WI.resolvedLayoutDirection` will ignore
1265         the value of `WI.settings.debugLayoutDirection` and instead use the system.
1266
1267         Moving the instantiation of `WI.showDebugUISetting` outside `WI.runBootstrapOperations`
1268         allows the setting to be created when the Bootstrap.js script is loaded, rather than after
1269         the `DOMContentLoaded` event is fired. This means that it's guaranteed to exist before any
1270         interface/view code runs.
1271
1272         * UserInterface/Debug/Bootstrap.js:
1273         (WI.runBootstrapOperations):
1274
1275 2019-08-12  Devin Rousso  <drousso@apple.com>
1276
1277         Web Inspector: remove WI.DeprecatedRemoteObjectProperty
1278         https://bugs.webkit.org/show_bug.cgi?id=200549
1279
1280         Reviewed by Joseph Pecoraro.
1281
1282         * UserInterface/Protocol/RemoteObject.js:
1283         (WI.RemoteObject.prototype.deprecatedGetOwnProperties): Deleted.
1284         (WI.RemoteObject.prototype.deprecatedGetAllProperties): Deleted.
1285         (WI.RemoteObject.prototype.deprecatedGetDisplayableProperties): Deleted.
1286         (WI.RemoteObject.prototype._deprecatedGetProperties): Deleted.
1287         (WI.RemoteObject.prototype._deprecatedGetPropertiesResolver): Deleted.
1288         (WI.DeprecatedRemoteObjectProperty): Deleted.
1289         (WI.DeprecatedRemoteObjectProperty.prototype.fromPrimitiveValue): Deleted.
1290
1291         * UserInterface/Models/CallFrame.js:
1292         (WI.CallFrame.prototype.collectScopeChainVariableNames):
1293
1294         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
1295         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshProperties):
1296
1297 2019-08-12  Devin Rousso  <drousso@apple.com>
1298
1299         Web Inspector: REGRESSION(r248201): DOMDebugger: unable to add event breakpoint when All Events breakpoint is enabled
1300         https://bugs.webkit.org/show_bug.cgi?id=200561
1301
1302         Reviewed by Joseph Pecoraro.
1303
1304         * UserInterface/Controllers/DOMDebuggerManager.js:
1305         (WI.DOMDebuggerManager.prototype.addEventBreakpoint):
1306         (WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
1307
1308 2019-08-12  Devin Rousso  <drousso@apple.com>
1309
1310         Web Inspector: REGRESSION: DOMDebugger: breakpoints are forcibly enabled when resolving DOM breakpoints for newly added nodes
1311         https://bugs.webkit.org/show_bug.cgi?id=200639
1312
1313         Reviewed by Joseph Pecoraro.
1314
1315         Since DOM breakpoints revolve around a given DOM node, we attempt to restore DOM breakpoints
1316         whenever new nodes are added by matching them to the path of the DOM breakpoint. When doing
1317         so, we should be in a "temporarily restoring breakpoints" mode so that we don't forcibly
1318         enable all breakpoints.
1319
1320         * UserInterface/Controllers/DOMDebuggerManager.js:
1321         (WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL):
1322         (WI.DOMDebuggerManager.prototype._nodeInserted):
1323
1324 2019-08-12  Devin Rousso  <drousso@apple.com>
1325
1326         Web Inspector: Elements: Styles: add space between media query and style icon
1327         https://bugs.webkit.org/show_bug.cgi?id=200623
1328
1329         Reviewed by Joseph Pecoraro.
1330
1331         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
1332         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
1333         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
1334         (.spreadsheet-css-declaration .header:not(:first-child), .spreadsheet-css-declaration .header:not(.editing-selector) .selector, .spreadsheet-css-declaration.has-icon .header.editing-selector .selector): Added.
1335         (.spreadsheet-css-declaration .header.editing-selector .selector): Deleted.
1336         Ensure the selector field doesn't shift vertically when entering/exiting editing mode.
1337
1338 2019-08-09  Joseph Pecoraro  <pecoraro@apple.com>
1339
1340         Web Inspector: Address some ESLint warnings
1341         https://bugs.webkit.org/show_bug.cgi?id=200598
1342
1343         Reviewed by Devin Rousso.
1344
1345         * UserInterface/Base/Utilities.js:
1346         * UserInterface/Controllers/TimelineManager.js:
1347         * UserInterface/Models/DOMNodeStyles.js:
1348         * UserInterface/Models/LayoutTimelineRecord.js:
1349         * UserInterface/Models/ServerTimingEntry.js:
1350         * UserInterface/Models/TimelineRecording.js:
1351         * UserInterface/Protocol/RemoteObject.js:
1352         * UserInterface/Test/FrontendTestHarness.js:
1353         * UserInterface/Test/Test.js:
1354         * UserInterface/Views/CPUTimelineView.js:
1355         * UserInterface/Views/CPUUsageCombinedView.js:
1356         * UserInterface/Views/ChangesDetailsSidebarPanel.js:
1357         * UserInterface/Views/DOMTreeContentView.js:
1358         * UserInterface/Views/DOMTreeElement.js:
1359         * UserInterface/Views/DebuggerSidebarPanel.js:
1360         * UserInterface/Views/NetworkTableContentView.js:
1361         * UserInterface/Views/ResourceTimingBreakdownView.js:
1362         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
1363         * UserInterface/Views/TreeOutline.js:
1364
1365 2019-08-09  Joseph Pecoraro  <pecoraro@apple.com>
1366
1367         Web Inspector: Better organize manager / observer API groups
1368         https://bugs.webkit.org/show_bug.cgi?id=200594
1369
1370         Reviewed by Devin Rousso.
1371
1372         * UserInterface/Controllers/DebuggerManager.js:
1373         (WI.DebuggerManager.prototype.globalObjectCleared):
1374         (WI.DebuggerManager.prototype.reset): Deleted.
1375         Renamed.
1376
1377         * UserInterface/Protocol/DebuggerObserver.js:
1378         (WI.DebuggerObserver.prototype.globalObjectCleared):
1379
1380         * UserInterface/Controllers/CSSManager.js:
1381         * UserInterface/Controllers/CanvasManager.js:
1382         * UserInterface/Controllers/ConsoleManager.js:
1383         * UserInterface/Controllers/DOMManager.js:
1384         * UserInterface/Controllers/DOMStorageManager.js:
1385         * UserInterface/Controllers/LayerTreeManager.js:
1386         * UserInterface/Controllers/NetworkManager.js:
1387         * UserInterface/Controllers/TargetManager.js:
1388         * UserInterface/Controllers/TimelineManager.js:
1389         * UserInterface/Controllers/WorkerManager.js:
1390
1391 2019-08-10  Devin Rousso  <drousso@apple.com>
1392
1393         Web Inspector: REGRESSION(r248454): WK1 inspector frontend client doesn't queue messages to the frontend before it's loaded
1394         https://bugs.webkit.org/show_bug.cgi?id=200587
1395
1396         Reviewed by Joseph Pecoraro.
1397
1398         WK1 inspector sends messages to the frontend using `WebCore::InspectorClient::doDispatchMessageOnFrontendPage`,
1399         which does not do any sort of queueing to wait until the frontend is loaded (`InspectorFrontendHost.loaded()`).
1400
1401         Now that we are sending messages immediately, we should always queue.
1402
1403         * UserInterface/Test/TestStub.js:
1404         (InspectorFrontendAPI.dispatch): Added.
1405
1406         * UserInterface/Models/Frame.js:
1407         (WI.Frame.prototype.markDOMContentReadyEvent):
1408         (WI.Frame.prototype.markLoadEvent):
1409
1410         * UserInterface/Controllers/TimelineManager.js:
1411         (WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
1412         (WI.TimelineManager.prototype.pageLoadEventFired):
1413
1414 2019-08-09  Joseph Pecoraro  <pecoraro@apple.com>
1415
1416         Web Inspector: Node details sidebar sections have unclear delineation in Dark Mode
1417         https://bugs.webkit.org/show_bug.cgi?id=200603
1418         <rdar://problem/54146925>
1419
1420         Reviewed by Devin Rousso.
1421
1422         * UserInterface/Views/DetailsSection.css:
1423         (@media (prefers-color-scheme: dark)):
1424         (.details-section .details-section,):
1425         Give a details section header a different color than a normal sidebar header.
1426
1427 2019-08-09  Devin Rousso  <drousso@apple.com>
1428
1429         Web Inspector: REGRESSION(r248480): Sources: the Pause Reason section takes the entire vertical space when there are few breakpoints/resources
1430         https://bugs.webkit.org/show_bug.cgi?id=200597
1431
1432         Reviewed by Joseph Pecoraro.
1433
1434         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
1435         (@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .pause-reason-container): Deleted.
1436         Don't `flex-grow` or `flex-shrink` the Pause Reason section so it always displays its full
1437         content. The rest of the sections can grow/shrink as needed.
1438
1439 2019-08-09  Devin Rousso  <drousso@apple.com>
1440
1441         REGRESSION (Safari 6): Web Inspector: JSON may not be pretty printed if served as text/html
1442         https://bugs.webkit.org/show_bug.cgi?id=122898
1443         <rdar://problem/15241419>
1444
1445         Reviewed by Joseph Pecoraro.
1446
1447         Check the request/response data to see if it's JSON parsable. If so, allow the user to elect
1448         to view the request/response as a JSON preview instead of raw (or pretty printed) text.
1449
1450         Prefer the JSON view wherever possible.
1451
1452         * UserInterface/Views/ResourceClusterContentView.js:
1453         (WI.ResourceClusterContentView):
1454         (WI.ResourceClusterContentView.prototype.get requestContentView):
1455         (WI.ResourceClusterContentView.prototype.get customRequestContentView): Added.
1456         (WI.ResourceClusterContentView.prototype.get customResponseContentView):
1457         (WI.ResourceClusterContentView.prototype.get selectionPathComponents):
1458         (WI.ResourceClusterContentView.prototype.showRequest):
1459         (WI.ResourceClusterContentView.prototype._canShowCustomRequestContentView): Added.
1460         (WI.ResourceClusterContentView.prototype._canShowCustomResponseContentView):
1461         (WI.ResourceClusterContentView.prototype._contentViewForResourceType):
1462         (WI.ResourceClusterContentView.prototype._pathComponentForContentView):
1463         (WI.ResourceClusterContentView.prototype._identifierForContentView):
1464         (WI.ResourceClusterContentView.prototype._showContentViewForIdentifier):
1465         (WI.ResourceClusterContentView.prototype._canUseJSONContentViewForContent): Added.
1466         (WI.ResourceClusterContentView.prototype._tryEnableCustomRequestContentView): Added.
1467         (WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
1468         (WI.ResourceClusterContentView.prototype.saveToCookie): Deleted.
1469         (WI.ResourceClusterContentView.prototype._customContentViewConstructorForResource): Deleted.
1470         Since the current view is already saved in a `WI.Setting`, there's no need to save that
1471         state to a cookie, as it'll be restored elsewhere.
1472
1473         * UserInterface/Base/Main.js:
1474         (WI.showResourceRequest):
1475
1476         * UserInterface/Main.html:
1477         * UserInterface/Views/JSONContentView.js: Added.
1478         (WI.JSONContentView):
1479         (WI.JSONContentView.prototype.initialLayout):
1480         (WI.JSONContentView.prototype.attached):
1481         (WI.JSONContentView.prototype.closed):
1482         * UserInterface/Views/JSONContentView.css: Added.
1483         (.content-view.json):
1484         * Source/WebInspectorUI/UserInterface/Views/JSONResourceContentView.js: Deleted.
1485         * Source/WebInspectorUI/UserInterface/Views/JSONResourceContentView.css: Deleted.
1486         Create a more generic content view that shows a preview for the given JSON parsable string.
1487
1488         * UserInterface/Base/Utilities.js:
1489         (String.prototype.isJSON): Added.
1490         * UserInterface/Views/WebSocketDataGridNode.js:
1491         (WI.WebSocketDataGridNode.prototype.appendContextMenuItems):
1492         Utility function for checking if a string is JSON parsable.
1493
1494         * Localizations/en.lproj/localizedStrings.js:
1495
1496 2019-08-09  Devin Rousso  <drousso@apple.com>
1497
1498         Web Inspector: Sources: increase the vertical space allocated to the call stack when paused
1499         https://bugs.webkit.org/show_bug.cgi?id=200236
1500
1501         Reviewed by Joseph Pecoraro.
1502
1503         Rather than uniformly constrict the height of the Call Stack and Breakpoints sections, they
1504         should "flex" based on their importance, which can likely be derived from the current state.
1505         This way, it's possible to see information from each section at the same time, but still
1506         have enough space in each section to be able to do something useful.
1507
1508         When paused, the most useful data is the call stack, so give the Call Stack section the most
1509         vertical space (the Pause Reason is also important, but it usually needs very little space).
1510
1511         When not paused, it's likely that the user cares more about the resources with breakpoints
1512         than those without, so favor the Breakpoints section.
1513
1514         Each section will only expand to fit it's maximum content height.
1515
1516         If the inspector window becomes too short, remove the "flex" entirely and have all the
1517         content be part of a single scroll area instead.
1518
1519         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1520         (WI.SourcesNavigationSidebarPanel):
1521         (WI.SourcesNavigationSidebarPanel.prototype.createContentTreeOutline):
1522         (WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
1523         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
1524         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
1525         (WI.SourcesNavigationSidebarPanel.prototype._handleCallStackElementAddedOrRemoved): Deleted.
1526         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
1527         (.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Added.
1528         (.sidebar > .panel.navigation.sources > .content .details-section): Added.
1529         (.sidebar > .panel.navigation.sources > .content .details-section.collapsed > .header > .options, .sidebar > .panel.navigation.sources > .content .details-section:not(.collapsed) > .content, .sidebar > .panel.navigation.sources > .content .details-section:not(.collapsed) > .content > .group): Added.
1530         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container .create-breakpoint): Added.
1531         (.sidebar > .panel.navigation.sources > .content > .navigation-bar): Added.
1532         (@media (min-height: 650px)): Added.
1533         (.sidebar > .panel.navigation.sources > .content > .pause-reason-container): Added.
1534         (.sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources)): Added.
1535         (.sidebar > .panel.navigation.sources > .content > .call-stack-container): Added.
1536         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container): Added.
1537         (.sidebar > .panel.navigation.sources > .content > .resources): Added.
1538         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container .tree-outline .item.event-target-window .icon): Added.
1539         (.sidebar > .panel.navigation.sources > .content > .details-section): Deleted.
1540         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.paused-reason, .breakpoints).collapsed > .header > .options,): Deleted.
1541         (.sidebar > .panel.navigation.sources > .content > .details-section.collapsed > .content): Deleted.
1542         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint): Deleted.
1543         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.pause-reason, .call-stack, .breakpoints) > .content,): Deleted.
1544         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints) > .content): Deleted.
1545         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content): Deleted.
1546         (.sidebar > .panel.navigation.sources > .content > .details-section.call-stack): Deleted.
1547         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints): Deleted.
1548         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .create-breakpoint): Deleted.
1549         (@media (min-height: 600px)): Deleted.
1550         (.sidebar > .panel.navigation.sources > .content > .pause-reason): Deleted.
1551         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content,): Deleted.
1552         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .tree-outline .item.event-target-window .icon): Deleted.
1553         Wrap the Pause Reason, Call Stack, and Breakpoints `WI.DetailsSection`s in a container
1554         element so that the styling of the sticky header doesn't get affected by the clamping of the
1555         container's height.
1556
1557         * UserInterface/Views/DetailsSection.css:
1558         (.details-section):
1559         (.details-section > .header):
1560         Create CSS variables for styles that will be overridden by the Sources navigation sidebar.
1561
1562 2019-08-08  Devin Rousso  <drousso@apple.com>
1563
1564         Web Inspector: Page: don't allow the domain to be disabled
1565         https://bugs.webkit.org/show_bug.cgi?id=200109
1566
1567         Reviewed by Brian Burg.
1568
1569         The `PageAgent` is relied on by many of the other agents, so much so that it doesn't make
1570         sense to support the ability to "disable" (as well as "enable") the agent.
1571
1572         When the first frontend connects, we should treat the `PageAgent` as active and available.
1573
1574         * UserInterface/Controllers/NetworkManager.js:
1575         (WI.NetworkManager.prototype.initializeTarget):
1576
1577         * Test/Test.js:
1578         (WI.loaded):
1579         (WI.initializeBackendTarget):
1580         (WI.contentLoaded):
1581         (WI.targetsAvailable): Added.
1582         (WI.whenTargetsAvailable): Added.
1583         * Test/TestStub.js:
1584         Ensure that the backend always gets notified via `InspectorFrontendHost.loaded` so that
1585         messages being sent to the frontend are batched.
1586
1587 2019-08-08  Devin Rousso  <drousso@apple.com>
1588
1589         Web Inspector: rename `queryObjects` to `queryInstances` for clarity
1590         https://bugs.webkit.org/show_bug.cgi?id=200520
1591
1592         Reviewed by Brian Burg.
1593
1594         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
1595
1596 2019-08-07  Devin Rousso  <drousso@apple.com>
1597
1598         Fix construction of `WI.EventBreakpoint` after r248201
1599
1600         Reviewed by Joseph Pecoraro.
1601
1602         * UserInterface/Controllers/DOMManager.js:
1603         (WI.DOMManager.prototype.setBreakpointForEventListener):
1604
1605 2019-08-07  Devin Rousso  <drousso@apple.com>
1606
1607         Web Inspector: Settings: add an Engineering pane to expose useful settings for other WebKit engineers
1608         https://bugs.webkit.org/show_bug.cgi?id=200492
1609
1610         Reviewed by Joseph Pecoraro.
1611
1612         Other WebKit engineers might find being able to see internal objects or pause in internal
1613         scripts useful, so we should allow them to do so without having to enable Web Inspector's
1614         debug "mode".
1615
1616         A new "Engineering" pane is added to the Settings Tab:
1617          - Debugging
1618             - Show WebKit-internal scripts
1619             - Pause in WebKit-internal scripts
1620          - Heap Snapshot
1621             - Show Internal Objects
1622             - Show Private Symbols
1623
1624         * UserInterface/Base/Setting.js:
1625         * UserInterface/Views/SettingsTabContentView.js:
1626         (WI.SettingsTabContentView.prototype.initialLayout):
1627         (WI.SettingsTabContentView.prototype._createEngineeringSettingsView): Added.
1628         (WI.SettingsTabContentView.prototype._createDebugSettingsView):
1629
1630         * UserInterface/Base/Main.js:
1631         (WI.resolvedLayoutDirection):
1632         (WI.setLayoutDirection):
1633         * UserInterface/Base/Object.js:
1634
1635         * UserInterface/Protocol/InspectorBackend.js:
1636         (InspectorBackendClass):
1637         (InspectorBackendClass.prototype.set dumpInspectorProtocolMessages):
1638         (InspectorBackendClass.prototype.get dumpInspectorProtocolMessages):
1639         (InspectorBackendClass.prototype.set dumpInspectorTimeStats):
1640         (InspectorBackendClass.prototype.get dumpInspectorTimeStats):
1641         (InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages):
1642         (InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages):
1643         * UserInterface/Protocol/RemoteObject.js:
1644         (WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
1645         * UserInterface/Debug/Bootstrap.js:
1646         (WI.runBootstrapOperations):
1647         * UserInterface/Debug/UncaughtExceptionReporter.js:
1648         (handleUncaughtExceptionRecord):
1649         * UserInterface/Models/CSSProperty.js:
1650         (WI.CSSProperty.prototype._updateOwnerStyleText):
1651         * UserInterface/Models/CSSStyleDeclaration.js:
1652         (WI.CSSStyleDeclaration.prototype.update):
1653         * UserInterface/Controllers/DebuggerManager.js:
1654         (WI.DebuggerManager):
1655         (WI.DebuggerManager.prototype.initializeTarget):
1656         (WI.DebuggerManager.prototype.get knownNonResourceScripts):
1657         (WI.DebuggerManager.prototype.debuggerDidPause):
1658         (WI.DebuggerManager.prototype.scriptDidParse):
1659         (WI.DebuggerManager.prototype._handleEngineeringShowInternalScriptsSettingChanged): Added.
1660         (WI.DebuggerManager.prototype._handleEngineeringPauseForInternalScriptsSettingChanged): Added.
1661         (WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange): Deleted.
1662         (WI.DebuggerManager.prototype._debugUIEnabledDidChange): Deleted.
1663         * UserInterface/Views/ConsoleMessageView.js:
1664         (WI.ConsoleMessageView.prototype._appendLocationLink):
1665         * UserInterface/Views/HeapSnapshotDataGridTree.js:
1666         (WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
1667         * UserInterface/Views/OpenResourceDialog.js:
1668         (WI.OpenResourceDialog.prototype._addScriptsForTarget):
1669         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
1670         (WI.SpreadsheetCSSStyleDeclarationEditor):
1671         * UserInterface/Views/StackTraceView.js:
1672         (WI.StackTraceView):
1673         * UserInterface/Views/View.js:
1674         (WI.View.prototype._layoutSubtree):
1675
1676 2019-08-07  Nikita Vasilyev  <nvasilyev@apple.com>
1677
1678         Web Inspector: RTL: content of Variables section should always be LTR
1679         https://bugs.webkit.org/show_bug.cgi?id=200481
1680
1681         Reviewed by Devin Rousso.
1682
1683         * UserInterface/Views/ComputedStyleDetailsPanel.js:
1684         (WI.ComputedStyleDetailsPanel.prototype.initialLayout):
1685
1686 2019-08-07  Devin Rousso  <drousso@apple.com>
1687
1688         Web Inspector: Uncaught Exception: TimelineAgent already enabled
1689         https://bugs.webkit.org/show_bug.cgi?id=200513
1690
1691         Reviewed by Joseph Pecoraro.
1692
1693         Update some incorrect compatibility comments from r248286.
1694
1695         * UserInterface/Protocol/InspectorFrontendAPI.js:
1696         * UserInterface/Controllers/TimelineManager.js:
1697
1698 2019-08-06  Devin Rousso  <drousso@apple.com>
1699
1700         Web Inspector: Show radius values in box model metrics view
1701         https://bugs.webkit.org/show_bug.cgi?id=160993
1702         <rdar://problem/27919035>
1703
1704         Reviewed by Brian Burg.
1705
1706         * UserInterface/Views/BoxModelDetailsSectionRow.js:
1707         (WI.BoxModelDetailsSectionRow.prototype._getPropertyValue): Added.
1708         (WI.BoxModelDetailsSectionRow.prototype._getPropertyValueAsPx):
1709         (WI.BoxModelDetailsSectionRow.prototype._getBox):
1710         (WI.BoxModelDetailsSectionRow.prototype._getComponentPrefix): Added.
1711         (WI.BoxModelDetailsSectionRow.prototype._getComponentSuffix):
1712         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics):
1713         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement):
1714         (WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement):
1715         (WI.BoxModelDetailsSectionRow.prototype._applyUserInput):
1716         (WI.BoxModelDetailsSectionRow.prototype._applyUserInput.inspectedPage_node_toggleInlineStyleProperty):
1717         * UserInterface/Views/BoxModelDetailsSectionRow.css:
1718         (.details-section .row.box-model .box): Added.
1719         (.details-section .row.box-model .box > .label): Added.
1720         (.details-section .row.box-model .box.position): Added.
1721         (.details-section .row.box-model .box.margin): Added.
1722         (.details-section .row.box-model:not(.hovered) .box.margin, .details-section .row.box-model .box.margin.active): Added.
1723         (.details-section .row.box-model .box.border): Added.
1724         (.details-section .row.box-model:not(.hovered) .box.border, .details-section .row.box-model .box.border.active): Added.
1725         (.details-section .row.box-model .box.border > .label): Added.
1726         (.details-section .row.box-model .box.border.has-top-left-radius, .details-section .row.box-model .box.border.has-top-left-radius .box): Added.
1727         (.details-section .row.box-model .box.border.has-top-right-radius, .details-section .row.box-model .box.border.has-top-right-radius .box): Added.
1728         (.details-section .row.box-model .box.border.has-bottom-right-radius, .details-section .row.box-model .box.border.has-bottom-right-radius .box): Added.
1729         (.details-section .row.box-model .box.border.has-bottom-left-radius, .details-section .row.box-model .box.border.has-bottom-left-radius .box): Added.
1730         (.details-section .row.box-model .box.padding): Added.
1731         (.details-section .row.box-model:not(.hovered) .box.padding, .details-section .row.box-model .box.padding.active): Added.
1732         (.details-section .row.box-model .box.content): Added.
1733         (.details-section .row.box-model:not(.hovered) .box.content, .details-section .row.box-model .box.content.active): Added.
1734         (.details-section .row.box-model :matches(.top, .right, .bottom, .left)): Added.
1735         (.details-section .row.box-model :matches(.top, .right, .bottom, .left):not(.editing), .details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
1736         (.details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
1737         (.details-section .row.box-model :matches(.top-left, .top-right)): Added.
1738         (.details-section .row.box-model :matches(.bottom-left, .bottom-right):not(.editing)): Added.
1739         (.details-section .row.box-model :matches(.bottom-left, .bottom-right).editing): Added.
1740         (.details-section .row.box-model :matches(.top-left, .bottom-left):not(.editing)): Added.
1741         (.details-section .row.box-model :matches(.top-left, .bottom-left).editing): Added.
1742         (.details-section .row.box-model :matches(.top-right, .bottom-right):not(.editing)): Added.
1743         (.details-section .row.box-model :matches(.top-right, .bottom-right).editing): Added.
1744         (@media (prefers-color-scheme: dark) .details-section .row.box-model .box): Added.
1745         (@media (prefers-color-scheme: dark) .details-section .row.box-model:not(.hovered) .box:matches(.margin, .border, .padding, .content), .details-section .row.box-model .box.active:matches(.margin, .border, .padding, .content)): Added.
1746         (@media (prefers-color-scheme: dark) .details-section .row.box-model .box.margin): Added.
1747         (@media (prefers-color-scheme: dark) .details-section .row.box-model .box.border): Added.
1748         (.details-section .row.box-model :matches(.position, .margin, .border, .padding, .content)): Deleted.
1749         (.details-section .row.box-model .position): Deleted.
1750         (.details-section .row.box-model .margin): Deleted.
1751         (.details-section .row.box-model:not(.hovered) .margin, .details-section .row.box-model .margin.active): Deleted.
1752         (.details-section .row.box-model .border): Deleted.
1753         (.details-section .row.box-model:not(.hovered) .border, .details-section .row.box-model .border.active): Deleted.
1754         (.details-section .row.box-model .padding): Deleted.
1755         (.details-section .row.box-model:not(.hovered) .padding, .details-section .row.box-model .padding.active): Deleted.
1756         (.details-section .row.box-model .content): Deleted.
1757         (.details-section .row.box-model:not(.hovered) .content, .details-section .row.box-model .content.active): Deleted.
1758         (.details-section .row.box-model :matches(.content span, .top, .right, .bottom, .left)): Deleted.
1759         (.details-section .row.box-model :matches(.right, .left)): Deleted.
1760         (.details-section .row.box-model:not(.hovered) :matches(.margin, .border, .padding, .content), .details-section .row.box-model .active:matches(.margin, .border, .padding, .content)): Deleted.
1761
1762         * UserInterface/Models/CSSProperty.js:
1763         (WI.CSSProperty.prototype.update):
1764         Ensure that the `_value` is updated whenever the `_rawValue` is updated.
1765
1766 2019-08-06  Commit Queue  <commit-queue@webkit.org>
1767
1768         Unreviewed, rolling out r248289.
1769         https://bugs.webkit.org/show_bug.cgi?id=200488
1770
1771         Broke internal builds (Requested by drousso on #webkit).
1772
1773         Reverted changeset:
1774
1775         "Web Inspector: Styles: show @supports CSS groupings"
1776         https://bugs.webkit.org/show_bug.cgi?id=200419
1777         https://trac.webkit.org/changeset/248289
1778
1779 2019-08-06  Nikita Vasilyev  <nvasilyev@apple.com>
1780
1781         Web Inspector: RTL: go-to arrows and expand triangles in Computed panel should match their context
1782         https://bugs.webkit.org/show_bug.cgi?id=200449
1783
1784         Reviewed by Joseph Pecoraro.
1785
1786         * UserInterface/Views/ComputedStyleSection.css:
1787         (body[dir=rtl] .computed-style-section .computed-property-item .disclosure-button): Deleted.
1788
1789         * UserInterface/Views/Main.css:
1790         (body[dir=rtl] [dir=ltr] .go-to-arrow): Added.
1791         In the RTL mode, LTR "islands" should have their contents to be still LTR.
1792
1793 2019-08-05  Devin Rousso  <drousso@apple.com>
1794
1795         Web Inspector: Styles: show @supports CSS groupings
1796         https://bugs.webkit.org/show_bug.cgi?id=200419
1797
1798         Reviewed by Joseph Pecoraro.
1799
1800         * UserInterface/Models/CSSGrouping.js: Renamed from Source/WebInspectorUI/UserInterface/Models/CSSMedia.js.
1801         (WI.CSSGrouping):
1802         (WI.CSSGrouping.prototype.get type):
1803         (WI.CSSGrouping.prototype.get text):
1804         (WI.CSSGrouping.prototype.get sourceCodeLocation):
1805         (WI.CSSGrouping.prototype.get isMedia): Added.
1806         (WI.CSSGrouping.prototype.get isSupports): Added.
1807         (WI.CSSGrouping.prototype.get prefix): Added.
1808
1809         * UserInterface/Models/CSSStyleDeclaration.js:
1810         (WI.CSSStyleDeclaration.prototype.get groupings): Added.
1811         (WI.CSSStyleDeclaration.prototype.generateCSSRuleString):
1812         (WI.CSSStyleDeclaration.prototype.get mediaList): Deleted.
1813
1814         * UserInterface/Models/CSSRule.js:
1815         (WI.CSSRule):
1816         (WI.CSSRule.prototype.get groupings): Added.
1817         (WI.CSSRule.prototype.update):
1818         (WI.CSSRule.prototype._selectorResolved):
1819         (WI.CSSRule.prototype.get mediaList): Deleted.
1820
1821         * UserInterface/Models/DOMNodeStyles.js:
1822         (WI.DOMNodeStyles.prototype._parseRulePayload):
1823         (WI.DOMNodeStyles.prototype.rulesForSelector): Deleted.
1824
1825         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
1826         (WI.SpreadsheetCSSStyleDeclarationSection):
1827         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
1828         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleEditorFilterApplied):
1829         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._createMediaHeader): Deleted.
1830         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
1831         (.spreadsheet-css-declaration :matches(.header, .header-groupings)): Added.
1832         (.spreadsheet-css-declaration :matches(.header, .header-groupings):first-child): Added.
1833         (.spreadsheet-css-declaration .header-groupings > .grouping): Added.
1834         (.spreadsheet-css-declaration .header-groupings + .header > .selector > .icon): Added.
1835         (.spreadsheet-css-declaration :matches(.header, .header-media)): Deleted.
1836         (.spreadsheet-css-declaration :matches(.header, .header-media):first-child): Deleted.
1837         (.spreadsheet-css-declaration .media-label): Deleted.
1838
1839         * UserInterface/Controllers/CSSManager.js:
1840         (WI.CSSManager.protocolGroupingTypeToEnum): Added.
1841         (WI.CSSManager.protocolMediaSourceToEnum): Deleted.
1842
1843         * UserInterface/Main.html:
1844         * UserInterface/Test.html:
1845
1846 2019-08-05  Devin Rousso  <drousso@apple.com>
1847
1848         Can't use $0, $1 etc when inspecting Google Docs pages because the content uses these for function names
1849         https://bugs.webkit.org/show_bug.cgi?id=195834
1850
1851         Reviewed by Joseph Pecoraro.
1852
1853         Allow the user to alias saved results by providing a different prefix (e.g. "$") from within
1854         Web Inspector. When changing the alias, all existing saved results will update to be
1855         reference-able from the new alias.
1856
1857         * UserInterface/Controllers/RuntimeManager.js:
1858         (WI.RuntimeManager):
1859         (WI.RuntimeManager.preferredSavedResultPrefix): Added.
1860         (WI.RuntimeManager.prototype.initializeTarget):
1861         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
1862         (WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
1863
1864         * UserInterface/Base/Setting.js:
1865         * UserInterface/Base/Main.js:
1866         (WI.contentLoaded):
1867         (WI.contentLoaded.updateConsoleSavedResultPrefixCSSVariable): Added.
1868         * UserInterface/Views/ConsoleMessageView.js:
1869         (WI.ConsoleMessageView.prototype.toClipboardString):
1870         (WI.ConsoleMessageView.prototype.removeEventListeners): Added.
1871         (WI.ConsoleMessageView.prototype._appendSavedResultIndex):
1872         (WI.ConsoleMessageView.prototype._appendSavedResultIndex.updateSavedVariableText): Added.
1873         (WI.ConsoleMessageView.prototype._rootPropertyPathForObject):
1874         (WI.ConsoleMessageView.prototype._rootPropertyPathForObject.prefixSavedResultIndex): Added.
1875         * UserInterface/Views/LogContentView.js:
1876         (WI.LogContentView.prototype._sessionStarted):
1877         (WI.LogContentView.prototype._logCleared):
1878         * UserInterface/Views/DOMTreeOutline.css:
1879         (.tree-outline.dom.show-last-selected li.last-selected > span::after):
1880         * UserInterface/Views/QuickConsole.js:
1881         (WI.QuickConsole):
1882         (WI.QuickConsole.prototype.closed):
1883         (WI.QuickConsole.prototype._updateAutomaticExecutionContextPathComponentTooltip): Added.
1884         Listen for changes to the setting that holds the current saved result alias and update any
1885         related UI accordingly.
1886
1887         * UserInterface/Views/SettingsTabContentView.js:
1888         (WI.SettingsTabContentView.prototype._createConsoleSettingsView):
1889         * UserInterface/Views/SettingsTabContentView.css:
1890         (.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="text"]): Added.
1891         * UserInterface/Views/SettingsGroup.js:
1892         (WI.SettingsGroup.prototype.addCustomEditor): Added.
1893         Add an input to the Settings tab that controls the saved result prefix alias. Only allow
1894         [a-zA-Z0-9_$] as values (but [0-9] cannot be used as the start).
1895
1896         * UserInterface/Models/PropertyPath.js:
1897         (WI.PropertyPath.prototype.set pathComponent): Added.
1898         Miscellaneous getters/setters.
1899
1900         * Localizations/en.lproj/localizedStrings.js:
1901
1902         * UserInterface/Test/TestHarness.js:
1903         (TestHarness.prototype.newline): Added.
1904         Convenience function for adding newlines to test results.
1905
1906 2019-08-05  Devin Rousso  <drousso@apple.com>
1907
1908         Web Inspector: Timelines: disable related agents when the tab is closed
1909         https://bugs.webkit.org/show_bug.cgi?id=200118
1910
1911         Reviewed by Joseph Pecoraro.
1912
1913         Rework how `enable`/`disable` is used for timeline-related agents so that events are not sent
1914         and data isn't kept alive when the Timelines tab isn't enabled.
1915
1916         * UserInterface/Controllers/TimelineManager.js:
1917         (WI.TimelineManager):
1918         (WI.TimelineManager.prototype.get domains): Added.
1919         (WI.TimelineManager.prototype.activateExtraDomain): Added.
1920         (WI.TimelineManager.prototype.initializeTarget):
1921         (WI.TimelineManager.prototype.reset):
1922         (WI.TimelineManager.prototype.set autoCaptureOnPageLoad):
1923         (WI.TimelineManager.prototype.enable): Added.
1924         (WI.TimelineManager.prototype.disable): Added.
1925         (WI.TimelineManager.prototype.startCapturing):
1926         (WI.TimelineManager.prototype.stopCapturing):
1927         (WI.TimelineManager.prototype.async processJSON):
1928         (WI.TimelineManager.prototype.capturingStarted):
1929         (WI.TimelineManager.prototype.capturingStopped):
1930         (WI.TimelineManager.prototype.autoCaptureStarted):
1931         (WI.TimelineManager.prototype.eventRecorded):
1932         (WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
1933         (WI.TimelineManager.prototype.pageLoadEventFired):
1934         (WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
1935         (WI.TimelineManager.prototype.memoryTrackingUpdated):
1936         (WI.TimelineManager.prototype.heapTrackingStarted):
1937         (WI.TimelineManager.prototype.heapTrackingCompleted):
1938         (WI.TimelineManager.prototype.heapSnapshotAdded):
1939         (WI.TimelineManager.prototype._loadNewRecording):
1940         (WI.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
1941         (WI.TimelineManager.prototype._provisionalLoadStarted):
1942         (WI.TimelineManager.prototype._mainResourceDidChange):
1943         (WI.TimelineManager.prototype._resourceWasAdded):
1944         (WI.TimelineManager.prototype._garbageCollected):
1945         (WI.TimelineManager.prototype._memoryPressure):
1946         (WI.TimelineManager.prototype.scriptProfilerTrackingUpdated):
1947         (WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
1948         (WI.TimelineManager.prototype._updateAutoCaptureInstruments):
1949         (WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
1950         (WI.TimelineManager.prototype._handleDOMNodePowerEfficientPlaybackStateChanged):
1951         * UserInterface/Models/Instrument.js:
1952         (WI.Instrument.startLegacyTimelineAgent):
1953         (WI.Instrument.stopLegacyTimelineAgent):
1954
1955         * UserInterface/Controllers/HeapManager.js:
1956         (WI.HeapManager): Added.
1957         (WI.HeapManager.prototype.get domains): Added.
1958         (WI.HeapManager.prototype.activateExtraDomain): Added.
1959         (WI.HeapManager.prototype.initializeTarget):
1960         (WI.HeapManager.prototype.enable): Added.
1961         (WI.HeapManager.prototype.disable): Added.
1962         (WI.HeapManager.prototype.snapshot): Added.
1963         (WI.HeapManager.prototype.getPreview): Added.
1964         (WI.HeapManager.prototype.getRemoteObject): Added.
1965         (WI.HeapManager.prototype.garbageCollected):
1966
1967         * UserInterface/Controllers/MemoryManager.js:
1968         (WI.MemoryManager): Added.
1969         (WI.MemoryManager.prototype.get domains): Added.
1970         (WI.MemoryManager.prototype.activateExtraDomain): Added.
1971         (WI.MemoryManager.prototype.initializeTarget):
1972         (WI.MemoryManager.prototype.enable): Added.
1973         (WI.MemoryManager.prototype.disable): Added.
1974         (WI.MemoryManager.prototype.memoryPressure):
1975
1976         * UserInterface/Views/TimelineTabContentView.js:
1977         (WI.TimelineTabContentView):
1978         (WI.TimelineTabContentView.prototype.closed):
1979
1980         * UserInterface/Models/HeapAllocationsInstrument.js:
1981         (WI.HeapAllocationsInstrument):
1982         (WI.HeapAllocationsInstrument.prototype._takeHeapSnapshot):
1983         * UserInterface/Views/HeapAllocationsTimelineView.js:
1984         (WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
1985         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
1986         (WI.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
1987         (WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
1988         (WI.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
1989         Go through the `HeapManager` for `HeapAgent` commands so it can better manage state.
1990
1991         * UserInterface/Test/Test.js:
1992         (WI.contentLoaded):
1993
1994 2019-08-05  Nikita Vasilyev  <nvasilyev@apple.com>
1995
1996         Web Inspector: brotli-compressed resources have "Compressed: No" in Resources details sidebar
1997         https://bugs.webkit.org/show_bug.cgi?id=200452
1998
1999         Reviewed by Joseph Pecoraro.
2000
2001         * UserInterface/Models/Resource.js:
2002         (WI.Resource.prototype.get compressed):
2003         Add "br" - Brotli content encoding.
2004
2005 2019-08-05  Devin Rousso  <drousso@apple.com>
2006
2007         Web Inspector: Styles: variable swatch not shown for var() with a fallback
2008         https://bugs.webkit.org/show_bug.cgi?id=200237
2009
2010         Reviewed by Joseph Pecoraro.
2011
2012         * UserInterface/Views/SpreadsheetStyleProperty.js:
2013         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
2014         (WI.SpreadsheetStyleProperty.prototype._replaceSpecialTokens): Added.
2015         (WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
2016         (WI.SpreadsheetStyleProperty.prototype._addColorTokens):
2017         (WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
2018         (WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
2019         Check to see if there's a fallback value in the `var()` and tokenize it if there is. Mark
2020         the property as invalid if the `var()` doesn't end up resolving to anything.
2021
2022         * UserInterface/Views/InlineSwatch.js:
2023         (WI.InlineSwatch):
2024         (WI.InlineSwatch.prototype.get value):
2025         (WI.InlineSwatch.prototype._updateSwatch):
2026         (WI.InlineSwatch.prototype._handleContextMenuEvent):
2027         (WI.InlineSwatch.prototype._getNextValidHEXFormat.hexMatchesCurrentColor):
2028         (WI.InlineSwatch.prototype._getNextValidHEXFormat):
2029         Allow the `value` to be a function. In that case, use the getter `this.value` instead of the
2030         value `this._value` directly so that the function is invoked.
2031         This is needed for variable swatches because the fallback value could change after the
2032         swatch has been created (e.g. another swatch in a CSS property value that just modifies the
2033         text, rather than re-renders the entire CSS property value).
2034
2035         * UserInterface/Models/CSSStyleDeclaration.js:
2036         (WI.CSSStyleDeclaration.prototype.resolveVariableValue): Added.
2037         Follow the variable chain until an ultimate value is reached.
2038
2039         * UserInterface/Models/CSSKeywordCompletions.js:
2040         (WI.CSSKeywordCompletions.isColorAwareProperty):
2041         (WI.CSSKeywordCompletions.isTimingFunctionAwareProperty): Added.
2042         Limit `cubic-bezier` and `spring` tokens to only be shown for timing function properties.
2043
2044 2019-08-05  Devin Rousso  <drousso@apple.com>
2045
2046         Web Inspector: rename "Stylesheet" to "Style Sheet" to match spec text
2047         https://bugs.webkit.org/show_bug.cgi?id=200422
2048
2049         Reviewed by Joseph Pecoraro.
2050
2051         * Localizations/en.lproj/localizedStrings.js:
2052
2053         * UserInterface/Controllers/CSSManager.js:
2054         (WI.CSSManager.prototype._resourceAdded):
2055         (WI.CSSManager.prototype._resourceTypeDidChange):
2056         (WI.CSSManager.prototype._clearStyleSheetsForResource):
2057         (WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
2058         * UserInterface/Models/CSSStyleSheet.js:
2059         (WI.CSSStyleSheet.prototype.get displayName):
2060         * UserInterface/Models/CollectionTypes.js:
2061         (WI.CSSStyleSheetCollection.prototype.get displayName):
2062         * UserInterface/Models/Resource.js:
2063         (WI.Resource.displayNameForType):
2064         (WI.Resource.prototype.get syntheticMIMEType):
2065         * UserInterface/Models/ResourceCollection.js:
2066         (WI.ResourceCollection.prototype.objectIsRequiredType):
2067         * UserInterface/Views/NetworkTableContentView.js:
2068         (WI.NetworkTableContentView):
2069         (WI.NetworkTableContentView.shortDisplayNameForResourceType):
2070         * UserInterface/Views/ResourceClusterContentView.js:
2071         (WI.ResourceClusterContentView.prototype._contentViewForResourceType):
2072         * UserInterface/Views/ResourceSidebarPanel.js:
2073         (WI.ResourceSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
2074         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
2075         (WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
2076         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2077         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._save):
2078         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu):
2079         * UserInterface/Views/StyleOriginView.js:
2080         (WI.StyleOriginView.prototype.update):
2081         * UserInterface/Views/TextResourceContentView.js:
2082         (WI.TextResourceContentView.prototype._shouldBeEditable):
2083
2084         * UserInterface/Views/CSSStyleSheetTreeElement.js:
2085         (WI.CSSStyleSheetTreeElement):
2086         * UserInterface/Views/ResourceIcons.css:
2087         (:matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon): Added.
2088         (.source-map-resource.resource-icon.resource-type-style-sheet .icon): Added.
2089         (.large :matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon): Added.
2090         (.large .source-map-resource.resource-icon.resource-type-style-sheet .icon): Added.
2091         (:matches(.resource-icon.resource-type-stylesheet, .stylesheet-icon) .icon): Deleted.
2092         (.source-map-resource.resource-icon.resource-type-stylesheet .icon): Deleted.
2093         (.large :matches(.resource-icon.resource-type-stylesheet, .stylesheet-icon) .icon): Deleted.
2094         (.large .source-map-resource.resource-icon.resource-type-stylesheet .icon): Deleted.
2095
2096 2019-08-03  Devin Rousso  <drousso@apple.com>
2097
2098         Web Inspector: Elements: Styles: move psuedo-selector rules before inherited rules
2099         https://bugs.webkit.org/show_bug.cgi?id=199950
2100
2101         Reviewed by Joseph Pecoraro.
2102
2103         Since pseudo-selector rules (usually) affect the selected element, or are related to its
2104         content, it's more useful to have them near that element's rules instead of after all of
2105         it's inherited rules.
2106
2107         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
2108         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
2109
2110 2019-08-03  Devin Rousso  <drousso@apple.com>
2111
2112         Web Inspector: Elements: Styles: add icons for various CSS rule types
2113         https://bugs.webkit.org/show_bug.cgi?id=199946
2114
2115         Reviewed by Joseph Pecoraro.
2116
2117         * UserInterface/Controllers/CSSManager.js:
2118         (WI.CSSManager.displayNameForPseudoId):
2119         Add hardcoded pseudo-selector identifiers for older backends.
2120
2121         * UserInterface/Models/CSSSelector.js:
2122         (WI.CSSSelector.prototype.isPseudoSelector): Added.
2123         (WI.CSSSelector.prototype.isPseudoElementSelector): Deleted.
2124         There are more types of pseudo-selectors than just `:{before|after}`.
2125
2126         * UserInterface/Models/CSSStyleDeclaration.js:
2127         (WI.CSSStyleDeclaration.prototype.generateCSSRuleString): Added.
2128
2129         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
2130         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.spreadsheetCSSStyleDeclarationSectionAddNewRule): Added.
2131         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
2132         Provide a delegate method for adding a new rule, so the `WI.SpreadsheetRulesStyleDetailsPanel`
2133         can know what selector to focus once the new rule gets added.
2134
2135         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2136         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
2137         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
2138         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu): Added.
2139         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
2140         (.spreadsheet-css-declaration .header.editing-selector .selector): Added.
2141         (.spreadsheet-css-declaration .selector > .icon): Added.
2142         (.spreadsheet-css-declaration .selector > .icon + *): Added.
2143         (.spreadsheet-css-declaration .selector.style-attribute > span): Added.
2144         When "mousedown" (or "contextmenu") on the icon, show a context menu with helpful actions:
2145          - Copy Rule
2146          - {Disable|Enable} Rule
2147          - Duplicate Selector
2148          - Add :{active|focus|hover|visited} Rule
2149          - Create ::{before|after} Rule
2150          - Reveal in {Resources Tab|Sources Tab|Stylesheet}
2151         Drive-by: add an extra 0.5px of initial margin before the Style Attribute selector (which is
2152         sans-serif) so it properly aligns with the other selectors (which are monospaced).
2153
2154         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
2155         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
2156         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
2157         (.spreadsheet-style-declaration-editor:empty): Added.
2158         (.spreadsheet-style-declaration-editor.no-properties): Deleted.
2159         Add some extra space when there's no inline style so it looks a bit less cramped.
2160
2161         * UserInterface/Main.html:
2162         * UserInterface/Views/StyleRuleIcons.css: Added.
2163         (.author-style-rule-icon .icon):
2164         (.author-style-rule-icon.pseudo-selector .icon):
2165         (.user-style-rule-icon .icon):
2166         (.user-style-rule-icon.pseudo-selector .icon):
2167         (.user-agent-style-rule-icon .icon):
2168         (.user-agent-style-rule-icon.pseudo-selector .icon):
2169         (.inspector-style-rule-icon .icon):
2170         (.inspector-style-rule-icon.pseudo-selector .icon):
2171         (.inherited-style-rule-icon .icon):
2172         (.inherited-element-style-rule-icon .icon):
2173         * UserInterface/Images/StyleRule.svg: Added.
2174         * UserInterface/Images/StyleRuleInheritedElement.svg: Added.
2175         * UserInterface/Images/StyleRulePseudo.svg: Added.
2176         Add generic icon classes for style rule icons.
2177
2178         * UserInterface/Base/Setting.js:
2179         * UserInterface/Views/SettingsTabContentView.js:
2180         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2181         Add experimental setting.
2182
2183         * Localizations/en.lproj/localizedStrings.js:
2184
2185 2019-08-03  Devin Rousso  <drousso@apple.com>
2186
2187         Web Inspector: DOM: add a special breakpoint for "All Events"
2188         https://bugs.webkit.org/show_bug.cgi?id=200285
2189
2190         Reviewed by Joseph Pecoraro.
2191
2192         Similar to the existing "All Requests" breakpoint, there should be a way to set a breakpoint
2193         that would pause for any DOM event, regardless of the event's name. This is useful for
2194         situations where the event name isn't known, or where one simply want's to pause on the next
2195         entry to the event loop.
2196
2197         Along these lines, make the "requestAnimationFrame", "setTimeout", and "setInterval"
2198         event breakpoints into special breakpoints that can be added/removed via the create
2199         breakpoint context menu. This simplifies the process for setting these breakpoints, and also
2200         makes them more discoverable (most people wouldn't consider them to be "events").
2201
2202         * UserInterface/Models/EventBreakpoint.js:
2203         (WI.EventBreakpoint):
2204         (WI.EventBreakpoint.deserialize):
2205         (WI.EventBreakpoint.prototype.saveIdentityToCookie):
2206         (WI.EventBreakpoint.prototype.toJSON):
2207
2208         * UserInterface/Controllers/DebuggerManager.js:
2209         (WI.DebuggerManager.prototype._pauseReasonFromPayload):
2210
2211         * UserInterface/Controllers/DOMDebuggerManager.js:
2212         (WI.DOMDebuggerManager):
2213         (WI.DOMDebuggerManager.prototype.initializeTarget):
2214         (WI.DOMDebuggerManager.supportsDOMBreakpoints): Added.
2215         (WI.DOMDebuggerManager.supportsEventBreakpoints):
2216         (WI.DOMDebuggerManager.supportsEventListenerBreakpoints): Added.
2217         (WI.DOMDebuggerManager.supportsURLBreakpoints):
2218         (WI.DOMDebuggerManager.supportsXHRBreakpoints): Added.
2219         (WI.DOMDebuggerManager.supportsAllListenersBreakpoint): Added.
2220         (WI.DOMDebuggerManager.prototype.get allAnimationFramesBreakpoint): Added.
2221         (WI.DOMDebuggerManager.prototype.get allIntervalsBreakpoint): Added.
2222         (WI.DOMDebuggerManager.prototype.get allListenersBreakpoint): Added.
2223         (WI.DOMDebuggerManager.prototype.get allTimeoutsBreakpoint): Added.
2224         (WI.DOMDebuggerManager.prototype.get listenerBreakpoints): Added.
2225         (WI.DOMDebuggerManager.prototype.isBreakpointSpecial):
2226         (WI.DOMDebuggerManager.prototype.listenerBreakpointForEventName): Added.
2227         (WI.DOMDebuggerManager.prototype.addEventBreakpoint):
2228         (WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
2229         (WI.DOMDebuggerManager.prototype.addURLBreakpoint):
2230         (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
2231         (WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
2232         (WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
2233         (WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
2234         (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged):
2235         (WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
2236         (WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged):
2237         (WI.DOMDebuggerManager.prototype.get eventBreakpoints): Deleted.
2238         (WI.DOMDebuggerManager.prototype.eventBreakpointForTypeAndEventName): Deleted.
2239         Add additional target compatibility checks.
2240
2241         * UserInterface/Views/EventBreakpointPopover.js:
2242         (WI.EventBreakpointPopover.prototype.show):
2243         (WI.EventBreakpointPopover.prototype.dismiss):
2244         (WI.EventBreakpointPopover.prototype._handleTypeSelectChange): Deleted.
2245         * UserInterface/Views/EventBreakpointPopover.css:
2246         (.popover .event-breakpoint-content > input): Added.
2247         (.popover .event-breakpoint-content > input::placeholder): Added.
2248         (.popover .event-breakpoint-content > .event-type): Deleted.
2249         (.popover .event-breakpoint-content > .event-type > input): Deleted.
2250         (.popover .event-breakpoint-content > .event-type > input::placeholder): Deleted.
2251
2252         * UserInterface/Views/EventBreakpointTreeElement.css:
2253         (.breakpoint.event.breakpoint-for-interval:not(.breakpoint-paused-icon) .icon): Added.
2254         (.breakpoint.event.breakpoint-for-timeout:not(.breakpoint-paused-icon) .icon): Added.
2255         (.breakpoint.event.breakpoint-for-timer:not(.breakpoint-paused-icon) .icon): Deleted.
2256
2257         * UserInterface/Views/DebuggerSidebarPanel.js:
2258         (WI.DebuggerSidebarPanel):
2259         (WI.DebuggerSidebarPanel.prototype.saveStateToCookie):
2260         (WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
2261         (WI.DebuggerSidebarPanel.prototype._addBreakpoint):
2262         (WI.DebuggerSidebarPanel.prototype._addTreeElement):
2263         (WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
2264         (WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
2265         (WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu.addToggleForSpecialEventBreakpoint): Added.
2266         (WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu):
2267         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
2268         (WI.SourcesNavigationSidebarPanel):
2269         (WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
2270         (WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
2271         (WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
2272         (WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
2273         (WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu.addToggleForSpecialEventBreakpoint): Added.
2274         (WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
2275         Add create breakpoint context menu items (also sort the breakpoints in this order):
2276          - "All Animation Frames"  =>  [A] All Animation Frames
2277          - "All Timeouts"          =>  [T] All Timeouts
2278          - "All Intervals"         =>  [I] All Intervals
2279          - "All Events"            =>  [E] All Events
2280
2281         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2282         (WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
2283
2284         * UserInterface/Base/Setting.js:
2285         * UserInterface/Images/EventBreakpointInterval.svg: Added.
2286         * UserInterface/Images/EventBreakpointTimeout.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/EventBreakpointTimer.svg.
2287         * Localizations/en.lproj/localizedStrings.js:
2288
2289 2019-08-03  Devin Rousso  <drousso@apple.com>
2290
2291         Web Inspector: Heap Snapshot Views should be searchable
2292         https://bugs.webkit.org/show_bug.cgi?id=157582
2293         <rdar://problem/26228629>
2294
2295         Reviewed by Joseph Pecoraro.
2296
2297         Without the ability to filter/search, it's far more difficult to find objects of interest.
2298         Rather than spending time scrolling through the entire heap snapshot or sorting by "Name",
2299         a simple filter/search (which also uses the global search settings) is almost instant.
2300
2301         * UserInterface/Views/HeapAllocationsTimelineView.js:
2302         (WI.HeapAllocationsTimelineView.prototype.updateFilter): Addded.
2303         (WI.HeapAllocationsTimelineView.prototype.get showsFilterBar): Deleted.
2304         * UserInterface/Views/HeapSnapshotClusterContentView.js:
2305         (WI.HeapSnapshotClusterContentView.prototype.updateFilter): Added.
2306         * UserInterface/Views/HeapSnapshotContentView.js:
2307         (WI.HeapSnapshotContentView):
2308         (WI.HeapSnapshotContentView.prototype.updateFilter): Added.
2309         (WI.HeapSnapshotContentView.prototype.dataGridMatchNodeAgainstCustomFilters): Added.
2310         (WI.HeapSnapshotContentView.prototype.dataGridMatchShouldPopulateWhenFilteringNode): Added.
2311         * UserInterface/Views/DataGrid.js:
2312         (WI.DataGrid.prototype._updateFilter.createIteratorForNodesToBeFiltered):
2313         Don't attempt to populate each heap snapshot `WI.DataGridNode` when filtering, as that can
2314         quickly exhaust memory due to the sheer size of a heap snapshot.
2315
2316         * UserInterface/Base/Main.js:
2317         (WI._find):
2318         * UserInterface/Views/TimelineTabContentView.js:
2319         (WI.TimelineTabContentView.prototype.get canHandleFindEvent): Added.
2320         (WI.TimelineTabContentView.prototype.handleFindEvent): Added.
2321         * UserInterface/Views/TimelineRecordingContentView.js:
2322         (WI.TimelineRecordingContentView.prototype.get canFocusFilterBar): Added.
2323         (WI.TimelineRecordingContentView.prototype.focusFilterBar): Added.
2324         * UserInterface/Views/FilterBar.js:
2325         (WI.FilterBar.prototype.focus): Added.
2326         Allow the current tab to intercept the find shortcut and do something custom. In the case
2327         of a `WI.TimelineTabContentView`, declare that it can handle the find event if the displayed
2328         content view (`WI.TimelineRecordingContentView`) can focus it's filter bar. If so, when the
2329         find shortcut is triggered, focus the filter bar.
2330
2331 2019-08-03  Devin Rousso  <drousso@apple.com>
2332
2333         Web Inspector: CSS Formatter: comments with an escape character aren't formatted
2334         https://bugs.webkit.org/show_bug.cgi?id=200168
2335
2336         Reviewed by Joseph Pecoraro.
2337
2338         Don't allow escaping of the "*" in CSS comments (e.g. `\*/`).
2339
2340         Add additional pretty printing rules for comments so that there's always some space between
2341         them and the surrounding text. This ensures that they don't interfere with readability.
2342
2343         * UserInterface/Workers/Formatter/CSSFormatter.js:
2344         (CSSFormatter.prototype._format):
2345
2346         * UserInterface/Workers/Formatter/FormatterContentBuilder.js:
2347         (FormatterContentBuilder.prototype.get indented): Added.
2348
2349 2019-08-03  Devin Rousso  <drousso@apple.com>
2350
2351         Web Inspector: Console: execution context picker doesn't update when switching to the inferred context from auto
2352         https://bugs.webkit.org/show_bug.cgi?id=200279
2353
2354         Reviewed by Joseph Pecoraro.
2355
2356         The `representedObject` of the "auto" execution context path component is shared with that
2357         execution context's actual path component, meaning that if the user switches from "auto" to
2358         that execution context's path component, the underlying `representedObject` wouldn't change,
2359         and therfore the `RuntimeManager.Event.ActiveExecutionContextChanged` wouldn't fire. In this
2360         case, update the visible ("selected") execution context path component manually.
2361
2362         * UserInterface/Views/QuickConsole.js:
2363         (WI.QuickConsole.prototype._selectExecutionContext):
2364         (WI.QuickConsole.prototype._pathComponentSelected):
2365
2366 2019-08-02  Devin Rousso  <drousso@apple.com>
2367
2368         Web Inspector: Console: all navigation items should be shown in the split console
2369         https://bugs.webkit.org/show_bug.cgi?id=200280
2370
2371         Reviewed by Joseph Pecoraro.
2372
2373         * UserInterface/Views/LogContentView.js:
2374         (WI.LogContentView):
2375         (WI.LogContentView.prototype.get navigationItems):
2376         Adjust the `visibilityPriority` of each `navigationItems` so that the filter/scope bars are
2377         kept visible for longer than the "Preserve Log"/"Emulate User Gesture" toggles.
2378
2379         * UserInterface/Views/FindBanner.js:
2380         (WI.FindBanner):
2381         * UserInterface/Views/FindBanner.css:
2382         (.find-banner.console-find-banner > input[type="search"]):
2383         (.find-banner.console-find-banner > :matches(input[type="search"], button)):
2384         (.find-banner.console-find-banner > input[type="search"]:focus, .find-banner.console-find-banner > input[type="search"]:focus ~ button, .find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown), .find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown) ~ button ): Added.
2385         (.find-banner.console-find-banner > input[type="search"]::placeholder): Deleted.
2386         (.find-banner.console-find-banner > input[type="search"]:focus): Deleted.
2387         (.find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown)): Deleted.
2388         (@media (prefers-color-scheme: dark) .find-banner.console-find-banner > input[type=search]:not(:placeholder-shown)): Deleted.
2389         Make the `WI.FindBanner` blend in with the surrounding content when it's not focused or has
2390         no content.
2391
2392 2019-08-02  Devin Rousso  <drousso@apple.com>
2393
2394         Web Inspector: Storage: disable related agents when the tab is closed
2395         https://bugs.webkit.org/show_bug.cgi?id=200117
2396
2397         Reviewed by Joseph Pecoraro.
2398
2399         Rework how `enable`/`disable` is used for storage-related agents so that events are not sent
2400         and data isn't kept alive when the Storage tab isn't enabled.
2401
2402         * UserInterface/Controllers/ApplicationCacheManager.js:
2403         (WI.ApplicationCacheManager):
2404         (WI.ApplicationCacheManage.prototype.get domains): Added.
2405         (WI.ApplicationCacheManage.prototype.activateExtraDomain): Added.
2406         (WI.ApplicationCacheManager.prototype.initializeTarget):
2407         (WI.ApplicationCacheManager.prototype.enable): Added.
2408         (WI.ApplicationCacheManager.prototype.disable): Added.
2409         (WI.ApplicationCacheManager.prototype.networkStateUpdated):
2410         (WI.ApplicationCacheManager.prototype.applicationCacheStatusUpdated):
2411         (WI.ApplicationCacheManager.prototype._reset): Added.
2412         (WI.ApplicationCacheManager.prototype._mainResourceDidChange):
2413         (WI.ApplicationCacheManager.prototype._manifestForFrameLoaded):
2414         (WI.ApplicationCacheManager.prototype._framesWithManifestsLoaded):
2415         (WI.ApplicationCacheManager.prototype.initialize): Deleted.
2416
2417         * UserInterface/Controllers/DOMStorageManager.js:
2418         (WI.DOMStorageManager):
2419         (WI.DOMStorageManager.prototype.get domains): Added.
2420         (WI.DOMStorageManager.prototype.activateExtraDomain): Added.
2421         (WI.DOMStorageManager.prototype.initializeTarget):
2422         (WI.DOMStorageManager.prototype.enable): Added.
2423         (WI.DOMStorageManager.prototype.disable): Added.
2424         (WI.DOMStorageManager.prototype.itemsCleared):
2425         (WI.DOMStorageManager.prototype.itemRemoved):
2426         (WI.DOMStorageManager.prototype.itemAdded):
2427         (WI.DOMStorageManager.prototype.itemUpdated):
2428         (WI.DOMStorageManager.prototype.inspectDOMStorage):
2429         (WI.DOMStorageManager.prototype._reset): Added.
2430         (WI.DOMStorageManager.prototype._addDOMStorageIfNeeded):
2431         (WI.DOMStorageManager.prototype._addCookieStorageIfNeeded):
2432         (WI.DOMStorageManager.prototype._mainResourceDidChange):
2433         (WI.DOMStorageManager.prototype.initialize): Deleted.
2434         (WI.DOMStorageManager.prototype.domStorageWasAdded): Deleted.
2435
2436         * UserInterface/Controllers/DatabaseManager.js:
2437         (WI.DatabaseManager):
2438         (WI.DatabaseManager.prototype.get domains): Added.
2439         (WI.DatabaseManager.prototype.activateExtraDomain): Added.
2440         (WI.DatabaseManager.prototype.initializeTarget):
2441         (WI.DatabaseManager.prototype.enable): Added.
2442         (WI.DatabaseManager.prototype.disable): Added.
2443         (WI.DatabaseManager.prototype.databaseWasAdded):
2444         (WI.DatabaseManager.prototype.inspectDatabase):
2445         (WI.DatabaseManager.prototype._reset): Added.
2446         (WI.DatabaseManager.prototype._mainResourceDidChange):
2447         (WI.DatabaseManager.prototype.initialize): Deleted.
2448
2449         * UserInterface/Controllers/IndexedDBManager.js:
2450         (WI.IndexedDBManager):
2451         (WI.IndexedDBManager.prototype.get domains): Added.
2452         (WI.IndexedDBManager.prototype.activateExtraDomain): Added.
2453         (WI.IndexedDBManager.prototype.initializeTarget):
2454         (WI.IndexedDBManager.prototype.enable): Added.
2455         (WI.IndexedDBManager.prototype.disable): Added.
2456         (WI.IndexedDBManager.prototype.clearObjectStore):
2457         (WI.IndexedDBManager.prototype._reset): Added.
2458         (WI.IndexedDBManager.prototype._mainResourceDidChange):
2459         (WI.IndexedDBManager.prototype.initialize): Deleted.
2460
2461         * UserInterface/Controllers/AppController.js:
2462         (WI.AppController.prototype.activateExtraDomains):
2463         * UserInterface/Controllers/CanvasManager.js:
2464         (WI.CanvasManager.prototype.get domains): Added.
2465         (WI.CanvasManager.prototype.activateExtraDomain): Added.
2466         Only call `enable` on any extra agents if the domain is not controlled by a manager.
2467
2468         * UserInterface/Views/StorageTabContentView.js:
2469         (WI.StorageTabContentView):
2470         (WI.StorageTabContentView.static isTabAllowed):
2471         (WI.StorageTabContentView.prototype.canShowRepresentedObject):
2472         (WI.StorageTabContentView.prototype.closed): Added.
2473
2474         * UserInterface/Test.html:
2475         * UserInterface/Test/Test.js:
2476         (WI.loaded):
2477         (WI.contentLoaded):
2478
2479 2019-08-02  Devin Rousso  <drousso@apple.com>
2480
2481         Web Inspector: Timelines: Develop > Start Timeline Recording doesn't work when focused on a detached inspector window
2482         https://bugs.webkit.org/show_bug.cgi?id=200125
2483         <rdar://problem/53543008>
2484
2485         Reviewed by Brian Burg.
2486
2487         Always show the Timelines tab in Web Inspector whenever timeline recording starts/stops.
2488         Notify the UIProcess whenever the timeline recording state changes.
2489
2490         * UserInterface/Protocol/InspectorFrontendAPI.js:
2491         (InspectorFrontendAPI.setTimelineProfilingEnabled):
2492
2493 2019-08-02  Devin Rousso  <drousso@apple.com>
2494
2495         Web Inspector: "Inspector.initialized" happens before breakpoints are set
2496         https://bugs.webkit.org/show_bug.cgi?id=200364
2497
2498         Reviewed by Joseph Pecoraro.
2499
2500         Allow managers to register a promise that will delay `Inspector.initialized`. This is needed
2501         when restoring breakpoints so that "Automatically Show Web Inspector for JSContexts" can set
2502         them before any scripts have evaluated, ensuring that no breakpoints are "skipped".
2503
2504         * UserInterface/Protocol/Target.js:
2505         (WI.Target.prototype.initialize):
2506         (WI.Target.registerInitializationPromise): Added.
2507
2508         * UserInterface/Controllers/DOMDebuggerManager.js:
2509         (WI.DOMDebuggerManager):
2510         * UserInterface/Controllers/DebuggerManager.js:
2511         (WI.DebuggerManager):
2512
2513 2019-08-01  Devin Rousso  <drousso@apple.com>
2514
2515         Unreviewed, remove `emulateUserGesture` parameter from `Debugger.evaluateOnCallFrame` for iOS 13
2516
2517         Rubber-stamped by Joseph Pecoraro.
2518
2519         * UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js:
2520         * Versions/Inspector-iOS-13.0.json:
2521         The iOS 13 protocol has already been decided, so these shouldn't have been added unless they
2522         were cherry-picked in.
2523
2524 2019-07-31  Devin Rousso  <drousso@apple.com>
2525
2526         Web Inspector: Debugger: support emulateUserGesture parameter in Debugger.evaluateOnCallFrame
2527         https://bugs.webkit.org/show_bug.cgi?id=200272
2528
2529         Reviewed by Joseph Pecoraro.
2530
2531         When paused, evaluating in the console should still respect the "Emulate User Gesture" checkbox.
2532
2533         * UserInterface/Controllers/RuntimeManager.js:
2534         (WI.RuntimeManager.prototype.evaluateInInspectedWindow):
2535
2536         * UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js:
2537         * Versions/Inspector-iOS-13.0.json:
2538
2539 2019-07-31  Devin Rousso  <drousso@apple.com>
2540
2541         Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'issueMessage.sourceCodeLocation.sourceCode')
2542         https://bugs.webkit.org/show_bug.cgi?id=200296
2543
2544         Reviewed by Joseph Pecoraro.
2545
2546         When fetching all `WI.IssueMessage`s for a given `WI.SourceCode`, the `WI.IssueMessage` may
2547         be associated in a different way (e.g. by url, instead of `WI.SourceCodeLocation`). As such,
2548         we should pass the `WI.SourceCode` along, and use it when adding the `WI.IssueTreeElement`.
2549
2550         * UserInterface/Views/DebuggerSidebarPanel.js:
2551         (WI.DebuggerSidebarPanel.prototype._addIssuesForSourceCode):
2552         (WI.DebuggerSidebarPanel.prototype._addIssue):
2553
2554         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
2555         (WI.SourcesNavigationSidebarPanel.prototype._addIssue):
2556         (WI.SourcesNavigationSidebarPanel.prototype._addIssuesForSourceCode):
2557
2558 2019-07-31  Devin Rousso  <drousso@apple.com>
2559
2560         Web Inspector: DOM: provide a way to disable/breakpoint all event listeners for a given DOM node or event type
2561         https://bugs.webkit.org/show_bug.cgi?id=200233
2562
2563         Reviewed by Joseph Pecoraro.
2564
2565         Often, when trying to debug issues with DOM events, it's extremely tedious to have to go
2566         through event listeners one by one and disable them (or set a breakpoint). This patch adds
2567         a way of performing these "state modifications" in batch operations, based on the current
2568         grouping method of the Event Listeners section.
2569
2570         * UserInterface/Controllers/DOMManager.js:
2571         (WI.DOMManager.supportsDisablingEventListeners): Added.
2572         (WI.DOMManager.supportsEventListenerBreakpoints): Added.
2573         Common convenience functions for checking for protocol support.
2574
2575         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
2576         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.createEventListenerSection):
2577         * UserInterface/Views/DOMNodeDetailsSidebarPanel.css:
2578         (.sidebar > .panel.dom-node-details .details-section.dom-node-event-listeners .details-section.event-listener-section > .header > .event-listener-options): Added.
2579         (.sidebar > .panel.dom-node-details .details-section.dom-node-event-listeners .details-section.event-listener-section:hover > .header > .event-listener-options): Added.
2580         Add an options element that shows a context menu:
2581          - "Disable Event Listeners"/"Enable Event Listeners"
2582          - "Add Breakpoints"/"Delete Breakpoints"
2583         Each action applies the corresponding state to all event listeners in that section.
2584
2585         * UserInterface/Views/EventListenerSectionGroup.js:
2586         (WI.EventListenerSectionGroup):
2587         (WI.EventListenerSectionGroup.prototype.get supportsStateModification): Added.
2588         (WI.EventListenerSectionGroup.prototype.get isEventListenerDisabled): Added.
2589         (WI.EventListenerSectionGroup.prototype.set isEventListenerDisabled): Added.
2590         (WI.EventListenerSectionGroup.prototype.get hasEventListenerBreakpoint): Added.
2591         (WI.EventListenerSectionGroup.prototype.set hasEventListenerBreakpoint): Added.
2592         (WI.EventListenerSectionGroup.prototype._updateDisabledToggle): Added.
2593         (WI.EventListenerSectionGroup.prototype._updateBreakpointToggle): Added.
2594         (WI.EventListenerSectionGroup.prototype._createDisabledToggleRow): Deleted.
2595         (WI.EventListenerSectionGroup.prototype._createBreakpointToggleRow): Deleted.
2596         Expose a way to modify the event listener's state so that the UI (e.g. checkbox and title)
2597         also get's updated.
2598
2599         * Localizations/en.lproj/localizedStrings.js:
2600
2601 2019-07-30  Nikita Vasilyev  <nvasilyev@apple.com>
2602
2603         Web Inspector: Resources: Display outline around images when viewing image collections
2604         https://bugs.webkit.org/show_bug.cgi?id=200212
2605
2606         Reviewed by Devin Rousso.
2607
2608         * UserInterface/Views/CollectionContentView.css:
2609         (.content-view.collection .resource.image img):
2610         (.content-view.collection .resource.image img:hover):
2611
2612 2019-07-29  Devin Rousso  <drousso@apple.com>
2613
2614         Web Inspector: Resources: add a "Show Grid" navigation item for the Images collection
2615         https://bugs.webkit.org/show_bug.cgi?id=200260
2616
2617         Reviewed by Joseph Pecoraro.
2618
2619         Each subview `WI.ImageResourceContentView` already listens for changes to the underlying
2620         `WI.settings.showImageGrid` and adds the `.show-grid` class if enabled. As such, this change
2621         just adds a `WI.ButtonNavigationItem` for toggling `WI.settings.showImageGrid` from the
2622         Images "folder".
2623
2624         * UserInterface/Views/ResourceCollectionContentView.js:
2625         (WI.ResourceCollectionContentView):
2626         (WI.ResourceCollectionContentView.prototype.get navigationItems):
2627         (WI.ResourceCollectionContentView.prototype.attached): Added.
2628         (WI.ResourceCollectionContentView.prototype.detached): Added.
2629         (WI.ResourceCollectionContentView.prototype._updateImageTypeScopeBar):
2630         Drive-by: hide the image type `WI.ScopeBar` if there's only one type of image.
2631         (WI.ResourceCollectionContentView.prototype._handleShowGridButtonClicked): Added.
2632         (WI.ResourceCollectionContentView.prototype._handleShowImageGridSettingChanged): Added.
2633
2634 2019-07-29  Devin Rousso  <drousso@apple.com>
2635
2636         Web Inspector: add -webkit-* keywords for *-height CSS properties
2637         https://bugs.webkit.org/show_bug.cgi?id=200240
2638
2639         Reviewed by Joseph Pecoraro.
2640
2641         * UserInterface/Models/CSSKeywordCompletions.js:
2642
2643         * UserInterface/Views/Main.css:
2644         (.message-text-view):
2645         * UserInterface/Views/Toolbar.css:
2646         (.toolbar .control-section):
2647         (.toolbar .item-section):
2648         Replace `-webkit-min-content` with `min-content`.
2649
2650 2019-07-26  Greg Doolittle  <gr3g@apple.com>
2651
2652         Web Inspector: AXI: Audit: Typo of "some" as "somee"
2653         https://bugs.webkit.org/show_bug.cgi?id=200166
2654
2655         Reviewed by Devin Rousso.
2656
2657         * Localizations/en.lproj/localizedStrings.js:
2658         * UserInterface/Controllers/AuditManager.js:
2659         (WI.AuditManager.prototype._addDefaultTests):
2660         (WI.AuditManager):
2661
2662 2019-07-24  Devin Rousso  <drousso@apple.com>
2663
2664         Web Inspector: REGRESSION: no context menu items work when context menu clicking on "Add Breakpoint"
2665         https://bugs.webkit.org/show_bug.cgi?id=199953
2666
2667         Reviewed by Joseph Pecoraro.
2668
2669         * UserInterface/Views/ContextMenuUtilities.js:
2670         (WI.addMouseDownContextMenuHandlers): Added.
2671         Create a helper function for managing elements that show a context menu on "mousedown".
2672
2673         * UserInterface/Base/SearchUtilities.js:
2674         (WI.SearchUtilities.createSettingsButton):
2675         * UserInterface/Views/CanvasContentView.js:
2676         (WI.CanvasContentView.prototype.initialLayout):
2677         (WI.CanvasContentView.prototype._populateCanvasElementButtonContextMenu): Added.
2678         (WI.CanvasContentView.prototype._populateViewShaderButtonContextMenu): Added.
2679         (WI.CanvasContentView.prototype._populateViewRecordingButtonContextMenu): Added.
2680         (WI.CanvasContentView.prototype._handleCanvasElementButtonMouseDown): Deleted.
2681         (WI.CanvasContentView.prototype._handleViewShaderButtonMouseDown): Deleted.
2682         (WI.CanvasContentView.prototype._handleViewRecordingButtonMouseDown): Deleted.
2683         * UserInterface/Views/DebuggerSidebarPanel.js:
2684         (WI.DebuggerSidebarPanel):
2685         (WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu): Added.
2686         (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointMouseDown): Deleted.
2687         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
2688         (WI.SourcesNavigationSidebarPanel):
2689         (WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu): Added.
2690         (WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu): Added.
2691         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeMouseDown): Deleted.
2692         (WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointMouseDown): Deleted.
2693
2694         * UserInterface/Views/TabBar.js:
2695         (WI.TabBar):
2696         (WI.TabBar.prototype._handleTabPickerTabContextMenu): Deleted.
2697         * UserInterface/Views/LegacyTabBar.js:
2698         (WI.LegacyTabBar):
2699         (WI.LegacyTabBar.prototype._handleTabPickerTabContextMenu): Deleted.
2700         Remove the "contextmenu" handler on the tab picker, as that's already used by the entire
2701         tab bar to show/hide tabs.
2702
2703 2019-07-24  Devin Rousso  <drousso@apple.com>
2704
2705         Web Inspector: print the target of `console.screenshot` last so the target is the closest item to the image
2706         https://bugs.webkit.org/show_bug.cgi?id=199308
2707
2708         Reviewed by Joseph Pecoraro.
2709
2710         * UserInterface/Views/ConsoleMessageView.js:
2711         (WI.ConsoleMessageView.prototype.render):
2712         (WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
2713         (WI.ConsoleMessageView.prototype._handleContextMenu):
2714         * UserInterface/Views/ConsoleMessageView.css:
2715         (.console-image > .console-message-body > :matches(hr, img)): Added.
2716         (.console-image > .console-message-body > hr): Added.
2717         (.console-image > .console-message-body > img): Added.
2718         (.console-log-level.console-image::before): Added.
2719         (.console-message-body > .console-image): Deleted.
2720         (.console-log-level.console-image-container::before): Deleted.
2721         Allow `ConsoleMessage.MessageType.Image` to be an `ConsoleMessage.MessageLevel.Error`, and
2722         print the message (and extra parameters) in that case.
2723         Drive-by: reorganize the switch-case so all paths have the same `default` case.
2724
2725         * Localizations/en.lproj/localizedStrings.js:
2726
2727 2019-07-23  Nikita Vasilyev  <nvasilyev@apple.com>
2728
2729         Web Inspector: Styles: Command-X should cut selected properties
2730         https://bugs.webkit.org/show_bug.cgi?id=199341
2731
2732         Reviewed by Devin Rousso.
2733
2734         Implement cutting of selected CSS properties in the style editor.
2735         Unify cutting and copying logic wherever possible.
2736
2737         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
2738         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
2739         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.placeTextCaretInFocusedProperty): Added.
2740         Cut/copy events could only fire on SpreadsheetCSSStyleDeclarationEditor element if it
2741         has selection inside of it. Placing text caret at the beginning of the focused property
2742         ensures that.
2743
2744         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy): Deleted.
2745         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
2746         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._copySelectedProperties): Added.
2747         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._removeSelectedProperties): Added.
2748         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2749         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):
2750         * UserInterface/Views/SpreadsheetStyleProperty.js:
2751         Remove old copying logic.
2752
2753 2019-07-23  Nikita Vasilyev  <nvasilyev@apple.com>
2754
2755         Web Inspector: Display "Resource has no content" for about:blank iframes instead of an error
2756         https://bugs.webkit.org/show_bug.cgi?id=198029
2757
2758         Reviewed by Devin Rousso.
2759
2760         Display "about:blank" in the middle of the content view when selecting "about:blank" resources.
2761         Previoulsly, we showed a misleading "An error occurred trying to load the resource" error
2762         message.
2763
2764         * UserInterface/Models/CSSStyleSheet.js:
2765         (WI.CSSStyleSheet.prototype.requestContentFromBackend):
2766         * UserInterface/Models/Resource.js:
2767         (WI.Resource.prototype.requestContentFromBackend):
2768         * UserInterface/Models/Script.js:
2769         (WI.Script.prototype.requestContentFromBackend):
2770         * UserInterface/Models/SourceCode.js:
2771         (WI.SourceCode.generateSpecialContentForURL):
2772         (WI.SourceCode.prototype._processContent):
2773         (WI.SourceCode):
2774         * UserInterface/Views/ResourceContentView.js:
2775         (WI.ResourceContentView.prototype._contentAvailable):
2776
2777         * UserInterface/Views/SourceCodeTextEditor.js:
2778         (WI.SourceCodeTextEditor.prototype._contentAvailable):
2779         (WI.SourceCodeTextEditor.prototype._showMessage):
2780         * UserInterface/Views/TextResourceContentView.js:
2781         (WI.TextResourceContentView.prototype._contentDidPopulate):
2782         Display empty text editor when it has no content instead of "Resource has no content" message.
2783
2784 2019-07-22  Devin Rousso  <drousso@apple.com>
2785
2786         Web Inspector: Uncaught Exception: Breakpoint at specified location already exists.
2787         https://bugs.webkit.org/show_bug.cgi?id=197034
2788         <rdar://problem/50049004>
2789
2790         Reviewed by Joseph Pecoraro.
2791
2792         When "adjusting" a `WI.Breakpoint` (e.g. removing and then re-adding with a different
2793         configuration), make sure to only re-add the `WI.Breakpoint` to the `WI.Target` it was just
2794         removed from, rather to all `WI.targets`.
2795
2796         Since we iterate over `WI.targets` in both `WI.DebuggerManager.prototype._setBreakpoint` and
2797         `WI.DebuggerManager.prototype._removeBreakpoint`, we ended up iterating `WI.targets` twice.
2798
2799         Each time the `WI.Breakpoint` is removed from a `WI.Target`, pass the `WI.Target` to the
2800         `callback` given to `WI.DebuggerManager.prototype._removeBreakpoint`, so that the eventual
2801         call to `WI.DebuggerManager.prototype._setBreakpoint` can reuse it as the `specificTarget`,
2802         instead of iterating `WI.targets` (meaning we only iterate it once).
2803
2804         * UserInterface/Controllers/DebuggerManager.js:
2805         (WI.DebuggerManager.prototype.addBreakpoint):
2806         (WI.DebuggerManager.prototype._removeBreakpoint.didRemoveBreakpoint):
2807         (WI.DebuggerManager.prototype._breakpointDisplayLocationDidChange):
2808         (WI.DebuggerManager.prototype._breakpointEditablePropertyDidChange):
2809
2810 2019-07-22  Devin Rousso  <drousso@apple.com>
2811
2812         Localization: change fps to FPS
2813         <rdar://problem/53342508>
2814
2815         Rubber-stamped by Joseph Pecoraro.
2816
2817         * UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
2818         (WI.RenderingFrameTimelineOverviewGraph.prototype._updateDividers.createDividerAtPosition):
2819
2820         * Localizations/en.lproj/localizedStrings.js:
2821
2822 2019-07-19  Devin Rousso  <drousso@apple.com>
2823
2824         Web Inspector: Issues toggling multiple breakpoints on one line
2825         https://bugs.webkit.org/show_bug.cgi?id=199918
2826
2827         Reviewed by Joseph Pecoraro.
2828
2829         * UserInterface/Views/SourceCodeTextEditor.js:
2830         (WI.SourceCodeTextEditor):
2831         (WI.SourceCodeTextEditor.prototype.close):
2832         (WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
2833         (WI.SourceCodeTextEditor.prototype.textEditorUpdatedFormatting):
2834         (WI.SourceCodeTextEditor.prototype._handleFormatterDidChange): Added.
2835         Listen for `WI.SourceCode.Event.FormatterDidChange` events as there may be multiple content
2836         views for the same `WI.SourceCode`. Previously, if there were, only the active one would
2837         properly update it's "line -> column -> breakpoint" mapping, causing an error to be thrown
2838         when the non-active content views tried to retrieve the breakpoint for the new line/column.
2839
2840 2019-07-17  Olivier Blin  <olivier.blin@softathome.com>
2841
2842         Web Inspector: application/xml content not shown
2843         https://bugs.webkit.org/show_bug.cgi?id=199861
2844
2845         Reviewed by Devin Rousso.
2846
2847         application/xml content from XHR requests was not shown in the
2848         inspector, an error message was displayed instead.
2849
2850         application/xml content should be treated as text, since
2851         application/xml is the standard mimetype for XML content.
2852         Apache serves XML content with the application/xml mimetype by
2853         default.
2854
2855         * UserInterface/Base/MIMETypeUtilities.js:
2856         (WI.fileExtensionForMIMEType):
2857         Report "xml" extension for "application/xml" mimetype.
2858         (WI.shouldTreatMIMETypeAsText):
2859         Treat XML files as text.
2860
2861 2019-07-16  Nikita Vasilyev  <nvasilyev@apple.com>
2862
2863         Web Inspector: Changes panel should be strictly LTR
2864         https://bugs.webkit.org/show_bug.cgi?id=199767
2865
2866         Reviewed by Joseph Pecoraro.
2867
2868         Changes panel is primarily CSS code and CSS is strictly LTR.
2869
2870         * UserInterface/Views/ChangesDetailsSidebarPanel.js:
2871         (WI.ChangesDetailsSidebarPanel):
2872
2873 2019-07-15  Youenn Fablet  <youenn@apple.com>
2874
2875         Enable a debug WebRTC mode without any encryption
2876         https://bugs.webkit.org/show_bug.cgi?id=199177
2877         <rdar://problem/52074986>
2878
2879         Reviewed by Eric Carlson.
2880
2881         * Localizations/en.lproj/localizedStrings.js:
2882         * UserInterface/Base/Main.js:
2883
2884 2019-07-15  Greg Doolittle <gr3g@apple.com>
2885
2886         Web Inspector: AXI: Audit: Typos in Accessibility audits
2887         https://bugs.webkit.org/show_bug.cgi?id=199716
2888         <rdar://problem/52721711>
2889
2890         Reviewed by Devin Rousso.
2891
2892         * UserInterface/Controllers/AuditManager.js:
2893
2894 2019-07-15  Devin Rousso  <drousso@apple.com>
2895
2896         Web Inspector: Device Settings: update Safari user agent from 12.2 to 13.0
2897         https://bugs.webkit.org/show_bug.cgi?id=199758
2898
2899         Reviewed by Maciej Stachowiak.
2900
2901         * UserInterface/Base/Main.js:
2902         (WI._handleDeviceSettingsToolbarButtonClicked):
2903
2904 2019-07-12  Nikita Vasilyev  <nvasilyev@apple.com>
2905
2906         Web Inspector: Changes: dismissing a blank property makes style rule to show in Changes panel
2907         https://bugs.webkit.org/show_bug.cgi?id=199760
2908
2909         Reviewed by Devin Rousso.
2910
2911         * UserInterface/Models/CSSProperty.js:
2912         (WI.CSSProperty.prototype._updateOwnerStyleText):
2913         Call updatePropertiesModifiedState even when _updateOwnerStyleText returns early.
2914
2915 2019-07-12  Devin Rousso  <drousso@apple.com>
2916
2917         Web Inspector: Elements: always show all navigation bar items, but disable those that wouldn't work
2918         https://bugs.webkit.org/show_bug.cgi?id=199594
2919
2920         Reviewed by Ross Kirsling.
2921
2922         Reorder the navigation items of the Elements tab (left to right):
2923          - Show rulers
2924          - Force print media styles
2925          - Force Dark Appearance / Force Light Appearance
2926          - Show compositing borders
2927          - Enable paint flashing
2928          - Show shadow DOM nodes
2929         This way, "related" (e.g. print styles and dark/light appearance both relate to CSS media)
2930         toggles are grouped closer together.
2931
2932         * UserInterface/Views/DOMTreeContentView.js:
2933         (WI.DOMTreeContentView):
2934         (WI.DOMTreeContentView.prototype.get navigationItems):
2935         (WI.DOMTreeContentView.prototype._defaultAppearanceDidChange):
2936         (WI.DOMTreeContentView.prototype._toggleAppearance):
2937
2938         * Localizations/en.lproj/localizedStrings.js:
2939
2940 2019-07-11  Devin Rousso  <drousso@apple.com>
2941
2942         Web Inspector: Layers: Uncaught Exception: Request with id = 2 failed. {"code":-32601,"message":"'Page' domain was not found","data":[{"code":-32601,"message":"'Page' domain was not found"}]}
2943         https://bugs.webkit.org/show_bug.cgi?id=199555
2944
2945         Reviewed by Joseph Pecoraro.
2946
2947         Use modern inspected target support checking, and defer agent commands until a target is
2948         available.
2949
2950         * UserInterface/Views/Layers3DContentView.js:
2951         (WI.Layers3DContentView):
2952         (WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
2953         (WI.Layers3DContentView.prototype._updateCompositingBordersButtonState):
2954         (WI.Layers3DContentView.prototype._toggleCompositingBorders):
2955
2956         * UserInterface/Views/DOMTreeContentView.js:
2957         (WI.DOMTreeContentView):
2958         (WI.DOMTreeContentView.prototype._toggleCompositingBorders):
2959         (WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):
2960         (WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged):
2961         (WI.DOMTreeContentView.prototype._showPrintStylesChanged):
2962         (WI.DOMTreeContentView.prototype._showRulersChanged):
2963         Drive-by: apply the same changes to the Elements tab for when the Layers tab isn't enabled.
2964
2965 2019-07-09  Devin Rousso  <drousso@apple.com>
2966
2967         Web Inspector: Canvas: replace WTF::Vector with std::initializer_list in CallTracer to avoid dynamic allocations
2968         https://bugs.webkit.org/show_bug.cgi?id=199611
2969
2970         Reviewed by Joseph Pecoraro.
2971
2972         * UserInterface/Models/Recording.js:
2973         (WI.Recording.prototype.async swizzle):
2974         Drive-by: handle the situation where a parameter is an array of deduplicated strings, which
2975                   would otherwise be treated as an array of numbers.
2976
2977 2019-07-09  Joseph Pecoraro  <pecoraro@apple.com>
2978
2979         Web Inspector: Add another Protocol Version (iOS 13.0)
2980         https://bugs.webkit.org/show_bug.cgi?id=199631
2981         <rdar://problem/47538193>
2982
2983         Reviewed by Devin Rousso.
2984
2985         * UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js: Added.
2986         * Versions/Inspector-iOS-13.0.json: Added.
2987
2988 2019-07-08  Devin Rousso  <drousso@apple.com>
2989
2990         Web Inspector: Debugger: special breakpoints and event targets should be sorted into separate "areas"
2991         https://bugs.webkit.org/show_bug.cgi?id=199554
2992
2993         Reviewed by Joseph Pecoraro.
2994
2995         Move the special All Requests breakpoint down to be right above all other URL breakpoints.
2996         Move the `window` object tree element below other DOM node tree elements.
2997
2998         * UserInterface/Views/DebuggerSidebarPanel.js:
2999         (WI.DebuggerSidebarPanel.prototype._addTreeElement):
3000         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
3001         (WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
3002
3003 2019-07-08  Devin Rousso  <drousso@apple.com>
3004
3005         Web Inspector: DOM Debugger: there should be different icons for each type of DOM breakpoint
3006         https://bugs.webkit.org/show_bug.cgi?id=199552
3007
3008         Reviewed by Joseph Pecoraro.
3009
3010         [S] for Subtree Modified
3011         [A] for Attribute Modified
3012         [R] for Node Removed
3013
3014         * UserInterface/Views/DOMBreakpointTreeElement.js:
3015         (WI.DOMBreakpointTreeElement):
3016         * UserInterface/Views/DOMBreakpointTreeElement.css: Added.
3017         (.breakpoint.dom.breakpoint-for-subtree-modified:not(.breakpoint-paused-icon) .icon):
3018         (.breakpoint.dom.breakpoint-for-attribute-modified:not(.breakpoint-paused-icon) .icon):
3019         (.breakpoint.dom.breakpoint-for-node-removed:not(.breakpoint-paused-icon) .icon):
3020
3021         * UserInterface/Main.html:
3022         * UserInterface/Images/DOMBreakpointAttributeModified.svg: Added.
3023         * UserInterface/Images/DOMBreakpointNodeRemoved.svg: Added.
3024         * UserInterface/Images/DOMBreakpointSubtreeModified.svg: Added.
3025
3026 2019-07-08  Devin Rousso  <drousso@apple.com>
3027
3028         Uncaught Exception: Unexpected enum value: CPU
3029         https://bugs.webkit.org/show_bug.cgi?id=199564
3030
3031         Reviewed by Joseph Pecoraro.
3032
3033         * UserInterface/Controllers/TimelineManager.js:
3034         (WI.TimelineManager.prototype._updateAutoCaptureInstruments):
3035         Filter the list of auto-capture instruments based on what's actually supported, instead of
3036         directly using the saved list from the `WI.Setting`.
3037
3038 2019-07-08  Devin Rousso  <drousso@apple.com>
3039
3040         Enabling the Layers tab hides the paint flashing button
3041         https://bugs.webkit.org/show_bug.cgi?id=199549
3042
3043         Reviewed by Joseph Pecoraro.
3044
3045         Still show the Compositing Borders and Paint Flashing navigation items in the Elements tab
3046         even when the Layers tab is enabled (just like the Layers details sidebar).
3047
3048         * UserInterface/Views/DOMTreeContentView.js:
3049         (WI.DOMTreeContentView.prototype.get navigationItems):
3050         (WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):
3051
3052 2019-07-08  Devin Rousso  <drousso@apple.com>
3053
3054         Web Inspector: REGRESSION: Elements: pasting in the Styles sidebar adds a text node to the DOM tree
3055         https://bugs.webkit.org/show_bug.cgi?id=199588
3056
3057         Reviewed by Joseph Pecoraro.
3058
3059         * UserInterface/Base/Main.js:
3060         (WI._paste):
3061         Bail if `event.defaultPrevented`, as that means that something else has handled (and likely
3062         overrode) this event.
3063
3064 2019-07-08  Devin Rousso  <drousso@apple.com>
3065
3066         Web Inspector: the "x" in the Exception icon overlaps the border
3067         https://bugs.webkit.org/show_bug.cgi?id=199553
3068
3069         Reviewed by Joseph Pecoraro.
3070
3071         * UserInterface/Images/Exception.svg:
3072         * UserInterface/Images/Function.svg:
3073         * UserInterface/Images/TailDeletedFunction.svg:
3074
3075 2019-07-08  Devin Rousso  <drousso@apple.com>
3076
3077         Web Inspector: Debugger: there should be a different icon for URL breakpoints
3078         https://bugs.webkit.org/show_bug.cgi?id=199550
3079
3080         Reviewed by Joseph Pecoraro.
3081
3082         Use the same (down|up) arrow icon for the Network Tab and the Network timeline.
3083
3084         * UserInterface/Views/URLBreakpointTreeElement.js:
3085         (WI.URLBreakpointTreeElement):
3086         * UserInterface/Views/URLBreakpointTreeElement.css:
3087         (.breakpoint.url:not(.breakpoint-paused-icon) .icon): Added.
3088
3089         * UserInterface/Views/DebuggerSidebarPanel.js:
3090         (WI.DebuggerSidebarPanel.prototype._addBreakpoint):
3091         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
3092         (WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
3093
3094         * UserInterface/Images/URLBreakpoint.svg: Added.
3095
3096 2019-07-08  Devin Rousso  <drousso@apple.com>
3097
3098         Web Inspector: Timelines: CPU: the Duration string isn't localized
3099         https://bugs.webkit.org/show_bug.cgi?id=199582
3100         <rdar://problem/51698165>
3101
3102         Reviewed by Joseph Pecoraro.
3103
3104         * UserInterface/Views/CPUTimelineView.js:
3105         (WI.CPUTimelineView.prototype._layoutEnergyChart):
3106
3107         * Localizations/en.lproj/localizedStrings.js:
3108
3109 2019-07-06  Nikita Vasilyev  <nvasilyev@apple.com>
3110
3111         Web Inspector: Styles: unbalanced quotes and parenthesis aren't displayed as property closed after editing values
3112         https://bugs.webkit.org/show_bug.cgi?id=199090
3113         <rdar://problem/51965431>
3114
3115         Reviewed by Devin Rousso.
3116
3117         `}` gets added by WI.tokenizeCSSValue (called by SpreadsheetStyleProperty.prototype._renderValue)
3118         when it encounters unbalanced quotes. Fix unbalanced quotes by re-rendering the value from the model,
3119         not the DOM content.
3120
3121         * UserInterface/Views/SpreadsheetStyleProperty.js:
3122         (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit):
3123         For consistency, render property name from the model as well.
3124
3125 2019-07-05  Devin Rousso  <drousso@apple.com>
3126
3127         Web Inspector: current call frame indicator not visible in dark mode
3128         https://bugs.webkit.org/show_bug.cgi?id=199047
3129         <rdar://problem/51922895>
3130
3131         Reviewed by Timothy Hatcher.
3132
3133         * UserInterface/Views/CallFrameTreeElement.css:
3134         (.tree-outline .item.call-frame .status > .status-image):
3135         (.tree-outline .item.call-frame.selected .status > .status-image):
3136         Replace the CSS variables used for `fill` with their actual color value (in `light` mode),
3137         as the semantic "name" of the variable doesn't really match its usage. As an example, the
3138         current call frame shouldn't rely on the value of `--border-color`, as it's not a "border".
3139
3140 2019-07-05  Matt Baker  <mattbaker@apple.com>
3141
3142         Web Inspector: Elements: use a CSS transition when showing/hiding DOM breakpoint gutter
3143         https://bugs.webkit.org/show_bug.cgi?id=199411
3144
3145         Reviewed by Devin Rousso.
3146
3147         * UserInterface/Views/DOMTreeContentView.css:
3148         (.content-view.dom-tree .tree-outline.dom):
3149
3150 2019-07-02  Devin Rousso  <drousso@apple.com>
3151
3152         Web Inspector: Elements: allow nodes to be copied and pasted
3153         https://bugs.webkit.org/show_bug.cgi?id=199182
3154
3155         Reviewed by Matt Baker.
3156
3157         Copy is already supported, so there's nothing that needs to be done there.
3158
3159         Pasting is as simple as calling `insertAdjacentHTML("afterend", ...)` on the selected node.
3160
3161         * UserInterface/Base/Main.js:
3162         (WI.contentLoaded):
3163         (WI._paste): Added.
3164
3165         * UserInterface/Views/DOMTreeContentView.js:
3166         (WI.DOMTreeContentView.prototype.handlePasteEvent): Added.
3167
3168 2019-07-02  Devin Rousso  <drousso@apple.com>
3169
3170         Web Inspector: DOM Debugger: descendant breakpoints should be able to be enabled/disabled/deleted from a collapsed parent
3171         https://bugs.webkit.org/show_bug.cgi?id=199332
3172
3173         Reviewed by Matt Baker.
3174
3175         * UserInterface/Controllers/DOMDebuggerManager.js:
3176         (WI.DOMDebuggerManager.prototype.get domBreakpoints):
3177         (WI.DOMDebuggerManager.prototype.domBreakpointsForNode):
3178         (WI.DOMDebuggerManager.prototype.domBreakpointsInSubtree): Added.
3179         (WI.DOMDebuggerManager.prototype.removeDOMBreakpoint):
3180         (WI.DOMDebuggerManager.prototype._detachDOMBreakpoint):
3181         (WI.DOMDebuggerManager.prototype._detachBreakpointsForFrame):
3182         (WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL):
3183         (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
3184         Provide a way of getting a "summary" array of `DOMBreakpoint`s for all descendant nodes.
3185         Rework the data structure for holding `DOMBreakpoint`s to use a `Multimap` so no duplicates
3186         can be added (it uses a `Set` instead of an `Array`).
3187
3188         * UserInterface/Views/DOMTreeElement.js:
3189         (WI.DOMTreeElement):
3190         (WI.DOMTreeElement.prototype.get hasBreakpoint):
3191         (WI.DOMTreeElement.prototype.set breakpointStatus):
3192         (WI.DOMTreeElement.prototype.bindRevealDescendantBreakpointsMenuItemHandler): Added.
3193         (WI.DOMTreeElement.prototype._subtreeBreakpointChanged): Added.
3194         (WI.DOMTreeElement.prototype._updateBreakpointStatus):
3195         (WI.DOMTreeElement.prototype._statusImageContextmenu):
3196         (WI.DOMTreeElement.prototype.subtreeBreakpointCountDidChange): Deleted.
3197         * UserInterface/Views/DOMTreeOutline.js:
3198         (WI.DOMTreeOutline.prototype.populateContextMenu):
3199         * UserInterface/Views/ContextMenuUtilities.js:
3200         (WI.appendContextMenuItemsForDOMNode):
3201         (WI.appendContextMenuItemsForDOMNodeBreakpoints):
3202         Keep track of the actual descendant `DOMNodeTreeElement` that have breakpoints, rather than
3203         just a count, so that the "Reveal Descendant Breakpoints" action is able to access them.
3204         Change "Reveal Descendant Breakpoints" to reveal and select all descendant breakpoints
3205         instead of just the first one.
3206         Drive-by: don't remove specific (event) listener breakpoints when invoking the
3207                   "Delete Descendant Breakpoints" action, as that's not obvious from the UI.
3208
3209         * UserInterface/Controllers/BreakpointPopoverController.js:
3210         (WI.BreakpointPopoverController.prototype.appendContextMenuItems):
3211         * UserInterface/Views/DOMBreakpointTreeElement.js:
3212         (WI.DOMBreakpointTreeElement.prototype.populateContextMenu):
3213         * UserInterface/Views/DOMNodeTreeElement.js:
3214         (WI.DOMNodeTreeElement.prototype.populateContextMenu):
3215         * UserInterface/Views/EventBreakpointTreeElement.js:
3216         (WI.EventBreakpointTreeElement.prototype.populateContextMenu):
3217         * UserInterface/Views/URLBreakpointTreeElement.js:
3218         (WI.URLBreakpointTreeElement.prototype.populateContextMenu):
3219         Remove the separator before "Delete Breakpoint" so all breakpoint actions are in the same section.
3220
3221         * Localizations/en.lproj/localizedStrings.js:
3222         * UserInterface/Base/Multimap.js:
3223         (Multimap.prototype.get size): Added.
3224
3225 2019-07-02  Matt Baker  <mattbaker@apple.com>
3226
3227         REGRESSION (r238563): Web Inspector: Selection is erratic when holding Up/Down on Network Table
3228         https://bugs.webkit.org/show_bug.cgi?id=193841
3229         <rdar://problem/47559124>
3230
3231         Reviewed by Devin Rousso.
3232
3233         Selecting and revealing a row after reloading Table data, but before the
3234         layout that populates visible rows, could cause the Table to always be
3235         scrolled so that the revealed row is first.
3236
3237         This patch fixes `revealRow` by calculating the position of the row being
3238         revealed in the absence of its DOM element, so that the Table is only
3239         scrolled when necessary.
3240
3241         * UserInterface/Views/Table.js:
3242         (WI.Table.prototype.revealRow):
3243         (WI.Table.prototype._resizeColumnsAndFiller):
3244         Drive-by fix: use realOffsetWidth for consistency.
3245         (WI.Table.prototype._updateVisibleRows):
3246         (WI.Table.prototype._calculateOffsetHeight):
3247         (WI.Table.prototype._calculateScrollTop):
3248
3249 2019-07-02  Devin Rousso  <drousso@apple.com>
3250
3251         Web Inspector: Debug: "Reset Web Inspector" should also clear the saved window size and attachment side
3252         https://bugs.webkit.org/show_bug.cgi?id=198956
3253
3254         Reviewed by Matt Baker.
3255
3256         * UserInterface/Base/Main.js:
3257         (WI.reset): Added.
3258
3259         * UserInterface/Views/SettingsTabContentView.js:
3260         (WI.SettingsTabContentView.prototype._createDebugSettingsView):
3261
3262 2019-07-02  Devin Rousso  <drousso@apple.com>
3263
3264         Web Inspector: Audit: missing demo audits for WebInspectorAudit functions
3265         https://bugs.webkit.org/show_bug.cgi?id=198719
3266
3267         Reviewed by Matt Baker.
3268
3269         Other than the LayoutTests, there's no way to see an example of the functionality of many of
3270         the exposed `WebInspectorAudit` functions. There should be a demo audit for every exposed
3271         function so they're more discoverable.
3272
3273         * UserInterface/Controllers/AuditManager.js:
3274         (WI.AuditManager.prototype._addDefaultTests):
3275         (WI.AuditManager.prototype._addDefaultTests.removeWhitespace): Added.
3276         Move all demo audit test functions to be actual JavaScript functions, which are then
3277         stringified and stripped of unnecessary white-space.
3278
3279         * Localizations/en.lproj/localizedStrings.js:
3280
3281 2019-07-01  Devin Rousso  <drousso@apple.com>
3282
3283         Web Inspector: REGRESSION(r245498): Timelines: CPU: discontinuities are filled in by the next record
3284         https://bugs.webkit.org/show_bug.cgi?id=198927
3285
3286         Reviewed by Matt Baker.
3287
3288         * UserInterface/Controllers/TimelineManager.js:
3289         (WI.TimelineManager.prototype.capturingStarted):
3290         (WI.TimelineManager.prototype.capturingStopped):
3291         * UserInterface/Models/TimelineRecording.js:
3292         (WI.TimelineRecording):
3293         (WI.TimelineRecording.prototype.start):
3294         (WI.TimelineRecording.prototype.capturingStarted): Added.
3295         (WI.TimelineRecording.prototype.capturingStopped): Added.
3296         (WI.TimelineRecording.prototype.reset):
3297         (WI.TimelineRecording.prototype.addRecord):
3298         (WI.TimelineRecording.prototype.discontinuitiesInTimeRange):
3299         (WI.TimelineRecording.prototype.addD