Web Inspector: TestSuite test cases should have their own timeout to ensure tests...
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2019-04-05  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: TestSuite test cases should have their own timeout to ensure tests fail with output instead of timeout by test runner
4         https://bugs.webkit.org/show_bug.cgi?id=162814
5         <rdar://problem/28574102>
6
7         Reviewed by Brian Burg.
8
9         A 10s timer is started for every test case added to an async suite. The timer is cleared
10         when the test finishes, but if the timer fires, the test is forcibly ended with an error.
11
12         This timer can be configured by setting a `timeout` value when adding the test case. Values
13         are expected to be in milliseconds. The value `-1` will prevent a timer from being set.
14
15         This change also relaxes the expectation that any individual test case failure will stop the
16         rest of the suite from running. Since timers are set per test case, it is possible to
17         recover from a "bad" test case to still run the remaining test cases.
18
19         NOTE: there may be unexpected behaviour if a test times out, as the timer doesn't actually
20         stop the execution of the test, so it may still run and log information, which may appear
21         "out of nowhere" in the middle of other tests.
22
23         * UserInterface/Test/TestSuite.js:
24         (TestSuite.prototype.get passCount):
25         (AsyncTestSuite.prototype.runTestCases):
26         (SyncTestSuite.prototype.runTestCases):
27
28 2019-04-03  Devin Rousso  <drousso@apple.com>
29
30         Web Inspector: Single click on links in non-read-only TextEditors should not follow links
31         https://bugs.webkit.org/show_bug.cgi?id=123364
32         <rdar://problem/15323913>
33
34         Reviewed by Timothy Hatcher.
35
36         * UserInterface/Base/Main.js:
37         (WI._updateModifierKeys):
38         Add classes to the body whenever alt, shift, or ctrl are pressed.
39
40         * UserInterface/Views/CodeMirrorEditor.js:
41         (WI.CodeMirrorEditor.create):
42         Add a `read-only` class if the `CodeMirror` is readonly.
43
44         * UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
45         (.cm-s-default .cm-link,):
46         (.read-only.cm-s-default .cm-link:hover,):
47         (.cm-s-default .cm-link:hover,): Deleted.
48
49         * UserInterface/Views/TextEditor.js:
50         (WI.TextEditor.prototype.set readOnly):
51         (WI.TextEditor.prototype._openClickedLinks):
52
53 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
54
55         Remove support for -apple-trailing-word
56         https://bugs.webkit.org/show_bug.cgi?id=196525
57
58         Reviewed by Zalan Bujtas.
59
60         This CSS property is nonstandard and not used.
61
62         * UserInterface/Models/CSSKeywordCompletions.js:
63
64 2019-04-03  Nikita Vasilyev  <nvasilyev@apple.com>
65
66         Web Inspector: Uncaught Exception: TypeError: this._computedStyleSection.focus is not a function. (In 'this._computedStyleSection.focus()', 'this._computedStyleSection.focus' is undefined)
67         https://bugs.webkit.org/show_bug.cgi?id=192108
68         <rdar://problem/46685392>
69
70         Reviewed by Devin Rousso.
71
72         This patch fixes the uncaught exception. Tabbing to and from "Properties" section continues
73         working the same way as before the patch.
74
75         * UserInterface/Views/ComputedStyleDetailsPanel.js:
76         (WI.ComputedStyleDetailsPanel.prototype.focusFirstSection): Deleted.
77         (WI.ComputedStyleDetailsPanel.prototype.focusLastSection): Deleted.
78
79 2019-04-02  Devin Rousso  <drousso@apple.com>
80
81         Web Inspector: Elements: DOM breakpoint icon should stroke when hovering selection area
82         https://bugs.webkit.org/show_bug.cgi?id=196516
83         <rdar://problem/49540494>
84
85         Reviewed by Timothy Hatcher.
86
87         * UserInterface/Views/DOMTreeContentView.css:
88         (body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, .hovered) .status-image.breakpoint,): Added.
89         (body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, .hovered) .status-image.breakpoint.subtree): Added.
90         (body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, :hover) .status-image.breakpoint): Deleted.
91         (body:not(.window-inactive) .content-view.dom-tree .tree-outline.dom:focus li:matches(.selected, :hover) .status-image.breakpoint.subtree): Deleted.
92
93 2019-04-01  Devin Rousso  <drousso@apple.com>
94
95         Web Inspector: Debugger: modernize serialization of breakpoints and the maps that hold them
96         https://bugs.webkit.org/show_bug.cgi?id=196230
97         <rdar://problem/49236485>
98
99         Reviewed by Joseph Pecoraro.
100
101         * UserInterface/Controllers/DebuggerManager.js:
102         (WI.DebuggerManager):
103         (WI.DebuggerManager.prototype.breakpointsForSourceCode):
104         (WI.DebuggerManager.prototype.addBreakpoint):
105         (WI.DebuggerManager.prototype.removeBreakpoint):
106         (WI.DebuggerManager.prototype._setBreakpoint):
107         (WI.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
108
109         * UserInterface/Models/Breakpoint.js:
110         (WI.Breakpoint):
111         (WI.Breakpoint.fromJSON): Added.
112         (WI.Breakpoint.prototype.toJSON):
113         (WI.Breakpoint.prototype.set resolved):
114         (WI.Breakpoint.prototype.recreateAction):
115         (WI.Breakpoint.prototype.saveIdentityToCookie):
116         (WI.Breakpoint.prototype._isSpecial): Added.
117         (WI.Breakpoint.set resolved.isSpecialBreakpoint): Deleted.
118         (WI.Breakpoint.serializeOptions): Deleted.
119
120         * UserInterface/Models/BreakpointAction.js:
121         (WI.BreakpointAction):
122         (WI.BreakpointAction.fromJSON): Added.
123         (WI.BreakpointAction.prototype.toProtocol): Added.
124
125         * UserInterface/Views/DebuggerSidebarPanel.js:
126         (WI.DebuggerSidebarPanel.prototype._addBreakpointsForSourceCode):
127
128         * UserInterface/Views/SourceCodeTextEditor.js:
129         (WI.SourceCodeTextEditor.prototype._prepareEditorForInitialContent):
130         (WI.SourceCodeTextEditor.prototype._breakpointsEnabledDidChange):
131
132 2019-04-01  Devin Rousso  <drousso@apple.com>
133
134         Web Inspector: DOMDebugger: disabling a breakpoint for a specific event listener removes it from the UI
135         https://bugs.webkit.org/show_bug.cgi?id=196453
136         <rdar://problem/49489318>
137
138         Reviewed by Joseph Pecoraro.
139
140         Allow breakpoints for specific event listeners to be disabled, rather than immeditately
141         removing/deleting them when they are about to become disabled. This preserves the existing
142         functionality, but now allows for the tree element to stay in the UI in a disabled state.
143
144         * UserInterface/Controllers/DOMManager.js:
145         (WI.DOMManager):
146         (WI.DOMManager.prototype.setBreakpointForEventListener):
147         (WI.DOMManager.prototype.removeBreakpointForEventListener):
148         (WI.DOMManager.prototype.removeEventListenerBreakpointsForNode): Added.
149         (WI.DOMManager.prototype._updateEventBreakpoint): Added.
150         (WI.DOMManager.prototype._handleEventBreakpointDisabledStateChanged): Added.
151
152         * UserInterface/Controllers/DOMDebuggerManager.js:
153         (WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
154
155         * UserInterface/Views/EventBreakpointTreeElement.js:
156         (WI.EventBreakpointTreeElement.prototype.populateContextMenu):
157         (WI.EventBreakpointTreeElement.prototype._toggleBreakpoint):
158
159         * UserInterface/Views/ContextMenuUtilities.js:
160         (WI.appendContextMenuItemsForDOMNodeBreakpoints):
161
162         * UserInterface/Views/DOMNodeTreeElement.js:
163         (WI.DOMNodeTreeElement.prototype.ondelete):
164
165 2019-04-01  Devin Rousso  <drousso@apple.com>
166
167         Web Inspector: Canvas: auto-record after page load sometimes shows the wrong UI
168         https://bugs.webkit.org/show_bug.cgi?id=196320
169         <rdar://problem/49356686>
170
171         Reviewed by Joseph Pecoraro.
172
173         It was previously possible that the timing of a recording being started and the preview
174         image being loaded would not always be in the same order.
175
176         Utilize the existing `View.prototype.layout` mechanics to ensure that updates are coalesced
177         and that the changes are always applied in a particular order.
178
179         * UserInterface/Views/CanvasContentView.js:
180         (WI.CanvasContentView):
181         (WI.CanvasContentView.prototype.refreshPreview): Added.
182         (WI.CanvasContentView.prototype.initialLayout):
183         (WI.CanvasContentView.prototype.layout):
184         (WI.CanvasContentView.prototype.shown):
185         (WI.CanvasContentView.prototype.attached):
186         (WI.CanvasContentView.prototype._refreshPixelSize):
187         (WI.CanvasContentView.prototype.refresh): Deleted.
188         (WI.CanvasContentView.prototype._recordingStarted): Deleted.
189         (WI.CanvasContentView.prototype._recordingProgress): Deleted.
190         (WI.CanvasContentView.prototype._recordingStopped): Deleted.
191         (WI.CanvasContentView.prototype._shaderProgramAdded): Deleted.
192         (WI.CanvasContentView.prototype._shaderProgramRemoved): Deleted.
193
194         * UserInterface/Views/CanvasOverviewContentView.js:
195         (WI.CanvasOverviewContentView.prototype._refreshPreviews):
196
197 2019-04-01  Devin Rousso  <drousso@apple.com>
198
199         Web Inspector: Canvas: add compatibility support for WebMetal
200         https://bugs.webkit.org/show_bug.cgi?id=196412
201         <rdar://problem/49439417>
202
203         Reviewed by Joseph Pecoraro.
204
205         * UserInterface/Models/Canvas.js:
206         (WI.Canvas.fromPayload):
207         (WI.Canvas.displayNameForContextType):
208         * UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
209         * Versions/Inspector-iOS-12.2.json:
210
211 2019-04-01  Devin Rousso  <drousso@apple.com>
212
213         Web Inspector: "Copy as HTML" appears twice when showing a context menu for a logged node
214         https://bugs.webkit.org/show_bug.cgi?id=196271
215         <rdar://problem/49290676>
216
217         Reviewed by Joseph Pecoraro.
218
219         * UserInterface/Views/ObjectTreeBaseTreeElement.js:
220         (WI.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
221
222         * Localizations/en.lproj/localizedStrings.js:
223
224 2019-04-01  Devin Rousso  <drousso@apple.com>
225
226         Web Inspector: Debugger: breakpoints don't populate in inspector2 on first load
227         https://bugs.webkit.org/show_bug.cgi?id=196063
228         <rdar://problem/49097787>
229
230         Reviewed by Joseph Pecoraro.
231
232         In the case that a breakpoint becomes resolved after the resource has finished loaded, there
233         won't be an already existing `TreeElement` for the breakpoint to replace.
234
235         This can realistically only happen if the IndexedDB lookup is super slow, or the resource is
236         extremely fast (e.g. a `data` url).
237
238         * UserInterface/Views/DebuggerSidebarPanel.js:
239         (WI.DebuggerSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):
240         (WI.DebuggerSidebarPanel.prototype._addDebuggerObject): Deleted.
241
242         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
243         (WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
244         (WI.SourcesNavigationSidebarPanel.prototype._addBreakpointsForSourceCode):
245         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):
246
247 2019-04-01  Joseph Pecoraro  <pecoraro@apple.com>
248
249         Web Inspector: CPU Usage Timeline - Adjust Energy Impact Threshholds
250         https://bugs.webkit.org/show_bug.cgi?id=196421
251         <rdar://problem/49125703>
252
253         Reviewed by Devin Rousso.
254
255         - Low - Keep Below 3% to continue to encourage idle pages stay below 3%
256           Might want to reduce to 2.5 or 2 after fixing bug 196419.
257
258         - High - Make Above 30% instead of 50% to encourage long running interactivity to stay below 30%
259           Depends on interaction, but sustained (1-2min) at 30%+ will certainly impact battery.
260
261         - Very High - Make above 100% instead of 150%
262           CPU Usage spikes around page load and is quite often still under 100% despite many threads.
263           Drop this a bit as we dropped High down.
264
265         Reduce the size of the Medium section, and increase the High section
266         Having 70% of the chart be "Medium" is just too much Medium, and
267         we've now made it more possible to be in the High range.
268
269         * UserInterface/Views/CPUTimelineView.js:
270         (WI.CPUTimelineView.prototype.get mediumEnergyThreshold):
271         (WI.CPUTimelineView.prototype.get highEnergyThreshold):
272         (WI.CPUTimelineView.prototype.get lowEnergyGraphBoundary):
273         (WI.CPUTimelineView.prototype.get mediumEnergyGraphBoundary):
274         (WI.CPUTimelineView.prototype.get highEnergyGraphBoundary):
275         (WI.CPUTimelineView.prototype.initialLayout):
276         (WI.CPUTimelineView.prototype.layout.bestThreadLayoutMax):
277         (WI.CPUTimelineView.prototype._layoutEnergyChart):
278
279 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
280
281         Delete WebMetal implementation in favor of WebGPU
282         https://bugs.webkit.org/show_bug.cgi?id=195418
283
284         Reviewed by Dean Jackson.
285
286         * UserInterface/Models/Canvas.js:
287         (WI.Canvas.fromPayload):
288         (WI.Canvas.displayNameForContextType):
289         * UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
290         * Versions/Inspector-iOS-12.2.json:
291
292 2019-03-29  Devin Rousso  <drousso@apple.com>
293
294         Web Inspector: Storage: some cookie column headers are not localized
295         https://bugs.webkit.org/show_bug.cgi?id=196406
296         <rdar://problem/48467422>
297
298         Reviewed by Joseph Pecoraro.
299
300         * UserInterface/Views/CookieStorageContentView.js:
301         (WI.CookieStorageContentView.prototype.initialLayout):
302
303         * Localizations/en.lproj/localizedStrings.js:
304
305 2019-03-28  Joseph Pecoraro  <pecoraro@apple.com>
306
307         Web Inspector: Show Resource Initiator in Network Tab detail views
308         https://bugs.webkit.org/show_bug.cgi?id=196316
309         <rdar://problem/49352679>
310
311         Reviewed by Devin Rousso.
312
313         * UserInterface/Controllers/NetworkManager.js:
314         (WI.NetworkManager.prototype.resourceRequestWillBeSent):
315         (WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache):
316         (WI.NetworkManager.prototype._initiatorCallFramesFromPayload):
317         Initialize call frames from the initiator payload.
318
319         * UserInterface/Models/Resource.js:
320         (WI.Resource.prototype.get initiatorCallFrames):
321         Initialization and accessor.
322
323         * UserInterface/Views/CallFrameTreeElement.js:
324         (WI.CallFrameTreeElement):
325         Selecting a native element won't do anything so just don't allow selection.
326
327         * UserInterface/Views/ResourceHeadersContentView.css:
328         (.resource-headers .go-to-link):
329         (.resource-headers .call-stack):
330         (.resource-headers .call-stack:hover):
331         (@media (prefers-color-scheme: dark)):
332         * UserInterface/Views/ResourceHeadersContentView.js:
333         (WI.ResourceHeadersContentView):
334         (WI.ResourceHeadersContentView.prototype.hidden):
335         (WI.ResourceHeadersContentView.prototype._refreshSummarySection):
336         Add an "Initiator" line in the summary with a way to view the whole
337         initiator backtrace if one exists.
338
339 2019-03-26  Devin Rousso  <drousso@apple.com>
340
341         Web Inspector: Sources: fix typo in CSS selector to always show add breakpoint button
342         https://bugs.webkit.org/show_bug.cgi?id=196241
343
344         Reviewed by Matt Baker.
345
346         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
347         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.paused-reason, .breakpoints).collapsed > .header > .options,):
348         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.paused-reason, .breakpoins).collapsed > .header > .options,): Deleted.
349
350 2019-03-25  Joseph Pecoraro  <pecoraro@apple.com>
351
352         Web Inspector: Page Weight indicator clears on pages with zero length resources (macrumors.com)
353         https://bugs.webkit.org/show_bug.cgi?id=196170
354
355         Reviewed by Timothy Hatcher.
356
357         * UserInterface/Models/DefaultDashboard.js:
358         (WI.DefaultDashboard.prototype._resourceSizeDidChange):
359         Catch NaN earlier.
360
361         * UserInterface/Models/Resource.js:
362         (WI.Resource.prototype.updateWithMetrics):
363         When we receive exact metrics transition the estimated size to zero,
364         since we won't receive any more updates for the resource.
365
366 2019-03-24  Devin Rousso  <drousso@apple.com>
367
368         Web Inspector: Canvas: WebGL action icon shouldn't invert when selected
369         https://bugs.webkit.org/show_bug.cgi?id=196135
370
371         Reviewed by Timothy Hatcher.
372
373         * UserInterface/Views/RecordingActionTreeElement.js:
374         (WI.RecordingActionTreeElement._classNameForAction):
375         (WI.RecordingActionTreeElement._classNameForAction.classNameForActionName): Deleted.
376         Remove unnecessary logging and memoization.
377
378         * UserInterface/Views/RecordingActionTreeElement.css:
379         (.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
380         (@media (prefers-color-scheme: dark)):
381         (.item.recording-action:not(.invalid, .initial-state, .has-context-replacer, .name-unknown) > .icon): Added.
382         (.tree-outline:focus .item.recording-action.selected:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
383         (.item.recording-action.has-context-replacer > .icon): Deleted.
384         (.item.recording-action:not(.invalid, .initial-state, .has-context-replacer) > .icon): Deleted.
385         Simplify styles between light and dark mode.
386
387 2019-03-24  Simon Welsh  <simon@welsh-au.com>
388
389         Web Inspector: testCellRoleForRequiredChidren accessibility audit checks for rows in cells
390         https://bugs.webkit.org/show_bug.cgi?id=195988
391
392         Reviewed by Timothy Hatcher.
393
394         The audit now checks that rows contain cells, allowing any of the four
395         cell-based roles.
396
397         * UserInterface/Controllers/AuditManager.js:
398         (WI.AuditManager.prototype.addDefaultTestsIfNeeded):
399         (WI.AuditManager):
400         (WI.AuditManager.prototype.addDefaultTestsIfNeeded.const.testCellRoleForRequiredChidren): Deleted.
401
402 2019-03-24  Devin Rousso  <drousso@apple.com>
403
404         Web Inspector: Canvas: missing icons for WebGL2 contexts
405         https://bugs.webkit.org/show_bug.cgi?id=196136
406
407         Reviewed by Timothy Hatcher.
408
409         * UserInterface/Views/CanvasSidebarPanel.css:
410         (.sidebar > .panel.navigation.canvas > .navigation-bar > .item.record-start-stop.disabled > .glyph): Added.
411         (.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.canvas:matches(.canvas-2d, .bitmaprenderer) .icon): Added.
412         (.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.canvas:matches(.webgl, .webgl2, .webgpu, .webmetal) .icon): Added.
413         (@media (prefers-color-scheme: dark)):
414         (.sidebar > .panel.navigation.canvas > .navigation-bar > .item.record-start-stop.disabled): Deleted.
415         (.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.canvas.canvas-2d .icon): Deleted.
416         (.sidebar > .panel.navigation.canvas > .content > .tree-outline .item.casnvas.webgl .icon): Deleted.
417         Use the 2D icon for BitmapRenderer and the 3D icon for WebGL2, WebMetals, and WebGPU.
418         Drive-by: the start/stop button text was too dark when disabled in dark mode.
419
420         * UserInterface/Models/Canvas.js:
421         Drive-by: "gpu" => "webgpu", to match the protocol string.
422
423 2019-03-22  Devin Rousso  <drousso@apple.com>
424
425         Web Inspector: Sources: "Reveal in Resources Tab" still shown when Sources tab is enabled
426         https://bugs.webkit.org/show_bug.cgi?id=196134
427
428         Reviewed by Joseph Pecoraro.
429
430         * UserInterface/Views/RecordingActionTreeElement.js:
431         (WI.RecordingActionTreeElement.prototype.populateContextMenu):
432         Drive-by: find the first call frame that has a source code location, rather than naively
433         always using the top call frame.
434
435         * UserInterface/Views/SearchResultTreeElement.js:
436         (WI.SearchResultTreeElement.prototype.populateContextMenu):
437
438 2019-03-22  Keith Rollin  <krollin@apple.com>
439
440         Enable ThinLTO support in Production builds
441         https://bugs.webkit.org/show_bug.cgi?id=190758
442         <rdar://problem/45413233>
443
444         Reviewed by Daniel Bates.
445
446         Enable building with Thin LTO in Production when using Xcode 10.2 or
447         later. This change results in a 1.45% progression in PLT5. Full
448         Production build times increase about 2-3%. Incremental build times
449         are more severely affected, and so LTO is not enabled for local
450         engineering builds.
451
452         LTO is enabled only on macOS for now, until rdar://problem/49013399,
453         which affects ARM builds, is fixed.
454
455         To change the LTO setting when building locally:
456
457         - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
458           command line.
459         - If building with `build-webkit`, specify --lto-mode={none,thin,full}
460           on the command line.
461         - If building with `build-root`, specify --lto={none,thin,full} on the
462           command line.
463         - If building with Xcode, create a LocalOverrides.xcconfig file at the
464           top level of your repository directory (if needed) and define
465           WK_LTO_MODE to full, thin, or none.
466
467         * Configurations/Base.xcconfig:
468
469 2019-03-21  Joseph Pecoraro  <pecoraro@apple.com>
470
471         Web Inspector: Timelines - Cannot export on about:blank - suggested filename containing a colon silently fails
472         https://bugs.webkit.org/show_bug.cgi?id=196109
473
474         Reviewed by Timothy Hatcher.
475
476         * UserInterface/Base/FileUtilities.js:
477         (WI.FileUtilities.sanitizeFilename):
478         (WI.FileUtilities.inspectorURLForFilename):
479         New utility functions.
480
481         * UserInterface/Test.html:
482         Include FileUtilities.
483
484         * UserInterface/Base/Main.js:
485         * UserInterface/Controllers/AuditManager.js:
486         (WI.AuditManager.prototype.export):
487         * UserInterface/Debug/ProtocolTrace.js:
488         (WI.ProtocolTrace.prototype.get saveData):
489         (WI.ProtocolTrace):
490         * UserInterface/Views/ConsoleMessageView.js:
491         (WI.ConsoleMessageView.prototype._handleContextMenu):
492         (WI.ConsoleMessageView):
493         * UserInterface/Views/ContextMenuUtilities.js:
494         * UserInterface/Views/HeapSnapshotContentView.js:
495         (WI.HeapSnapshotContentView.prototype._exportSnapshot):
496         * UserInterface/Views/LogContentView.js:
497         (WI.LogContentView.prototype.get saveData):
498         (WI.LogContentView.prototype._handleContextMenuEvent):
499         * UserInterface/Views/NetworkTableContentView.js:
500         (WI.NetworkTableContentView.prototype._exportHAR):
501         * UserInterface/Views/RecordingContentView.js:
502         (WI.RecordingContentView.prototype._exportRecording):
503         (WI.RecordingContentView.prototype._exportReduction):
504         * UserInterface/Views/ScriptContentView.js:
505         (WI.ScriptContentView.prototype.get saveData):
506         * UserInterface/Views/ShaderProgramContentView.js:
507         (WI.ShaderProgramContentView.prototype.get saveData):
508         * UserInterface/Views/TextContentView.js:
509         (WI.TextContentView.prototype.get saveData):
510         * UserInterface/Views/TextResourceContentView.js:
511         (WI.TextResourceContentView.prototype.get saveData):
512         * UserInterface/Views/TimelineRecordingContentView.js:
513         (WI.TimelineRecordingContentView.prototype._exportTimelineRecording):
514         Update "web-inspector:///" URL building code to use the utility.
515
516 2019-03-21  Nikita Vasilyev  <nvasilyev@apple.com>
517
518         Web Inspector: Use CSS variables for text color in Computed panel
519         https://bugs.webkit.org/show_bug.cgi?id=196117
520
521         Reviewed by Timothy Hatcher.
522
523         * UserInterface/Views/ComputedStyleSection.css:
524         (.computed-style-section):
525         (.computed-style-section .computed-property-item .property-trace-item .selector):
526         (.computed-style-section .computed-property-item .go-to-link):
527
528 2019-03-21  Devin Rousso  <drousso@apple.com>
529
530         Web Inspector: Timelines: flatten the overview to show all records, one per line
531         https://bugs.webkit.org/show_bug.cgi?id=191901
532         <rdar://problem/46423618>
533
534         Reviewed by Timothy Hatcher.
535
536         * UserInterface/Views/OverviewTimelineView.js:
537         (WI.OverviewTimelineView):
538         (WI.OverviewTimelineView.prototype.closed):
539         (WI.OverviewTimelineView.prototype.get navigationItems): Added.
540         (WI.OverviewTimelineView.prototype.reset):
541         (WI.OverviewTimelineView.prototype.layout):
542         (WI.OverviewTimelineView.prototype.get _relevantTimelines): Added.
543         (WI.OverviewTimelineView.prototype.get _shouldGroupBySourceCode): Added.
544         (WI.OverviewTimelineView.prototype._loadExistingRecords): Added.
545         (WI.OverviewTimelineView.prototype._insertDataGridNode):
546         (WI.OverviewTimelineView.prototype._addResourceToDataGridIfNeeded):
547         (WI.OverviewTimelineView.prototype._addSourceCodeTimeline):
548         (WI.OverviewTimelineView.prototype._processPendingRepresentedObjects):
549         (WI.OverviewTimelineView.prototype._handleGroupBySourceCodeSettingChanged): Added.
550         (WI.OverviewTimelineView.prototype._handleGroupBySourceCodeNavigationItemCheckedDidChange): Added.
551         (WI.OverviewTimelineView.prototype._handleTimelineRecordAdded): Added.
552         (WI.OverviewTimelineView.prototype._sourceCodeTimelineAdded):
553         (WI.OverviewTimelineView.prototype._networkTimelineRecordAdded): Deleted.
554         Listen for new records on all timelines. Add each record as a new line. Since each timeline
555         has different data to display, only show the "name" and "graph" for all records.
556
557         * UserInterface/Views/TimelineRecordingContentView.js:
558         (WI.TimelineRecordingContentView):
559         (WI.TimelineRecordingContentView.prototype._currentContentViewDidChange):
560         (WI.TimelineRecordingContentView.prototype._updateImportedView): Deleted.
561         When viewing the overview of an imported recording, show the non-grouped overview.
562
563         * UserInterface/Models/TimelineRecording.js:
564         (WI.TimelineRecording.prototype.addRecord):
565         (WI.TimelineRecording.prototype._keyForRecord):
566         Drive-by: show Media timeline events under the owner frame's resource when grouped.
567
568         * UserInterface/Views/TimelineRecordBar.css:
569         (.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment, .timeline-record-bar.timeline-record-type-heap-allocations > .segment): Added.
570         (.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment): Deleted.
571
572         * UserInterface/Base/Setting.js:
573         Add setting for controlling the Timeline overview grouping.
574
575         * UserInterface/Main.html:
576         * UserInterface/Views/SourceCodeTimelineTreeElement.js: Removed.
577         * UserInterface/Views/TimelineRecordingImportedView.js: Removed.
578         * UserInterface/Views/TimelineRecordingImportedView.css: Removed.
579         Remove unused files.
580
581         * Localizations/en.lproj/localizedStrings.js:
582
583 2019-03-21  Devin Rousso  <drousso@apple.com>
584
585         Web Inspector: Sources: the name of the file should not be used as a folder
586         https://bugs.webkit.org/show_bug.cgi?id=196064
587         <rdar://problem/49097710>
588
589         Reviewed by Timothy Hatcher.
590
591         * UserInterface/Views/GeneralTreeElement.js:
592         (WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath):
593
594         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
595         (WI.SourcesNavigationSidebarPanel.prototype._addResource):
596         Drive-by: sort resources in each folder by name when grouping by path.
597
598 2019-03-20  Devin Rousso  <drousso@apple.com>
599
600         Web Inspector: Canvas: rework how Canvas.enable/Canvas.disable is used so that events are not sent when the Canvas tab isn't enabled
601         https://bugs.webkit.org/show_bug.cgi?id=195828
602         <rdar://problem/48941756>
603
604         Reviewed by Timothy Hatcher.
605
606         * UserInterface/Controllers/CanvasManager.js:
607         (WI.CanvasManager):
608         (WI.CanvasManager.prototype.initializeTarget):
609         (WI.CanvasManager.prototype.enable): Added.
610         (WI.CanvasManager.prototype.disable): Added.
611
612         * UserInterface/Views/CanvasTabContentView.js:
613         (WI.CanvasTabContentView):
614         (WI.CanvasTabContentView.prototype.closed): Added.
615
616         * UserInterface/Base/Test.js:
617         (WI.contentLoaded):
618
619 2019-03-20  Devin Rousso  <drousso@apple.com>
620
621         Web Inspector: Sources: collapsing a section doesn't shrink the space used by that section
622         https://bugs.webkit.org/show_bug.cgi?id=196045
623
624         Reviewed by Timothy Hatcher.
625
626         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
627         (WI.SourcesNavigationSidebarPanel):
628         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
629         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
630         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
631         (.sidebar > .panel.navigation.sources > .content > .details-section):
632         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.paused-reason, .breakpoins).collapsed > .header > .options,):
633         (.sidebar > .panel.navigation.sources > .content > .details-section.collapsed > .content):
634         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint):
635         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.pause-reason, .call-stack, .breakpoints) > .content,):
636         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints) > .content):
637         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content):
638         (.sidebar > .panel.navigation.sources > .content > .details-section.call-stack):
639         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints):
640         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .create-breakpoint):
641         (.sidebar > .panel.navigation.sources > .content > .pause-reason):
642         (.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content,):
643         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .tree-outline .item.event-target-window .icon):
644         (.sidebar > .panel.navigation.sources > .content .details-section): Deleted.
645         (.sidebar > .panel.navigation.sources > .content .details-section:matches(.paused-reason, .breakpoins).collapsed > .header > .options,): Deleted.
646         (.sidebar > .panel.navigation.sources > .content .details-section.collapsed > .content): Deleted.
647         (.sidebar > .panel.navigation.sources > .content .details-section.breakpoints > .header > .options .create-breakpoint): Deleted.
648         (.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Deleted.
649         (.sidebar > .panel.navigation.sources > .content > .call-stack-container): Deleted.
650         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container): Deleted.
651         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container .create-breakpoint): Deleted.
652         (.sidebar > .panel.navigation.sources > .content > .resources-container): Deleted.
653         (.sidebar > .panel.navigation.sources > .content > .pause-reason-container): Deleted.
654         (.sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container)): Deleted.
655         (.sidebar > .panel.navigation.sources > .content > .breakpoints .tree-outline .item.event-target-window .icon): Deleted.
656          - Apply the overflow scrolling to the content element of each `WI.DetailsSection`.
657          - Ensure that there is a maximum height for each section.
658          - When `.collapsed`, don't try to grow/shrink the section based on its contents.
659
660         * UserInterface/Views/CallFrameTreeElement.css:
661         (.tree-outline .item.call-frame):
662         (.tree-outline .item.call-frame .status):
663         Make the container of the active call frame status indicator relatively positioned so that
664         the active call frame status indicator will follow the container when scrolling.
665
666 2019-03-20  Devin Rousso  <drousso@apple.com>
667
668         Web Inspector: Timeline should show when events preventDefault() was called on an event or not
669         https://bugs.webkit.org/show_bug.cgi?id=176824
670         <rdar://problem/34290931>
671
672         Reviewed by Timothy Hatcher.
673
674         Original patch by Joseph Pecoraro <pecoraro@apple.com>.
675
676         * Localizations/en.lproj/localizedStrings.js:
677         New string.
678
679         * UserInterface/Controllers/TimelineManager.js:
680         (WI.TimelineManager.prototype._processRecord):
681         Include the whole data object as extra details.
682
683         * UserInterface/Models/ScriptTimelineRecord.js:
684         (WI.ScriptTimelineRecord):
685         (WI.ScriptTimelineRecord.prototype.get eventType):
686         Wholesale copy of the extra data instead of just a single property.
687
688         * UserInterface/Views/ScriptDetailsTimelineView.js:
689         (WI.ScriptDetailsTimelineView):
690         Give the name column more initial space, there is still extra space
691         after this adjustment but name is comfortably larger (and the most
692         likely to be expanded).
693
694         * UserInterface/Views/ScriptTimelineDataGridNode.js:
695         (WI.ScriptTimelineDataGridNode.prototype.get subtitle):
696         Include "default prevented" as the event's subtitle if it was prevented.
697
698 2019-03-20  Devin Rousso  <drousso@apple.com>
699
700         Web Inspector: Styles Redesign: Editing selector should not hide the rule
701         https://bugs.webkit.org/show_bug.cgi?id=178489
702         <rdar://problem/35062434>
703
704         Reviewed by Timothy Hatcher.
705
706         Extracts the selector payload parsing logic inside `WI.DOMNodeStyles` into static functions
707         so that when the user changes the selector of a `WI.CSSRule`, it's able to process and
708         update itself with the new selector. This is mainly useful in the case where the `WI.CSSRule`
709         no longer applies to the selected node (meaning it won't be part of that node's
710         `WI.DOMNodeStyles`) in that it allows the `WI.SpreadsheetCSSStyleDeclarationSection` to
711         display the new selector text and the owner `WI.SpreadsheetRulesStyleDetailsPanel` to keep
712         that section visible even though it isn't applicable to the current node anymore.
713
714         * UserInterface/Models/DOMNodeStyles.js:
715         (WI.DOMNodeStyles):
716         (WI.DOMNodeStyles.parseSelectorListPayload): Added.
717         (WI.DOMNodeStyles.createSourceCodeLocation): Added.
718         (WI.DOMNodeStyles.prototype.refresh):
719         (WI.DOMNodeStyles.prototype.refresh.fetchedMatchedStyles):
720         (WI.DOMNodeStyles.prototype.refresh.fetchedInlineStyles):
721         (WI.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
722         (WI.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
723         (WI.DOMNodeStyles.prototype._parseRulePayload):
724         (WI.DOMNodeStyles.prototype._styleSheetContentDidChange):
725         (WI.DOMNodeStyles.prototype.refresh.parseRuleMatchArrayPayload): Deleted.
726         (WI.DOMNodeStyles.prototype._createSourceCodeLocation): Deleted.
727         (WI.DOMNodeStyles.prototype._parseSelectorListPayload): Deleted.
728         Keep track of all `WI.CSSRule` and `WI.CSSStyleDeclaration` that have ever been associated
729         with this object, so that if a rule's selector is changed to no longer match, and then is
730         changed back to match again, we are able to update that rule instead of creating a new one.
731
732         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
733         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
734         (WI.SpreadsheetRulesStyleDetailsPanel.prototype._handleSectionFilterApplied):
735         (WI.SpreadsheetRulesStyleDetailsPanel.prototype._handleSectionSelectorWillChange): Added.
736         Attempt to preserve the position of any sections that are changed and no longer apply to the
737         current node.
738
739         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
740         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidChange):
741         (WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
742         Drive-by: remove unused CSS classes.
743
744         * UserInterface/Models/CSSRule.js:
745         (WI.CSSRule.prototype.update):
746         (WI.CSSRule.prototype._selectorResolved):
747         Drive-by: remove unused event.
748
749         * UserInterface/Base/Multimap.js:
750         (Multimap.prototype.has): Added.
751         (Multimap.prototype.sets): Added.
752         (Multimap.prototype.copy): Added.
753
754 2019-03-20  Devin Rousso  <drousso@apple.com>
755
756         Web Inspector: no way to filter out all console messages or all evaluations/results
757         https://bugs.webkit.org/show_bug.cgi?id=167035
758         <rdar://problem/30023523>
759
760         Reviewed by Timothy Hatcher.
761
762         * UserInterface/Views/LogContentView.js:
763         (WI.LogContentView):
764         (WI.LogContentView.prototype.didAppendConsoleMessageView):
765         (WI.LogContentView.prototype._markScopeBarItemUnread):
766         (WI.LogContentView.prototype._markScopeBarItemForMessageLevelUnread): Added.
767         (WI.LogContentView.prototype._previousMessageRepeatCountUpdated):
768         (WI.LogContentView.prototype._messageSourceBarSelectionDidChange):
769         (WI.LogContentView.prototype._scopeBarSelectionDidChange):
770         (WI.LogContentView.prototype._filterMessageElements):
771         (WI.LogContentView.prototype.performSearch):
772         * UserInterface/Views/LogContentView.css:
773         (.log-scope-bar > li.unread.evaluations::before): Added.
774
775         * UserInterface/Views/ConsoleCommandView.js:
776         (WI.ConsoleCommandView):
777         Drive-by: remove unnecessary super-class extends.
778
779         * Localizations/en.lproj/localizedStrings.js:
780
781 2019-03-20  Nikita Vasilyev  <nvasilyev@apple.com>
782
783         Web Inspector: Styles: enabledProperties don't get invalidated after removing property
784         https://bugs.webkit.org/show_bug.cgi?id=196038
785
786         Reviewed by Timothy Hatcher.
787
788         * UserInterface/Models/CSSStyleDeclaration.js:
789         (WI.CSSStyleDeclaration.prototype.shiftPropertiesAfter):
790
791 2019-03-20  Devin Rousso  <drousso@apple.com>
792
793         Web Inspector: DOM: include window as part of any event listener chain
794         https://bugs.webkit.org/show_bug.cgi?id=195730
795         <rdar://problem/48916872>
796
797         Reviewed by Timothy Hatcher.
798
799         Allow non-nodes (e.g. `window`) to be listed as the target of an event listener.
800         Add support for the same concept when showing breakpoint details after pausing on a specific
801         event listener in the Debugger/Sources navigation sidebar.
802
803         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
804         (WI.DOMNodeDetailsSidebarPanel.prototype.initialLayout):
805         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByEvent):
806         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByTarget): Added.
807         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.eventListenersCallback):
808         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners):
809         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByNode): Deleted.
810
811         * UserInterface/Views/EventListenerSectionGroup.js:
812         (WI.EventListenerSectionGroup.prototype._targetTextOrLink): Added.
813         (WI.EventListenerSectionGroup.prototype._nodeTextOrLink): Deleted.
814
815         * UserInterface/Views/DebuggerSidebarPanel.js:
816         (WI.DebuggerSidebarPanel.prototype._addBreakpoint):
817         (WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
818         (WI.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
819         (WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
820         * UserInterface/Views/DebuggerSidebarPanel.css:
821         (.sidebar > .panel.navigation.debugger > .content > .breakpoints .tree-outline .item.event-target-window .icon): Added.
822
823         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
824         (WI.SourcesNavigationSidebarPanel):
825         (WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
826         (WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
827         (WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
828         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
829         (.sidebar > .panel.navigation.sources > .content > .breakpoints .tree-outline .item.event-target-window .icon): Added.
830
831         * Localizations/en.lproj/localizedStrings.js:
832
833 2019-03-20  Devin Rousso  <drousso@apple.com>
834
835         Web Inspector: Debugger: virtualize the list of variables in the Scope sidebar
836         https://bugs.webkit.org/show_bug.cgi?id=192648
837         <rdar://problem/46800949>
838
839         Reviewed by Joseph Pecoraro.
840
841         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
842         (WI.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
843
844         * UserInterface/Views/TreeElement.js:
845         (WI.TreeElement.prototype.set hidden):
846         (WI.TreeElement.prototype._attach):
847         (WI.TreeElement.prototype._detach):
848         (WI.TreeElement.prototype.collapse):
849         (WI.TreeElement.prototype.expand):
850         Move `updateVirtualizedElements` calls to the owner `WI.TreeOutline` to ensure that they get
851         called. Make the remaining calls use rAF debouncing to better coalesce updates.
852
853         * UserInterface/Views/TreeOutline.js:
854         (WI.TreeOutline.prototype._rememberTreeElement):
855         (WI.TreeOutline.prototype._forgetTreeElement):
856         (WI.TreeOutline.prototype.registerScrollVirtualizer):
857         (WI.TreeOutline.prototype._updateVirtualizedElements.calculateOffsetFromContainer): Added.
858         (WI.TreeOutline.prototype._updateVirtualizedElements):
859         (WI.TreeOutline.prototype._calculateVirtualizedValues): Deleted.
860         Calculate the `WI.TreeOutline`'s top offset within the scroll container so that it will only
861         update when it's within the visual area.
862
863         * UserInterface/Views/Utilities.js:
864         (Array.prototype.remove):
865         Return whether the item was actually removed from the array.
866
867 2019-03-20  Joseph Pecoraro  <pecoraro@apple.com>
868
869         Web Inspector: Timelines - Export fails for MediaTimelineRecords with originator DOM Node - Cannot serialize cyclic structure
870         https://bugs.webkit.org/show_bug.cgi?id=196027
871
872         Reviewed by Timothy Hatcher.
873
874         * UserInterface/Models/MediaTimelineRecord.js:
875         (WI.MediaTimelineRecord.prototype.toJSON):
876         Remove the originator since that is a WI.DOMNode and cannot
877         be JSON serialized.
878
879 2019-03-20  Devin Rousso  <drousso@apple.com>
880
881         Web Inspector: Debugger: move breakpoint storage to use `WI.ObjectStore`
882         https://bugs.webkit.org/show_bug.cgi?id=192719
883         <rdar://problem/46746857>
884
885         Reviewed by Timothy Hatcher.
886
887         * UserInterface/Controllers/DebuggerManager.js:
888         (WI.DebuggerManager):
889         (WI.DebuggerManager.prototype.addBreakpoint):
890         (WI.DebuggerManager.prototype.removeBreakpoint):
891         (WI.DebuggerManager.prototype._debuggerBreakpointOptions):
892         (WI.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
893         (WI.DebuggerManager.prototype._setBreakpoint):
894         (WI.DebuggerManager.prototype._breakpointDisabledStateDidChange):
895         (WI.DebuggerManager.prototype._breakpointEditablePropertyDidChange):
896         (WI.DebuggerManager.prototype._saveBreakpoints): Deleted.
897
898         * UserInterface/Models/Breakpoint.js:
899         (WI.Breakpoint.prototype.saveIdentityToCookie):
900         (WI.Breakpoint.prototype.serializeOptions): Added.
901         (WI.Breakpoint.prototype.toJSON): Added.
902         (WI.Breakpoint.prototype.get options): Deleted.
903         (WI.Breakpoint.prototype.get info): Deleted.
904         (WI.Breakpoint.prototype._serializableActions): Deleted.
905         * UserInterface/Models/BreakpointAction.js:
906         (WI.BreakpointAction.prototype.toJSON): Added.
907         (WI.BreakpointAction.prototype.get info): Deleted.
908
909         * UserInterface/Base/ObjectStore.js:
910         (WI.ObjectStore.async reset): Added.
911         (WI.ObjectStore._open):
912         (WI.ObjectStore.prototype.get keyPath): Added.
913         (WI.ObjectStore.prototype.async.getAll):
914         (WI.ObjectStore.prototype.async.put): Added.
915         (WI.ObjectStore.prototype.async.putObject): Added.
916         (WI.ObjectStore.prototype.async.add): Deleted.
917         (WI.ObjectStore.prototype.async.addObject): Deleted.
918         Replace `add` with `put` so that if a key already exists, it is overridden.
919
920         * UserInterface/Controllers/AuditManager.js:
921         (WI.AuditManager.prototype.set editing):
922         (WI.AuditManager.prototype.async processJSON):
923
924         * UserInterface/Controllers/BreakpointPopoverController.js:
925         (WI.BreakpointPopoverController.prototype._popoverActionsAddActionButtonClicked):
926         Inline some `WI.Breakpoint` static values.
927
928 2019-03-20  Devin Rousso  <drousso@apple.com>
929
930         Web Inspector: Sources: disabled breakpoints banner should be sticky
931         https://bugs.webkit.org/show_bug.cgi?id=195104
932         <rdar://problem/48442259>
933
934         Reviewed by Timothy Hatcher.
935
936         Allow each of the individual sections to be scrolled separately from the entire sidebar.
937
938         Leverage CSS variables set via JavaScript to be able to calculate the maximum height of each
939         `WI.TreeOutline` section based on the number of items.
940
941         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
942         (WI.SourcesNavigationSidebarPanel):
943         (WI.SourcesNavigationSidebarPanel.prototype._handleCallStackElementAddedOrRemoved): Added.
944         (WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
945         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
946         (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
947         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
948         (.sidebar > .panel.navigation.sources > .content):
949         (.sidebar > .panel.navigation.sources > .content .details-section): Added.
950         (.sidebar > .panel.navigation.sources > .content .details-section.paused-reason.collapsed > .header > .options,): Added.
951         (.sidebar > .panel.navigation.sources > .content .details-section.collapsed > .content): Added.
952         (.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Added.
953         (.sidebar > .panel.navigation.sources > .content > .call-stack-container): Added.
954         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container): Added.
955         (.sidebar > .panel.navigation.sources > .content > .breakpoints-container .create-breakpoint): Added.
956         (.sidebar > .panel.navigation.sources > .content > .resources-container): Added.
957         (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread): Added.
958         (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread > .item.thread): Added.
959         (@media (min-height: 600px) .sidebar > .panel.navigation.sources > .content): Added.
960         (@media (min-height: 600px) .sidebar > .panel.navigation.sources > .content > .pause-reason-container): Added.
961         (@media (min-height: 600px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container)): Added.
962         (.sidebar > .panel.navigation.sources > .content > .details-section): Deleted.
963         (.sidebar > .panel.navigation.sources > .content > .details-section.paused-reason.collapsed > .header > .options,): Deleted.
964         (.sidebar > .panel.navigation.sources > .content > .details-section.collapsed > .content): Deleted.
965         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint): Deleted.
966         (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread): Deleted.
967         (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread > .item.thread): Deleted.
968         (.sidebar > .panel.navigation.sources > .content > .resources): Deleted.
969
970 2019-03-20  Devin Rousso  <drousso@apple.com>
971
972         "Reveal in Layers Tab" context menu option should not be available if the Layers Tab has not been enabled
973         https://bugs.webkit.org/show_bug.cgi?id=196009
974
975         Reviewed by Joseph Pecoraro.
976
977         * UserInterface/Views/ContextMenuUtilities.js:
978         (WI.appendContextMenuItemsForDOMNode):
979
980 2019-03-20  Devin Rousso  <drousso@apple.com>
981
982         Web Inspector: Console: add a setting for controlling auto-expansion of Trace messages
983         https://bugs.webkit.org/show_bug.cgi?id=195690
984
985         Reviewed by Timothy Hatcher.
986
987         * UserInterface/Views/ConsoleMessageView.js:
988         (WI.ConsoleMessageView.prototype._appendStackTrace):
989
990         * UserInterface/Base/Setting.js:
991         * UserInterface/Views/SettingsTabContentView.js:
992         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
993
994         * Localizations/en.lproj/localizedStrings.js:
995
996 2019-03-20  Devin Rousso  <drousso@apple.com>
997
998         Web Inspector: DOM: selecting a node in a different frame should automatically switch the console prompt's execution context
999         https://bugs.webkit.org/show_bug.cgi?id=195805
1000         <rdar://problem/48930866>
1001
1002         Reviewed by Timothy Hatcher.
1003
1004         Add an "Auto" execution context item that is selected by default and will update the
1005         selected execution context whenever the inspected node changes. It will also display the
1006         preferred name for whatever execution context is currently active.
1007
1008         * UserInterface/Views/QuickConsole.js:
1009         (WI.QuickConsole):
1010         (WI.QuickConsole.prototype.initializeMainExecutionContextPathComponent):
1011         (WI.QuickConsole.prototype._preferredNameForFrame): Added.
1012         (WI.QuickConsole.prototype._selectExecutionContext): Added.
1013         (WI.QuickConsole.prototype._executionContextPathComponentsToDisplay):
1014         (WI.QuickConsole.prototype._rebuildExecutionContextPathComponents):
1015         (WI.QuickConsole.prototype._framePageExecutionContextsChanged):
1016         (WI.QuickConsole.prototype._frameExecutionContextsCleared):
1017         (WI.QuickConsole.prototype._activeExecutionContextChanged):
1018         (WI.QuickConsole.prototype._createExecutionContextPathComponent):
1019         (WI.QuickConsole.prototype._insertOtherExecutionContextPathComponent):
1020         (WI.QuickConsole.prototype._removeOtherExecutionContextPathComponent):
1021         (WI.QuickConsole.prototype._insertExecutionContextPathComponentForFrame):
1022         (WI.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
1023         (WI.QuickConsole.prototype._targetRemoved):
1024         (WI.QuickConsole.prototype._pathComponentSelected):
1025         (WI.QuickConsole.prototype._handleInspectedNodeChanged): Added.
1026         (WI.QuickConsole.prototype.get selectedExecutionContext): Deleted.
1027         (WI.QuickConsole.prototype.set selectedExecutionContext): Deleted.
1028         (WI.QuickConsole.prototype._createExecutionContextPathComponentFromFrame): Deleted.
1029         * UserInterface/Views/QuickConsole.css:
1030         (.quick-console > .navigation-bar > .hierarchical-path:not(.automatic-execution-context)): Added.
1031         (.quick-console > .navigation-bar > .hierarchical-path:not(.automatic-execution-context) .execution-context): Added.
1032         (.quick-console > .navigation-bar > .hierarchical-path:not(.automatic-execution-context) .execution-context .selector-arrows): Added.
1033         (.quick-console > .navigation-bar > .hierarchical-path.non-default-execution-context .execution-context): Deleted.
1034         (.quick-console > .navigation-bar > .hierarchical-path.non-default-execution-context .execution-context .selector-arrows): Deleted.
1035
1036         * UserInterface/Controllers/DOMManager.js:
1037         (WI.DOMManager.prototype.get inspectedNode): Added.
1038         (WI.DOMManager.prototype.setInspectedNode):
1039         Broadcast when the inspected node changes.
1040
1041         * UserInterface/Views/NavigationBar.js:
1042         (WI.NavigationBar.prototype.layout):
1043         When `sizesToFit` is enabled, don't force any items to be hidden.
1044
1045         * Localizations/en.lproj/localizedStrings.js:
1046
1047 2019-03-20  Devin Rousso  <drousso@apple.com>
1048
1049         Web Inspector: refactor WI.TimelineDataGridNode and its subclasses to unify the API surface
1050         https://bugs.webkit.org/show_bug.cgi?id=195959
1051         <rdar://problem/49028896>
1052
1053         Reviewed by Timothy Hatcher.
1054
1055         * UserInterface/Views/TimelineDataGridNode.js:
1056         (WI.TimelineDataGridNode.prototype.get records):
1057         (WI.TimelineDataGridNode.prototype.get data):
1058         (WI.TimelineDataGridNode.prototype.refresh):
1059
1060         * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
1061         (WI.HeapAllocationsTimelineDataGridNode):
1062         (WI.HeapAllocationsTimelineDataGridNode.prototype.get heapSnapshot): Added.
1063         (WI.HeapAllocationsTimelineDataGridNode.prototype.get data):
1064         (WI.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
1065         (WI.HeapAllocationsTimelineDataGridNode.prototype.createCells):
1066         (WI.HeapAllocationsTimelineDataGridNode.prototype._handleHeapSnapshotCollectedNodes):
1067         (WI.HeapAllocationsTimelineDataGridNode.prototype._handleHeapSnapshotInvalidated):
1068         (WI.HeapAllocationsTimelineDataGridNode.prototype.get record): Deleted.
1069         (WI.HeapAllocationsTimelineDataGridNode.prototype.updateTimestamp): Deleted.
1070         (WI.HeapAllocationsTimelineDataGridNode.prototype._heapSnapshotCollectedNodes): Deleted.
1071         (WI.HeapAllocationsTimelineDataGridNode.prototype._heapSnapshotInvalidated): Deleted.
1072
1073         * UserInterface/Views/LayoutTimelineDataGridNode.js:
1074         (WI.LayoutTimelineDataGridNode):
1075         (WI.LayoutTimelineDataGridNode.prototype.get data):
1076         (WI.LayoutTimelineDataGridNode.prototype.createCellContent):
1077         (WI.LayoutTimelineDataGridNode.prototype.get records): Deleted.
1078
1079         * UserInterface/Views/MediaTimelineDataGridNode.js:
1080         (WI.MediaTimelineDataGridNode):
1081         (WI.MediaTimelineDataGridNode.prototype.get records): Deleted.
1082
1083         * UserInterface/Views/ProfileNodeDataGridNode.js:
1084         (WI.ProfileNodeDataGridNode):
1085         (WI.ProfileNodeDataGridNode.prototype.get profileNode):
1086         (WI.ProfileNodeDataGridNode.prototype.get data):
1087         (WI.ProfileNodeDataGridNode.prototype.createCellContent):
1088         (WI.ProfileNodeDataGridNode.prototype._populate):
1089         (WI.ProfileNodeDataGridNode.prototype.get records): Deleted.
1090         (WI.ProfileNodeDataGridNode.prototype.get baseStartTime): Deleted.
1091         (WI.ProfileNodeDataGridNode.prototype.get rangeStartTime): Deleted.
1092         (WI.ProfileNodeDataGridNode.prototype.get rangeEndTime): Deleted.
1093         (WI.ProfileNodeDataGridNode.prototype.updateRangeTimes): Deleted.
1094         (WI.ProfileNodeDataGridNode.prototype.refresh): Deleted.
1095
1096         * UserInterface/Views/RenderingFrameTimelineDataGridNode.js:
1097         (WI.RenderingFrameTimelineDataGridNode):
1098         (WI.RenderingFrameTimelineDataGridNode.prototype.get data):
1099         (WI.RenderingFrameTimelineDataGridNode.prototype.createCellContent):
1100         (WI.RenderingFrameTimelineDataGridNode.prototype.get records): Deleted.
1101
1102         * UserInterface/Views/ResourceTimelineDataGridNode.js:
1103         (WI.ResourceTimelineDataGridNode):
1104         (WI.ResourceTimelineDataGridNode.prototype.get resource):
1105         (WI.ResourceTimelineDataGridNode.prototype.get data):
1106         (WI.ResourceTimelineDataGridNode.prototype.createCellContent):
1107         (WI.ResourceTimelineDataGridNode.prototype.appendContextMenuItems):
1108         (WI.ResourceTimelineDataGridNode.prototype.filterableDataForColumn):
1109         (WI.ResourceTimelineDataGridNode.prototype._createNameCellDocumentFragment):
1110         (WI.ResourceTimelineDataGridNode.prototype._cachedCellContent):
1111         (WI.ResourceTimelineDataGridNode.prototype._timelineRecordUpdated):
1112         (WI.ResourceTimelineDataGridNode.prototype._dataGridNodeGoToArrowClicked):
1113         (WI.ResourceTimelineDataGridNode.prototype._updateStatus):
1114         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar.else.let.graphDataSource.get startTime):
1115         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar.else.let.graphDataSource.get currentTime):
1116         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar.else.let.graphDataSource.get endTime):
1117         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar.else.let.graphDataSource.get _extraTimePadding):
1118         (WI.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar):
1119         (WI.ResourceTimelineDataGridNode.prototype.get records): Deleted.
1120
1121         * UserInterface/Views/ResourceTimingPopoverDataGridNode.js:
1122         (WI.ResourceTimingPopoverDataGridNode):
1123         (WI.ResourceTimingPopoverDataGridNode.prototype.get records): Deleted.
1124
1125         * UserInterface/Views/ScriptTimelineDataGridNode.js:
1126         (WI.ScriptTimelineDataGridNode.prototype.get data):
1127         (WI.ScriptTimelineDataGridNode.prototype.get subtitle):
1128         (WI.ScriptTimelineDataGridNode.prototype.createCellContent):
1129         (WI.ScriptTimelineDataGridNode.prototype.get records): Deleted.
1130         (WI.ScriptTimelineDataGridNode.prototype.get baseStartTime): Deleted.
1131         (WI.ScriptTimelineDataGridNode.prototype.get rangeStartTime): Deleted.
1132         (WI.ScriptTimelineDataGridNode.prototype.get rangeEndTime): Deleted.
1133         (WI.ScriptTimelineDataGridNode.prototype.updateRangeTimes): Deleted.
1134
1135         * UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js:
1136         (WI.SourceCodeTimelineTimelineDataGridNode.prototype.get data):
1137
1138         * UserInterface/Views/HeapAllocationsTimelineView.js:
1139         (WI.HeapAllocationsTimelineView):
1140         (WI.HeapAllocationsTimelineView.prototype.layout):
1141         (WI.HeapAllocationsTimelineView.prototype.reset):
1142         * UserInterface/Views/LayoutTimelineView.js:
1143         (WI.LayoutTimelineView.prototype._processPendingRecords):
1144         * UserInterface/Views/MediaTimelineView.js:
1145         (WI.MediaTimelineView.prototype._processPendingRecords):
1146         * UserInterface/Views/NetworkTimelineView.js:
1147         (WI.NetworkTimelineView.prototype._processPendingRecords):
1148         * UserInterface/Views/OverviewTimelineView.js:
1149         (WI.OverviewTimelineView.prototype._addResourceToDataGridIfNeeded):
1150         (WI.OverviewTimelineView.prototype._addSourceCodeTimeline):
1151         * UserInterface/Views/RenderingFrameTimelineView.js:
1152         (WI.RenderingFrameTimelineView.prototype._processPendingRecords):
1153         * UserInterface/Views/ScriptDetailsTimelineView.js:
1154         (WI.ScriptDetailsTimelineView.prototype.layout):
1155         (WI.ScriptDetailsTimelineView.prototype._processPendingRecords):
1156         Update Timeline `WI.DataGrid` views to use the new constructor format.
1157
1158         * UserInterface/Views/ResourceTimelineDataGridNode.css:
1159         (.resource-timing-popover-content .data-grid td.graph-column):
1160         Drive-by: add extra padding before/after resource timing bars shown when hovering.
1161
1162 2019-03-20  Devin Rousso  <drousso@apple.com>
1163
1164         Web Inspector: changes to CSS resources only take affect once editing stops
1165         https://bugs.webkit.org/show_bug.cgi?id=195774
1166         <rdar://problem/48905413>
1167
1168         Reviewed by Timothy Hatcher.
1169
1170         * UserInterface/Controllers/CSSManager.js:
1171         (WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
1172         (WI.CSSManager.prototype._resourceContentDidChange):
1173         (WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
1174         (WI.CSSManager.prototype._updateResourceContent):
1175         Use a `Throttler` instead of a 500ms debounce.
1176
1177 2019-03-20  Devin Rousso  <drousso@apple.com>
1178
1179         Web Inspector: Search: allow DOM searches to be case sensitive
1180         https://bugs.webkit.org/show_bug.cgi?id=194673
1181         <rdar://problem/48087577>
1182
1183         Reviewed by Timothy Hatcher.
1184
1185         * UserInterface/Views/SearchSidebarPanel.js:
1186         (WI.SearchSidebarPanel.prototype.performSearch):
1187
1188         * UserInterface/Views/DOMTreeContentView.js:
1189         (WI.DOMTreeContentView.prototype.performSearch.contextNodesReady):
1190
1191         * UserInterface/Controllers/DOMManager.js:
1192         (WI.DOMManager.prototype.performSearch.callback): Deleted.
1193         (WI.DOMManager.prototype.performSearch): Deleted.
1194         (WI.DOMManager.prototype.searchResult.mycallback): Deleted.
1195         (WI.DOMManager.prototype.searchResult): Deleted.
1196         (WI.DOMManager.prototype.cancelSearch): Deleted.
1197         Drive-by: remove unused code.
1198
1199 2019-03-19  Devin Rousso  <drousso@apple.com>
1200
1201         Web Inspector: Sources: provide option to group by path
1202         https://bugs.webkit.org/show_bug.cgi?id=195203
1203         <rdar://problem/27340680>
1204
1205         Reviewed by Timothy Hatcher.
1206
1207         Create top-level folders for each origin and nest all resources (in a folder chain) underneath.
1208
1209         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1210         (WI.SourcesNavigationSidebarPanel):
1211         (WI.SourcesNavigationSidebarPanel.prototype.closed):
1212         (WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject.searchTreeOutline): Added.
1213         (WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject):
1214         (WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
1215         (WI.SourcesNavigationSidebarPanel.prototype._updateMainFrameTreeElement):
1216         (WI.SourcesNavigationSidebarPanel.prototype._addResource):
1217         (WI.SourcesNavigationSidebarPanel.prototype._addScript):
1218         (WI.SourcesNavigationSidebarPanel.prototype._addWorkerTargetWithMainResource):
1219         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeMouseDown.addOption): Added.
1220         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeMouseDown): Added.
1221         (WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
1222         (WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
1223         (WI.SourcesNavigationSidebarPanel.prototype._handleFrameMainResourceDidChange):
1224         (WI.SourcesNavigationSidebarPanel.prototype._handleMainFrameDidChange):
1225         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
1226         (.sidebar > .panel.navigation.sources > .content):
1227         (.sidebar > .panel.navigation.sources > .content > .details-section.paused-reason.collapsed > .header > .options,):
1228         (.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint): Added.
1229         (.sidebar > .panel.navigation.sources > .content > .resources): Added.
1230         (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread): Added.
1231         (.sidebar > .panel.navigation.sources > .content .tree-outline.single-thread > .item.thread): Added.
1232         (.sidebar > .panel.navigation.sources > .content > .details-section.scripts:not(.collapsed)): Deleted.
1233         (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread): Deleted.
1234         (.sidebar > .panel.navigation.sources > .content > .tree-outline.single-thread > .item.thread): Deleted.
1235         Drive-by: fix "No Filter Results" message view to not overlap eachother.
1236         Drive-by: try to be more smart about what tree we focus when selecting a represented object.
1237
1238         * UserInterface/Views/ResourceTreeElement.js:
1239         (WI.ResourceTreeElement):
1240         (WI.ResourceTreeElement.prototype.get mainTitleText):
1241         (WI.ResourceTreeElement.prototype._updateTitles):
1242         * UserInterface/Base/URLUtilities.js:
1243         (WI.displayNameForURL):
1244         Provide a way for the display name to use a directory "/" instead of the last path component.
1245         This is needed in cases where the loaded resource is an implicit "index.*".
1246
1247         * UserInterface/Views/GeneralTreeElement.js:
1248         (WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath): Added.
1249         * UserInterface/Views/SourceCodeTreeElement.js:
1250         (WI.SourceCodeTreeElement.prototype.createFoldersAsNeededForSubpath): Deleted.
1251
1252         * Localizations/en.lproj/localizedStrings.js:
1253         * UserInterface/Models/Resource.js:
1254
1255         * UserInterface/Views/DetailsSection.css:
1256         (.details-section > .header .go-to-arrow):
1257         Drive-by: vertically center go-to-arrow.
1258
1259         * UserInterface/Protocol/InspectorFrontendAPI.js:
1260         (InspectorFrontendAPI.contextMenuItemSelected):
1261
1262         * UserInterface/Base/Setting.js:
1263         * UserInterface/Views/NetworkTableContentView.js:
1264         (WI.NetworkTableContentView):
1265         (WI.NetworkTableContentView.prototype.get filterNavigationItems):
1266         (WI.NetworkTableContentView.prototype._populateNameCell):
1267         (WI.NetworkTableContentView.prototype._generateSortComparator):
1268         (WI.NetworkTableContentView.prototype._insertResourceAndReloadTable):
1269         (WI.NetworkTableContentView.prototype._updateFilteredEntries):
1270         (WI.NetworkTableContentView.prototype._handleGroupMediaRequestsByDOMNodeCheckedDidChange): Added.
1271         (WI.NetworkTableContentView.prototype._handleGroupByDOMNodeCheckedDidChange): Deleted.
1272         Rename the `groupByNode` setting to be more specific.
1273
1274 2019-03-19  Devin Rousso  <drousso@apple.com>
1275
1276         Web Inspector: CPU Usage Timeline - the right edge of each column should align with a CPU measurement
1277         https://bugs.webkit.org/show_bug.cgi?id=195789
1278         <rdar://problem/48915271>
1279
1280         Reviewed by Joseph Pecoraro.
1281
1282         Right now, each column is rendered such that the middle of the column is aligned with the
1283         time of the CPU measurement. This could potentially be misleading, as the width/position of
1284         the bar implies that there was a period of time after the actual time of the CPU measurement
1285         that should be "attributed" to that same CPU measurement.
1286
1287            1      2      3
1288                _______
1289                [  *  ]
1290                [  *  ]_______
1291                [  *  ][  *  ]
1292         _______[  *  ][  *  ]
1293         [  *  ][  *  ][  *  ]
1294         [__*__][__*__][__*__]
1295          A   B  C   D  E   F
1296
1297         In this example, one might "attribute" any work done at time B to record 1, when in reality,
1298         it should be "attributed" to record 2, since the CPU measurement had already been taken by
1299         the time B was captured, meaning that the work for B hadn't yet been done and could
1300         therefore not have affected the CPU measurement for record 1.
1301
1302         We should be rendering the columns such that the CPU measurement aligns with the trailing
1303         edge of the column, so that all of the work that could be "attributed" to a given CPU
1304         measurement comes before it.
1305
1306           1      2      3
1307             _______       ___
1308             [    *]       [
1309             [    *]_______[
1310             [    *][    *][
1311         ____[    *][    *][
1312           *][    *][    *][
1313         __*][____*][____*][__
1314          A   B  C   D  E   F
1315
1316                 NOTE: this "rendering" isn't exactly accurate, as the `*` should overlap the `]`.
1317
1318         Legend:
1319          - `[     ]` represents a column for a CPU measurement
1320          - `*` represents the time when the measurement actually takes place
1321
1322         * UserInterface/Views/CPUTimelineOverviewGraph.js:
1323         (WI.CPUTimelineOverviewGraph.prototype.layout):
1324         (WI.CPUTimelineOverviewGraph.prototype._handleChartClick):
1325         * UserInterface/Views/TimelineOverview.js:
1326         (WI.TimelineOverview.prototype._recordSelected):
1327
1328 2019-03-19  Devin Rousso  <drousso@apple.com>
1329
1330         Web Inspector: Provide $event in the console when paused on an event listener
1331         https://bugs.webkit.org/show_bug.cgi?id=188672
1332
1333         Reviewed by Timothy Hatcher.
1334
1335         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
1336         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNames):
1337
1338 2019-03-19  Devin Rousso  <drousso@apple.com>
1339
1340         Web Inspector: DOM: "Capture Screenshot" should only be shown if the node is attached
1341         https://bugs.webkit.org/show_bug.cgi?id=195793
1342         <rdar://problem/48916594>
1343
1344         Reviewed by Joseph Pecoraro.
1345
1346         * UserInterface/Models/DOMNode.js:
1347         (WI.DOMNode.prototype.get attached): Added.
1348
1349         * UserInterface/Views/ContextMenuUtilities.js:
1350         (WI.appendContextMenuItemsForDOMNode):
1351         * UserInterface/Views/DOMTreeElement.js:
1352         (WI.DOMTreeElement.prototype._populateTagContextMenu):
1353
1354 2019-03-18  Joseph Pecoraro  <pecoraro@apple.com>
1355
1356         Web Inspector: HAR Extension for `serverIPAddress` port number
1357         https://bugs.webkit.org/show_bug.cgi?id=195695
1358
1359         Reviewed by Matt Baker.
1360
1361         * UserInterface/Controllers/HARBuilder.js:
1362         (WI.HARBuilder.entry):
1363         (WI.HARBuilder.port):
1364         * UserInterface/Models/LocalResource.js:
1365         (WI.LocalResource.fromHAREntry):
1366
1367 2019-03-16  Nikita Vasilyev  <nvasilyev@apple.com>
1368
1369         Web Inspector: Changes: style attribute changes aren't being tracked
1370         https://bugs.webkit.org/show_bug.cgi?id=193859
1371         <rdar://problem/47568977>
1372
1373         Reviewed by Devin Rousso.
1374
1375         * UserInterface/Controllers/CSSManager.js:
1376         (WI.CSSManager):
1377         (WI.CSSManager.prototype.get modifiedStyles):
1378         (WI.CSSManager.prototype.addModifiedStyle):
1379         (WI.CSSManager.prototype._mainResourceDidChange):
1380         (WI.CSSManager.prototype.get modifiedCSSRules): Deleted.
1381         (WI.CSSManager.prototype.addModifiedCSSRule): Deleted.
1382         (WI.CSSManager.prototype.removeModifiedCSSRule): Deleted.
1383         * UserInterface/Models/CSSRule.js:
1384         (WI.CSSRule.prototype.get stringId): Deleted.
1385         (WI.CSSRule.prototype.markModified): Deleted.
1386         * UserInterface/Models/CSSStyleDeclaration.js:
1387         (WI.CSSStyleDeclaration.prototype.get stringId):
1388         (WI.CSSStyleDeclaration.prototype.markModified):
1389         Inline styles weren't tracked because they didn't have owner rules.
1390         Track style declarations instead of CSS rules.
1391
1392         * UserInterface/Views/ChangesDetailsSidebarPanel.css:
1393         (.sidebar > .panel.changes-panel .css-rule):
1394         (.sidebar > .panel.changes-panel .css-rule + .css-rule):
1395         (.changes-panel .selector.style-attribute):
1396         (.changes-panel .selector:not(.style-attribute)):
1397         (.changes-panel .css-property-line > .property):
1398         (.changes-panel .css-property-line.unchanged): Deleted.
1399         Drive-by: use text-color-secondary for unchanged properties instead of altering opacity.
1400
1401         * UserInterface/Views/ChangesDetailsSidebarPanel.js:
1402         (WI.ChangesDetailsSidebarPanel.prototype.layout):
1403         (WI.ChangesDetailsSidebarPanel.prototype._createRuleElement):
1404         For an inline style declaration, instead of showing a CSS source file location show an appropriate selector for its DOM node.
1405
1406 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
1407
1408         Web Inspector: HAR Extension for Resource Priority
1409         https://bugs.webkit.org/show_bug.cgi?id=195693
1410
1411         Reviewed by Devin Rousso.
1412
1413         * UserInterface/Controllers/HARBuilder.js:
1414         (WI.HARBuilder.entry):
1415         (WI.HARBuilder.priority):
1416         (WI.HARBuilder.networkPriorityFromHARPriority):
1417         Include priority custom extension.
1418
1419         * UserInterface/Models/LocalResource.js:
1420         (WI.LocalResource.fromHAREntry):
1421         Import priority.
1422
1423 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
1424
1425         Web Inspector: CPU Usage Timeline - Give long thread names a tooltip if they could be ellipsized
1426         https://bugs.webkit.org/show_bug.cgi?id=195314
1427
1428         Reviewed by Devin Rousso.
1429
1430         * UserInterface/Views/CPUUsageView.js:
1431         (WI.CPUUsageView):
1432
1433 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
1434
1435         Web Inspector: CPU Usage Timeline - Reduce the intensity of the orange overlay color in dark mode
1436         https://bugs.webkit.org/show_bug.cgi?id=195772
1437
1438         Reviewed by Devin Rousso.
1439
1440         * UserInterface/Views/Variables.css:
1441         (@media (prefers-color-scheme: dark)):
1442         (:root):
1443
1444 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
1445
1446         Web Inspector: Timelines - Import / Export Timeline Recordings
1447         https://bugs.webkit.org/show_bug.cgi?id=195709
1448         <rdar://problem/23188921>
1449
1450         Reviewed by Devin Rousso.
1451
1452         Timeline exporting saves TimelineRecording and TimelineOverview state.
1453         The TimelineRecording includes all kinds of model objects, such as
1454         records, markers, memory pressure events, etc. It also includes raw
1455         protocol data, such as script profiler samples. TimelineOverview
1456         includes some of the view state to restore, such as the selected
1457         time range, zoom level, and selected timeline.
1458
1459         Timeline importing constructs a new TimelineRecording by replaying
1460         the records, markers, and other events, as well as re-initializing
1461         more state. To finally display the imported recording, the content
1462         view will immediately initialize start/current/end times and the
1463         overview will restore the view state.
1464
1465         * Localizations/en.lproj/localizedStrings.js:
1466         New strings.
1467
1468         * UserInterface/Controllers/TimelineManager.js:
1469         (WI.TimelineManager.synthesizeImportError):
1470         (WI.TimelineManager.prototype.importRecording):
1471         Import API.
1472
1473         (WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
1474         Initialize the samples on the recording via a different path
1475         so that the data can be saved for exporting.
1476
1477         * UserInterface/Models/TimelineRecording.js:
1478         (WI.TimelineRecording):
1479         (WI.TimelineRecording.import):
1480         (WI.TimelineRecording.prototype.exportData):
1481         (WI.TimelineRecording.prototype.get capturing):
1482         (WI.TimelineRecording.prototype.get imported):
1483         (WI.TimelineRecording.prototype.unloaded):
1484         (WI.TimelineRecording.prototype.reset):
1485         (WI.TimelineRecording.prototype.addEventMarker):
1486         (WI.TimelineRecording.prototype.addRecord):
1487         (WI.TimelineRecording.prototype.addMemoryPressureEvent):
1488         (WI.TimelineRecording.prototype.initializeCallingContextTrees):
1489         (WI.TimelineRecording.prototype.canExport):
1490         Save data at the TimelineRecording level that can be used for export.
1491         We only allow exporting a TimelineRecording that has started/stopped
1492         at least once and is not currently capturing.
1493
1494         * UserInterface/Views/TimelineRecordingContentView.js:
1495         (WI.TimelineRecordingContentView):
1496         (WI.TimelineRecordingContentView.prototype.get navigationItems):
1497         (WI.TimelineRecordingContentView.prototype.get supportsSave):
1498         (WI.TimelineRecordingContentView.prototype.get saveData):
1499         (WI.TimelineRecordingContentView.prototype.shown):
1500         (WI.TimelineRecordingContentView.prototype._capturingStarted):
1501         (WI.TimelineRecordingContentView.prototype._capturingStopped):
1502         (WI.TimelineRecordingContentView.prototype._initializeImportedRecording):
1503         (WI.TimelineRecordingContentView.prototype._exportTimelineRecording):
1504         (WI.TimelineRecordingContentView.prototype._importButtonNavigationItemClicked):
1505         (WI.TimelineRecordingContentView.prototype._recordingReset):
1506         Add Import and Export buttons in the Timeline navigation bar.
1507
1508         * UserInterface/Views/TimelineOverview.js:
1509         (WI.TimelineOverview):
1510         (WI.TimelineOverview.prototype.exportData):
1511         (WI.TimelineOverview.prototype._instrumentAdded):
1512         (WI.TimelineOverview.prototype._recordingImported):
1513         When importing a recording update the TimelineOverview state
1514         soon afterwards.
1515
1516         * UserInterface/Models/CPUTimelineRecord.js:
1517         (WI.CPUTimelineRecord.fromJSON):
1518         (WI.CPUTimelineRecord.prototype.toJSON):
1519         * UserInterface/Models/GarbageCollection.js:
1520         (WI.GarbageCollection.fromJSON):
1521         (WI.GarbageCollection.prototype.toJSON):
1522         * UserInterface/Models/Geometry.js:
1523         (WI.Quad.fromJSON):
1524         (WI.Quad.prototype.toJSON):
1525         * UserInterface/Models/HeapAllocationsTimelineRecord.js:
1526         (WI.HeapAllocationsTimelineRecord.fromJSON):
1527         (WI.HeapAllocationsTimelineRecord.prototype.toJSON):
1528         * UserInterface/Models/LayoutTimelineRecord.js:
1529         (WI.LayoutTimelineRecord.fromJSON):
1530         (WI.LayoutTimelineRecord.prototype.toJSON):
1531         * UserInterface/Models/MediaTimelineRecord.js:
1532         (WI.MediaTimelineRecord.fromJSON):
1533         (WI.MediaTimelineRecord.prototype.toJSON):
1534         * UserInterface/Models/MemoryPressureEvent.js:
1535         (WI.MemoryPressureEvent.fromJSON):
1536         (WI.MemoryPressureEvent.prototype.toJSON):
1537         * UserInterface/Models/MemoryTimelineRecord.js:
1538         (WI.MemoryTimelineRecord):
1539         (WI.MemoryTimelineRecord.fromJSON):
1540         (WI.MemoryTimelineRecord.prototype.toJSON):
1541         * UserInterface/Models/RenderingFrameTimelineRecord.js:
1542         (WI.RenderingFrameTimelineRecord.fromJSON):
1543         (WI.RenderingFrameTimelineRecord.prototype.toJSON):
1544         * UserInterface/Models/ResourceTimelineRecord.js:
1545         (WI.ResourceTimelineRecord.fromJSON):
1546         (WI.ResourceTimelineRecord.prototype.toJSON):
1547         * UserInterface/Models/ScriptTimelineRecord.js:
1548         (WI.ScriptTimelineRecord.fromJSON):
1549         (WI.ScriptTimelineRecord.prototype.toJSON):
1550         * UserInterface/Models/TimelineMarker.js:
1551         (WI.TimelineMarker.fromJSON):
1552         (WI.TimelineMarker.prototype.toJSON):
1553         (WI.TimelineMarker.prototype.get type):
1554         (WI.TimelineMarker.prototype.get details):
1555         (WI.TimelineMarker.prototype.set time):
1556         (WI.TimelineMarker):
1557         * UserInterface/Models/TimelineRecord.js:
1558         (WI.TimelineRecord.fromJSON):
1559         (WI.TimelineRecord.prototype.toJSON):
1560         Import / Export toJSON / fromJSON implementations.
1561         
1562         * UserInterface/Views/CPUTimelineOverviewGraph.js:
1563         (WI.CPUTimelineOverviewGraph):
1564         (WI.CPUTimelineOverviewGraph.prototype._cpuTimelineRecordAdded):
1565         (WI.CPUTimelineOverviewGraph.prototype._processRecord):
1566         * UserInterface/Views/LayoutTimelineOverviewGraph.js:
1567         (WI.LayoutTimelineOverviewGraph):
1568         (WI.LayoutTimelineOverviewGraph.prototype._layoutTimelineRecordAdded):
1569         (WI.LayoutTimelineOverviewGraph.prototype._processRecord):
1570         * UserInterface/Views/LayoutTimelineView.js:
1571         (WI.LayoutTimelineView):
1572         (WI.LayoutTimelineView.prototype._layoutTimelineRecordAdded):
1573         (WI.LayoutTimelineView.prototype._processRecord):
1574         * UserInterface/Views/MediaTimelineView.js:
1575         (WI.MediaTimelineView):
1576         (WI.MediaTimelineView.prototype._handleRecordAdded):
1577         (WI.MediaTimelineView.prototype._processRecord):
1578         * UserInterface/Views/MemoryTimelineOverviewGraph.js:
1579         (WI.MemoryTimelineOverviewGraph):
1580         (WI.MemoryTimelineOverviewGraph.prototype._memoryTimelineRecordAdded):
1581         (WI.MemoryTimelineOverviewGraph.prototype._processRecord):
1582         * UserInterface/Views/MemoryTimelineView.js:
1583         (WI.MemoryTimelineView):
1584         (WI.MemoryTimelineView.prototype._memoryTimelineRecordAdded):
1585         (WI.MemoryTimelineView.prototype._processRecord):
1586         * UserInterface/Views/NetworkTimelineOverviewGraph.js:
1587         (WI.NetworkTimelineOverviewGraph):
1588         (WI.NetworkTimelineOverviewGraph.prototype.reset):
1589         (WI.NetworkTimelineOverviewGraph.prototype._networkTimelineRecordAdded):
1590         (WI.NetworkTimelineOverviewGraph.prototype._processRecord):
1591         (WI.NetworkTimelineOverviewGraph.prototype._networkTimelineRecordAdded.compareByStartTime): Deleted.
1592         * UserInterface/Views/NetworkTimelineView.js:
1593         (WI.NetworkTimelineView):
1594         (WI.NetworkTimelineView.prototype._networkTimelineRecordAdded):
1595         (WI.NetworkTimelineView.prototype._processRecord):
1596         * UserInterface/Views/RenderingFrameTimelineView.js:
1597         (WI.RenderingFrameTimelineView):
1598         (WI.RenderingFrameTimelineView.prototype._renderingFrameTimelineRecordAdded):
1599         (WI.RenderingFrameTimelineView.prototype._processRecord):
1600         * UserInterface/Views/ScriptDetailsTimelineView.js:
1601         (WI.ScriptDetailsTimelineView):
1602         (WI.ScriptDetailsTimelineView.prototype._scriptTimelineRecordAdded):
1603         (WI.ScriptDetailsTimelineView.prototype._processRecord):
1604         Add common _processRecord path to each timeline OverviewGraph and TimelineView.
1605         By calling this in construction we populate graphs with TimelineRecords that
1606         may have already existed. This is necessary for imports, but this also fixes
1607         the case where you enable a timeline that had data and it didn't show data.
1608
1609         * UserInterface/Views/LayoutTimelineOverviewGraph.css:
1610         (.timeline-overview-graph.layout-overview > .graph-row):
1611         (.timeline-overview-graph.layout-overview > .graph-row > .timeline-record-bar):
1612         (.timeline-overview-graph.layout-overview > .graph-row > .timeline-record-bar > .segment):
1613         (.timeline-overview-graph.layout > .graph-row): Deleted.
1614         (.timeline-overview-graph.layout > .graph-row > .timeline-record-bar): Deleted.
1615         (.timeline-overview-graph.layout > .graph-row > .timeline-record-bar > .segment): Deleted.
1616         * UserInterface/Views/TimelineRecordBar.css:
1617         (.timeline-record-bar.timeline-record-type-layout.paint > .segment,):
1618         (.timeline-record-bar.timeline-record-type-layout.layout-timeline-record-paint > .segment,): Deleted.
1619         We simplified some of the sub-record type enum strings. To do this we needed to change
1620         "layout" to "layout-overview" to avoid a conflict.
1621
1622 2019-03-15  Joseph Pecoraro  <pecoraro@apple.com>
1623
1624         Web Inspector: Network - Toggle Between Live Activity and Imported HAR resource collections
1625         https://bugs.webkit.org/show_bug.cgi?id=195734
1626
1627         Reviewed by Devin Rousso.
1628
1629         * Localizations/en.lproj/localizedStrings.js:
1630         * UserInterface/Images/NetworkHAR.svg: Added.
1631         * UserInterface/Images/NetworkOverview.svg: Added.
1632         * UserInterface/Views/NetworkTableContentView.css:
1633         (.content-view.tab.network > .content-browser > .navigation-bar .hierarchical-path .icon):
1634         (.network-overview-icon > .icon):
1635         (.network-har-icon > .icon):
1636         (@media (prefers-color-scheme: dark)):
1637
1638         * UserInterface/Views/NetworkTableContentView.js:
1639         (WI.NetworkTableContentView):
1640         (WI.NetworkTableContentView.prototype.get navigationItems):
1641         (WI.NetworkTableContentView.prototype.reset):
1642         (WI.NetworkTableContentView.prototype.tableIndexForRepresentedObject):
1643         (WI.NetworkTableContentView.prototype.tableRepresentedObjectForIndex):
1644         (WI.NetworkTableContentView.prototype.tableNumberOfRows):
1645         (WI.NetworkTableContentView.prototype.tableCellContextMenuClicked):
1646         (WI.NetworkTableContentView.prototype.tableSelectionDidChange):
1647         (WI.NetworkTableContentView.prototype.tablePopulateCell):
1648         (WI.NetworkTableContentView.prototype._addCollection):
1649         (WI.NetworkTableContentView.prototype._setActiveCollection):
1650         (WI.NetworkTableContentView.prototype._addCollectionPathComponent):
1651         (WI.NetworkTableContentView.prototype._collectionsHierarchicalPathComponentWasSelected):
1652         (WI.NetworkTableContentView.prototype._changeCollection):
1653         (WI.NetworkTableContentView.prototype.handleClearShortcut):
1654         (WI.NetworkTableContentView.prototype._updateWaterfallTimeRange):
1655         (WI.NetworkTableContentView.prototype._updateWaterfallTimelineRuler):
1656         (WI.NetworkTableContentView.prototype._canExportHAR):
1657         (WI.NetworkTableContentView.prototype._processPendingEntries):
1658         (WI.NetworkTableContentView.prototype._populateWithInitialResourcesIfNeeded):
1659         (WI.NetworkTableContentView.prototype._rowIndexForRepresentedObject):
1660         (WI.NetworkTableContentView.prototype._updateEntryForResource):
1661         (WI.NetworkTableContentView.prototype._updateEmptyFilterResultsMessage):
1662         (WI.NetworkTableContentView.prototype._mainResourceDidChange):
1663         (WI.NetworkTableContentView.prototype._mainFrameDidChange):
1664         (WI.NetworkTableContentView.prototype._resourceLoadingDidFinish):
1665         (WI.NetworkTableContentView.prototype._resourceLoadingDidFail):
1666         (WI.NetworkTableContentView.prototype._resourceTransferSizeDidChange):
1667         (WI.NetworkTableContentView.prototype._handleResourceAdded):
1668         (WI.NetworkTableContentView.prototype._runForMainCollection):
1669         (WI.NetworkTableContentView.prototype._isShowingMainCollection):
1670         (WI.NetworkTableContentView.prototype._insertResourceAndReloadTable):
1671         (WI.NetworkTableContentView.prototype._handleNodeDidFireEvent):
1672         (WI.NetworkTableContentView.prototype._handleNodeLowPowerChanged):
1673         (WI.NetworkTableContentView.prototype._updateSort):
1674         (WI.NetworkTableContentView.prototype._updateFilteredEntries):
1675         (WI.NetworkTableContentView.prototype._urlFilterDidChange):
1676         (WI.NetworkTableContentView.prototype._HARResources):
1677         (WI.NetworkTableContentView.prototype._importHAR):
1678         Introduce the concept of collections that can be swapped in/out
1679         to re-render the Network Table with different contents.
1680
1681 2019-03-15  Devin Rousso  <drousso@apple.com>
1682
1683         Web Inspector: provide a way to capture a screenshot of a node from within the page
1684         https://bugs.webkit.org/show_bug.cgi?id=194279
1685         <rdar://problem/10731573>
1686
1687         Reviewed by Joseph Pecoraro.
1688
1689         Add `console.screenshot` functionality, which displays a screenshot of a given object (if
1690         able) within Web Inspector's Console tab. From there, it can be viewed and saved.
1691
1692         Currently, `console.screenshot` will
1693          - capture an image of a `Node` (if provided)
1694          - capture an image of the viewport if nothing is provided
1695
1696         * UserInterface/Models/ConsoleMessage.js:
1697         (WI.ConsoleMessage):
1698         * UserInterface/Views/ConsoleCommandView.js:
1699         (WI.ConsoleCommandView.prototype.render):
1700         * UserInterface/Views/ConsoleMessageView.js:
1701         (WI.ConsoleMessageView.prototype.render):
1702         (WI.ConsoleMessageView.prototype.toClipboardString):
1703         (WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
1704         (WI.ConsoleMessageView.prototype._appendSavedResultIndex):
1705         (WI.ConsoleMessageView.prototype._appendStackTrace):
1706         (WI.ConsoleMessageView.prototype._makeExpandable):
1707         (WI.ConsoleMessageView.prototype._handleContextMenu): Added.
1708         * UserInterface/Views/ConsoleMessageView.css:
1709         (.console-user-command.special-user-log > .console-message-body): Added.
1710         (.console-message-body): Added.
1711         (.console-message-body > span): Added.
1712         (.console-message-body > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider)): Added.
1713         (.console-message-body > .console-image): Added.
1714         (.console-message-body > .show-grid): Added.
1715         (.console-error-level .console-message-body): Added.
1716         (.console-warning-level .console-message-body): Added.
1717         (.console-log-level.console-image-container::before): Added.
1718         (.console-user-command > .console-message-body): Added.
1719         (.console-warning-level .console-message-body): Added.
1720         (.console-error-level .console-message-body): Added.
1721         (.console-user-command > .console-message-body): Added.
1722         (.console-user-command.special-user-log > .console-message-text): Deleted.
1723         (.console-message-text): Deleted.
1724         (.console-message-text > span): Deleted.
1725         (.console-message-text > span > :matches(.console-message-enclosed, .console-message-preview, .console-message-preview-divider)): Deleted.
1726         (.console-error-level .console-message-text): Deleted.
1727         (.console-warning-level .console-message-text): Deleted.
1728         (.console-user-command > .console-message-text): Deleted.
1729         (.console-warning-level .console-message-text): Deleted.
1730         (.console-error-level .console-message-text): Deleted.
1731         (.console-user-command > .console-message-text): Deleted.
1732         * UserInterface/Views/LogContentView.css:
1733         (.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-text .highlighted): Added.
1734         (.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-body .highlighted): Deleted.
1735         Renamed variables/classes to be more semantically correct when the content is an image.
1736          - `_messageTextElement` to `_messageBodyElement` (JS)
1737          - `.console-message-text` to `.console-message-body` (CSS)
1738
1739         * UserInterface/Controllers/JavaScriptLogViewController.js:
1740         (WI.JavaScriptLogViewController.prototype.renderPendingMessages):
1741
1742         * UserInterface/Views/Main.css:
1743         (:matches(img, canvas).show-grid):
1744         (@media (prefers-color-scheme: dark) :matches(img, canvas).show-grid):
1745
1746         * UserInterface/Base/FileUtilities.js:
1747         (WI.FileUtilities.screenshotString): Added.
1748
1749         * UserInterface/Models/NativeFunctionParameters.js:
1750         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
1751
1752         * UserInterface/Images/ConsoleImage.svg: Copied from UserInterface/Images/Canvas.svg.
1753         * Localizations/en.lproj/localizedStrings.js:
1754
1755 2019-03-14  Nikita Vasilyev  <nvasilyev@apple.com>
1756
1757         Web Inspector: Styles: Jump to effective property button doesn't hide after overridden property become effective
1758         https://bugs.webkit.org/show_bug.cgi?id=195770
1759         <rdar://problem/48903634>
1760
1761         Reviewed by Matt Baker.
1762
1763         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
1764         (.spreadsheet-style-declaration-editor .property .select-effective-property): Added.
1765         (.spreadsheet-style-declaration-editor .property.overridden .select-effective-property): Deleted.
1766         Hide `.select-effective-property` element for properties that aren't overridden.
1767
1768 2019-03-14  Devin Rousso  <drousso@apple.com>
1769
1770         Web Inspector: REGRESSION: Canvas: the first processed action should be selected as soon as it's available if no previous selected action exists
1771         https://bugs.webkit.org/show_bug.cgi?id=195732
1772         <rdar://problem/48875214>
1773
1774         Reviewed by Matt Baker.
1775
1776         * UserInterface/Views/CanvasSidebarPanel.js:
1777         (WI.CanvasSidebarPanel.prototype._handleRecordingProcessedAction):
1778         Rather than wait until the entire recording is ready, set the selected action as soon as the
1779         first action is ready (assuming there isn't already a selected action).
1780
1781 2019-03-14  Joseph Pecoraro  <pecoraro@apple.com>
1782
1783         Web Inspector: Network - HAR Import
1784         https://bugs.webkit.org/show_bug.cgi?id=195642
1785         <rdar://problem/34820974>
1786
1787         Reviewed by Devin Rousso.
1788
1789         * Localizations/en.lproj/localizedStrings.js
1790         * UserInterface/Test.html:
1791         * UserInterface/Test.html:
1792         New strings and resources.
1793
1794         * UserInterface/Controllers/HARBuilder.js:
1795         (WI.HARBuilder.dateFromHARDate):
1796         (WI.HARBuilder.protocolFromHARProtocol):
1797         (WI.HARBuilder.responseSourceFromHARFetchType):
1798         Reverse parsers from HAR to WI.Resource types.
1799
1800         * UserInterface/Models/LocalResource.js: Added.
1801         (WI.LocalResource):
1802         (WI.LocalResource.headersArrayToHeadersObject):
1803         (WI.LocalResource.fromHAREntry):
1804         (WI.LocalResource.prototype.hasContent):
1805         (WI.LocalResource.prototype.setContent):
1806         (WI.LocalResource.prototype.requestContentFromBackend):
1807         A Resource subclass with data fully supplied in the frontend.
1808
1809         * UserInterface/Controllers/NetworkManager.js:
1810         (WI.NetworkManager):
1811         (WI.NetworkManager.synthesizeImportError):
1812         (WI.NetworkManager.prototype.localResourceForURL):
1813         (WI.NetworkManager.prototype.processHAR):
1814         Process a HAR and extract local resources.
1815
1816         * UserInterface/Views/NetworkTableContentView.js:
1817         (WI.NetworkTableContentView):
1818         (WI.NetworkTableContentView.prototype.reset):
1819         (WI.NetworkTableContentView.prototype._handleResourceAdded):
1820         (WI.NetworkTableContentView.prototype._importHAR):
1821         Add an import button. When an import succeeds reset the
1822         table and only show imported resources (ignoring page
1823         loaded resources).
1824
1825 2019-03-14  Devin Rousso  <drousso@apple.com>
1826
1827         Web Inspector: Console: getEventListeners should work for any EventTarget
1828         https://bugs.webkit.org/show_bug.cgi?id=195713
1829
1830         Reviewed by Joseph Pecoraro.
1831
1832         * UserInterface/Models/NativeFunctionParameters.js:
1833
1834 2019-03-14  Devin Rousso  <drousso@apple.com>
1835
1836         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
1837         https://bugs.webkit.org/show_bug.cgi?id=195123
1838         <rdar://problem/48450148>
1839
1840         Reviewed by Joseph Pecoraro.
1841
1842         * UserInterface/Controllers/CSSManager.js:
1843         (WI.CSSManager.displayNameForPseudoId): Added.
1844
1845         * UserInterface/Models/DOMNodeStyles.js:
1846         (WI.DOMNodeStyles.static uniqueOrderedStyles): Added.
1847         (WI.DOMNodeStyles.prototype.get uniqueOrderedStyles):
1848
1849         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
1850         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
1851         (WI.SpreadsheetRulesStyleDetailsPanel.prototype._handleSectionFilterApplied):
1852         Rather than iterate over the `WI.DOMNode`'s list of pseudo-elements (which is only ::before
1853         and ::after), we iterate over the `WI.DOMNodeStyle`'s list of pseudo-element rules. This is
1854         an object where the key is a `CSS.PseudoId` and the value is an object containing all the
1855         matched rules and ordered styles for that pseudo-type. We can preserve the current
1856         functionality by using the ::before/::after `WI.DOMNode` when we encounter one of those
1857         pseudo-ids.
1858
1859         An additional benefit of this change is that `::before`/`::after` styles will still appear
1860         in the Rules panel even if they don't have a `content` property set (e.g. when the
1861         `::before`/`::after` pseudo-element doesn't exist). This is because the styles are no longer
1862         fetched from those pseudo-element nodes directly, but rather as a matched style for the
1863         parent node. As such, editing a `content` property to become invalid/disablde in a
1864         `::before`/`::after` rule won't make the entire rule disappeaer.
1865
1866 2019-03-14  Devin Rousso  <drousso@apple.com>
1867
1868         Web Inspector: we should show artificial context menus on mousedown instead of click
1869         https://bugs.webkit.org/show_bug.cgi?id=195494
1870
1871         Reviewed by Joseph Pecoraro.
1872
1873         * UserInterface/Views/ContextMenu.js:
1874         (WI.ContextMenu):
1875         (WI.ContextMenu.prototype.show):
1876         (WI.ContextMenu.prototype.addBeforeShowCallback): Added.
1877         (WI.ContextMenu.prototype.handleEvent):
1878         Provide a way to register a callback that will be called right as the "contextmenu" event is
1879         handled, but before the context menu is actually shown. Since "mousedown" events are also
1880         fired when/before a "contextmenu" event is fired, each of the below callers has to maintain
1881         some state indicating "we are about to show a context menu, so ignore all "mousedown" events
1882         until that time". Without this, the below callers wouldn't be able to tell when the context
1883         menu is finally shown.
1884
1885         * UserInterface/Base/SearchUtilities.js:
1886         (WI.SearchUtilities.createSettingsButton):
1887         * UserInterface/Views/CanvasContentView.js:
1888         (WI.CanvasContentView):
1889         (WI.CanvasContentView.prototype.initialLayout):
1890         (WI.CanvasContentView.prototype._handleCanvasElementButtonMouseDown): Added.
1891         (WI.CanvasContentView.prototype._handleViewShaderButtonMouseDown): Added.
1892         (WI.CanvasContentView.prototype._handleViewRecordingButtonMouseDown): Added.
1893         (WI.CanvasContentView.prototype._canvasElementButtonClicked): Deleted.
1894         (WI.CanvasContentView.prototype._handleViewShaderButtonClicked): Deleted.
1895         (WI.CanvasContentView.prototype._handleViewRecordingButtonClicked): Deleted.
1896         * UserInterface/Views/DebuggerSidebarPanel.js:
1897         (WI.DebuggerSidebarPanel):
1898         (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointMouseDown): Added.
1899         (WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointClicked): Deleted.
1900         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
1901         (WI.SourcesNavigationSidebarPanel):
1902         (WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointMouseDown): Added.
1903         (WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointClicked): Deleted.
1904         * UserInterface/Views/TabBar.js:
1905         (WI.TabBar.prototype._handleMouseDown):
1906         * UserInterface/Views/LegacyTabBar.js:
1907         (WI.LegacyTabBar.prototype._handleMouseDown):
1908
1909 2019-03-13  Devin Rousso  <drousso@apple.com>
1910
1911         Web Inspector: Debugger: pausing in an inline script on a page with a URL query creates an Extra Script
1912         https://bugs.webkit.org/show_bug.cgi?id=195705
1913         <rdar://problem/48853820>
1914
1915         Reviewed by Antoine Quint.
1916
1917         * UserInterface/Models/Script.js:
1918         (WI.Script.prototype._resolveResource):
1919         If the page's URL has a query parameter, the payload we receive for any inline <script>s
1920         doesn't include the query parameter as part of its URL. As such, if there isn't an existing
1921         resource with a URL that exactly matches the URL of the script and if the URL of the main
1922         resource for the script's target starts with the URL of the script, we assume that the
1923         script "belongs" to the target's main resource and associate the script with it as such.
1924
1925 2019-03-13  Keith Rollin  <krollin@apple.com>
1926
1927         Add support for new StagedFrameworks layout
1928         https://bugs.webkit.org/show_bug.cgi?id=195543
1929
1930         Reviewed by Alexey Proskuryakov.
1931
1932         When creating the WebKit layout for out-of-band Safari/WebKit updates,
1933         use an optional path prefix when called for.
1934
1935         Opportunistic cleanup: remove unused
1936         OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH variable, which otherwise would
1937         have needlessly been updated to also incorporate the new prefix.
1938
1939         * Configurations/Base.xcconfig:
1940         * Configurations/WebKitTargetConditionals.xcconfig: Added.
1941
1942 2019-03-13  Nikita Vasilyev  <nvasilyev@apple.com>
1943
1944         REGRESSION(r240946): Web Inspector: Styles: removing selected property doesn't update overridden status
1945         https://bugs.webkit.org/show_bug.cgi?id=195389
1946         <rdar://problem/48658929>
1947
1948         Reviewed by Matt Baker.
1949
1950         * UserInterface/Models/DOMNodeStyles.js:
1951         (WI.DOMNodeStyles.prototype.changeStyleText):
1952         Call DOMNodeStyles.prototype.refresh after the callback. No updates
1953         to CSSStyleDeclaration happen until the callback is called.
1954
1955 2019-03-13  Devin Rousso  <drousso@apple.com>
1956
1957         Web Inspector: Protocol Logging: log messages with backtrace if inspector^2 is open
1958         https://bugs.webkit.org/show_bug.cgi?id=195687
1959
1960         Reviewed by Joseph Pecoraro.
1961
1962         * UserInterface/Protocol/LoggingProtocolTracer.js:
1963         (WI.LoggingProtocolTracer.prototype._processEntry):
1964
1965 2019-03-13  Devin Rousso  <drousso@apple.com>
1966
1967         Web Inspector: REGRESSION(r242737): unnecessary semicolon added when populating WI.TreeOutline stylesheet
1968         https://bugs.webkit.org/show_bug.cgi?id=195689
1969
1970         Reviewed by Joseph Pecoraro.
1971
1972         * UserInterface/Views/TreeOutline.js:
1973         (WI.TreeOutline._generateStyleRulesIfNeeded):
1974
1975 2019-03-13  Joseph Pecoraro  <pecoraro@apple.com>
1976
1977         Web Inspector: Network - HAR Export duplicates blocked/send time if there was no dns/connect block
1978         https://bugs.webkit.org/show_bug.cgi?id=195655
1979         <rdar://problem/48831152>
1980
1981         Reviewed by Devin Rousso.
1982
1983         * UserInterface/Controllers/HARBuilder.js:
1984         (WI.HARBuilder.timings):
1985
1986 2019-03-12  Devin Rousso  <drousso@apple.com>
1987
1988         Web Inspector: Sources: allow image collections to be filtered by type
1989         https://bugs.webkit.org/show_bug.cgi?id=195630
1990
1991         Reviewed by Matt Baker.
1992
1993         * UserInterface/Views/ResourceCollectionContentView.js:
1994         (WI.ResourceCollectionContentView):
1995         (WI.ResourceCollectionContentView.prototype.get navigationItems): Added.
1996         (WI.ResourceCollectionContentView.prototype.contentViewAdded):
1997         (WI.ResourceCollectionContentView.prototype.contentViewRemoved): Added.
1998         (WI.ResourceCollectionContentView.prototype._updateImageTypeScopeBar): Added.
1999         (WI.ResourceCollectionContentView.prototype._handleImageTypeSelectionChanged): Added.
2000         * UserInterface/Views/ResourceCollectionContentView.css: Asdded.
2001         (.resource-collection-image-type-scope-bar.default-item-selected):
2002
2003         * UserInterface/Views/CollectionContentView.css:
2004         (.content-view.collection > .content-view[hidden]): Added.
2005
2006         * UserInterface/Views/ScopeBarItem.js:
2007         (WI.ScopeBarItem.prototype.set hidden):
2008         * UserInterface/Views/MultipleScopeBarItem.js:
2009         (WI.MultipleScopeBarItem.prototype.set scopeBarItems):
2010         (WI.MultipleScopeBarItem.prototype.set selectedScopeBarItem):
2011         (WI.MultipleScopeBarItem.prototype.get _visibleScopeBarItems): Added.
2012         (WI.MultipleScopeBarItem.prototype._selectElementSelectionChanged):
2013         (WI.MultipleScopeBarItem.prototype._handleItemHiddenChanged): Added.
2014         Dispatch an event when an item is hidden so that any owner `WI.MultipleScopeBarItem` can
2015         rerender it's <select> without that item.
2016
2017         * Localizations/en.lproj/localizedStrings.js:
2018         * UserInterface/Main.html:
2019
2020 2019-03-12  Nikita Vasilyev  <nvasilyev@apple.com>
2021
2022         Web Inspector: Keyboard shortcut for settings tab too greedy on non-US keyboards
2023         https://bugs.webkit.org/show_bug.cgi?id=192947
2024         <rdar://problem/46886779>
2025
2026         Reviewed by Devin Rousso.
2027
2028         * UserInterface/Base/Main.js:
2029         (WI._showSettingsTab):
2030
2031 2019-03-12  Devin Rousso  <drousso@apple.com>
2032
2033         Web Inspector: Elements: provide node context menu items for event listeners sorted by node
2034         https://bugs.webkit.org/show_bug.cgi?id=195633
2035
2036         Reviewed by Matt Baker.
2037
2038         * UserInterface/Base/DOMUtilities.js:
2039         (WI.linkifyNodeReferenceElement):
2040         (WI.bindInteractionsForNodeToElement): Added.
2041         Split logic for adding event listeners into a separate function so it can be used on
2042         existing DOM without modifying it.
2043
2044         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
2045         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByNode):
2046
2047 2019-03-12  Devin Rousso  <drousso@apple.com>
2048
2049         Web Inspector: DOM Debugger: remove left padding when the last DOM breakpoint is removed
2050         https://bugs.webkit.org/show_bug.cgi?id=195522
2051
2052         Reviewed by Matt Baker.
2053
2054         * UserInterface/Views/DOMTreeContentView.js:
2055         (WI.DOMTreeContentView.prototype._updateBreakpointStatus):
2056         * UserInterface/Views/DOMTreeElement.js:
2057         (WI.DOMTreeElement.prototype.get hasBreakpoint): Added.
2058
2059 2019-03-12  Devin Rousso  <drousso@apple.com>
2060
2061         Web Inspector: Canvas: export recording as HTML
2062         https://bugs.webkit.org/show_bug.cgi?id=195311
2063         <rdar://problem/48588673>
2064
2065         Reviewed by Joseph Pecoraro.
2066
2067         * UserInterface/Models/Recording.js:
2068         (WI.Recording.prototype.async swizzle):
2069         (WI.Recording.prototype.toHTML): Added.
2070         (WI.Recording.prototype.toHTML.escapeHTML): Added.
2071         (WI.Recording.prototype.toHTML.processObject): Added.
2072         (WI.Recording.prototype.toHTML.processValue): Added.
2073
2074         * UserInterface/Views/RecordingContentView.js:
2075         (WI.RecordingContentView):
2076         (WI.RecordingContentView.prototype._exportRecording):
2077         (WI.RecordingContentView.prototype._exportReduction): Added.
2078         (WI.RecordingContentView.prototype._updateExportButton): Added.
2079         (WI.RecordingContentView.prototype._handleExportNavigationItemClicked): Added.
2080         (WI.RecordingContentView.prototype._handleRecordingProcessedAction):
2081
2082         * UserInterface/Views/CanvasOverviewContentView.js:
2083         (WI.CanvasOverviewContentView):
2084         * UserInterface/Views/HeapAllocationsTimelineView.js:
2085         (WI.HeapAllocationsTimelineView):
2086         * UserInterface/Views/HeapSnapshotContentView.js:
2087         (WI.HeapSnapshotContentView):
2088         Drive-by: s/`toolTip`/`tooltip`.
2089
2090         * Localizations/en.lproj/localizedStrings.js:
2091
2092 2019-03-12  Devin Rousso  <drousso@apple.com>
2093
2094         Web Inspector: Audit: there should be a centralized place for reusable code
2095         https://bugs.webkit.org/show_bug.cgi?id=195265
2096         <rdar://problem/47040673>
2097
2098         Reviewed by Joseph Pecoraro.
2099
2100         * UserInterface/Controllers/AuditManager.js:
2101         (WI.AuditManager.prototype.async start):
2102         (WI.AuditManager.prototype._topLevelTestForTest): Added.
2103         (WI.AuditManager.prototype._topLevelTestForTest.walk): Added.
2104
2105         * UserInterface/Models/AuditTestBase.js:
2106         (WI.AuditTestBase):
2107         (WI.AuditTestBase.prototype.async setup): Added.
2108         (WI.AuditTestBase.toJSON):
2109
2110         * UserInterface/Models/AuditTestCase.js:
2111         (WI.AuditTestCase.async.fromPayload):
2112         (WI.AuditTestCase.prototype.async run.async parseResponse):
2113         Allow additional data to be passed back to the result's `data` for testing.
2114
2115         * UserInterface/Models/AuditTestGroup.js:
2116         (WI.AuditTestGroup.async.fromPayload):
2117
2118 2019-03-12  Joseph Pecoraro  <pecoraro@apple.com>
2119
2120         Web Inspector: Timelines - Improve handling of past recordings (readonly)
2121         https://bugs.webkit.org/show_bug.cgi?id=195594
2122
2123         Reviewed by Devin Rousso.
2124
2125         * UserInterface/Views/TimelineRecordingContentView.js:
2126         (WI.TimelineRecordingContentView.prototype._clearTimeline):
2127         Don't allow clearing of a readonly recording.
2128
2129         * UserInterface/Views/TimelineTabContentView.js:
2130         (WI.TimelineTabContentView.prototype._toggleRecordingOnSpacebar):
2131         Don't do anything when viewing a readonly recording.
2132
2133         (WI.TimelineTabContentView.prototype._recordButtonClicked):
2134         Start a new recording if viewing a readonly recording.
2135
2136 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
2137
2138         Web Inspector: REGRESSION: Network Cookies Table does not load
2139         https://bugs.webkit.org/show_bug.cgi?id=195599
2140
2141         Reviewed by Devin Rousso.
2142
2143         * UserInterface/Views/ResourceCookiesContentView.js:
2144         (WI.ResourceCookiesContentView.prototype.tableIndexForRepresentedObject):
2145         (WI.ResourceCookiesContentView.prototype.tableRepresentedObjectForIndex):
2146         Include needed delegate methods.
2147
2148 2019-03-11  Devin Rousso  <drousso@apple.com>
2149
2150         Web Inspector: use -webkit-{margin,padding}-{start,end} instead of [dir={ltr/rtl}] rules
2151         https://bugs.webkit.org/show_bug.cgi?id=195569
2152         <rdar://problem/48778727>
2153
2154         Reviewed by Matt Baker.
2155
2156         * UserInterface/Debug/UncaughtExceptionReporter.css:
2157         * UserInterface/Views/BoxModelDetailsSectionRow.css:
2158         * UserInterface/Views/BreakpointActionView.css:
2159         * UserInterface/Views/BreakpointPopoverController.css:
2160         * UserInterface/Views/CPUTimelineView.css:
2161         * UserInterface/Views/CallFrameTreeElement.css:
2162         * UserInterface/Views/CallFrameView.css:
2163         * UserInterface/Views/DOMTreeContentView.css:
2164         * UserInterface/Views/DOMTreeOutline.css:
2165         * UserInterface/Views/DashboardContainerView.css:
2166         * UserInterface/Views/DataGrid.css:
2167         * UserInterface/Views/DebuggerDashboardView.css:
2168         * UserInterface/Views/DebuggerSidebarPanel.css:
2169         * UserInterface/Views/DefaultDashboardView.css:
2170         * UserInterface/Views/DetailsSection.css:
2171         * UserInterface/Views/FilterBar.css:
2172         * UserInterface/Views/FindBanner.css:
2173         * UserInterface/Views/FontResourceContentView.css:
2174         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
2175         * UserInterface/Views/HierarchicalPathComponent.css:
2176         * UserInterface/Views/LayerTreeDetailsSidebarPanel.css:
2177         * UserInterface/Views/Main.css:
2178         * UserInterface/Views/NetworkTableContentView.css:
2179         * UserInterface/Views/OpenResourceDialog.css:
2180         * UserInterface/Views/RecordingActionTreeElement.css:
2181         * UserInterface/Views/ScopeRadioButtonNavigationItem.css:
2182         * UserInterface/Views/SettingsTabContentView.css:
2183         * UserInterface/Views/ThreadTreeElement.css:
2184         * UserInterface/Views/Toolbar.css:
2185         * UserInterface/Views/TreeOutline.css:
2186         * UserInterface/Views/TypeTreeElement.css:
2187         * UserInterface/Views/TypeTreeView.css:
2188         * UserInterface/Views/URLBreakpointPopover.css:
2189         * UserInterface/Views/WebSocketContentView.css:
2190
2191         * UserInterface/Views/RecordingActionTreeElement.js:
2192         (WI.RecordingActionTreeElement.static _getClassNames):
2193         Replace class `.action` with `.recording-action` for better uniqueness/clarity.
2194
2195 2019-03-11  Devin Rousso  <drousso@apple.com>
2196
2197         Web Inspector: DOMDebugger: protocol error on first open
2198         https://bugs.webkit.org/show_bug.cgi?id=195248
2199         <rdar://problem/48538465>
2200
2201         Unreviewed followup of r242743 to fix test inspector/dom-debugger/dom-breakpoints.html.
2202
2203         * UserInterface/Controllers/DOMDebuggerManager.js:
2204         (WI.DOMDebuggerManager.prototype.addDOMBreakpoint):
2205         (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
2206         Still attempt to resolve the DOM breakpoint if it already has a `domNodeIdentifier` so that
2207         it will get added to the node's frame's DOM breakpoint map. Without this, some breakpoints
2208         might get "missed" when calling `WI.domDebuggerManager.removeDOMBreakpointsForNode`.
2209
2210 2019-03-11  Justin Fan  <justin_fan@apple.com>
2211
2212         [Web GPU] Update GPUSwapChainDescriptor, GPUSwapChain and implement GPUCanvasContext
2213         https://bugs.webkit.org/show_bug.cgi?id=194406
2214         <rdar://problem/47892466>
2215
2216         Reviewed by Myles C. Maxfield.
2217
2218         Name updates for Web GPU renaming in inspector.
2219
2220         * UserInterface/Models/Canvas.js:
2221         (WI.Canvas.displayNameForContextType):
2222
2223 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
2224
2225         Web Inspector: Editing Timelines shows two CPU Timelines
2226         https://bugs.webkit.org/show_bug.cgi?id=195578
2227
2228         Reviewed by Devin Rousso.
2229
2230         * UserInterface/Controllers/TimelineManager.js:
2231         (WI.TimelineManager.availableTimelineTypes):
2232         The CPU Instrument is already in the default list.
2233
2234 2019-03-11  Devin Rousso  <drousso@apple.com>
2235
2236         Web Inspector: DOMDebugger: protocol error on first open
2237         https://bugs.webkit.org/show_bug.cgi?id=195248
2238         <rdar://problem/48538465>
2239
2240         Reviewed by Joseph Pecoraro.
2241
2242         Don't try to call `DOMDebugger` commands until a target has been initialized.
2243         Still attempt to resolve DOM breakpoints whenever the main resource/frame changes.
2244
2245         * UserInterface/Controllers/DOMDebuggerManager.js:
2246         (WI.DOMDebuggerManager):
2247         (WI.DOMDebuggerManager.prototype.initializeTarget): Added.
2248         (WI.DOMDebuggerManager.supportsEventBreakpoints):
2249         (WI.DOMDebuggerManager.prototype.get supported):
2250         (WI.DOMDebuggerManager.prototype.addDOMBreakpoint):
2251         (WI.DOMDebuggerManager.prototype.removeDOMBreakpoint):
2252         (WI.DOMDebuggerManager.prototype.addEventBreakpoint):
2253         (WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
2254         (WI.DOMDebuggerManager.prototype.addURLBreakpoint):
2255         (WI.DOMDebuggerManager.prototype.removeURLBreakpoint):
2256         (WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL): Added.
2257         (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
2258         (WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
2259         (WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
2260         (WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
2261         (WI.DOMDebuggerManager.prototype._saveDOMBreakpoints):
2262         (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged):
2263         (WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
2264         (WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged):
2265         (WI.DOMDebuggerManager.prototype._mainFrameDidChange):
2266         (WI.DOMDebuggerManager.prototype._mainResourceDidChange):
2267         (WI.DOMDebuggerManager.prototype.removeEventBreakpoint.breakpointRemoved): Deleted.
2268         (WI.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints): Deleted.
2269         (WI.DOMDebuggerManager.prototype._updateDOMBreakpoint.breakpointUpdated): Deleted.
2270         (WI.DOMDebuggerManager.prototype._resolveEventBreakpoint): Deleted.
2271         (WI.DOMDebuggerManager.prototype._resolveURLBreakpoint): Deleted.
2272
2273         * UserInterface/Base/Multimap.js: Added.
2274         (Multimap):
2275         (Multimap.prototype.get):
2276         (Multimap.prototype.add):
2277         (Multimap.prototype.delete):
2278         (Multimap.prototype.clear):
2279         (Multimap.prototype.keys):
2280         (Multimap.prototype.*values):
2281         (Multimap.prototype.*[Symbol.iterator]):
2282         (Multimap.prototype.toJSON):
2283         * .eslintrc:
2284         * UserInterface/Main.html:
2285         * UserInterface/Test.html:
2286         Helper data structure for managing Maps of Sets (e.g. all DOM breakpoints for a URL).
2287
2288 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
2289
2290         Web Inspector: CPU Usage Timeline - Enable by default
2291         https://bugs.webkit.org/show_bug.cgi?id=195471
2292
2293         Reviewed by Devin Rousso.
2294
2295         Remove experimental setting and include the CPU timeline in the
2296         default set of timelines.
2297
2298         * UserInterface/Base/Setting.js:
2299         * UserInterface/Controllers/TimelineManager.js:
2300         (WI.TimelineManager.defaultTimelineTypes):
2301         * UserInterface/Main.html:
2302         * UserInterface/Views/CPUTimelineOverviewGraph.css:
2303         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.selected):
2304         (.timeline-overview-graph.cpu > .column-chart > svg > rect): Deleted.
2305         (body[dir=rtl] .timeline-overview-graph.cpu > .column-chart): Deleted.
2306         * UserInterface/Views/CPUTimelineOverviewGraph.js:
2307         (WI.CPUTimelineOverviewGraph):
2308         (WI.CPUTimelineOverviewGraph.prototype.layout):
2309         * UserInterface/Views/ContentView.js:
2310         (WI.ContentView.createFromRepresentedObject):
2311         * UserInterface/Views/LegacyCPUTimelineView.css: Removed.
2312         * UserInterface/Views/LegacyCPUTimelineView.js: Removed.
2313         * UserInterface/Views/SettingsTabContentView.js:
2314         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2315         * UserInterface/Views/Variables.css:
2316         (:root):
2317
2318 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
2319
2320         Web Inspector: CPU Usage Timeline - Better Thread chart layout values
2321         https://bugs.webkit.org/show_bug.cgi?id=195547
2322
2323         Reviewed by Devin Rousso.
2324
2325         * UserInterface/Views/CPUTimelineView.js:
2326         (WI.CPUTimelineView.prototype.layout.bestThreadLayoutMax):
2327         (WI.CPUTimelineView.prototype.layout.layoutView):
2328         (WI.CPUTimelineView.prototype._showGraphOverlay):
2329         Include a separate layoutMax for the combined view and a thread layoutMax
2330         for the thread groups.
2331
2332 2019-03-11  Joseph Pecoraro  <pecoraro@apple.com>
2333
2334         Web Inspector: CPU Usage Timeline - Add legend and graph hover effects
2335         https://bugs.webkit.org/show_bug.cgi?id=195390
2336
2337         Reviewed by Devin Rousso.
2338
2339         * Localizations/en.lproj/localizedStrings.js:
2340         New strings for the legends.
2341
2342         * UserInterface/Main.html:
2343         Combined files.
2344
2345         * UserInterface/Views/Variables.css:
2346         (:root):
2347         (@media (prefers-color-scheme: dark)):
2348         Tweaked colors, including individual stroke and fill colors for each CPU section.
2349
2350         * UserInterface/Views/CPUTimelineOverviewGraph.css:
2351         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.total-usage):
2352         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.main-thread-usage):
2353         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.worker-thread-usage):
2354         Updated colors.
2355
2356         * UserInterface/Views/CPUUsageCombinedView.css: Renamed from Source/WebInspectorUI/UserInterface/Views/CPUUsageStackedView.css.
2357         (.cpu-usage-combined-view > .details > .legend-container):
2358         (.cpu-usage-combined-view > .details > .legend-container > .row):
2359         (.cpu-usage-combined-view > .details > .legend-container > .row + .row):
2360         (.cpu-usage-combined-view > .details > .legend-container > .row > .swatch):
2361         * UserInterface/Views/CPUUsageCombinedView.js: Renamed from Source/WebInspectorUI/UserInterface/Views/CPUUsageStackedView.js.
2362         (WI.CPUUsageCombinedView.appendLegendRow):
2363         (WI.CPUUsageCombinedView):
2364         (WI.CPUUsageCombinedView.prototype.get graphElement):
2365         (WI.CPUUsageCombinedView.prototype.get chart):
2366         (WI.CPUUsageCombinedView.prototype.get rangeChart):
2367         (WI.CPUUsageCombinedView.prototype.clear):
2368         (WI.CPUUsageCombinedView.prototype.updateChart):
2369         (WI.CPUUsageCombinedView.prototype.updateMainThreadIndicator):
2370         (WI.CPUUsageCombinedView.prototype.clearLegend):
2371         (WI.CPUUsageCombinedView.prototype.updateLegend):
2372         (WI.CPUUsageCombinedView.prototype._updateDetails):
2373         * UserInterface/Views/CPUUsageIndicatorView.css: Removed.
2374         * UserInterface/Views/CPUUsageIndicatorView.js: Removed.
2375         Combined the Indicator and StackedAreaChart into a single view
2376         that share a left details section.
2377
2378         * UserInterface/Views/CPUUsageView.js:
2379         (WI.CPUUsageView):
2380         (WI.CPUUsageView.prototype.get graphElement):
2381         (WI.CPUUsageView.prototype.clear):
2382         (WI.CPUUsageView.prototype.updateChart):
2383         (WI.CPUUsageView.prototype.clearLegend):
2384         (WI.CPUUsageView.prototype.updateLegend):
2385         (WI.CPUUsageView.prototype._updateDetails):
2386         Include a legend in the left details section.
2387
2388         * UserInterface/Views/AreaChart.js:
2389         (WI.AreaChart):
2390         (WI.AreaChart.prototype.addPointMarker):
2391         (WI.AreaChart.prototype.clearPointMarkers):
2392         (WI.AreaChart.prototype.clear):
2393         (WI.AreaChart.prototype.layout):
2394         * UserInterface/Views/StackedAreaChart.js:
2395         (WI.StackedAreaChart):
2396         (WI.StackedAreaChart.prototype.addPointMarker):
2397         (WI.StackedAreaChart.prototype.clearPointMarkers):
2398         (WI.StackedAreaChart.prototype.clear):
2399         (WI.StackedAreaChart.prototype.layout):
2400         Add point markers for the area charts.
2401
2402         * UserInterface/Views/CPUTimelineView.css:
2403         * UserInterface/Views/CPUTimelineView.js:
2404         (WI.CPUTimelineView):
2405         (WI.CPUTimelineView.prototype.get cpuUsageViewHeight):
2406         (WI.CPUTimelineView.prototype.clear):
2407         (WI.CPUTimelineView.prototype.initialLayout.appendLegendRow):
2408         (WI.CPUTimelineView.prototype.initialLayout):
2409         (WI.CPUTimelineView.prototype.layout):
2410         (WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
2411         (WI.CPUTimelineView.prototype._handleMouseClick):
2412         (WI.CPUTimelineView.prototype._handleGraphMouseMove):
2413         (WI.CPUTimelineView.prototype._showGraphOverlayNearTo):
2414         (WI.CPUTimelineView.prototype._updateGraphOverlay):
2415         (WI.CPUTimelineView.prototype._showGraphOverlay.xScale):
2416         (WI.CPUTimelineView.prototype._showGraphOverlay.yScale):
2417         (WI.CPUTimelineView.prototype._showGraphOverlay.addOverlayPoint):
2418         (WI.CPUTimelineView.prototype._showGraphOverlay):
2419         (WI.CPUTimelineView.prototype._clearOverlayMarkers.clearGraphOverlayElement):
2420         (WI.CPUTimelineView.prototype._clearOverlayMarkers):
2421         (WI.CPUTimelineView.prototype._hideGraphOverlay):
2422         Include graph overlay markers.
2423
2424 2019-03-11  Devin Rousso  <drousso@apple.com>
2425
2426         Web Inspector: eliminate manual syncing of numeric constants used by JavaScript and CSS
2427         https://bugs.webkit.org/show_bug.cgi?id=194883
2428         <rdar://problem/48257785>
2429
2430         Reviewed by Joseph Pecoraro.
2431
2432         * UserInterface/Views/CanvasOverviewContentView.js:
2433         (WI.CanvasOverviewContentView):
2434         (WI.CanvasOverviewContentView.static get recordingAutoCaptureInputMargin): Added.
2435         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize):
2436         * UserInterface/Views/CanvasOverviewContentView.css:
2437         (.navigation-bar > .item.canvas-recording-auto-capture > label > input):
2438
2439         * UserInterface/Views/MemoryTimelineView.js:
2440         (WI.MemoryTimelineView.static get memoryCategoryViewHeight): Added.
2441         (WI.MemoryTimelineView.prototype.initialLayout): Added.
2442         (WI.MemoryTimelineView.prototype.layout):
2443         * UserInterface/Views/MemoryCategoryView.css:
2444         (.memory-category-view):
2445
2446         * UserInterface/Views/NetworkTableContentView.js:
2447         (WI.NetworkTableContentView.static get nodeWaterfallDOMEventSize): Added.
2448         (WI.NetworkTableContentView.prototype.initialLayout):
2449         * UserInterface/Views/NetworkTableContentView.css:
2450         (.content-view.network .network-table): Deleted.
2451
2452         * UserInterface/Views/TreeOutline.js:
2453         (WI.TreeOutline._generateStyleRulesIfNeeded):
2454         * UserInterface/Views/TreeOutline.css:
2455         (.tree-outline, .tree-outline .children):
2456         (.tree-outline .item):
2457
2458         * UserInterface/Controllers/CanvasManager.js:
2459         (WI.CanvasManager.supportsRecordingAutoCapture):
2460         Drive-by: fix usage of InspectorBackend.domains.{CanvasAgent => Canvas}
2461
2462 2019-03-11  Nikita Vasilyev  <nvasilyev@apple.com>
2463
2464         REGRESSION(r242622): Web Inspector: Fix asserts "Overridden property is missing overridingProperty"
2465         https://bugs.webkit.org/show_bug.cgi?id=195515
2466         <rdar://problem/48737315>
2467
2468         Reviewed by Matt Baker.
2469
2470         * UserInterface/Views/SpreadsheetStyleProperty.js:
2471         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
2472
2473 2019-03-07  Nikita Vasilyev  <nvasilyev@apple.com>
2474
2475         Web Inspector: Styles: overridden CSS property should have go-to button to jump to effective property
2476         https://bugs.webkit.org/show_bug.cgi?id=185930
2477         <rdar://problem/40506252>
2478
2479         Reviewed by Matt Baker.
2480
2481         Introduce a new experimental jump to effective property button. The button is a small arrow button
2482         next to an overridden CSS property. Clicking the button scrolls to the effective CSS property and
2483         selects it.
2484
2485         * Localizations/en.lproj/localizedStrings.js:
2486         * UserInterface/Base/Setting.js:
2487         * UserInterface/Models/CSSProperty.js:
2488         (WI.CSSProperty):
2489         (WI.CSSProperty.prototype.update):
2490         (WI.CSSProperty.prototype.get overridingProperty):
2491         (WI.CSSProperty.prototype.set overridingProperty):
2492         * UserInterface/Models/DOMNodeStyles.js:
2493         (WI.DOMNodeStyles.prototype._markOverriddenProperties):
2494         * UserInterface/Views/SettingsTabContentView.js:
2495         (WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2496         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
2497         (.spreadsheet-style-declaration-editor .property.overridden .select-effective-property):
2498         (.spreadsheet-style-declaration-editor .property.overridden:hover .select-effective-property,):
2499         (.spreadsheet-style-declaration-editor .property.overridden:hover .select-effective-property::after,):
2500         (@media (prefers-color-scheme: dark)):
2501         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
2502         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertySelectByProperty):
2503         * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
2504         (WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetCSSStyleDeclarationEditorSelectProperty):
2505         * UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
2506         (WI.SpreadsheetRulesStyleDetailsPanel.prototype.spreadsheetCSSStyleDeclarationSectionSelectProperty):
2507         * UserInterface/Views/SpreadsheetStyleProperty.js:
2508         (WI.SpreadsheetStyleProperty.prototype.updateStatus):
2509
2510 2019-03-07  Devin Rousso  <drousso@apple.com>
2511
2512         Web Inspector: Protocol: add type checking when commands are called via invoke
2513         https://bugs.webkit.org/show_bug.cgi?id=195310
2514         <rdar://problem/48588679>
2515
2516         Reviewed by Joseph Pecoraro.
2517
2518         * UserInterface/Protocol/InspectorBackend.js:
2519         (InspectorBackend.Command.prototype.invoke.deliverFailure): Added.
2520         (InspectorBackend.Command.prototype.invoke):
2521         (InspectorBackend.Command.prototype._invokeWithArguments):
2522
2523 2019-03-07  Devin Rousso  <drousso@apple.com>
2524
2525         Web Inspector: REGRESSION(r242118): WI.ScopeBar missing background
2526         https://bugs.webkit.org/show_bug.cgi?id=195299
2527
2528         Reviewed by Joseph Pecoraro.
2529
2530         Rework the way `color`, `background-color`, and `border-color` are set for `WI.ScopeBar` to
2531         use CSS variables instead. Divides the variables into three categories:
2532          - default: these are the values that the `WI.ScopeBar` would use normally
2533          - override: these are values that take precidence over the default (e.g. set by other elements)
2534             - falls back to default when no value is set
2535          - actual: this is the resulting value that will be used when displaying
2536             - this way, other elements can "mirror" the styling of the `WI.ScopeBar`
2537
2538         * UserInterface/Views/ScopeBar.css:
2539         (.scope-bar):
2540         (.scope-bar > li):
2541         (.scope-bar > li::before):
2542         (.scope-bar > li:matches(.selected, :hover)):
2543         (.scope-bar > li:not(.selected):hover::after):
2544         (.scope-bar > li.selected:active::after):
2545         (.scope-bar > li.multiple > select):
2546         (body[dir=ltr] .scope-bar > li.multiple > select):
2547         (body[dir=rtl] .scope-bar > li.multiple > select):
2548         (.scope-bar > li.multiple:not(.selected) > select): Added.
2549         (.scope-bar > li.multiple > .arrows):
2550         (.scope-bar > li::before): Deleted.
2551         (.scope-bar.default-item-selected > li.multiple.selected::before): Deleted.
2552         (.scope-bar > li:matches(.selected, :hover)::before): Deleted.
2553         (.scope-bar > li.selected:active::before): Deleted.
2554         (.scope-bar > li.multiple.selected > select): Deleted.
2555         (body[dir=ltr] .scope-bar > li.multiple > .arrows): Deleted.
2556         (body[dir=rtl] .scope-bar > li.multiple > .arrows): Deleted.
2557         (.scope-bar > li.multiple:matches(.selected, :hover, :active) > .arrows): Deleted.
2558         (.scope-bar > li:matches(.selected, :active)): Deleted.
2559         (@media (prefers-color-scheme: dark)): Deleted.
2560         Switch to using `::after` since `::before` is more commonly used.
2561
2562         * UserInterface/Views/MultipleScopeBarItem.js:
2563         (WI.MultipleScopeBarItem.prototype._handleMouseDown):
2564         Drive-by: fix the <select> alignment by re-firing the "mousedown" event on it.
2565
2566         * UserInterface/Views/AuditTestGroupContentView.js:
2567         (WI.AuditTestGroupContentView.prototype.layout):
2568         * UserInterface/Views/AuditTestGroupContentView.css:
2569         (.content-view.audit-test-group > header > nav > .scope-bar > li):
2570         (.content-view.audit-test-group > header > nav > .scope-bar > li:not(:hover, .selected)):
2571         (.content-view.audit-test-group > header > nav > .scope-bar > li > img): Added.
2572         (.content-view.audit-test-group > header > nav > .scope-bar > li.pass > img): Added.
2573         (.content-view.audit-test-group > header > nav > .scope-bar > li.warn > img): Added.
2574         (.content-view.audit-test-group > header > nav > .scope-bar > li.fail > img): Added.
2575         (.content-view.audit-test-group > header > nav > .scope-bar > li.error > img): Added.
2576         (.content-view.audit-test-group > header > nav > .scope-bar > li.unsupported > img): Added.
2577         (.content-view.audit-test-group > section > .audit-test-case:first-child, .content-view.audit-test-group > section > .audit-test-case.filtered ~ .audit-test-case:not(.filtered), .content-view.audit-test-group > section > .audit-test-group + .audit-test-case, .content-view.audit-test-group > section > .audit-test-case + .audit-test-group): Added.
2578         (.content-view.audit-test-group > section > .audit-test-case:not(.filtered) ~ .audit-test-case:not(.filtered)): Added.
2579         (.content-view.audit-test-group > header > nav > .scope-bar > li::before): Deleted.
2580         (.content-view.audit-test-group > header > nav > .scope-bar > li.pass::before): Deleted.
2581         (.content-view.audit-test-group > header > nav > .scope-bar > li.warn::before): Deleted.
2582         (.content-view.audit-test-group > header > nav > .scope-bar > li.fail::before): Deleted.
2583         (.content-view.audit-test-group > header > nav > .scope-bar > li.error::before): Deleted.
2584         (.content-view.audit-test-group > header > nav > .scope-bar > li.unsupported::before): Deleted.
2585         (.content-view.audit-test-group > section > .audit-test-case:first-child, .content-view.audit-test-group > section > .audit-test-group + .audit-test-case, .content-view.audit-test-group > section > .audit-test-case + .audit-test-group): Deleted.
2586         Replace the `::before` image with an actual `<img>` now that the `WI.ScopeBar` itself uses
2587         a pseudo-element for the background styling.
2588
2589         * UserInterface/Views/LogContentView.js:
2590         (WI.LogContentView):
2591         * UserInterface/Views/LogContentView.css:
2592         (.log-scope-bar > li:not(.unread) > .indicator): Added.
2593         (.log-scope-bar > li.unread > .indicator): Added.
2594         (.log-scope-bar > li.unread:hover > .indicator): Added.
2595         (.log-scope-bar > li.unread.errors > .indicator): Added.
2596         (.log-scope-bar > li.unread.warnings > .indicator): Added.
2597         (.log-scope-bar > li.unread.logs > .indicator): Added.
2598         (.log-scope-bar > li.unread::before): Deleted.
2599         (body[dir=ltr] .log-scope-bar > li.unread::before): Deleted.
2600         (body[dir=rtl] .log-scope-bar > li.unread::before): Deleted.
2601         (.log-scope-bar > li.unread:hover::before): Deleted.
2602         (.log-scope-bar > li.unread.errors::before): Deleted.
2603         (.log-scope-bar > li.unread.warnings::before): Deleted.
2604         (.log-scope-bar > li.unread.logs::before): Deleted.
2605         Replace the `::before` unread indicator with an actual `<div>` now that the `WI.ScopeBar`
2606         itself uses a pseudo-element for the background styling.
2607
2608         * UserInterface/Views/TimelineRecordingContentView.css:
2609         (.content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected):
2610         (.content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected > .multiple): Deleted.
2611         (.content-view.timeline-recording > .content-browser > .navigation-bar > .item.scope-bar.default-item-selected > .multiple .arrows): Deleted.
2612
2613         * UserInterface/Views/CanvasSidebarPanel.js:
2614         (WI.CanvasSidebarPanel.prototype._updateRecordingScopeBar):
2615         Drive-by: fix typo.
2616
2617 2019-03-07  Devin Rousso  <drousso@apple.com>
2618
2619         Web Inspector: CSS: there should be a way to inline-replace a variable with it's value
2620         https://bugs.webkit.org/show_bug.cgi?id=195335
2621
2622         Reviewed by Joseph Pecoraro.
2623
2624         * UserInterface/Views/InlineSwatch.js:
2625         (WI.InlineSwatch):
2626         (WI.InlineSwatch.prototype.didDismissPopover):
2627         (WI.InlineSwatch.prototype._swatchElementClicked):
2628         (WI.InlineSwatch.prototype._swatchElementClicked.optionsForType): Added.
2629         Shift-clicking a variable swatch replaces the text with the variable's value.
2630         Drive-by: try to create a readonly swatch for the variable's value (e.g. a color indicator).
2631
2632         * UserInterface/Views/SpreadsheetStyleProperty.js:
2633         (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
2634         If the value of a variable swatch changes, re-render the value.
2635
2636         * UserInterface/Views/CodeMirrorTextMarkers.js:
2637         (createCodeMirrorTextMarkers):
2638         (createCodeMirrorColorTextMarkers):
2639         (createCodeMirrorGradientTextMarkers):
2640         (createCodeMirrorBezierTextMarkers):
2641         (createCodeMirrorSpringTextMarkers):
2642         Refactor function parameters for more flexibility.
2643
2644         * Localizations/en.lproj/localizedStrings.js:
2645
2646 2019-03-06  Devin Rousso  <drousso@apple.com>
2647
2648         Web Inspector: Elements: highlight the node when hovering event listeners sorted by node
2649         https://bugs.webkit.org/show_bug.cgi?id=195368
2650
2651         Reviewed by Joseph Pecoraro.
2652
2653         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
2654         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByNode):
2655
2656 2019-03-06  Matt Baker  <mattbaker@apple.com>
2657
2658         Web Inspector: system accent color follow-ups
2659         https://bugs.webkit.org/show_bug.cgi?id=195190
2660
2661         Reviewed by Devin Rousso.
2662
2663         * UserInterface/Views/ButtonToolbarItem.css:
2664         (.toolbar .item.button:not(.disabled):matches(:focus, .activate.activated)):
2665         (@media (prefers-color-scheme: dark)):
2666         (.toolbar .item.button:not(.disabled):active:matches(:focus, .activate.activated)): Deleted.
2667         Drop pressed toolbar button style. It's extremely subtle and not worth the hassle.
2668
2669         * UserInterface/Views/LogContentView.css:
2670         (.console-messages:focus .console-item.selected::after):
2671         (@media (prefers-color-scheme: dark)):
2672
2673         * UserInterface/Views/ScopeBar.css:
2674         (.scope-bar > li.selected:active::before):
2675
2676         * UserInterface/Views/TimelineRecordBar.css:
2677         (.timeline-record-bar.selected > .segment):
2678
2679 2019-03-06  Matt Baker  <mattbaker@apple.com>
2680
2681         REGRESSION: Elements tab: Uncaught Exception: No node with given id found
2682         https://bugs.webkit.org/show_bug.cgi?id=194299
2683         <rdar://problem/47828647>
2684
2685         Reviewed by Devin Rousso.
2686
2687         When removing the selection, TreeOutline subclasses should have more
2688         control over which item becomes selected after the selection is removed.
2689         DOMTreeOutline should track the items that are being removed, and prevent
2690         them or their descendants from becoming selected.
2691
2692         * UserInterface/Views/DOMTreeOutline.js:
2693         (WI.DOMTreeOutline):
2694         (WI.DOMTreeOutline.prototype.ondelete):
2695         (WI.DOMTreeOutline.prototype.canSelectTreeElement):
2696
2697         * UserInterface/Views/TreeOutline.js:
2698         (WI.TreeOutline.prototype.selectionControllerLastSelectableItem):
2699         (WI.TreeOutline.prototype.selectionControllerPreviousSelectableItem):
2700         (WI.TreeOutline.prototype.selectionControllerNextSelectableItem):
2701         (WI.TreeOutline.prototype.canSelectTreeElement):
2702
2703 2019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
2704
2705         Web Inspector: CPU Usage Timeline - Allow clicking a bar in the overview to select a tight time range around it
2706         https://bugs.webkit.org/show_bug.cgi?id=195321
2707
2708         Reviewed by Devin Rousso.
2709
2710         * UserInterface/Models/Timeline.js:
2711         (WI.Timeline.prototype.closestRecordTo):
2712         Helper to get the closest record to a timestamp.
2713
2714         * UserInterface/Views/CPUTimelineOverviewGraph.css:
2715         (.timeline-overview-graph.cpu > .stacked-column-chart):
2716         (.timeline-overview-graph.cpu > .stacked-column-chart > svg > rect.selected):
2717         Style a selected record with the active color.
2718
2719         * UserInterface/Views/CPUTimelineOverviewGraph.js:
2720         (WI.CPUTimelineOverviewGraph):
2721         (WI.CPUTimelineOverviewGraph.prototype.get samplingRatePerSecond):
2722         (WI.CPUTimelineOverviewGraph.prototype.reset):
2723         (WI.CPUTimelineOverviewGraph.prototype.layout):
2724         (WI.CPUTimelineOverviewGraph.prototype.updateSelectedRecord):
2725         (WI.CPUTimelineOverviewGraph.prototype._graphPositionForMouseEvent):
2726         (WI.CPUTimelineOverviewGraph.prototype._handleGraphMouseClick):
2727         A click in the overview which hits a rect triggers a selection of
2728         the associated timeline record.
2729
2730         * UserInterface/Views/StackedColumnChart.js:
2731         (WI.StackedColumnChart.prototype.addColumnSet):
2732         (WI.StackedColumnChart.prototype.layout):
2733         Allow setting an additional class name with a column set.
2734         It will set the class name on each rect in that column.
2735
2736         * UserInterface/Views/TimelineOverview.js:
2737         (WI.TimelineOverview.prototype._recordSelected):
2738         When selecting a CPU record, make a selection range of 2 neighboring
2739         columns in each direction.
2740
2741         * UserInterface/Views/TimelineRuler.js:
2742         (WI.TimelineRuler.prototype._handleClick):
2743         When a sub-element has handled the click stop further event propagation.
2744
2745         * UserInterface/Views/TimelineOverviewGraph.js:
2746         (WI.TimelineOverviewGraph.prototype.get selected):
2747         Drive-by style fix.
2748
2749 2019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
2750
2751         Web Inspector: TimelineOverview clicks do not always behave as expected
2752         https://bugs.webkit.org/show_bug.cgi?id=195319
2753
2754         Reviewed by Devin Rousso.
2755
2756         * UserInterface/Views/TimelineRuler.js:
2757         (WI.TimelineRuler.prototype._shouldIgnoreMicroMovement):
2758         (WI.TimelineRuler.prototype._handleMouseDown):
2759         (WI.TimelineRuler.prototype._handleMouseMove):
2760         Ignore moves that haven't gone more than 4px. Once the threshold is
2761         passed allow all moves. This improves the click behavior since
2762         previously click would never re-dispatch if there was any movement.
2763
2764 2019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
2765
2766         Web Inspector: CPU Usage Timeline - Statistics and Sources sections
2767         https://bugs.webkit.org/show_bug.cgi?id=195202
2768
2769         Reviewed by Devin Rousso.
2770
2771         * Localizations/en.lproj/localizedStrings.js:
2772         New strings.
2773
2774         * UserInterface/Base/Utilities.js:
2775         (Map.prototype.getOrInitialize):
2776         Helper to get and if not found initialize with a value.
2777
2778         * UserInterface/Views/CPUTimelineView.css:
2779         (.timeline-view.cpu > .content > .overview > .chart > .container.stats):
2780         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table):
2781         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table > tr > th):
2782         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table > tr > td.number):
2783         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table > tr > td.label):
2784         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .show-more):
2785         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .filter):
2786         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .filter:hover):
2787         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .active):
2788         (.timeline-view.cpu > .content > .overview > .chart > .container.stats > table .active + .active):
2789         (@media (prefers-color-scheme: dark)):
2790         Colors for the statistics sections.
2791
2792         * UserInterface/Views/CPUTimelineView.js:
2793         (WI.CPUTimelineView):
2794         (WI.CPUTimelineView.prototype.reset):
2795         (WI.CPUTimelineView.prototype.clear):
2796         (WI.CPUTimelineView.prototype._clearStatistics):
2797         (WI.CPUTimelineView.prototype._clearSources):
2798         Updates for additional sections.
2799         Include a cache of the statisiticsData so we can relayout parts of the UI and
2800         avoid an entire UI update.
2801
2802         (WI.CPUTimelineView.prototype.initialLayout):
2803         (WI.CPUTimelineView.prototype._layoutBreakdownChart):
2804         (WI.CPUTimelineView.prototype._layoutStatisticsAndSources):
2805         (WI.CPUTimelineView.prototype._layoutStatisticsSection.createEllipsisElement):
2806         (WI.CPUTimelineView.prototype._layoutStatisticsSection):
2807         (WI.CPUTimelineView.prototype._layoutSourcesSection.firstNonNativeCallFrame):
2808         (WI.CPUTimelineView.prototype._layoutSourcesSection.keyForSourceCodeLocation):
2809         (WI.CPUTimelineView.prototype._layoutSourcesSection.labelForLocation):
2810         (WI.CPUTimelineView.prototype._layoutSourcesSection.createEllipsisElement):
2811         (WI.CPUTimelineView.prototype._layoutSourcesSection):
2812         Extract layouts into helper methods to avoid an enormous layout method.
2813
2814         (WI.CPUTimelineView.prototype._computeSamplingData.incrementTypeCount):
2815         (WI.CPUTimelineView.prototype._computeSamplingData):
2816         Compute additional data when going through script events.
2817
2818         (WI.CPUTimelineView.prototype._resetSourcesFilters):
2819         (WI.CPUTimelineView.prototype._addSourcesFilter):
2820         (WI.CPUTimelineView.prototype._removeSourcesFilter):
2821         (WI.CPUTimelineView.prototype._updateSourcesFilters):
2822         Helpers for updating the source filters.
2823
2824         (WI.CPUTimelineView.prototype._createTableRow):
2825         (WI.CPUTimelineView.prototype._insertTableRow):
2826         Helpers for creating rows in the statistics / sources tables.
2827
2828 2019-03-06  Joseph Pecoraro  <pecoraro@apple.com>
2829
2830         Web Inspector: Simplify chart <rect>s with x/y attributes instead of transform(x, y)
2831         https://bugs.webkit.org/show_bug.cgi?id=195352
2832
2833         Reviewed by Matt Baker.
2834
2835         * UserInterface/Views/ColumnChart.js:
2836         (WI.ColumnChart.prototype.layout):
2837         (WI.ColumnChart):
2838         * UserInterface/Views/RangeChart.js:
2839         (WI.RangeChart.prototype.layout):
2840         (WI.RangeChart):
2841         * UserInterface/Views/StackedColumnChart.js:
2842         (WI.StackedColumnChart.prototype.layout):
2843         (WI.StackedColumnChart):
2844
2845 2019-03-06  Devin Rousso  <drousso@apple.com>
2846
2847         Web Inspector: CSS Changes: only show changes for the given node
2848         https://bugs.webkit.org/show_bug.cgi?id=194608
2849         <rdar://problem/48050206>
2850
2851         Reviewed by Timothy Hatcher.
2852
2853         * UserInterface/Views/ChangesDetailsSidebarPanel.js:
2854         (WI.ChangesDetailsSidebarPanel.prototype.inspect):
2855         (WI.ChangesDetailsSidebarPanel.prototype.supportsDOMNode):
2856         (WI.ChangesDetailsSidebarPanel.prototype.layout):
2857         Make this panel a subclass of `WI.DOMDetailsSidebarPanel` so it has access to the selected
2858         DOM node in the Elements tab.
2859
2860         * UserInterface/Base/Setting.js:
2861         * UserInterface/Views/SettingsTabContentView.js:
2862         (WI.SettingsTabContentView.prototype._createGeneralSettingsView):
2863         Create new general setting for controlling this change.
2864
2865         * Localizations/en.lproj/localizedStrings.js:
2866
2867 2019-03-06  Devin Rousso  <drousso@apple.com>
2868
2869         Web Inspector: Canvas: color swatches aren't shown for valid inputs with leading/trailing whitespace
2870         https://bugs.webkit.org/show_bug.cgi?id=195298
2871
2872         Reviewed by Timothy Hatcher.
2873
2874         * UserInterface/Views/RecordingActionTreeElement.js:
2875         (WI.RecordingActionTreeElement._generateDOM):
2876         (WI.RecordingActionTreeElement._createSwatchForColorParameters):
2877         Trim the color string since it can be an arbitrary string, seeing as it is captured before
2878         the <canvas> has a chance to parse/fix it.
2879
2880 2019-03-05  Joseph Pecoraro  <pecoraro@apple.com>
2881
2882         Web Inspector: recordsInTimeRange sometimes does not get the expected record when includeRecordBeforeStart
2883         https://bugs.webkit.org/show_bug.cgi?id=195317
2884
2885         Reviewed by Devin Rousso.
2886
2887         * UserInterface/Models/Timeline.js:
2888         (WI.Timeline.prototype.recordsOverlappingTimeRange):
2889
2890 2019-03-05  Devin Rousso  <drousso@apple.com>
2891
2892         Web Inspector: Canvas: remove event listeners once a recording is ready
2893         https://bugs.webkit.org/show_bug.cgi?id=195324
2894
2895         Reviewed by Matt Baker.
2896
2897         * UserInterface/Models/Recording.js:
2898         (WI.Recording):
2899         (WI.Recording.prototype.async swizzle):
2900         (WI.Recording.prototype.async _process):
2901
2902         * UserInterface/Views/RecordingActionTreeElement.js:
2903         (WI.RecordingActionTreeElement):
2904         (WI.RecordingActionTreeElement.prototype._handleValidityChanged):
2905
2906         * UserInterface/Views/CanvasSidebarPanel.js:
2907         (WI.CanvasSidebarPanel.prototype.set recording):
2908         (WI.CanvasSidebarPanel.prototype._handleRecordingProcessedAction):
2909
2910         * UserInterface/Views/RecordingContentView.js:
2911         (WI.RecordingContentView.prototype.initialLayout):
2912         (WI.RecordingContentView.prototype._handleRecordingProcessedAction):
2913
2914 2019-03-05  Joseph Pecoraro  <pecoraro@apple.com>
2915
2916         Web Inspector: Attempting to select records in the bottom 16px of the timeline overview graph fails
2917         https://bugs.webkit.org/show_bug.cgi?id=195318
2918
2919         Reviewed by Devin Rousso.
2920
2921         The bottom few pixels of the overview are reserved for the scroll-container
2922         which may show a scrollbar if the overview needs to scroll. When the scrollbars
2923         are not visible we can allow pointer events to click through the invisible
2924         scroll-container and allow record selection.
2925
2926         * UserInterface/Views/TimelineOverview.css:
2927         (.timeline-overview:not(.has-scrollbar) > .scroll-container):
2928         * UserInterface/Views/TimelineOverview.js:
2929         (WI.TimelineOverview.prototype._handleScrollEvent):
2930         (WI.TimelineOverview.prototype._handleWheelEvent):
2931         (WI.TimelineOverview._handleGestureStart):
2932
2933 2019-03-05  Devin Rousso  <drousso@apple.com>
2934
2935         Web Inspector: iPod user agent UIString should have a lowercase "T"
2936         https://bugs.webkit.org/show_bug.cgi?id=195312
2937         <rdar://problem/48586853>
2938
2939         Reviewed by Matt Baker.
2940
2941         * UserInterface/Base/Main.js:
2942         (WI._handleDeviceSettingsToolbarButtonClicked):
2943
2944 2019-03-05  Joseph Pecoraro  <pecoraro@apple.com>
2945
2946         Web Inspector: CPU Usage Timeline - Adjust sizes in timeline overview
2947         https://bugs.webkit.org/show_bug.cgi?id=195313
2948
2949         Reviewed by Devin Rousso.
2950
2951         Reduce the height slightly to save some precious vertical space.
2952         Also increase the size of the minimum bar height so that it doesn't
2953         look like there are no events when there is low CPU.
2954
2955         * UserInterface/Views/CPUTimelineOverviewGraph.css:
2956         (body .sidebar > .panel.navigation.timeline > .timelines-content li.item.cpu,):
2957         * UserInterface/Views/CPUTimelineOverviewGraph.js:
2958         (WI.CPUTimelineOverviewGraph.prototype.get height):
2959         Reduce the CPU overview graph height to 60px.
2960
2961         (WI.CPUTimelineOverviewGraph.prototype.layout):
2962         Increase the minimum size of a column bar to 4px.
2963
2964 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
2965
2966         Web Inspector: Reload actions from second level inspector should properly reload the inspected inspector
2967         https://bugs.webkit.org/show_bug.cgi?id=195306
2968
2969         Reviewed by Matt Baker.
2970
2971         * UserInterface/Base/Main.js:
2972         Provide a better reload for a Nth level inspector.
2973
2974         * UserInterface/Debug/Bootstrap.js:
2975         (WI.runBootstrapOperations):
2976         Simplify, should not need to check for InspectorFrontendHost.
2977
2978 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
2979
2980         Web Inspector: MediaSource logging not initialized properly
2981         https://bugs.webkit.org/show_bug.cgi?id=195307
2982
2983         Reviewed by Matt Baker.
2984
2985         * UserInterface/Controllers/ConsoleManager.js:
2986         (WI.ConsoleManager.prototype.initializeLogChannels):
2987         Typo caused undefined to be included and trigger assertions.
2988
2989 2019-03-04  Devin Rousso  <drousso@apple.com>
2990
2991         Web Inspector: CSS: class input isn't fully centered
2992         https://bugs.webkit.org/show_bug.cgi?id=195297
2993
2994         Reviewed by Matt Baker.
2995
2996         * UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
2997         (.sidebar > .panel.details.css-style > .content ~ .class-list-container > .new-class > .class-name-input):
2998         (body[dir=ltr] .sidebar > .panel.details.css-style > .content ~ .class-list-container > .new-class > .class-name-input): Deleted.
2999         (body[dir=rtl] .sidebar > .panel.details.css-style > .content ~ .class-list-container > .new-class > .class-name-input): Deleted.
3000
3001 2019-03-04  Devin Rousso  <drousso@apple.com>
3002
3003         Web Inspector: Audit: show the version number in the UI
3004         https://bugs.webkit.org/show_bug.cgi?id=195292
3005
3006         Reviewed by Matt Baker.
3007
3008         * UserInterface/Views/AuditNavigationSidebarPanel.js:
3009         (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
3010         (WI.AuditNavigationSidebarPanel.prototype._updateNoAuditsPlaceholder):
3011         Fix the logic for showing a placeholder when editing or with only disabled tests.
3012
3013         * UserInterface/Views/AuditNavigationSidebarPanel.css:
3014         (.sidebar > .panel.navigation.audit > .content > .message-text-view): Added.
3015         (.audit-version): Added.
3016         Don't obstruct the "Edit" button when showing a placeholder.
3017
3018         * Localizations/en.lproj/localizedStrings.js:
3019
3020 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
3021
3022         ITMLKit Inspector: Data Bindings / Associated Data for nodes
3023         https://bugs.webkit.org/show_bug.cgi?id=195290
3024         <rdar://problem/48304019>
3025
3026         Reviewed by Devin Rousso.
3027
3028         * Localizations/en.lproj/localizedStrings.js:
3029         New title and empty message strings.
3030
3031         * UserInterface/Views/DOMNodeDetailsSidebarPanel.css:
3032         (.sidebar > .panel.dom-node-details .details-section.dom-node-associated-data > .content .row):
3033         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
3034         (WI.DOMNodeDetailsSidebarPanel.prototype.initialLayout):
3035         (WI.DOMNodeDetailsSidebarPanel.prototype.layout):
3036         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshDataBindings):
3037         (WI.DOMNodeDetailsSidebarPanel.prototype._refreshAssociatedData):
3038         (WI.DOMNodeDetailsSidebarPanel.prototype._attributesChanged):
3039         New Node sections only enabled for ITMLKit `WI.sharedApp.hasExtraDomains`.
3040
3041         * UserInterface/Views/ObjectTreeView.js:
3042         (WI.ObjectTreeView):
3043         Provide a way, like TreeElement/View to access the ObjectTreeView from an element.
3044
3045 2019-03-04  Devin Rousso  <drousso@apple.com>
3046
3047         Web Inspector: Canvas: protocol error on first open
3048         https://bugs.webkit.org/show_bug.cgi?id=195059
3049         <rdar://problem/48407871>
3050
3051         Reviewed by Joseph Pecoraro.
3052
3053         * UserInterface/Controllers/CanvasManager.js:
3054         (WI.CanvasManager.prototype.initializeTarget):
3055         (WI.CanvasManager.prototype.static supportsRecordingAutoCapture):
3056         (WI.CanvasManager.prototype.setRecordingAutoCaptureFrameCount):
3057         If targets aren't available, wait until they are and then set the auto-capture frame count.
3058
3059 2019-03-04  Devin Rousso  <drousso@apple.com>
3060
3061         Web Inspector: Toggling Timeline "Stop when page loads" to on should stop (immediately or soon) any active recording if already past the load event
3062         https://bugs.webkit.org/show_bug.cgi?id=195239
3063
3064         Reviewed by Joseph Pecoraro.
3065
3066         * UserInterface/Controllers/TimelineManager.js:
3067         (WI.TimelineManager.prototype._handleTimelinesAutoStopSettingChanged):
3068
3069 2019-03-02  Devin Rousso  <drousso@apple.com>
3070
3071         Web Inspector: Unexpectedly frequent flashing of DOM node attributes
3072         https://bugs.webkit.org/show_bug.cgi?id=148049
3073         <rdar://problem/22296830>
3074
3075         Reviewed by Joseph Pecoraro.
3076
3077         Save a timestamp of when the CSS animation began, so that if the attribute's node is replaced,
3078         we can "resume" the CSS animation at the same point with the attribute's new node.
3079
3080         * UserInterface/Views/DOMTreeElement.js:
3081         (WI.DOMTreeElement):
3082         (WI.DOMTreeElement.prototype.attributeDidChange):
3083         (WI.DOMTreeElement.prototype._buildAttributeDOM):
3084         (WI.DOMTreeElement.prototype._createModifiedAnimation):
3085         (WI.DOMTreeElement.prototype._markNodeChanged): Deleted.
3086         (WI.DOMTreeElement.prototype._nodeChangedAnimationEnd): Deleted.
3087         (WI.DOMTreeElement.prototype._fireDidChange): Deleted.
3088
3089 2019-03-02  Devin Rousso  <drousso@apple.com>
3090
3091         Web Inspector: Debugger: DOM, URL, and Event breakpoints don't grey out when all breakpoints are disabled
3092         https://bugs.webkit.org/show_bug.cgi?id=195170
3093         <rdar://problem/48478193>
3094
3095         Reviewed by Joseph Pecoraro.
3096
3097         * UserInterface/Views/DOMBreakpointTreeElement.js:
3098         (WI.DOMBreakpointTreeElement):
3099         (WI.DOMBreakpointTreeElement.prototype.onattach):
3100         (WI.DOMBreakpointTreeElement.prototype.ondetach):
3101         (WI.DOMBreakpointTreeElement.prototype._updateStatus):
3102         * UserInterface/Views/EventBreakpointTreeElement.js:
3103         (WI.EventBreakpointTreeElement):
3104         (WI.EventBreakpointTreeElement.prototype.onattach):
3105         (WI.EventBreakpointTreeElement.prototype.ondetach):
3106         (WI.EventBreakpointTreeElement.prototype._updateStatus):
3107         * UserInterface/Views/URLBreakpointTreeElement.js:
3108         (WI.URLBreakpointTreeElement):
3109         (WI.URLBreakpointTreeElement.prototype.onattach):
3110         (WI.URLBreakpointTreeElement.prototype.ondetach):
3111         (WI.URLBreakpointTreeElement.prototype._updateStatus):
3112         Remove the `"resolved"` class when the global "breakpoints enabled" state is changed.
3113
3114         * UserInterface/Controllers/DOMDebuggerManager.js:
3115         (WI.DOMDebuggerManager):
3116         (WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged): Added.
3117         (WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged): Added.
3118         (WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged): Added.
3119         (WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
3120         (WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
3121         (WI.DOMDebuggerManager.prototype._resolveEventBreakpoint):
3122         (WI.DOMDebuggerManager.prototype._resolveURLBreakpoint):
3123         (WI.DOMDebuggerManager.prototype._updateEventBreakpoint.breakpointUpdated): Deleted.
3124         (WI.DOMDebuggerManager.prototype._updateURLBreakpoint.breakpointUpdated): Deleted.
3125         * UserInterface/Models/DOMBreakpoint.js:
3126         (WI.DOMBreakpoint):
3127         (WI.DOMBreakpoint.deserialize): Added.
3128         (WI.DOMBreakpoint.prototype.set disabled):
3129         (WI.DOMBreakpoint.prototype.set domNodeIdentifier):
3130         * UserInterface/Models/EventBreakpoint.js:
3131         (WI.EventBreakpoint.deserialize): Added.
3132         (WI.EventBreakpoint.prototype.set disabled):
3133         (WI.EventBreakpoint.fromPayload): Deleted.
3134         * UserInterface/Models/URLBreakpoint.js:
3135         (WI.URLBreakpoint.deserialize): Added.
3136         (WI.URLBreakpoint.prototype.set disabled):
3137         * UserInterface/Views/DOMTreeContentView.js:
3138         (WI.DOMTreeContentView):
3139         (WI.DOMTreeContentView.prototype._handleDOMBreakpointDisabledStateChanged): Added.
3140         (WI.DOMTreeContentView.prototype._handleDOMBreakpointDOMNodeChanged): Added.
3141         * UserInterface/Views/DebuggerSidebarPanel.js:
3142         (WI.DebuggerSidebarPanel.prototype._handleDOMBreakpointResolvedStateChanged): Added.
3143         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
3144         (WI.SourcesNavigationSidebarPanel):
3145         (WI.SourcesNavigationSidebarPanel.prototype._handleDOMBreakpointResolvedStateChanged): Added.
3146         Drive-by: rename all events with the name `*DidChange` to `*Changed`.
3147         Drive-by: create static `deserialize` helper functions.
3148
3149 2019-03-02  Devin Rousso  <drousso@apple.com>
3150
3151         Web Inspector: Sources: breakpoints should be disabled when an audit is running
3152         https://bugs.webkit.org/show_bug.cgi?id=195105
3153         <rdar://problem/48441373>
3154
3155         Reviewed by Joseph Pecoraro.
3156
3157         * UserInterface/Views/SourcesNavigationSidebarPanel.js:
3158         (WI.SourcesNavigationSidebarPanel):
3159         (WI.SourcesNavigationSidebarPanel.prototype.closed):
3160         (WI.SourcesNavigationSidebarPanel.prototype._updateTemporarilyDisabledBreakpointsButtons): Added.
3161         (WI.SourcesNavigationSidebarPanel.prototype._updateBreakpointsDisabledBanner):
3162         (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingWillStart):
3163         (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStopped):
3164         (WI.SourcesNavigationSidebarPanel.prototype._handleAuditManagerTestScheduled): Added.
3165         (WI.SourcesNavigationSidebarPanel.prototype._handleAuditManagerTestCompleted): Added.
3166         * UserInterface/Views/SourcesNavigationSidebarPanel.css:
3167         (.sidebar > .panel.navigation.sources > .content > .warning-banner + .warning-banner): Added.
3168
3169         * UserInterface/Views/DebuggerSidebarPanel.js:
3170         (WI.DebuggerSidebarPanel):
3171
3172 2019-03-02  Devin Rousso  <drousso@apple.com>
3173
3174         Web Inspector: Debugger: don't enable breakpoints when source location changes
3175         https://bugs.webkit.org/show_bug.cgi?id=195081
3176         <rdar://problem/48422701>
3177
3178         Reviewed by Joseph Pecoraro.
3179
3180         * UserInterface/Controllers/DebuggerManager.js:
3181         (WI.DebuggerManager.prototype._breakpointDisplayLocationDidChange):
3182         (WI.DebuggerManager.prototype._breakpointEditablePropertyDidChange):
3183
3184 2019-03-01  Joseph Pecoraro  <pecoraro@apple.com>
3185
3186         Web Inspector: CPU Usage - Energy Impact Section
3187         https://bugs.webkit.org/show_bug.cgi?id=195151
3188
3189         Reviewed by Devin Rousso.
3190
3191         * Localizations/en.lproj/localizedStrings.js:
3192         * UserInterface/Main.html:
3193         New strings and resources.
3194
3195         * UserInterface/Views/CPUTimelineView.css:
3196         (.timeline-view.cpu > .content .subtitle > .info):
3197         (@media (prefers-color-scheme: dark)):
3198         (.energy-info-popover-content):
3199         (.timeline-view.cpu > .content > .overview > .divider):
3200         (body[dir=ltr] .timeline-view.cpu > .content > .overview > .divider):
3201         (body[dir=rtl] .timeline-view.cpu > .content > .overview > .divider):
3202         (.timeline-view.cpu :matches(.area-chart, .stacked-area-chart) svg > path):
3203         (.timeline-view.cpu .gauge-chart:not(.empty) > svg > path.low):
3204         (.timeline-view.cpu .gauge-chart:not(.empty) > svg > path.medium):
3205         (.timeline-view.cpu .gauge-chart:not(.empty) > svg > path.high):
3206         (.timeline-view.cpu .gauge-chart:not(.empty) > svg > polygon.needle):
3207         (.timeline-view.cpu .energy):
3208         (.timeline-view.cpu .energy .energy-impact):
3209         (.timeline-view.cpu .energy .energy-impact.low):
3210         (.timeline-view.cpu .energy .energy-impact.medium):
3211         (.timeline-view.cpu .energy .energy-impact.high):
3212         (.timeline-view.cpu .energy .energy-impact-number):
3213         Styling the chart and text for the different energy impact levels.
3214
3215         * UserInterface/Views/CPUTimelineView.js:
3216         (WI.CPUTimelineView.prototype.get lowEnergyValue):
3217         (WI.CPUTimelineView.prototype.get highEnergyValue):
3218         (WI.CPUTimelineView.prototype.initialLayout):
3219         (WI.CPUTimelineView.prototype.layout):
3220         (WI.CPUTimelineView.prototype._layoutEnergyChart.mapWithBias):
3221         (WI.CPUTimelineView.prototype._layoutEnergyChart.valuesForGauge):
3222         (WI.CPUTimelineView.prototype._layoutEnergyChart):
3223         (WI.CPUTimelineView.prototype._clearEnergyImpactText):
3224         New gauge chart and associated popover.
3225         We do a bit of biasing of the data for each of the sections
3226         in the gauge chart. Each section biases toward the cap of the
3227         section so that:
3228           - we encourage lower power usage (sub 3%)
3229           - the gauge needle quickly moves past the low value of a range
3230
3231         * UserInterface/Views/GaugeChart.css: Added.
3232         (.gauge-chart):
3233         (body[dir=rtl] .gauge-chart):
3234         (.gauge-chart > svg > path,):
3235         (.gauge-chart > svg > polygon.needle):
3236         (.gauge-chart.empty > svg > polygon.needle):
3237         (@media (prefers-color-scheme: dark)):
3238         * UserInterface/Views/GaugeChart.js: Added.
3239         (WI.GaugeChart.prototype.get size):
3240         (WI.GaugeChart.prototype.get segments):
3241         (WI.GaugeChart.prototype.get value):
3242         (WI.GaugeChart.prototype.set value):
3243         (WI.GaugeChart.prototype.clear):
3244         (WI.GaugeChart.prototype.initialLayout):
3245         (WI.GaugeChart.prototype.layout):
3246         (WI.GaugeChart.prototype._validateSegments):
3247         (WI.GaugeChart.prototype._createSegmentPathData):
3248         GaugeChart with variable number of sections and a
3249         current value needle. It has a bit of customization
3250         when drawing the arc at the start of each segment.
3251
3252         * UserInterface/Views/Variables.css:
3253         (:root):
3254         (@media (prefers-color-scheme: dark)):
3255         New CPU colors for the different energy impact levels.
3256
3257 2019-03-01  Nikita Vasilyev  <nvasilyev@apple.com>
3258
3259         Web Inspector: Data grid border colors don't match accent colors
3260         https://bugs.webkit.org/show_bug.cgi?id=195232
3261
3262         Reviewed by Matt Baker.
3263
3264         * UserInterface/Views/DataGrid.css:
3265         (.data-grid:focus tr.selected td:not(:last-child)):
3266         (body[dir=ltr] .data-grid:focus tr.selected td:not(:last-child)):
3267         (body[dir=rtl] .data-grid:focus tr.selected td:not(:last-child)):
3268
3269 2019-02-28  Devin Rousso  <drousso@apple.com>
3270
3271         Web Inspector: Timelines: don't show the auto-stop UI when not inspecting a page
3272         https://bugs.webkit.org/show_bug.cgi?id=195192
3273
3274         Reviewed by Joseph Pecoraro.
3275
3276         * UserInterface/Views/TimelineRecordingContentView.js:
3277         (WI.TimelineRecordingContentView):
3278         (WI.TimelineRecordingContentView.prototype.get navigationItems):
3279
3280 2019-02-28  Joseph Pecoraro  <pecoraro@apple.com>
3281
3282         Web Inspector: CPU Usage: Worker thread that dies might stay at a high value forever
3283         https://bugs.webkit.org/show_bug.cgi?id=195148
3284
3285         Reviewed by Matt Baker.
3286
3287         * UserInterface/Views/CPUTimelineView.js:
3288         (CPUTimelineView.prototype.layout):
3289         Handle workers dieing or at least zeroing out between records.
3290
3291 2019-02-28  Joseph Pecoraro  <pecoraro@apple.com>
3292
3293         Web Inspector: CPU Usage Timeline - Make Threads section expandable / collapsable
3294         https://bugs.webkit.org/show_bug.cgi?id=195085
3295
3296         Reviewed by Matt Baker.
3297
3298         * UserInterface/Base/Setting.js:
3299         New setting to save the Threads expanded/collapsed state.
3300
3301         * UserInterface/Views/CPUTimelineView.css:
3302         (.timeline-view.cpu > .content > .details > .subtitle):
3303         (.timeline-view.cpu > .content > .details > details > .subtitle.threads):
3304         (.timeline-view.cpu > .content > .details > .subtitle): Deleted.
3305         (.timeline-view.cpu > .content > .details > .subtitle.threads): Deleted.
3306         Ensure subtitle styles apply now that one of the subtitles is inside
3307         of a <details> / <summary> element.
3308
3309         * UserInterface/Views/CPUTimelineView.js:
3310         (WI.CPUTimelineView.prototype.initialLayout):
3311         Make the Threads group a <details> / <summary> expandable / collapsed element.
3312
3313         * UserInterface/Views/Main.css:
3314         (summary):
3315         (summary::-webkit-details-marker):
3316         Default styles for <summary>.
3317
3318 2019-02-28  Joseph Pecoraro  <pecoraro@apple.com>
3319
3320         Web Inspector: View.removeSubview not removing the element properly when not parented
3321         https://bugs.webkit.org/show_bug.cgi?id=195146
3322
3323         Reviewed by Matt Baker.
3324
3325         * UserInterface/Views/View.js:
3326         (WI.View.prototype.removeSubview):
3327         Since the element may not be a direct child, just use Element.prototype.remove.
3328
3329 2019-02-28  Matt Baker  <mattbaker@apple.com>
3330
3331         Web Inspector: Debugger: disabled breakpoint color is too dark
3332         https://bugs.webkit.org/show_bug.cgi?id=195103
3333         <rdar://problem/48440678>
3334
3335         Reviewed by Devin Rousso.
3336
3337         Increase the disabled breakpoint contrast, as well as the contrast between
3338         disabled and auto-continue breakpoints. Disabled breakpoints stand out by
3339         being somewhat brighter and less saturated. Using the same strategy for
3340         auto-continue breakpoints is too subtle to provide sufficient contrast.
3341
3342         We can adopt the technique used by Xcode, and overlay a white triangle
3343         marker on the breakpoint arrow to indicate an auto-continue breakpoint.
3344
3345         * UserInterface/Views/BreakpointTreeElement.css:
3346         (.item.breakpoint .status > .status-image):
3347         (.item.breakpoint.selected .status > .status-image.resolved):
3348         Add white outline to make selected breakpoint button stand out.
3349         (.item.breakpoint .status > .status-image.auto-continue::after):
3350         (.item.breakpoint .status > .status-image.disabled):
3351         (.item.breakpoint .status > .status-image.auto-continue): Deleted.
3352
3353
3354         * UserInterface/Views/DOMTreeContentView.css:
3355         (.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint):
3356         (.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.disabled):
3357         (.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.subtree):
3358         (.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.disabled,): Deleted.
3359
3360         * UserInterface/Views/TextEditor.css:
3361         (.text-editor > .CodeMirror .has-breakpoint .CodeMirror-linenumber::before):
3362         (.text-editor > .CodeMirror .breakpoint-auto-continue:not(.execution-line.primary) .CodeMirror-linenumber::after):
3363         (.text-editor > .CodeMirror .breakpoint-disabled .CodeMirror-linenumber::before):
3364         (.text-editor > .CodeMirror .breakpoint-auto-continue:not(.breakpoint-disabled) .CodeMirror-linenumber::before): Deleted.
3365
3366         * UserInterface/Views/Variables.css:
3367         (:root):
3368         Add breakpoint color variables to use across all breakpoint controls.
3369         Use system colors if available, otherwise fall back to hard-coded values
3370         based on sampling the default (blue) accent color on Mojave.
3371
3372 2019-02-28  Nikita Vasilyev  <nvasilyev@apple.com>
3373
3374         Web Inspector: Styles: Control-Space should force completion
3375         https://bugs.webkit.org/show_bug.cgi?id=194796
3376         <rdar://problem/48180822>
3377
3378         Reviewed by Matt Baker.
3379
3380         Pressing Control-Space when editing CSS property should show completion popover,
3381         even if the value is empty.
3382
3383         * UserInterface/Models/CSSCompletions.js:
3384         (WI.CSSCompletions.prototype.startsWith):
3385         Performance optimization: exit early when `prefix` is empty.
3386
3387         * UserInterface/Views/SpreadsheetStyleProperty.js:
3388         (WI.SpreadsheetStyleProperty.prototype._nameCompletionDataProvider):
3389         (WI.SpreadsheetStyleProperty.prototype._valueCompletionDataProvider):
3390         * UserInterface/Views/SpreadsheetTextField.js:
3391         (WI.SpreadsheetTextField):
3392         (WI.SpreadsheetTextField.prototype._handleKeyDown):
3393         (WI.SpreadsheetTextField.prototype._updateCompletions):
3394
3395 2019-02-28  Devin Rousso  <drousso@apple.com>
3396
3397         Web Inspector: Canvas: enabling auto-capture if the frame count is empty triggers an assertion
3398         https://bugs.webkit.org/show_bug.cgi?id=195060
3399
3400         Reviewed by Matt Baker.
3401
3402         * UserInterface/Views/CanvasOverviewContentView.js:
3403         (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount):
3404         (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel):
3405         (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureCheckedDidChange):
3406
3407 2019-02-28  Joseph Pecoraro  <pecoraro@apple.com>
3408
3409         Web Inspector: Revert -webkit-border-end changes that are unreliable
3410         https://bugs.webkit.org/show_bug.cgi?id=195149
3411
3412         Reviewed by Matt Baker.
3413
3414         * UserInterface/Views/CPUUsageIndicatorView.css:
3415         (.cpu-usage-indicator-view > .details):
3416         (body[dir=ltr] .cpu-usage-indicator-view > .details):
3417         (body[dir=rtl] .cpu-usage-indicator-view > .details):
3418         * UserInterface/Views/CPUUsageStackedView.css:
3419         (.cpu-usage-stacked-view > .details):
3420         (body[dir=ltr] .cpu-usage-stacked-view > .details):
3421         (body[dir=rtl] .cpu-usage-stacked-view > .details):
3422         * UserInterface/Views/CPUUsageView.css:
3423         (.cpu-usage-view > .details):
3424         (body[dir=ltr] .cpu-usage-view > .details):
3425         (body[dir=rtl] .cpu-usage-view > .details):
3426         * UserInterface/Views/MemoryCategoryView.css:
3427         (.memory-category-view > .details):
3428         (body[dir=ltr] .memory-category-view > .details):
3429         (body[dir=rtl] .memory-category-view > .details):
3430
3431 2019-02-28  Joseph Pecoraro  <pecoraro@apple.com>
3432
3433         Web Inspector: Cleanup some Chart code
3434         https://bugs.webkit.org/show_bug.cgi?id=195147
3435
3436         Reviewed by Matt Baker.
3437
3438         * UserInterface/Views/RangeChart.js:
3439         (WI.RangeChart.prototype.layout):
3440         (WI.RangeChart):
3441         * UserInterface/Views/StackedColumnChart.js:
3442         (WI.StackedColumnChart.prototype.layout):
3443         (WI.StackedColumnChart):
3444
3445 2019-02-27  Joseph Pecoraro  <pecoraro@apple.com>
3446
3447         Web Inspector: Add a new Scanner TimelineMarker to show up when mousing over TimelineView graphs
3448         https://bugs.webkit.org/show_bug.cgi?id=195079
3449
3450         Reviewed by Devin Rousso.
3451
3452         * UserInterface/Base/Utilities.js:
3453         (Note.prototype.enclosingNodeOrSelfWithClassInArray):
3454         Helper for a set of classes.
3455
3456         * UserInterface/Models/TimelineMarker.js:
3457         Add a new marker type, "Scanner".
3458
3459         * UserInterface/Views/CPUTimelineView.js:
3460         (WI.CPUTimelineView.prototype.initialLayout):
3461         (WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
3462         (WI.CPUTimelineView.prototype._handleGraphMouseMove):
3463         * UserInterface/Views/MemoryTimelineView.js:
3464         (WI.MemoryTimelineView):
3465         (WI.MemoryTimelineView.prototype._graphPositionForMouseEvent):
3466         (WI.MemoryTimelineView.prototype._handleGraphMouseMove):
3467         Update a scanner time when mousing over various graphs that span the entire time range.
3468         These use the containing graph element because there was a single pixel between
3469         adjacent graphs which would cause the scanner to flicker because the mouse event target
3470         was not an svg element.
3471
3472         * UserInterface/Views/TimelineOverview.js:
3473         (WI.TimelineOverview.prototype.hidden):
3474         (WI.TimelineOverview.prototype.updateScannerTime):
3475         (WI.TimelineOverview.prototype.clearScanner):
3476         * UserInterface/Views/TimelineRecordingContentView.js:
3477         (WI.TimelineRecordingContentView):
3478         (WI.TimelineRecordingContentView.prototype._handleTimelineViewScannerTimeDidChange):
3479         (WI.TimelineRecordingContentView.prototype._handleTimelineViewScannerDidClear):
3480         Update the overview's ruler with scanner changes.
3481
3482         * UserInterface/Views/TimelineRuler.css:
3483         (.timeline-ruler > .markers > .marker.scanner):
3484         * UserInterface/Views/TimelineRuler.js:
3485         (WI.TimelineRuler):
3486         (WI.TimelineRuler.prototype.clearMarkers):
3487         (WI.TimelineRuler.prototype.updateScannerTime):
3488         (WI.TimelineRuler.prototype.clearScanner):
3489         (WI.TimelineRuler.prototype._updateMarkers):
3490         Have a special scanner marker that updates.
3491
3492         * UserInterface/Views/TimelineView.js:
3493         New events that a TimelineView can dispatch to update the overview.
3494
3495         * UserInterface/Views/Variables.css:
3496         (:root):
3497         (@media (prefers-color-scheme: dark)):
3498         Scanner marker colors.
3499
3500 2019-02-27  Devin Rousso  <drousso@apple.com>
3501
3502         Web Inspector: Use Element.closest for internal code
3503         https://bugs.webkit.org/show_bug.cgi?id=173747
3504
3505         Reviewed by Joseph Pecoraro.
3506
3507         Replace usage of added utility functions on the `Node` prototype with the built-in
3508         `Element.prototype.closest` as it's more flexible and is capable of doing the same thing.
3509
3510         * UserInterface/Base/Utilities.js:
3511         (Node.prototype.enclosingNodeOrSelfWithClass): Deleted.
3512         (Node.prototype.enclosingNodeOrSelfWithNodeNameInArray): Deleted.
3513         (Node.prototype.enclosingNodeOrSelfWithNodeName): Deleted.
3514         * UserInterface/Base/Main.js:
3515         (WI.handlePossibleLinkClick):
3516         (WI._focusedContentBrowser):
3517         * UserInterface/Views/CPUTimelineView.js:
3518         (WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
3519         * UserInterface/Views/CompletionSuggestionsView.js:
3520         (WI.CompletionSuggestionsView.prototype.set selectedIndex):
3521         (WI.CompletionSuggestionsView.prototype.update):
3522         (WI.CompletionSuggestionsView.prototype._itemClicked):
3523         * UserInterface/Views/ConsoleGroup.js:
3524         (WI.ConsoleGroup.prototype._titleClicked):
3525         * UserInterface/Views/DOMTreeContentView.js:
3526         (WI.DOMTreeContentView.prototype._mouseWasClicked):
3527         * UserInterface/Views/DOMTreeElement.js:
3528         (WI.DOMTreeElement.prototype._startEditingTarget):
3529         (WI.DOMTreeElement.prototype._populateTagContextMenu):
3530         * UserInterface/Views/DOMTreeOutline.js:
3531         (WI.DOMTreeOutline.prototype.populateContextMenu):
3532         * UserInterface/Views/DataGrid.js:
3533         (WI.DataGrid.prototype._startEditing):
3534         (WI.DataGrid.prototype._editingCancelled):
3535         (WI.DataGrid.prototype.dataGridNodeFromNode):
3536         (WI.DataGrid.prototype.dataGridNodeFromPoint):
3537         (WI.DataGrid.prototype._headerCellClicked):
3538         (WI.DataGrid.prototype._mouseoverColumnCollapser):
3539         (WI.DataGrid.prototype._mouseoutColumnCollapser):
3540         (WI.DataGrid.prototype._clickInColumnCollapser):
3541         (WI.DataGrid.prototype._contextMenuInHeader):
3542         (WI.DataGrid.prototype._contextMenuInDataTable):
3543         * UserInterface/Views/DataGridNode.js:
3544         (WI.DataGridNode.prototype.isEventWithinDisclosureTriangle):
3545         * UserInterface/Views/LegacyTabBar.js:
3546         (WI.LegacyTabBar.prototype._handleMouseDown):
3547         (WI.LegacyTabBar.prototype._handleClick):
3548         * UserInterface/Views/LogContentView.js:
3549         (WI.LogContentView.prototype._handleContextMenuEvent):
3550         (WI.LogContentView.prototype._mousedown):
3551         (WI.LogContentView.prototype._targetInMessageCanBeSelected):
3552         (WI.LogContentView.prototype._mousemove):
3553         (WI.LogContentView.prototype._mouseup):
3554         (WI.LogContentView.prototype._ondragstart):
3555         * UserInterface/Views/NavigationBar.js:
3556         (WI.NavigationBar.prototype._mouseDown):
3557         (WI.NavigationBar.prototype._mouseMoved):
3558         * UserInterface/Views/Popover.js:
3559         (WI.Popover.prototype.handleEvent):
3560         * UserInterface/Views/TabBar.js:
3561         (WI.TabBar.prototype._handleMouseDown):
3562         (WI.TabBar.prototype._handleClick):
3563         * UserInterface/Views/Table.js:
3564         (WI.Table.prototype._handleMouseDown):
3565         (WI.Table.prototype._handleContextMenu):
3566         * UserInterface/Views/TreeOutline.js:
3567         (WI.TreeOutline.prototype.treeElementFromNode):
3568
3569 2019-02-27  Devin Rousso  <drousso@apple.com>
3570
3571         Web Inspector: REGRESSION(r242118): Debugger: event breakpoints have no icon
3572         https://bugs.webkit.org/show_bug.cgi?id=195119
3573
3574         Reviewed by Matt Baker.
3575
3576         * UserInterface/Views/EventBreakpointTreeElement.js:
3577         (WI.EventBreakpointTreeElement):
3578
3579 2019-02-27  Devin Rousso  <drousso@apple.com>
3580
3581         Web Inspector: Dark Mode: unreadable text in bezier curve editor numeric input fields
3582         https://bugs.webkit.org/show_bug.cgi?id=195018
3583         <rdar://problem/48378541>
3584
3585         Reviewed by Matt Baker.
3586
3587         Simplify some styles using `-webkit-*` properties instead of `[dir=ltr]`/`[dir=rtl]` selectors.
3588
3589         * UserInterface/Views/BezierEditor.css:
3590         (.bezier-editor):
3591         (.bezier-editor > .bezier-preview):
3592         (.bezier-editor > .bezier-preview-timing):
3593         (.bezier-editor > .bezier-container .linear-curve):
3594         (.bezier-editor > .bezier-container .bezier-curve):
3595         (.bezier-editor > .bezier-container .control-line):
3596         (.bezier-editor > .bezier-container .control-handle):
3597         (.bezier-editor > .number-input-container):
3598         (.bezier-editor > .number-input-container > input):
3599         (body[dir=ltr] .bezier-editor > .bezier-preview-timing): Deleted.
3600         (body[dir=rtl] .bezier-editor > .bezier-preview-timing): Deleted.
3601         (body[dir=ltr] .bezier-editor > .number-input-container > input): Deleted.
3602         (body[dir=rtl] .bezier-editor > .number-input-container > input): Deleted.
3603         (@media (prefers-color-scheme: dark)): Deleted.
3604         Remove all custom styling on any <input>s, as they look fine with their default styling.
3605
3606         * UserInterface/Views/SpringEditor.css:
3607         (.spring-editor > .spring-preview):
3608         (.spring-editor > .spring-preview > div):
3609         (.spring-editor > .spring-timing > div):
3610
3611 2019-02-27  Devin Rousso  <drousso@apple.com>
3612
3613         Web Inspector: popover colors don't change when transitioning to/from dark mode
3614         https://bugs.webkit.org/show_bug.cgi?id=195113
3615         <rdar://problem/48444188>
3616
3617         Reviewed by Timothy Hatcher.
3618
3619         * UserInterface/Views/Popover.js:
3620         (WI.Popover.prototype.dismiss):
3621         (WI.Popover.prototype._addListenersIfNeeded):
3622
3623 2019-02-26  Matt Baker  <mattbaker@apple.com>
3624
3625         Web Inspector: Use system accent color throughout UI
3626         https://bugs.webkit.org/show_bug.cgi?id=193507
3627         <rdar://problem/47327971>
3628
3629         Reviewed by Timothy Hatcher.
3630
3631         * UserInterface/Images/Breakpoint.png: Removed.
3632         * UserInterface/Images/Breakpoint.svg: Added.
3633         * UserInterface/Images/Breakpoint@2x.png: Removed.
3634         * UserInterface/Images/BreakpointInactive.png: Removed.
3635         * UserInterface/Images/BreakpointInactive@2x.png: Removed.
3636         Replace breakpoint pixel art with an SVG image that can be styled in CSS.
3637
3638         * UserInterface/Images/CSSVariable.svg:
3639         * UserInterface/Images/CubicBezier.svg:
3640         * UserInterface/Images/UserInputPrompt.svg:
3641         Remove fill color since it is now styled in CSS.
3642
3643         * UserInterface/Views/BezierEditor.css:
3644         (.bezier-editor > .bezier-preview > div):
3645         (@media (prefers-color-scheme: dark)):
3646         (.bezier-editor > .bezier-container .control-handle):
3647         (.bezier-editor > .bezier-container .control-line):
3648         Use system accent color for control handles.
3649
3650         * UserInterface/Views/BreakpointTreeElement.css:
3651         (.item.breakpoint .status > .status-image):
3652         (.item.breakpoint .status > .status-image.resolved):
3653         Use system accent color for breakpoint fill, with a dark outline
3654         to match Xcode and make the button stand out against the selection.
3655
3656         * UserInterface/Views/BreakpointTreeElement.js:
3657         (WI.BreakpointTreeElement.prototype._updateStatus):
3658
3659         * UserInterface/Views/ButtonNavigationItem.css:
3660         (.navigation-bar .item.button > .glyph):
3661
3662         * UserInterface/Views/ConsolePrompt.js:
3663         (WI.ConsolePrompt):
3664
3665         * UserInterface/Views/DOMBreakpointTreeElement.js:
3666         * UserInterface/Views/DOMTreeContentView.css:
3667         (.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint):
3668         (.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.disabled,):
3669         (.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.subtree):
3670         (.content-view.dom-tree .tree-outline.dom li .status-image.breakpoint.disabled): Deleted.
3671         (.content-view.dom-tree .tree-outline.dom.breakpoints-disabled li .status-image.breakpoint): Deleted.
3672         (.content-view.dom-tree .tree-outline.dom.breakpoints-disabled li .status-image.breakpoint.disabled): Deleted.
3673
3674         * UserInterface/Views/DOMTreeOutline.css:
3675         (.tree-outline.dom li.selected .selection-area):
3676         (.tree-outline.dom li.elements-drag-over .selection-area):
3677         (.tree-outline.dom:focus li:matches(.selected, .hovered) .selection-area):
3678         (.tree-outline.dom li.hovered:not(.selected) .selection-area):
3679         (.tree-outline.dom li.pseudo-class-enabled > .selection-area::before):
3680         Use the system accent color for the "pseudo-class enabled" marker.
3681         (@media (prefers-color-scheme: dark)):
3682         (.tree-outline.dom:focus li.selected .selection-area): Deleted.
3683         Use --selected-background-color for selection and hover styles, which is
3684         set to the system highlight color if available.
3685
3686         * UserInterface/Views/InlineSwatch.css:
3687         (.inline-swatch:matches(.bezier, .spring, .variable)):
3688         (.inline-swatch:matches(.bezier, .spring)): Deleted.
3689         (.inline-swatch.variable): Deleted.
3690
3691         * UserInterface/Views/InlineSwatch.js:
3692         (WI.InlineSwatch):
3693
3694         * UserInterface/Views/NetworkDetailView.css:
3695         (.network .network-detail .navigation-bar .item.radio.button.text-only:before):
3696         (.network .network-detail .navigation-bar .item.radio.button.text-only.selected):
3697         (@media (prefers-color-scheme: dark)):
3698         (.network-detail .item.close > .glyph):
3699
3700         * UserInterface/Views/QuickConsole.css:
3701         (.quick-console > .console-prompt > .glyph):
3702         (.quick-console > .console-prompt::before): Deleted.
3703
3704         * UserInterface/Views/RadioButtonNavigationItem.css:
3705         (.navigation-bar .item.radio.button.text-only):
3706         (.navigation-bar .item.radio.button.text-only::before):
3707         (.navigation-bar .item.radio.button.text-only:matches(.selected, :hover)):
3708         (.navigation-bar .item.radio.button.text-only:matches(.selected, :hover)::before):
3709         (.navigation-bar .item.radio.button.text-only:not(.selected):hover::before):
3710         (.navigation-bar .item.radio.button.text-only.selected:active::before):
3711         (.navigation-bar .item.radio.button.text-only:hover): Deleted.
3712         (.navigation-bar .item.radio.button.text-only.selected): Deleted.
3713         (.navigation-bar .item.radio.button.text-only:active): Deleted.
3714         (.navigation-bar .item.radio.button.text-only.selected:active): Deleted.
3715         Use system accent color for selection and hover styles. Since it isn't
3716         yet possible to derive new colors from the accent color in CSS, fake it
3717         with a ::before pseudo-element that can have have `filter` or `opacity`
3718         effects applied to it without altering the button text color.
3719
3720         * UserInterface/Views/RenderingFrameTimelineOverviewGraph.css:
3721         (.timeline-overview-graph.rendering-frame > .frame-marker):
3722         Use system accent color for selected frame marker.
3723
3724         * UserInterface/Views/ScopeBar.css:
3725         (.scope-bar > li):
3726         (.scope-bar > li::before):
3727         (.scope-bar.default-item-selected > li.multiple.selected::before):
3728         (.scope-bar > li:matches(.selected, :hover)):
3729         (.scope-bar > li:matches(.selected, :hover)::before):
3730         (.scope-bar > li:not(.selected):hover::before):
3731         (.scope-bar > li.selected:active::before):
3732         (.scope-bar > li:hover): Deleted.
3733         (.scope-bar > li.selected): Deleted.
3734         (.scope-bar > li:active): Deleted.
3735         (.scope-bar > li.selected:active): Deleted.
3736
3737         * UserInterface/Views/SettingsTabContentView.css:
3738         (.content-view.settings .navigation-bar .item.radio.button.text-only:before):
3739
3740         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
3741         (.spreadsheet-style-declaration-editor):
3742         (@media (prefers-color-scheme: dark)):
3743
3744         * UserInterface/Views/TextEditor.css:
3745         (.text-editor > .CodeMirror .has-breakpoint .CodeMirror-linenumber::before):
3746         (.text-editor > .CodeMirror .breakpoint-resolved .CodeMirror-linenumber::before):
3747         (.text-editor > .CodeMirror .has-breakpoint.multiple-breakpoints .CodeMirror-linenumber::before):
3748         (@keyframes text-editor-highlight-fadeout):
3749         (@keyframes text-editor-hovered-expression-highlight-fadeout):
3750         Replace breakpoint pixel art with a solid color (the system accent
3751         color) clipped to the shape of a breakpoint.
3752
3753         * UserInterface/Views/TimelineRecordFrame.css:
3754         (.timeline-record-frame.selected):
3755
3756         * UserInterface/Views/URLBreakpointTreeElement.js:
3757
3758         * UserInterface/Views/Variables.css:
3759         (:root):
3760         (body.window-inactive):
3761         (@media (prefers-color-scheme: dark)):
3762         (body.mac-platform:not(.sierra, .high-sierra)):
3763         Add custom property overrides for system colors where supported.
3764
3765 2019-02-26  Devin Rousso  <drousso@apple.com>
3766
3767         Web Inspector: Search: no results when opening to Search tab
3768         https://bugs.webkit.org/show_bug.cgi?id=195058
3769         <rdar://problem/48407699>
3770
3771         Reviewed by Joseph Pecoraro.
3772
3773         * UserInterface/Views/SearchSidebarPanel.js:
3774         (WI.SearchSidebarPanel.prototype.performSearch):
3775         If targets aren't available, wait until they are and then perform the search.
3776
3777         * UserInterface/Base/Main.js:
3778         (WI.targetsAvailable): Added.
3779         Expose getter for indicating whether targets are available.
3780
3781 2019-02-26  Joseph Pecoraro  <pecoraro@apple.com>
3782
3783         Web Inspector: CPU Usage Timeline - Main Thread Indicator
3784         https://bugs.webkit.org/show_bug.cgi?id=194972
3785
3786         Reviewed by Devin Rousso.
3787
3788         * UserInterface/Main.html:
3789         * UserInterface/Base/Utilities.js:
3790         (value):
3791         The existing enclosingNode doesn't work for SVG because its names
3792         are lowercase. Add a simplified version for the svg case.
3793
3794         * UserInterface/Views/RangeChart.js: Added.
3795         (WI.RangeChart):
3796         (WI.RangeChart.prototype.get size):
3797         (WI.RangeChart.prototype.set size):
3798         (WI.RangeChart.prototype.addRange):
3799         (WI.RangeChart.prototype.clear):
3800         (WI.RangeChart.prototype.layout):
3801         A new chart that draws rects for given ranges.
3802
3803         * UserInterface/Models/Timeline.js:
3804         (WI.Timeline.prototype.recordsOverlappingTimeRange):
3805         Helper to specifically get records touching a range. Useful
3806         for when we have a single pixel spanning (startTime -> endTime)
3807         and we want to find records in that pixel.
3808
3809         * UserInterface/Views/CPUTimelineView.css:
3810         (.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart rect):
3811         (.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart .sample-type-script):
3812         (.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart .sample-type-style):
3813         (.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart .sample-type-layout):
3814         (.timeline-view.cpu .cpu-usage-indicator-view > .graph > .range-chart .sample-type-paint):
3815         * UserInterface/Views/CPUTimelineView.js:
3816         (WI.CPUTimelineView.prototype.get indicatorViewHeight):
3817         (WI.CPUTimelineView.prototype.clear):
3818         (WI.CPUTimelineView.prototype.get scrollableElements):
3819         (WI.CPUTimelineView.prototype.initialLayout):
3820         (WI.CPUTimelineView.prototype.layout):
3821         (WI.CPUTimelineView.prototype._graphPositionForMouseEvent):
3822         (WI.CPUTimelineView.prototype._handleIndicatorClick):
3823         (WI.CPUTimelineView.prototype._attemptSelectIndicatatorTimelineRecord):
3824         (WI.CPUTimelineView.prototype._selectTimelineRecord):
3825         Place the Main Thread Indicator view beneath the big graph.
3826         Clicking inside it selects records in the Timeline Overview.
3827
3828         * UserInterface/Views/CPUUsageIndicatorView.css: Added.
3829         (.cpu-usage-indicator-view):
3830         (.cpu-usage-indicator-view > .details):
3831         (body[dir=ltr] .cpu-usage-indicator-view > .details):
3832         (body[dir=rtl] .cpu-usage-indicator-view > .details):
3833         (body[dir=rtl] .cpu-usage-indicator-view > .graph):
3834         (.cpu-usage-indicator-view > .graph):
3835         (.cpu-usage-indicator-view > .graph,):