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