Web Inspector: discontinuous recordings should have discontinuities in the timeline...
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2016-06-04  Matt Baker  <mattbaker@apple.com>
2
3         Web Inspector: discontinuous recordings should have discontinuities in the timeline memory graph
4         https://bugs.webkit.org/show_bug.cgi?id=158052
5         <rdar://problem/26516695>
6
7         Reviewed by Joseph Pecoraro.
8
9         Add gaps to the overview and category line charts where discontinuities
10         exist in the timeline recording.
11
12         * UserInterface/Models/Timeline.js:
13         (WebInspector.Timeline.prototype.recordsInTimeRange):
14         Replaces `_visibleRecords` methods found in various views.
15
16         * UserInterface/Models/TimelineRecording.js:
17         (WebInspector.TimelineRecording.prototype.reset):
18         (WebInspector.TimelineRecording.prototype.addDiscontinuity):
19         (WebInspector.TimelineRecording.prototype.discontinuitiesInTimeRange):
20         Allow discontinuities to be added to the recording, and have a means to
21         look up gaps within a time range.
22
23         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
24         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._visibleRecords): Deleted.
25         Replaced by Timeline helper method.
26
27         * UserInterface/Views/MemoryTimelineOverviewGraph.js:
28         (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.insertDiscontinuity):
29         (WebInspector.MemoryTimelineOverviewGraph.prototype.layout):
30         Insert zero-points into the chart at discontinuity boundaries to create
31         gaps. Data points for records immediately before or after a gap are extended
32         to the edge of the discontinuity.
33
34         (WebInspector.MemoryTimelineOverviewGraph.prototype._visibleRecords): Deleted.
35         Replaced by Timeline helper method.
36
37         * UserInterface/Views/MemoryTimelineView.js:
38         (WebInspector.MemoryTimelineView.prototype.layout):
39         Insert zero-points into each category chart at discontinuity boundaries
40         to create gaps.
41
42         Insert zero-points into the chart to create gaps.
43         (WebInspector.MemoryTimelineView.prototype._visibleRecords): Deleted.
44         Replaced by Timeline helper method.
45
46         * UserInterface/Views/TimelineOverview.js:
47         (WebInspector.TimelineOverview.prototype.discontinuitiesInTimeRange):
48         Forward to the TimelineRecording, which isn't exposed to clients.
49
50         * UserInterface/Views/TimelineRecordingContentView.js:
51         (WebInspector.TimelineRecordingContentView):
52         (WebInspector.TimelineRecordingContentView.prototype._capturingStarted):
53         (WebInspector.TimelineRecordingContentView.prototype._capturingStopped):
54         (WebInspector.TimelineRecordingContentView.prototype._recordingReset):
55         Track discontinuities (recording stop followed by a start) and add them
56         to the current recording.
57
58 2016-06-03  Brian Burg  <bburg@apple.com>
59
60         Web Inspector: add a keyboard shortcut to close the current tab bar item
61         https://bugs.webkit.org/show_bug.cgi?id=158363
62         <rdar://problem/22677254>
63
64         Reviewed by Timothy Hatcher.
65
66         Make Cmd-w close the current tab. This matches Safari's keyboard shortcut.
67
68         * UserInterface/Views/TabBrowser.js:
69         (WebInspector.TabBrowser):
70         Don't do anything if the New Tab tab is the only tab bar item besides the
71         pinned "new tab" button.
72
73 2016-06-03  Brian Burg  <bburg@apple.com>
74
75         Web Inspector: setter for debugging flag InspectorBackend.dumpInspectorTimeStats does not work
76         https://bugs.webkit.org/show_bug.cgi?id=158366
77
78         Reviewed by Timothy Hatcher.
79
80         * UserInterface/Protocol/InspectorBackend.js:
81         (InspectorBackendClass.prototype.set dumpInspectorTimeStats):
82         Actually update the backing member when the setter is called.
83
84 2016-06-03  Nikita Vasilyev  <nvasilyev@apple.com>
85
86         Web Inspector: Remove unused WebInspector.CSSCompletions methods
87         https://bugs.webkit.org/show_bug.cgi?id=158352
88
89         Reviewed by Joseph Pecoraro.
90
91         * UserInterface/Models/CSSCompletions.js:
92         (WebInspector.CSSCompletions.prototype.firstStartsWith): Deleted.
93         (WebInspector.CSSCompletions.prototype.isLonghandPropertyName): Deleted.
94         (WebInspector.CSSCompletions.prototype.longhandsForShorthand): Deleted.
95
96 2016-06-03  Joseph Pecoraro  <pecoraro@apple.com>
97
98         Web Inspector: Update NativeFunctionParameters (FontFaceSet, HTMLSlotElement, EventTarget)
99         https://bugs.webkit.org/show_bug.cgi?id=158333
100
101         Reviewed by Brian Burg.
102
103         * UserInterface/Models/NativeFunctionParameters.js:
104         Replace FontLoader with FontFaceSet. Add HTMLSlotElement API.
105         EventTarget is now actually in the prototype chain, so add it as
106         a first class citizen and keep mixing it in for legacy backends.
107
108 2016-06-02  Joseph Pecoraro  <pecoraro@apple.com>
109
110         Web Inspector: Modernize Array.prototype.every/some callsites to arrow functions
111         https://bugs.webkit.org/show_bug.cgi?id=158330
112
113         Reviewed by Brian Burg.
114
115         * UserInterface/Controllers/DOMTreeManager.js:
116         (WebInspector.DOMTreeManager.prototype._updateContentFlowFromPayload):
117         * UserInterface/Models/ProfileNode.js:
118         (WebInspector.ProfileNode):
119         * UserInterface/Models/ScopeChainNode.js:
120         (WebInspector.ScopeChainNode):
121         * UserInterface/Models/StackTrace.js:
122         (WebInspector.StackTrace):
123         * UserInterface/Models/StructureDescription.js:
124         (WebInspector.StructureDescription):
125         * UserInterface/Models/TypeDescription.js:
126         (WebInspector.TypeDescription):
127         * UserInterface/Protocol/InspectorBackend.js:
128         (InspectorBackend.Command.prototype.supports):
129         * UserInterface/Views/ContentViewContainer.js:
130         (WebInspector.ContentViewContainer.prototype.showContentView):
131         * UserInterface/Views/NavigationSidebarPanel.js:
132         (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie.treeElementMatchesCookie):
133         (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
134         * UserInterface/Views/ScopeBar.js:
135         (WebInspector.ScopeBar.prototype.get selectedItems):
136         (WebInspector.ScopeBar.prototype.hasNonDefaultItemSelected):
137         * UserInterface/Views/TabContentView.js:
138         (WebInspector.TabContentView):
139         (WebInspector.TabContentView.console.assert): Deleted.
140
141 2016-06-02  Joseph Pecoraro  <pecoraro@apple.com>
142
143         Web Inspector: Modernize some function expressions that bind(this) to arrow functions
144         https://bugs.webkit.org/show_bug.cgi?id=158315
145
146         Reviewed by Brian Burg.
147
148         Convert a common "function(x) { ... }.bind(this)" pattern to use arrow
149         functions "(x) => { ... }", which lexically binds `this`, slightly faster,
150         and uses less memory.
151
152         * UserInterface/Base/Main.js:
153         (WebInspector._updateNewTabButtonState):
154         * UserInterface/Controllers/BreakpointPopoverController.js:
155         (WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
156         * UserInterface/Controllers/TypeTokenAnnotator.js:
157         (WebInspector.TypeTokenAnnotator.prototype.insertAnnotations):
158         (WebInspector.TypeTokenAnnotator.prototype.insertAnnotations.): Deleted.
159         * UserInterface/Models/RenderingFrameTimelineRecord.js:
160         (WebInspector.RenderingFrameTimelineRecord.prototype._calculateDurationRemainder):
161         (WebInspector.RenderingFrameTimelineRecord):
162         * UserInterface/Models/Resource.js:
163         (WebInspector.Resource.prototype.requestContent):
164         * UserInterface/Models/Script.js:
165         (WebInspector.Script.prototype.requestScriptSyntaxTree):
166         (WebInspector.Script.prototype.requestScriptSyntaxTree.makeSyntaxTreeAndCallCallback): Deleted.
167         * UserInterface/Models/SourceCodeLocation.js:
168         (WebInspector.SourceCodeLocation.prototype.populateLiveDisplayLocationString):
169         * UserInterface/Models/WrappedPromise.js:
170         (WebInspector.WrappedPromise):
171         * UserInterface/Views/BreakpointActionView.js:
172         (WebInspector.BreakpointActionView.prototype._updateBody):
173         * UserInterface/Views/BreakpointTreeElement.js:
174         (WebInspector.BreakpointTreeElement.prototype._dataUpdated):
175         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
176         (WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers.update):
177         (WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers):
178         * UserInterface/Views/DefaultDashboardView.js:
179         (WebInspector.DefaultDashboardView.prototype._appendElementForNamedItem.set item):
180         (WebInspector.DefaultDashboardView.prototype._appendElementForNamedItem):
181         * UserInterface/Views/ErrorObjectView.js:
182         (WebInspector.ErrorObjectView.prototype.update):
183         * UserInterface/Views/GeneralTreeElement.js:
184         (WebInspector.GeneralTreeElement.prototype.onattach):
185         (WebInspector.GeneralTreeElement.prototype.onattach.this._boundContextMenuEventHandler): Deleted.
186         * UserInterface/Views/InlineSwatch.js:
187         (WebInspector.InlineSwatch.prototype._getNextValidHEXFormat):
188         (WebInspector.InlineSwatch):
189         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
190         (WebInspector.LayerTreeDetailsSidebarPanel.prototype.refresh):
191         (WebInspector.LayerTreeDetailsSidebarPanel.prototype._showPopoverForSelectedNode):
192         (WebInspector.LayerTreeDetailsSidebarPanel.prototype._contentForPopover):
193         * UserInterface/Views/LogContentView.js:
194         (WebInspector.LogContentView.prototype._mouseup):
195         * UserInterface/Views/NavigationSidebarPanel.js:
196         (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
197         * UserInterface/Views/ObjectTreeBaseTreeElement.js:
198         (WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement):
199         (WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement.): Deleted.
200         * UserInterface/Views/ObjectTreePropertyTreeElement.js:
201         (WebInspector.ObjectTreePropertyTreeElement.prototype._updateEntries):
202         * UserInterface/Views/ObjectTreeView.js:
203         (WebInspector.ObjectTreeView.prototype._updateEntries):
204         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
205         (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection):
206         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
207         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
208         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeElementAddContextMenuItems):
209         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked.this._codeMirror.addKeyMap): Deleted.
210         * UserInterface/Views/TabBar.js:
211         * UserInterface/Views/VisualStylePropertyEditor.js:
212         (WebInspector.VisualStylePropertyEditor.prototype._checkDependencies):
213
214 2016-05-31  Nikita Vasilyev  <nvasilyev@apple.com>
215
216         Web Inspector: Storage DataGrids have a half-pixel transparent/white border below the header
217         https://bugs.webkit.org/show_bug.cgi?id=156699
218         <rdar://problem/25778260>
219
220         Reviewed by Timothy Hatcher.
221
222         Increase the width of the border below the DataGrid's header to match the border in the left sidebar.
223
224         * UserInterface/Views/DataGrid.css:
225         (.data-grid > .header-wrapper):
226
227 2016-05-31  Nikita Vasilyev  <nvasilyev@apple.com>
228
229         Web Inspector: Snapshot List scroll bar occludes border of containing view in top-right
230         https://bugs.webkit.org/show_bug.cgi?id=158219
231         <rdar://problem/26545018>
232
233         Reviewed by Timothy Hatcher.
234
235         * UserInterface/Views/TimelineDataGrid.css:
236         (.data-grid.timeline th): Deleted.
237         * UserInterface/Views/TimelineRecordingContentView.css:
238         (.content-view.timeline-recording > .content-browser > .navigation-bar):
239         Make the border line span across the whole navigation bar, not just its table cells.
240
241 2016-05-30  Brian Burg  <bburg@apple.com>
242
243         Web Inspector: Timelines: "-0.000ms" in Self Time
244         https://bugs.webkit.org/show_bug.cgi?id=158162
245         <rdar://problem/26523350>
246
247         Reviewed by Darin Adler.
248
249         Values such as -0.0000 and +0.00001 seem to indicate there is
250         some floating point error accumulating in profile node data.
251         Since the sampling profiler isn't accurate to that precision,
252         let's clean up the data so near-zero numbers are simply zero.
253
254         * UserInterface/Models/ProfileNode.js:
255         Round selfTime down to zero if it's less than the
256         smallest value we would show in the user interface.
257
258 2016-05-30  Brian Burg  <bburg@apple.com>
259
260         Web Inspector: Uncaught exception page should pre-populate the bug's URL with the inspected page URL
261         https://bugs.webkit.org/show_bug.cgi?id=158055
262         <rdar://problem/26516693>
263
264         Reviewed by Saam Barati.
265
266         * UserInterface/Debug/UncaughtExceptionReporter.js:
267         Include the encoded URL in the query string if it is not empty.
268
269 2016-05-30  Matt Baker  <mattbaker@apple.com>
270
271         Web Inspector: Right-clicking in Snapshot's DataGrid throws an exception
272         https://bugs.webkit.org/show_bug.cgi?id=157934
273         <rdar://problem/26380910>
274
275         Reviewed by Brian Burg.
276
277         Check that click event target is actually a cell, as it can be a row
278         when focusing the table after dismissing a popup menu.
279
280         * UserInterface/Views/DataGrid.js:
281         (WebInspector.DataGridNode.prototype.isEventWithinDisclosureTriangle):
282
283 2016-05-27  Joseph Pecoraro  <pecoraro@apple.com>
284
285         Web Inspector: Not all transitively dominated nodes display their retained size
286         https://bugs.webkit.org/show_bug.cgi?id=158174
287
288         Reviewed by Timothy Hatcher.
289
290         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
291         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._isDominatedByNonBaseParent):
292         Use the parent reference changing in the loop instead of always using the same parent.
293
294 2016-05-27  Devin Rousso  <dcrousso+webkit@gmail.com>
295
296         Web Inspector: Add indicators to show nesting levels inside DOM Tree
297         https://bugs.webkit.org/show_bug.cgi?id=157468
298         <rdar://problem/26162640>
299
300         Reviewed by Timothy Hatcher.
301
302         Add CSS rules to give all expanded node children lists a small line on the
303         left border indicating that all items under the line are descendants.
304
305         * UserInterface/Views/DOMTreeOutline.css:
306         (.tree-outline.dom li .selection):
307         (.tree-outline.dom li > span):
308         (.tree-outline.dom ol):
309         (.tree-outline.dom .tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded):
310         (.tree-outline.dom li.selected + ol.children.expanded):
311         (.tree-outline.dom li.parent::before):
312
313 2016-05-26  Matt Baker  <mattbaker@apple.com>
314
315         Uncaught Exception: TypeError: undefined is not an object (evaluating 'records[endIndex].endTime')
316         https://bugs.webkit.org/show_bug.cgi?id=158057
317
318         Reviewed by Timothy Hatcher.
319
320         * UserInterface/Views/TimelineRecordingContentView.js:
321         (WebInspector.TimelineRecordingContentView.prototype._updateTimelineViewTimes):
322         When the entire recording is selected, rendering frames should use the
323         record count as its end time instead of the recording's end time.
324
325 2016-05-25  Joseph Pecoraro  <pecoraro@apple.com>
326
327         Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'collectionData.affectedSnapshots')
328         https://bugs.webkit.org/show_bug.cgi?id=158051
329
330         Reviewed by Brian Burg.
331
332         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
333         (HeapSnapshot.prototype.updateDeadNodesAndGatherCollectionData):
334         * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
335         (HeapSnapshotWorker.prototype.createSnapshot):
336         If by the time the timeout fires we had cleared our snapshot list, then
337         updateDeadNodesAndGatherCollectionData could bail. Handle gracefully.
338
339 2016-05-23  Nikita Vasilyev  <nvasilyev@apple.com>
340
341         Web Inspector: Split console navigation bar doesn't wrap as expected
342         https://bugs.webkit.org/show_bug.cgi?id=157950
343         <rdar://problem/26395573>
344
345         Reviewed by Timothy Hatcher.
346
347         * UserInterface/Views/Main.css:
348         (#split-content-browser > .navigation-bar .item):
349         Fix the split console and don't touch any other navigation bars.
350
351 2016-05-22  Brady Eidson  <beidson@apple.com>
352
353         Move to C++14.
354         https://bugs.webkit.org/show_bug.cgi?id=157948
355
356         Reviewed by Michael Catanzaro.
357
358         * Configurations/Base.xcconfig:
359
360 2016-05-21  Matt Baker  <mattbaker@apple.com>
361
362         Web Inspector: Creating the CSSStyleDetailsSidebarPanel takes about 50ms (20%) of main load
363         https://bugs.webkit.org/show_bug.cgi?id=156707
364         <rdar://problem/25780404>
365
366         Reviewed by Timothy Hatcher.
367
368         This patch adds new View concepts, `initialLayout` and `widthDidChange`,
369         making it possible for hidden views to postpone the creation of their
370         UI subtree until they are shown for the first time.
371
372         Sidebar panels get this performance improvement by virtue of SidebarPanel
373         and StyleDetailsPanel, which trigger a layout when shown. This can be
374         removed once <https://webkit.org/b/150741> is fixed, and this is done
375         automatically by View.
376
377         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
378         (WebInspector.CSSStyleDeclarationTextEditor):
379         Should subclass View.
380         (WebInspector.CSSStyleDeclarationTextEditor.prototype.layout):
381         (WebInspector.CSSStyleDeclarationTextEditor.prototype.get element): Deleted.
382         Handled in View base class.
383         (WebInspector.CSSStyleDeclarationTextEditor.prototype.updateLayout): Deleted.
384         Relocate to `layout` override, ignore unused parameter `force`.
385
386         * UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
387         (WebInspector.CSSStyleDetailsSidebarPanel):
388         Create the minimum required initial state and UI elements. Relocate
389         anything that can be lazy loaded to `initialLayout`.
390
391         (WebInspector.CSSStyleDetailsSidebarPanel.prototype.initialLayout):
392         (WebInspector.CSSStyleDetailsSidebarPanel.prototype.sizeDidChange):
393         (WebInspector.CSSStyleDetailsSidebarPanel.prototype.widthDidChange): Deleted.
394
395         * UserInterface/Views/ComputedStyleDetailsPanel.js:
396         (WebInspector.ComputedStyleDetailsPanel):
397         Relocate anything that can be lazy loaded to `initialLayout`.
398         (WebInspector.ComputedStyleDetailsPanel.prototype.initialLayout):
399         (WebInspector.ComputedStyleDetailsPanel.prototype.shown): Deleted.
400         (WebInspector.ComputedStyleDetailsPanel.prototype.widthDidChange): Deleted.
401         Handled in View base class.
402
403         * UserInterface/Views/DataGrid.js:
404         (WebInspector.DataGrid.prototype.layout):
405         Resize logic can be safely moved to `sizeDidChange`, since columns are
406         always initialized when the width changes.
407         (WebInspector.DataGrid.prototype.sizeDidChange):
408         Reposition headers, scrollbars.
409         (WebInspector.DataGrid.prototype._updateHeaderAndScrollbar):
410         Broke out header repositioning, which needs to be called whenever
411         column widths are initialized or the view size changes.
412
413         * UserInterface/Views/NavigationBar.js:
414         (WebInspector.NavigationBar.prototype.layout):
415
416         * UserInterface/Views/RulesStyleDetailsPanel.js:
417         (WebInspector.RulesStyleDetailsPanel.prototype.sizeDidChange):
418         (WebInspector.RulesStyleDetailsPanel.prototype.widthDidChange): Deleted.
419
420         * UserInterface/Views/Sidebar.js:
421         (WebInspector.Sidebar.prototype._recalculateWidth):
422         Width changes need to be coordinated by the View base class, since the
423         initial layout must have occurred before handling a width change.
424         Force a layout with a resize layout reason.
425
426         * UserInterface/Views/SidebarPanel.js:
427         (WebInspector.SidebarPanel.prototype.get displayName):
428         Drive-by style fix: add getter so that CSSStyleDetailsSidebarPanel
429         doesn't have to read the private property directly.
430
431         (WebInspector.SidebarPanel.prototype.shown):
432         Force a layout whenever the panel is shown.
433         (WebInspector.SidebarPanel.prototype.sizeDidChange):
434         (WebInspector.SidebarPanel):
435         (WebInspector.SidebarPanel.prototype.widthDidChange): Deleted.
436
437         * UserInterface/Views/StyleDetailsPanel.js:
438         (WebInspector.StyleDetailsPanel.prototype.shown):
439         Schedule a layout when shown. A forced layout isn't necessary.
440         Unlike SidebarPanels, the initial state of style panels doesn't depend
441         on its layout, and can be safely initialized by the next rAF.
442
443         (WebInspector.StyleDetailsPanel.prototype.hidden):
444         Cancel a pending layout if the panel is hidden before the next AF.
445         (WebInspector.StyleDetailsPanel.prototype.widthDidChange): Deleted.
446         Not needed, defined in View base class.
447
448         * UserInterface/Views/TimelineOverview.js:
449         (WebInspector.TimelineOverview.prototype.sizeDidChange):
450         (WebInspector.TimelineOverview.prototype.layout):
451         Moved resize logic to `sizeDidChange`.
452
453         * UserInterface/Views/TimelineRuler.js:
454         (WebInspector.TimelineRuler.prototype.sizeDidChange):
455         (WebInspector.TimelineRuler.prototype.layout):
456         Moved resize logic to `sizeDidChange`.
457
458         * UserInterface/Views/View.js:
459         (WebInspector.View):
460         (WebInspector.View.prototype.updateLayout):
461         (WebInspector.View.prototype.cancelLayout):
462         Allow a pending layout to be canceled. Useful when a view with a
463         pending layout is hidden before the layout occurs.
464
465         (WebInspector.View.prototype.get layoutReason):
466         Protected getter for subclasses that need to check the layout reason
467         outside `sizeDidChange`.
468
469         (WebInspector.View.prototype.initialLayout):
470         Subclass hook to create UI subtree the first time a layout occurs.
471         Called only once during the lifetime of the View.
472
473         (WebInspector.View.prototype.layout):
474         Drive-by comment fix.
475         (WebInspector.View.prototype.sizeDidChange):
476         New layout cycle hook for subclasses.
477         (WebInspector.View.prototype._layoutSubtree):
478         Do an initial layout the first time layout is called.
479         Call the `sizeDidChange` hook so that subclasses can update state
480         which depends on size/position before doing layout.
481
482         * UserInterface/Views/VisualStyleDetailsPanel.js:
483         (WebInspector.VisualStyleDetailsPanel):
484         Create the minimum required initial state and UI elements. Relocate
485         anything that can be lazy loaded to `initialLayout`.
486
487         (WebInspector.VisualStyleDetailsPanel.prototype.refresh):
488         No changes, shifting line numbers confused the diff.
489         (WebInspector.VisualStyleDetailsPanel.prototype.initialLayout):
490         (WebInspector.VisualStyleDetailsPanel.prototype.sizeDidChange):
491         (WebInspector.VisualStyleDetailsPanel.prototype.widthDidChange): Deleted.
492
493 2016-05-21  Matt Baker  <mattbaker@apple.com>
494
495         Assertion Failed: StyleDetailsPanel.markAsNeedsRefresh() called with null domNode
496         https://bugs.webkit.org/show_bug.cgi?id=157955
497         <rdar://problem/26398943>
498
499         Reviewed by Timothy Hatcher.
500
501         CSSStyleDetailsSidebarPanel `visible` is true while the panel is being
502         removed from the details sidebar, even after calling `hidden()`. This
503         causes it to refresh its current StyleDetailsPanel with a null DOM node.
504
505         Unfortunately, SidebarPanel.visible isn't toggled by calling shown/hidden.
506         Since SidebarPanel.visible is only true if the panel is selected, we should
507         deselect panels before removing them.
508
509         * UserInterface/Views/Sidebar.js:
510         (WebInspector.Sidebar.prototype.removeSidebarPanel):
511         Deselect the panel being removed before calling visibiltyDidChange.
512
513         * UserInterface/Views/SidebarPanel.js:
514         (WebInspector.SidebarPanel.prototype.toggle): Deleted.
515         (WebInspector.SidebarPanel.prototype.willRemove): Deleted.
516         Drive-by update to remove some unused methods.
517
518 2016-05-20  Joseph Pecoraro  <pecoraro@apple.com>
519
520         REGRESSION(r200740): Web Inspector: TimelineRecordBar class lists not properly cleared, bleeding colors when zooming in and out
521         https://bugs.webkit.org/show_bug.cgi?id=157959
522         <rdar://problem/26393067>
523
524         Reviewed by Brian Burg.
525
526         * UserInterface/Views/TimelineRecordBar.js:
527         (WebInspector.TimelineRecordBar.prototype.set records):
528         When records are cleared, clear all classes.
529
530 2016-05-20  Nikita Vasilyev  <nvasilyev@apple.com>
531
532         Web Inspector: Split Console is auto opening all the time when using Inspect Element context menu
533         https://bugs.webkit.org/show_bug.cgi?id=157910
534         <rdar://problem/26374066>
535
536         Reviewed by Timothy Hatcher.
537
538         Currently, "synthetic" property is only used to decide whether adding a console message should
539         open the console or not. Replace it with "shouldRevealConsole".
540
541         * UserInterface/Controllers/DOMTreeManager.js:
542         (WebInspector.DOMTreeManager.prototype.inspectNodeObject.nodeAvailable):
543         (WebInspector.DOMTreeManager.prototype.inspectNodeObject):
544         * UserInterface/Controllers/JavaScriptLogViewController.js:
545         (WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult.saveResultCallback):
546         (WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult):
547         (WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted.printResult):
548         (WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
549         (WebInspector.JavaScriptLogViewController.prototype._appendConsoleMessageView):
550         * UserInterface/Models/ConsoleCommandResultMessage.js:
551         (WebInspector.ConsoleCommandResultMessage):
552         (WebInspector.ConsoleCommandResultMessage.prototype.get shouldRevealConsole):
553         (WebInspector.ConsoleCommandResultMessage.prototype.get synthetic): Deleted.
554         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
555         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.):
556         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
557
558 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
559
560         Web Inspector: Can't resume Debugger after breaking on exception in Promise
561         https://bugs.webkit.org/show_bug.cgi?id=157240
562         <rdar://problem/26030890>
563
564         Reviewed by Timothy Hatcher.
565
566         If we pause but have no source code to show we paused in purely internal
567         code. In such cases we were attempting to resume without actually
568         telling the backend to resume, so the backend and frontend were out of
569         sync. The frontend thinking it is "paused" without an activeCallFrame
570         and the backend actually being paused.
571
572         This change more gracefully handles this situation. It actually resumes
573         both the frontend and the backend.
574
575         * UserInterface/Controllers/DebuggerManager.js:
576         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
577         Resume the backend and the frontend.
578
579         (WebInspector.DebuggerManager.prototype._didResumeInternal):
580         Don't look at the active call frame, look at the paused state.
581         This may issue a Resumed event without actually triggering a
582         Paused event if this was the only pause, but that is harmless.
583
584 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
585
586         Web Inspector: Main Resource with <scripts> not showing up in debugger sidebar after reload
587         https://bugs.webkit.org/show_bug.cgi?id=157939
588         <rdar://problem/26385691>
589
590         Reviewed by Timothy Hatcher.
591
592         The order of events on a reload are:
593
594             - MainResourceChanged, add main resource
595             - ScriptsCleared, remove all elements
596
597         This change makes it so ScriptsCleared add the main resource (and
598         potentially other resources). This also avoids the work in
599         MainResourceChanged on reloads / navigations that would be wasted if
600         ScriptsCleared were to just remove it. However, this is still needed
601         for initial load where ScriptsCleared does not happen.
602
603         * UserInterface/Views/DebuggerSidebarPanel.js:
604         (WebInspector.DebuggerSidebarPanel.prototype._mainResourceDidChange):
605         Only add the main resource tree here when we are first loading.
606
607         (WebInspector.DebuggerSidebarPanel.prototype._scriptsCleared):
608         Add the main resource tree after we remove all children in navigations.
609
610         * UserInterface/Views/NavigationSidebarPanel.js:
611         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
612         This was not gracefully handling if there was no selected tree element.
613
614 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
615
616         Web Inspector: Visual Style connectors are not always centered properly
617         https://bugs.webkit.org/show_bug.cgi?id=157932
618
619         Reviewed by Timothy Hatcher.
620
621         * UserInterface/Views/VisualStylePropertyEditorLink.css:
622         (.visual-style-property-editor-link):
623         Remove the 1px margin on @2x that would cause jitter at different
624         sidebar widths. It is however needed on @1x.
625
626         (.visual-style-property-editor-link:not(.link-all)):
627         Make the height 20 so these both move closer to the center of the
628         <select> elements they are next to. They are not perfectly centered
629         as that would require a half pixel.
630
631         (.visual-style-property-editor-link.link-vertical):
632         Move the top line up a pixel so it is "up 0.5" from center and
633         the bottom one is already "down 0.5" from the center.
634
635 2016-05-19  Nikita Vasilyev  <nvasilyev@apple.com>
636
637         REGRESSION (r189385): Web Inspector: CSS properties modified via JS don't update in the Styles sidebar
638         https://bugs.webkit.org/show_bug.cgi?id=157918
639
640         Reviewed by Timothy Hatcher.
641
642         * UserInterface/Controllers/DOMTreeManager.js:
643         (WebInspector.DOMTreeManager):
644         (WebInspector.DOMTreeManager.prototype._inlineStyleInvalidated):
645         (WebInspector.DOMTreeManager.prototype._loadNodeAttributes):
646         Set the initial value of _loadNodeAttributesTimeout to be 0,
647         as setTimeout always returns a positive integer.
648
649 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
650
651         Web Inspector: Heap Snapshots taken before timeline view has a zero time do not get shown
652         https://bugs.webkit.org/show_bug.cgi?id=157923
653         <rdar://problem/26377366>
654
655         Reviewed by Timothy Hatcher.
656
657         * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
658         (WebInspector.HeapAllocationsTimelineDataGridNode):
659         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
660         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.updateTimestamp):
661         Show emDash for the timestamp if we don't yet have a zero time.
662         Update when we get a zero time.
663
664         * UserInterface/Views/HeapAllocationsTimelineView.js:
665         (WebInspector.HeapAllocationsTimelineView):
666         (WebInspector.HeapAllocationsTimelineView.prototype.layout):
667         (WebInspector.HeapAllocationsTimelineView.prototype.reset):
668         Save a list of nodes pre-zero time and update them when we get a zero time.
669
670 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
671
672         Web Inspector: HeapSnapshot Instances view should remove dead objects
673         https://bugs.webkit.org/show_bug.cgi?id=157920
674         <rdar://problem/26375866>
675
676         Reviewed by Timothy Hatcher.
677
678         * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
679         (HeapSnapshotWorker):
680         (HeapSnapshotWorker.prototype.clearSnapshots):
681         (HeapSnapshotWorker.prototype.createSnapshot):
682         Preserve a list of snapshots for this page's session. When
683         new snapshots come in we can determine which nodes have died
684         and update previous snapshots. Emit a CollectionEvent
685         containing the nodes that were deleted and affected snapshots.
686
687         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
688         (HeapSnapshot):
689         Stash the largest node identifier.
690         Create a byte-per-node list to mark it as dead or alive.
691         All snapshots start with all live nodes.
692
693         (HeapSnapshot.prototype.updateDeadNodesAndGatherCollectionData):
694         (HeapSnapshot.prototype._markDeadNodes):
695         When we get a new snapshot we can mark dead nodes in previous
696         snapshots. Determine the nodeIdentifiers of dead nodes, and
697         mark them as dead if they existed in previous snapshots.
698
699         (HeapSnapshot.buildCategories):
700         (HeapSnapshot.prototype.updateCategories):
701         (HeapSnapshotDiff.prototype.updateCategories):
702         Include a "deadCount" in category data. And provide a method
703         to return an updated category list.
704
705         (HeapSnapshot.prototype.serializeNode):
706         Include a "dead" property on nodes when they are first fetched.
707
708         * UserInterface/Proxies/HeapSnapshotDiffProxy.js:
709         (WebInspector.HeapSnapshotDiffProxy.prototype.updateForCollectionEvent):
710         (WebInspector.HeapSnapshotDiffProxy.prototype.updateCategories):
711         * UserInterface/Proxies/HeapSnapshotNodeProxy.js:
712         (WebInspector.HeapSnapshotNodeProxy):
713         (WebInspector.HeapSnapshotNodeProxy.deserialize):
714         * UserInterface/Proxies/HeapSnapshotProxy.js:
715         (WebInspector.HeapSnapshotProxy.prototype.updateForCollectionEvent):
716         (WebInspector.HeapSnapshotProxy.prototype.updateCategories):
717         Update snapshot proxies from a collection event by updating properties
718         and dispatching an event from the model object.
719
720         * UserInterface/Proxies/HeapSnapshotWorkerProxy.js:
721         (WebInspector.HeapSnapshotWorkerProxy):
722         (WebInspector.HeapSnapshotWorkerProxy.prototype.clearSnapshots):
723         (WebInspector.HeapSnapshotWorkerProxy.prototype._mainResourceDidChange):
724         Clear the session snapshot list when the main resource changes.
725         However we can't yet clear the HeapSnapshot objects on the worker
726         because we may still have UI that interact with them.
727
728         * UserInterface/Views/HeapAllocationsTimelineView.js:
729         (WebInspector.HeapAllocationsTimelineView):
730         (WebInspector.HeapAllocationsTimelineView.prototype.closed):
731         Register and unregister for HeapSnapshot collection events.
732
733         (WebInspector.HeapAllocationsTimelineView.prototype._heapSnapshotCollectionEvent.updateHeapSnapshotForEvent):
734         (WebInspector.HeapAllocationsTimelineView.prototype._heapSnapshotCollectionEvent):
735         Update all the snapshots we know about when a collection event happens.
736
737         * UserInterface/Views/HeapSnapshotClassDataGridNode.js:
738         (WebInspector.HeapSnapshotClassDataGridNode.prototype.removeCollectedNodes):
739         (WebInspector.HeapSnapshotClassDataGridNode.prototype.updateCount):
740         (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate):
741         (WebInspector.HeapSnapshotClassDataGridNode.prototype._fetchBatch):
742         * UserInterface/Views/HeapSnapshotContentView.js:
743         (WebInspector.HeapSnapshotContentView.prototype._heapSnapshotDataGridTreeDidPopulate):
744         (WebInspector.HeapSnapshotContentView):
745         * UserInterface/Views/HeapSnapshotDataGridTree.js:
746         (WebInspector.HeapSnapshotDataGridTree):
747         (WebInspector.HeapSnapshotDataGridTree.prototype.removeChild):
748         (WebInspector.HeapSnapshotDataGridTree.prototype.removeCollectedNodes):
749         (WebInspector.HeapSnapshotDataGridTree.prototype._heapSnapshotCollectedNodes):
750         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
751         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.removeCollectedNodes):
752         (WebInspector.HeapSnapshotInstancesDataGridTree):
753         Update the Instances DataGridTree UI when a collection event happens.
754         Remove any top level InstanceDataGridNodes that may be showing for collected nodes.
755         Update the category counts on the ClassDataGridNodes.
756         Update FetchMoreDataGridNodes to have updated counts (and replace removed nodes).
757
758 2016-05-19  Timothy Hatcher  <timothy@apple.com>
759
760         Web Inspector: REGRESSION: Search magnifying glass shifted in Search tab input field
761         https://bugs.webkit.org/show_bug.cgi?id=157913
762         rdar://problem/26374424
763
764         Reviewed by Joseph Pecoraro.
765
766         * UserInterface/Views/SearchSidebarPanel.css:
767         (.sidebar > .panel.navigation.search > .search-bar > input[type="search"]): Removed padding-left.
768         (.sidebar > .panel.navigation.search > .search-bar > input[type="search"]::-webkit-search-results-button):
769         Added. Add margin-right here instead.
770
771 2016-05-19  Timothy Hatcher  <timothy@apple.com>
772
773         Web Inspector: Timelines "Edit" button should be right-aligned
774         https://bugs.webkit.org/show_bug.cgi?id=157909
775         rdar://problem/26373969
776
777         Reviewed by Joseph Pecoraro.
778
779         * UserInterface/Views/ButtonNavigationItem.css:
780         (.navigation-bar .item.button.text-only): Deleted height: auto. Now inherited.
781         * UserInterface/Views/NavigationBar.css:
782         (.navigation-bar .item): Change height to auto to support any NavigationBar height.
783         This is needed since the Timelines tab has a shorter NavigationBar height, and
784         flexible items were overflowing.
785         * UserInterface/Views/TextNavigationItem.css:
786         (.navigation-bar .item.text): Deleted height: auto. Now inherited.
787         * UserInterface/Views/TimelineOverview.js:
788         (WebInspector.TimelineOverview): Add a FlexibleSpaceNavigationItem before the Edit button.
789
790 2016-05-19  Brian Burg  <bburg@apple.com>
791
792         Web Inspector: timelines should not update via requestAnimationFrame unless Web Inspector is visible
793         https://bugs.webkit.org/show_bug.cgi?id=157897
794         <rdar://problem/26330802>
795
796         Reviewed by Timothy Hatcher.
797
798         The timelines overview tries to animate using requestAnimationFrame, even if the
799         inspector frontend is not really visible. When it does this, requestAnimationFrame
800         simply stalls out until the inspector becomes visible. If a recording is started
801         while the inspector is not visible, then when it is shown again, the timeline will
802         start to animate from 0s instead of the current time. This happens because the
803         requestAnimationFrame was requested when the current time actually was 0, and it
804         finally executes some time later, when the current time is no longer accurate.
805         Since the timelines animate by calculating time elapsed since the previous frame
806         rather than using event timestamps, there is no way for the timelines to skip forward
807         in their animations in scenarios where the current time becomes arbitrarily skewed.
808
809         To fix this, consider the visibility state of the frontend as reported by the UIProcess.
810         Fire a global notification when visibility state changes, and start or stop updating
811         the current time as the frontend becomes visible or not shown.
812
813         This does not affect most other uses of requestAnimationFrame, which are used as
814         timers to call updateLayout at an appropriate time. The timelines case is different
815         because the current time is fixed prior to requesting an animation frame, and
816         later animation frames are only triggered by earlier requests, so there's nothing to
817         coalesce.
818
819         * UserInterface/Base/Main.js:
820         (WebInspector.loaded): Initialize WebInspector.visible.
821
822         * UserInterface/Base/Object.js: Add new event.
823
824         * UserInterface/Protocol/InspectorFrontendAPI.js:
825         (InspectorFrontendAPI.setIsVisible): Added.
826
827         * UserInterface/Test/Test.js:
828         (WebInspector.updateVisibilityState): Add a stub.
829
830         * UserInterface/Views/TimelineRecordingContentView.js:
831         (WebInspector.TimelineRecordingContentView):
832         (WebInspector.TimelineRecordingContentView.prototype._inspectorVisibilityStateChanged):
833         If visibility state changes while capturing, then start or stop updating the
834         current time as appropriate. Otherwise, refresh the timelines with updated
835         times so that they know about the recording's updated start/current/end time.
836
837         (WebInspector.TimelineRecordingContentView.prototype._startUpdatingCurrentTime):
838         Bail out if the Web Inspector frontend is not visible to the user and won't be
839         able to service requestAnimationFrames immediately.
840
841 2016-05-18  Timothy Hatcher  <timothy@apple.com>
842
843         Web Inspector: Classes toggle wraps in some localizations
844         https://bugs.webkit.org/show_bug.cgi?id=157878
845         rdar://problem/26108859
846
847         Reviewed by Brian Burg.
848
849         * UserInterface/Views/CSSStyleDetailsSidebarPanel.css:
850         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle):
851         Add white-space: nowrap.
852
853 2016-05-18  Matt Baker  <mattbaker@apple.com>
854
855         Web Inspector: unable to switch between navigation tree outlines using up/down arrow keys
856         https://bugs.webkit.org/show_bug.cgi?id=157713
857         <rdar://problem/26287086>
858
859         Reviewed by Timothy Hatcher.
860
861         * UserInterface/Views/NavigationSidebarPanel.js:
862         (WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
863         Listen for TreeOutline focus changes, and associate trees and their DOM
864         elements for quick lookup when handling focus events.
865
866         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineDidFocus):
867         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
868         When selecting a tree element causes an element in a different tree outline
869         to be deselected, remember the old selection so that it can be restored
870         the next time the tree outline get the focus.
871
872 2016-05-18  Matt Baker  <mattbaker@apple.com>
873
874         Web Inspector: Checkbox disappears when unchecking CSS property with value containing a semicolon
875         https://bugs.webkit.org/show_bug.cgi?id=157862
876         <rdar://problem/16214480>
877
878         Reviewed by Timothy Hatcher.
879
880         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
881         (WebInspector.CSSStyleDeclarationTextEditor.prototype._createCommentedCheckboxMarker):
882         Modify regex to match CSS properties with url() and quoted values,
883         which can contain semicolons.
884
885 2016-05-18  Nikita Vasilyev  <nvasilyev@apple.com>
886
887         Web Inspector: ugly gaps in Call Trees data grid when expanding more than one level
888         https://bugs.webkit.org/show_bug.cgi?id=157829
889         <rdar://problem/26339922>
890
891         Reviewed by Timothy Hatcher.
892
893         Make a more specific CSS selector to avoid style conflicts.
894
895         * UserInterface/Views/DataGrid.css:
896         (.data-grid:not(.variable-height-rows) > .data-container > table.data > tbody > tr > td > div): Deleted.
897         (.data-grid:not(.variable-height-rows) > .data-container > table.data > tbody > tr > td > .cell-content):
898         * UserInterface/Views/DataGrid.js:
899         (WebInspector.DataGridNode.prototype.createCell):
900
901 2016-05-18  Brian Burg  <bburg@apple.com>
902
903         Web Inspector: InspectorFrontendAPI.setTimelineProfilingEnabled should not implicitly show Timelines tab
904         https://bugs.webkit.org/show_bug.cgi?id=157846
905
906         Reviewed by Timothy Hatcher.
907
908         Currently, if the Web Inspector opens for an in-progress or finished automation session,
909         it will always show the Timelines tab, disregarding any previous user view state. This
910         is annoying and is a bad user experience when trying to debug the same test repeatedly.
911
912         * UserInterface/Protocol/InspectorFrontendAPI.js:
913         (InspectorFrontendAPI.setTimelineProfilingEnabled): Don't implicitly show Timelines tab.
914         (InspectorFrontendAPI.showTimelines): Added. This is called explicitly when desired.
915
916 2016-05-18  Brian Burg  <bburg@apple.com>
917
918         Web Inspector: DebuggerSidebarPanel doesn't need to help manage temporarily disabling breakpoints while capturing
919         https://bugs.webkit.org/show_bug.cgi?id=157854
920
921         Reviewed by Timothy Hatcher.
922
923         Duplicate the event listeners in DebuggerManager and move non-view-related
924         state updates out of DebuggerSidebarPanel's listeners into DebuggerManager's listeners.
925         This allows a test to exercise the temporary-disablement code paths during capturing.
926
927         * UserInterface/Controllers/DebuggerManager.js:
928         (WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily):
929         Use this to make the code a bit more readable.
930
931         (WebInspector.DebuggerManager.prototype._startDisablingBreakpointsTemporarily):
932         (WebInspector.DebuggerManager.prototype._stopDisablingBreakpointsTemporarily):
933         (WebInspector.DebuggerManager.prototype.startDisablingBreakpointsTemporarily): Deleted.
934         (WebInspector.DebuggerManager.prototype.stopDisablingBreakpointsTemporarily): Deleted.
935         Make this private since it's not used by other classes anymore.
936
937         (WebInspector.DebuggerManager.prototype._timelineCapturingWillStart): Added.
938         (WebInspector.DebuggerManager.prototype._timelineCapturingStopped): Added.
939
940         * UserInterface/Views/DebuggerSidebarPanel.js:
941         (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingWillStart): Deleted.
942         (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingStopped): Deleted.
943         (WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): Added.
944         (WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingStopped): Added.
945         Make the listener names consistent with TimelineManager: timelineCapturing{WillStart,Stopped}.
946
947 2016-05-18  Joseph Pecoraro  <pecoraro@apple.com>
948
949         Web Inspector: Improve console.takeHeapSnapshot documentation in console
950         https://bugs.webkit.org/show_bug.cgi?id=157853
951
952         Reviewed by Timothy Hatcher.
953
954         * UserInterface/Models/NativeFunctionParameters.js:
955         Mention optional label argument.
956
957 2016-05-18  Brian Burg  <bburg@apple.com>
958
959         Web Inspector: race between frontend and backend both starting timeline recordings causes console assert
960         https://bugs.webkit.org/show_bug.cgi?id=157850
961         <rdar://problem/26349229>
962
963         Reviewed by Joseph Pecoraro.
964
965         If TimelineManager has created a fresh recording and the Timeline.autoCaptureStarted
966         event comes before Timeline.recordingStarted, then the manager will try to start the
967         same recording twice. In this scenario, the manager should just wait until the
968         Timeline.recordingStarted event comes, since it causes TimelineMangare to set up
969         the isCapturing flag and other state.
970
971         * UserInterface/Controllers/TimelineManager.js:
972         (WebInspector.TimelineManager):
973         (WebInspector.TimelineManager.prototype.startCapturing):
974         (WebInspector.TimelineManager.prototype.capturingStarted):
975         (WebInspector.TimelineManager.prototype.autoCaptureStarted):
976         Add a new flag, this._waitingForCapturingStartedEvent. If true, don't start the
977         recording in response to this event.
978
979 2016-05-18  Matt Baker  <mattbaker@apple.com>
980
981         Web Inspector: REGRESSION(r197488): Incorrect start time in Rendering Frames timeline grid
982         https://bugs.webkit.org/show_bug.cgi?id=157840
983         <rdar://problem/26344937>
984
985         Reviewed by Brian Burg.
986
987         * UserInterface/Views/TimelineRecordingContentView.js:
988         (WebInspector.TimelineRecordingContentView.prototype._updateTimes):
989         The Rendering Frames timeline view needs a valid zero time.
990         (WebInspector.TimelineRecordingContentView.prototype._timeRangeSelectionChanged):
991         Adjust ruler selection path component values by the zero time unless
992         the current view is the Rendering Frames timeline view.
993
994 2016-05-17  Matt Baker  <mattbaker@apple.com>
995
996         Web Inspector: NavigationSidebarPanel should coordinate item selection between its tree outlines
997         https://bugs.webkit.org/show_bug.cgi?id=157813
998         <rdar://problem/26331779>
999
1000         Reviewed by Timothy Hatcher.
1001
1002         * UserInterface/Views/DebuggerSidebarPanel.js:
1003         (WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
1004         Deselecting elements in other tree outlines is now done in the base class.
1005
1006         * UserInterface/Views/NavigationSidebarPanel.js:
1007         (WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
1008         Listen for selection changed events on all content tree outlines.
1009         (WebInspector.NavigationSidebarPanel.prototype.treeElementAddedOrChanged):
1010         Moved stub from the public section to the protected section.
1011         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
1012         Deselect tree elements in any content tree outline that is not the
1013         parent of the selected element.
1014
1015         (WebInspector.NavigationSidebarPanel.prototype._treeSelectionDidChange): Deleted.
1016         Rename _contentTreeOutlineTreeSelectionDidChange, to prevent being
1017         shadowed by subclasses with _treeSelectionDidChange event handlers.
1018
1019 2016-05-17  Matt Baker  <mattbaker@apple.com>
1020
1021         Web Inspector: Remove TimelineSidebarPanel.js as it's no longer referenced anywhere
1022         https://bugs.webkit.org/show_bug.cgi?id=157819
1023
1024         Reviewed by Timothy Hatcher.
1025
1026         * UserInterface/Views/TimelineSidebarPanel.js: Removed.
1027         Removed unused file.
1028
1029 2016-05-17  Brian Burg  <bburg@apple.com>
1030
1031         Web Inspector: inspector tests should redirect and log console.trace() calls in test output
1032         https://bugs.webkit.org/show_bug.cgi?id=157802
1033         <rdar://problem/26325671>
1034
1035         Reviewed by Timothy Hatcher.
1036
1037         * UserInterface/Test/FrontendTestHarness.js:
1038         (FrontendTestHarness.prototype.redirectConsoleToTestOutput.createProxyConsoleHandler):
1039         Remove bind() that is now unnecessary. Also redirect console.warn.
1040
1041         (FrontendTestHarness.prototype.redirectConsoleToTestOutput):
1042         For console.trace(), throw and catch a dummy Error to get a stack trace.
1043         Do some post processing on it to remove useless frames and sanitize file paths.
1044
1045 2016-05-17  Brian Burg  <bburg@apple.com>
1046
1047         Web Inspector: Filtering huge data grids should yield occasionally so the UI remains responsive
1048         https://bugs.webkit.org/show_bug.cgi?id=157702
1049         <rdar://problem/26282898>
1050
1051         Based on a patch by Matt Baker <mattbaker@apple.com> on 2016-05-16
1052         Reviewed by Timothy Hatcher.
1053
1054         This patch adds a new class, YieldableTask, for processing large
1055         data sets without starving the runloop. A yieldable task takes a delegate,
1056         an iterator that produces the items to be processed by the delegate, and
1057         the "work interval" time slice and "idle interval" to wait between time slices.
1058         It works by using `yield` to suspend processing when the current time
1059         slice is exceeded, and setting a timeout to wait out the idle interval.
1060
1061         The iterator is responsible for deciding a good traversal order for items,
1062         and the delegate is responsible for processing each item in turn. Tasks
1063         cannot be reused once cancelled or processing completes.
1064
1065         Change DataGrid to use a yieldable task for filtering data grid nodes.
1066         When the filtering criteria changes, cancel the task and run a new task.
1067
1068         * UserInterface/Base/YieldableTask.js: Added.
1069         (WebInspector.YieldableTask.prototype.get processing):
1070         (WebInspector.YieldableTask.prototype.get cancelled):
1071         (WebInspector.YieldableTask.prototype.get idleInterval):
1072         (WebInspector.YieldableTask.prototype.get workInterval):
1073         Add getters.
1074
1075         (WebInspector.YieldableTask.prototype.start.createIteratorForProcessingItems):
1076         (WebInspector.YieldableTask.prototype.start):
1077         Set up an iterator that cranks through items to be processed until the
1078         time slice is exceeded. Check to see if the task is cancelled before and
1079         after calling out to the delegate to perform processing on the item.
1080
1081         (WebInspector.YieldableTask.prototype.cancel):
1082         Set the cancel flag. Tell the delegate the task is finished soon.
1083
1084         (WebInspector.YieldableTask.prototype._processPendingItems):
1085         Request the next item from the cranking iterator so it tries to process
1086         more items. If it yields but still has more items to process, set a timeout
1087         and continue processing more items after the idle interval.
1088
1089         (WebInspector.YieldableTask.prototype._willYield): Notify the delegate.
1090         (WebInspector.YieldableTask.prototype._didFinish): Clear state and notify.
1091         (WebInspector.YieldableTask):
1092
1093         * UserInterface/Main.html:
1094         * UserInterface/Test.html: Add new file.
1095
1096         * UserInterface/Views/DataGrid.js:
1097         (WebInspector.DataGrid):
1098         (WebInspector.DataGrid.prototype.filterDidChange):
1099         Cancel the currently running filter task, if any exists.
1100
1101         (WebInspector.DataGrid.prototype._updateFilter.createIteratorForNodesToBeFiltered):
1102         (WebInspector.DataGrid.prototype._updateFilter):
1103         Set up and start a new filtering task when the filter updates.
1104
1105         (WebInspector.DataGrid.prototype.yieldableTaskWillProcessItem):
1106         (WebInspector.DataGrid.prototype.yieldableTaskDidYield):
1107         (WebInspector.DataGrid.prototype.yieldableTaskDidFinish):
1108         Batch up notifications about filtered nodes changing since this can
1109         cause a lot of unnecessary work by event listeners.
1110
1111 2016-05-17  Brian Burg  <bburg@apple.com>
1112
1113         Web Inspector: breakpoints in sourceURL named scripts are not persisted
1114         https://bugs.webkit.org/show_bug.cgi?id=157714
1115         <rdar://problem/26287099>
1116
1117         Reviewed by Joseph Pecoraro.
1118
1119         The Inspector frontend doesn't try to persist a breakpoint that
1120         lacks a URL, even if the breakpoint has a sourceURL. Similarly, for
1121         breakpoints without a URL, the frontend asks the backend to create
1122         the breakpoint for a specific script identifier rather than a
1123         URL-based breakpoint. This prevents breakpoints in injected scripts
1124         from being resolved if the page is reloaded.
1125
1126         The Inspector backend knows how to resolve URL-based breakpoints
1127         by matching against the script's URL or sourceURL, so we just need
1128         to teach the frontend when either is appropriate to use.
1129
1130         This patch adds SourceCode.contentIdentifier, which is roughly
1131         `url || sourceURL` for content that is not emphemeral, such as
1132         console evaluations. Change breakpoint and debugger code to use
1133         `contentIdentifier` rather than `url`, and pass contentIdentifier
1134         to the backend when setting a breakpoint by URL.
1135
1136         * UserInterface/Controllers/DebuggerManager.js:
1137         (WebInspector.DebuggerManager.prototype.breakpointsForSourceCode):
1138         (WebInspector.DebuggerManager.prototype.scriptsForURL):
1139         (WebInspector.DebuggerManager.prototype.get searchableScripts):
1140         (WebInspector.DebuggerManager.prototype.removeBreakpoint):
1141         (WebInspector.DebuggerManager.prototype.reset):
1142         (WebInspector.DebuggerManager.prototype.scriptDidParse):
1143         (WebInspector.DebuggerManager.prototype._setBreakpoint):
1144         (WebInspector.DebuggerManager.prototype._saveBreakpoints):
1145         (WebInspector.DebuggerManager.prototype._associateBreakpointsWithSourceCode):
1146
1147         * UserInterface/Models/Breakpoint.js:
1148         (WebInspector.Breakpoint):
1149         (WebInspector.Breakpoint.prototype.get contentIdentifier):
1150         (WebInspector.Breakpoint.prototype.get info):
1151         (WebInspector.Breakpoint.prototype.saveIdentityToCookie):
1152         (WebInspector.Breakpoint.prototype.get url): Deleted.
1153         Replace uses of Breakpoint.prototype.get url with
1154         contentIdentifier inside the class and at all callsites.
1155
1156         * UserInterface/Models/Script.js:
1157         (WebInspector.Script.prototype.get contentIdentifier):
1158         Added. Use the URL, or the sourceURL unless the script is
1159         ephemeral and only run once, like as a console evaluation.
1160
1161         * UserInterface/Models/SourceCode.js:
1162         (WebInspector.SourceCode.prototype.get url): Added.
1163         All subclasses already override this getter. Add it here so that
1164         the default implementation of contentIdentifier can use it.
1165
1166         (WebInspector.SourceCode.prototype.get contentIdentifier): Added.
1167
1168         * UserInterface/Views/BreakpointTreeElement.js:
1169         (WebInspector.BreakpointTreeElement.prototype.get filterableData):
1170         * UserInterface/Views/ProbeSetDetailsSection.js:
1171         (WebInspector.ProbeSetDetailsSection.prototype._updateLinkElement):
1172         * UserInterface/Views/SourceCodeTextEditor.js:
1173         (WebInspector.SourceCodeTextEditor.prototype._matchesBreakpoint):
1174         * UserInterface/Views/TextResourceContentView.js:
1175         (WebInspector.TextResourceContentView.prototype.get supplementalRepresentedObjects):
1176
1177 2016-05-16  Joseph Pecoraro  <pecoraro@apple.com>
1178
1179         Uncaught Exception: TypeError: null is not an object (evaluating 'event.data.pathComponent.domTreeElement')
1180         https://bugs.webkit.org/show_bug.cgi?id=157759
1181         <rdar://problem/26309427>
1182
1183         Reviewed by Timothy Hatcher.
1184
1185         * UserInterface/Views/DOMTreeContentView.js:
1186         (WebInspector.DOMTreeContentView.prototype._pathComponentSelected):
1187         Handle possible null path components.
1188
1189         * UserInterface/Views/HierarchicalPathComponent.js:
1190         (WebInspector.HierarchicalPathComponent.prototype.get selectedPathComponent):
1191         When there is a list of just one that is triggered, the Clicked
1192         event should produce that one, to be consistent with clicking
1193         on a list of multiple elements and selecting the same value.
1194
1195 2016-05-16  Saam barati  <sbarati@apple.com>
1196
1197         Hook up ShadowChicken to the debugger to show tail deleted frames
1198         https://bugs.webkit.org/show_bug.cgi?id=156685
1199         <rdar://problem/25770521>
1200
1201         Reviewed by Filip Pizlo and Mark Lam and Joseph Pecoraro.
1202
1203         This patch makes the WebInspector display tail deleted frames.
1204         We show tail deleted frames with a gray [f] instead of a green
1205         [f]. We also put text in the tooltip to indicate that the frame
1206         is tail deleted. Other than that, tail deleted frames behave like
1207         normal frames. You can evaluate in them, inspect their scope, etc.
1208
1209         * Localizations/en.lproj/localizedStrings.js:
1210         * UserInterface/Images/TailDeletedFunction.svg: Added.
1211         * UserInterface/Images/gtk/TailDeletedFunction.svg: Added.
1212         * UserInterface/Models/CallFrame.js:
1213         * UserInterface/Views/CallFrameIcons.css:
1214         * UserInterface/Views/CallFrameTreeElement.js:
1215         * UserInterface/Views/CallFrameView.js:
1216
1217 2016-05-16  Nikita Vasilyev  <nvasilyev@apple.com>
1218
1219         Web Inspector: Contents of Duration column are covered by always on (legacy) scroll bars
1220         https://bugs.webkit.org/show_bug.cgi?id=157590
1221
1222         Reviewed by Timothy Hatcher.
1223
1224         Set the right padding of the DataGrid header to match the scrollbar width.
1225
1226         * UserInterface/Views/DataGrid.css:
1227         (.data-grid .data-container):
1228         (.data-grid.inline .data-container):
1229         Don't show scrollbars for inline data grids.
1230
1231         (.data-grid > .header-wrapper):
1232         (.data-grid.no-header > .header-wrapper > table.header):
1233         (.data-grid.no-header > table.header): Deleted.
1234         (.data-grid th): Deleted.
1235         * UserInterface/Views/DataGrid.js:
1236         (WebInspector.DataGrid):
1237         We can't add padding-rigth to a table. Wrap the table in div.header-wrapper.
1238
1239         (WebInspector.DataGrid.prototype._updateScrollbarPadding):
1240         (WebInspector.DataGrid.prototype.layout):
1241
1242 2016-05-16  Nikita Vasilyev  <nvasilyev@apple.com>
1243
1244         Web Inspector: Background stripes don't span the width of Network sidebar
1245         https://bugs.webkit.org/show_bug.cgi?id=157744
1246
1247         Reviewed by Timothy Hatcher.
1248
1249         * UserInterface/Views/NetworkSidebarPanel.css:
1250         (.sidebar > .panel.navigation.network.network-grid-content-view-showing > .content):
1251
1252 2016-05-16  Antoine Quint  <graouts@apple.com>
1253
1254         Web Inspector: Computed style shows both prefixed and unprefixed variants of properties
1255         https://bugs.webkit.org/show_bug.cgi?id=157674
1256         <rdar://problem/24339756>
1257
1258         Reviewed by Timothy Hatcher.
1259
1260         We make the CSSProperty `implicit` property read-write, and in the case where a computed style
1261         has a property marked as explicit, we also check that it's found in matching rules to consider
1262         it non-implicit. This correctly filters out variants of properties set explicitly.
1263
1264         * UserInterface/Models/CSSProperty.js:
1265         (WebInspector.CSSProperty.prototype.set implicit):
1266         * UserInterface/Models/DOMNodeStyles.js:
1267         (WebInspector.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
1268         (WebInspector.DOMNodeStyles.prototype.refresh):
1269         (WebInspector.DOMNodeStyles.prototype._isPropertyFoundInMatchingRules):
1270         (WebInspector.DOMNodeStyles):
1271
1272 2016-05-14  Timothy Hatcher  <timothy@apple.com>
1273
1274         Web Inspector: DataGrid _updateVisibleRows dominates profiles of timeline recordings when data grid (Overview or TimelineDataGrids) is showing
1275         https://bugs.webkit.org/show_bug.cgi?id=157664
1276         rdar://problem/26262219
1277
1278         Reviewed by Joseph Pecoraro.
1279
1280         * UserInterface/Views/DataGrid.js:
1281         (WebInspector.DataGrid): Added new members.
1282         (WebInspector.DataGrid.prototype.layout): Reset _cachedScrollTop and _cachedScrollHeight on resize.
1283         (WebInspector.DataGrid.prototype._noteScrollPositionChanged): Added.
1284         (WebInspector.DataGrid.prototype._updateVisibleRows): Cache sizes and positions when possible.
1285         (WebInspector.DataGridNode.prototype.set hidden): Added call to _noteRowsChanged.
1286         (WebInspector.DataGridNode.prototype.collapse): Call _noteRowsChanged instead of needsLayout.
1287         (WebInspector.DataGridNode.prototype.expand): Call _noteRowsChanged instead of needsLayout.
1288         (WebInspector.DataGrid.prototype._updateFilter): Removed direct call to _updateVisibleRows, this is
1289         better handled by DataGridNode's hidden setter.
1290
1291 2016-05-14  Timothy Hatcher  <timothy@apple.com>
1292
1293         Web Inspector: Many DataGrid instances do not save/restore their scroll position
1294         https://bugs.webkit.org/show_bug.cgi?id=157709
1295         rdar://problem/26286090
1296
1297         Reviewed by Brian Burg.
1298
1299         * UserInterface/Models/BackForwardEntry.js:
1300         (WebInspector.BackForwardEntry.prototype.makeCopy): Added.
1301         * UserInterface/Views/ContentViewContainer.js:
1302         (WebInspector.ContentViewContainer.prototype.showContentView): Copy the last entry for the view.
1303         * UserInterface/Views/DOMStorageContentView.js:
1304         (WebInspector.DOMStorageContentView.prototype.get scrollableElements): Added.
1305         * UserInterface/Views/HeapSnapshotContentView.js:
1306         (WebInspector.HeapSnapshotContentView.prototype.get scrollableElements): Added.
1307         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
1308         (WebInspector.IndexedDatabaseObjectStoreContentView.prototype.get scrollableElements): Added.
1309         * UserInterface/Views/MemoryTimelineView.js:
1310         (WebInspector.MemoryTimelineView.prototype.get scrollableElements): Added.
1311         * UserInterface/Views/ProfileView.js:
1312         (WebInspector.ProfileView.prototype.get scrollableElements): Added.
1313         (WebInspector.ProfileView.prototype._repopulateDataGridFromTree): Removed unused skipRefresh argument.
1314         * UserInterface/Views/ScriptClusterTimelineView.js:
1315         (WebInspector.ScriptClusterTimelineView.prototype.get scrollableElements): Added.
1316         * UserInterface/Views/ScriptProfileTimelineView.js:
1317         (WebInspector.ScriptProfileTimelineView.prototype.get scrollableElements): Added.
1318         * UserInterface/Views/TimelineView.js:
1319         (WebInspector.TimelineView.prototype.get scrollableElements): Added.
1320
1321 2016-05-14  Nikita Vasilyev  <nvasilyev@apple.com>
1322
1323         Web Inspector: Empty line shows arrow when hovering over Animation Frame Requested in timeline recording
1324         https://bugs.webkit.org/show_bug.cgi?id=157707
1325
1326         Reviewed by Timothy Hatcher.
1327
1328         * UserInterface/Views/DataGrid.css:
1329         (.data-grid:not(.variable-height-rows) > .data-container > table.data > tbody > tr > td > div):
1330
1331 2016-05-13  Simon Fraser  <simon.fraser@apple.com>
1332
1333         Unprefix -webkit-cross-fade()
1334         https://bugs.webkit.org/show_bug.cgi?id=157632
1335
1336         Reviewed by Darin Adler.
1337
1338         * UserInterface/Models/CSSKeywordCompletions.js:
1339
1340 2016-05-13  Matt Baker  <mattbaker@apple.com>
1341
1342         Web Inspector: Typing "layout" in filter for Layout and Rendering Timeline matches everything
1343         https://bugs.webkit.org/show_bug.cgi?id=157684
1344         <rdar://problem/26276588>
1345
1346         Reviewed by Joseph Pecoraro.
1347
1348         Hidden columns should not participate in built-in grid filtering
1349         using DataGrid.filterText. Hidden columns can still be custom filtered,
1350         which is how TimelineDataGrid filters scopebar columns.
1351
1352         * UserInterface/Views/DataGrid.js:
1353         (WebInspector.DataGridNode.prototype.get filterableData):
1354         Skip hidden columns.
1355
1356 2016-05-13  Matt Baker  <mattbaker@apple.com>
1357
1358         Web Inspector: Script ProfileViews should be searchable
1359         https://bugs.webkit.org/show_bug.cgi?id=157581
1360         <rdar://problem/26228530>
1361
1362         Reviewed by Joseph Pecoraro.
1363
1364         * UserInterface/Views/DataGrid.js:
1365         (WebInspector.DataGrid.prototype.get filterText):
1366         Make filterText readable.
1367
1368         * UserInterface/Views/ProfileDataGridNode.js:
1369         (WebInspector.ProfileDataGridNode.prototype.get callingContextTreeNode):
1370         (WebInspector.ProfileDataGridNode.prototype.filterableDataForColumn):
1371         Add filterable data for the "function" column.
1372         (WebInspector.ProfileDataGridNode.prototype._updateChildrenForModifiers):
1373         (WebInspector.ProfileDataGridNode.prototype.get node): Deleted.
1374         Renamed callingContextTreeNode to be less ambiguous.
1375
1376         * UserInterface/Views/ProfileDataGridTree.js:
1377         (WebInspector.ProfileDataGridTree.prototype._updateCurrentFocusDetails):
1378
1379         * UserInterface/Views/ProfileView.js:
1380         (WebInspector.ProfileView.prototype.get dataGrid):
1381         Expose data grid for use in parent view.
1382
1383         * UserInterface/Views/ScriptClusterTimelineView.js:
1384         (WebInspector.ScriptClusterTimelineView.prototype.selectRecord):
1385         Drive-by fix: forward property to current child TimelineView.
1386
1387         * UserInterface/Views/ScriptProfileTimelineView.js:
1388         (WebInspector.ScriptProfileTimelineView):
1389         (WebInspector.ScriptProfileTimelineView.prototype._scopeBarSelectionDidChange):
1390         (WebInspector.ScriptProfileTimelineView.prototype._showProfileViewForOrientation):
1391         Helper function to switch profile views. Persist filter text when
1392         switching to the new profile view.
1393
1394         (WebInspector.ScriptProfileTimelineView.prototype.get showsFilterBar): Deleted.
1395         Remove FIXME and show filter bar.
1396
1397         * UserInterface/Views/TimelineView.js:
1398         (WebInspector.TimelineView.prototype.setupDataGrid):
1399         Support switching to a new data grid.
1400         (WebInspector.TimelineView.prototype.dataGridMatchNodeAgainstCustomFilters):
1401         Hooking up filtering causes data grid nodes to be filtered based on the
1402         ruler selection. Although ScriptProfileTimelineView performs its own
1403         time-based filtering, this is necessary to prevent an assert.
1404
1405         (WebInspector.TimelineView.prototype._timelineDataGridSelectedNodeChanged):
1406         (WebInspector.TimelineView.prototype._timelineDataGridNodeWasFiltered):
1407         Converted arrow functions to member functions to allow unregistering
1408         event listeners on outgoing data grid when swapping grids.
1409
1410 2016-05-12  Matt Baker  <mattbaker@apple.com>
1411
1412         Web Inspector: Remove "Extra Scripts" folder from Resources sidebar if all children removed
1413         https://bugs.webkit.org/show_bug.cgi?id=157656
1414
1415         Reviewed by Timothy Hatcher.
1416
1417         * UserInterface/Views/ResourceSidebarPanel.js:
1418         (WebInspector.ResourceSidebarPanel.prototype._scriptWasRemoved):
1419         Remove parent folder after last script tree element removed.
1420
1421 2016-05-12  Matt Baker  <mattbaker@apple.com>
1422
1423         Web Inspector: Can't filter Rendering Frames by duration
1424         https://bugs.webkit.org/show_bug.cgi?id=157654
1425
1426         Reviewed by Timothy Hatcher.
1427
1428         * UserInterface/Views/RenderingFrameTimelineView.js:
1429         (WebInspector.RenderingFrameTimelineView.prototype._scopeBarSelectionDidChange):
1430         Call filterDidChange on the grid, not the base class.
1431         TimelineView.filterDidChange exists to let TimelineViews perform
1432         additional work when the grid filter changes (see LayoutTimelineView).
1433         (WebInspector.RenderingFrameTimelineView):
1434
1435 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
1436
1437         Web Inspector: Deleting nodes in DOM Tree sometimes changes selection to parent instead of sibling
1438         https://bugs.webkit.org/show_bug.cgi?id=157649
1439
1440         Reviewed by Timothy Hatcher.
1441
1442         * UserInterface/Views/DOMTreeElement.js:
1443         (WebInspector.DOMTreeElement.prototype._updateChildren): Deleted.
1444         When pressing delete, we remove the node via DOM.removeNode()
1445         and remove the DOMTreeElement when we receive a successful response.
1446         However, the backend could send a DOM.childNodeRemoved event before
1447         the response from DOM.removeNode, and the frontend would have a race
1448         between DOMTreeUpdater's timeout and the removeNode callback.
1449
1450         In DOMTreeUpdater's path, DOMTreeElement updateChildren would notice
1451         a removed node and set the selection to the parent node.
1452
1453         In the DOM.removeNode path, TreeOutline would update the selection
1454         based on availability of a previousSibling/nextSibling/parent.
1455
1456         Remove the custom code in DOMTreeElement updateChildren, so that it
1457         can just do the normal TreeOutline behavior via removeChildAtIndex.
1458
1459 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
1460
1461         REGRESSION: Web Inspector: Fails to load sourceMappingURL with relative URL
1462         https://bugs.webkit.org/show_bug.cgi?id=157650
1463         <rdar://problem/26133763>
1464
1465         Reviewed by Timothy Hatcher.
1466
1467         * UserInterface/Controllers/SourceMapManager.js:
1468         Wrong order of arguments. The intent was to pass the incoming
1469         baseURL as the partialURL, because if it was not absolute by
1470         that point we could make it relative to the main resource.
1471         However we accidentally put the main resource as the partial
1472         portion, which would just always return the main resource url.
1473         Swap the order, so that if the incoming base is absolute
1474         (such as a resource.url) that will be used, but if the
1475         incoming base is relative (e.g. an incomplete sourceURL) we
1476         can make it absolute with the main resource.
1477
1478 2016-05-12  Matt Baker  <mattbaker@apple.com>
1479
1480         Web Inspector: Uncaught exception when removing selected Timeline instrument
1481         https://bugs.webkit.org/show_bug.cgi?id=157639
1482         <rdar://problem/26252938>
1483
1484         Reviewed by Timothy Hatcher.
1485
1486         * UserInterface/Views/TimelineOverview.js:
1487         (WebInspector.TimelineOverview.prototype._instrumentRemoved):
1488         Remove timeline tree element before modifying state. Removing the tree
1489         element triggers a SelectionDidChange event, which can have side effects.
1490
1491 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
1492
1493         Web Inspector: Timeline Reset button only resets the one active Script TimelineView
1494         https://bugs.webkit.org/show_bug.cgi?id=157638
1495
1496         Reviewed by Timothy Hatcher.
1497
1498         * UserInterface/Views/ScriptClusterTimelineView.js:
1499         (WebInspector.ScriptClusterTimelineView.prototype.reset):
1500         Reset should reset all the views.
1501
1502         (WebInspector.ScriptClusterTimelineView.prototype.get navigationSidebarTreeOutline): Deleted.
1503         * UserInterface/Views/NetworkGridContentView.js:
1504         (WebInspector.NetworkGridContentView.prototype.get navigationSidebarTreeOutline): Deleted.
1505         * UserInterface/Views/TimelineView.js:
1506         (WebInspector.TimelineView.prototype.get navigationSidebarTreeOutlineScopeBar): Deleted.
1507         Remove dead code. Nobody calls these getters.
1508
1509 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
1510
1511         Web Inspector: Layout timeline popovers are inconsistently shown
1512         https://bugs.webkit.org/show_bug.cgi?id=157640
1513         <rdar://problem/26253394>
1514
1515         Reviewed by Timothy Hatcher.
1516
1517         * UserInterface/Views/TimelineDataGrid.js:
1518         (WebInspector.TimelineDataGrid.prototype._showPopoverForSelectedNodeSoon):
1519         Fix the bug by clearing _showPopoverTimeout when we show the popover.
1520
1521         (WebInspector.TimelineDataGrid.prototype._hidePopover):
1522         Modernize the code to use arrow functions and avoid binds.
1523
1524         (WebInspector.TimelineDataGrid.prototype._updatePopoverForSelectedNode):
1525         Updating with presentNewContentWithFrame animates the popover to the correct
1526         position instead of jumping and ending up at the wrong location.
1527
1528 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
1529
1530         Web Inspector: Remove forced layouts caused by DOMTreeElement during Timeline recording
1531         https://bugs.webkit.org/show_bug.cgi?id=157641
1532
1533         Reviewed by Timothy Hatcher.
1534
1535         * UserInterface/Views/DOMTreeElement.js:
1536         (WebInspector.DOMTreeElement.prototype.updateSelection): Deleted.
1537         This triggers forced layout and I could never actually get it to trigger anyways.
1538         Its history is from the original import, so I don't know why it was added to begin with.
1539         Just remove it.
1540
1541 2016-05-12  Commit Queue  <commit-queue@webkit.org>
1542
1543         Unreviewed, rolling out r200718.
1544         https://bugs.webkit.org/show_bug.cgi?id=157637
1545
1546         Data grid column dividers are misaligned (Requested by NVI on
1547         #webkit).
1548
1549         Reverted changeset:
1550
1551         "Web Inspector: Contents of Duration column are covered by
1552         always on (legacy) scroll bars"
1553         https://bugs.webkit.org/show_bug.cgi?id=157590
1554         http://trac.webkit.org/changeset/200718
1555
1556 2016-05-12  Matt Baker  <mattbaker@apple.com>
1557
1558         Web Inspector: 11% of time in TimelineRecording spent updating DataGrid that is not visible
1559         https://bugs.webkit.org/show_bug.cgi?id=157612
1560         <rdar://problem/26239051>
1561
1562         Reviewed by Timothy Hatcher.
1563
1564         During recording, a timeline view is constantly having its cached time
1565         values updated. These updates should only trigger forced layouts if the
1566         view supports live data.
1567
1568         * UserInterface/Views/TimelineView.js:
1569         (WebInspector.TimelineView.prototype.set zeroTime):
1570         Drive-by fix, add call to _filterTimesDidChange.
1571         (WebInspector.TimelineView.prototype.set startTime):
1572         (WebInspector.TimelineView.prototype.set endTime):
1573         (WebInspector.TimelineView.prototype.set currentTime):
1574         Don't update layout directly.
1575         (WebInspector.TimelineView.prototype._timesDidChange):
1576         Force a layout if the view supports live data. When not recording,
1577         a layout is always performed.
1578         (WebInspector.TimelineView):
1579         (WebInspector.TimelineView.prototype._filterTimesDidChange.delayedWork): Deleted.
1580         Changed to an arrow function.
1581         (WebInspector.TimelineView.prototype._filterTimesDidChange): Deleted.
1582         Renamed _timesDidChange, since the method now does more than throttle
1583         a filterDidChange call.
1584
1585 2016-05-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1586
1587         Web Inspector: Windows Perl fails to run copy-user-interface-resources.pl
1588         https://bugs.webkit.org/show_bug.cgi?id=157620
1589         <rdar://problem/26241548>
1590
1591         Reviewed by Timothy Hatcher.
1592
1593         There are two problems on Windows platform. 'cat' command is
1594         missing and can not execute shebang.
1595
1596         * Scripts/copy-user-interface-resources.pl: Invoke Perl scripts
1597         with explicitly specifying Perl command instead of relying on
1598         shebang.  Add a new subroutine 'appendFile' to concatenate files
1599         instread of 'cat' command.
1600
1601 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
1602
1603         Web Inspector: 3.8% of timeline recording spent in NavigationSidebarPanel _updateContentOverflowShadowVisibility for background tab
1604         https://bugs.webkit.org/show_bug.cgi?id=157616
1605
1606         Reviewed by Timothy Hatcher.
1607
1608         * UserInterface/Views/NavigationSidebarPanel.js:
1609         (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
1610         (WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
1611         Don't update or schedule and update if we aren't visible.
1612         When we are shown we will force an update.
1613
1614 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
1615
1616         Web Inspector: Reduce rAF churn in DefaultDashboardView on pages with lots of resources
1617         https://bugs.webkit.org/show_bug.cgi?id=157618
1618
1619         Reviewed by Timothy Hatcher.
1620
1621         * UserInterface/Views/DefaultDashboardView.js:
1622         (WebInspector.DefaultDashboardView):
1623         (WebInspector.DefaultDashboardView.prototype._updateDisplaySoon):
1624         (WebInspector.DefaultDashboardView.prototype._updateDisplay):
1625         Previously we were scheduling multiple rAFs that would all fire with
1626         the same data, each time a resource was added. Coalesce into one.
1627
1628 2016-05-12  Matt Baker  <mattbaker@apple.com>
1629
1630         Web Inspector: Improve snapshot selection in heap allocations overview graph
1631         https://bugs.webkit.org/show_bug.cgi?id=157588
1632         <rdar://problem/26231245>
1633
1634         Reviewed by Joseph Pecoraro.
1635
1636         Heap snapshot icon selection now uses the built-in record selection
1637         behavior provided by TimelineOverview/TimelineOverviewGraph. The marker
1638         representing the selected heap snapshot now has a "selected" style, and
1639         clicking an icon when the HeapAllocationsTimeline is not selected causes
1640         the timeline to become selected.
1641
1642         * UserInterface/Images/HeapSnapshotSelected.svg: Added.
1643         New art for selected snapshot icon.
1644
1645         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css:
1646         (.timeline-overview-graph.heap-allocations > img.snapshot.selected):
1647         (.timeline-overview-graph.heap-allocations:not(.selected) > img.snapshot.selected):
1648         Selected icon styles for selected/unselected overview graph.
1649
1650         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
1651         (WebInspector.HeapAllocationsTimelineOverviewGraph):
1652         Track selected image element.
1653
1654         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout):
1655         Associate image elements with their snapshot record, and reuse image
1656         elements between layouts. Image element click handler can just set the
1657         selectedRecord in the TimelineOverviewGraph base class.
1658
1659         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.updateSelectedRecord):
1660         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._updateSnapshotMarkers):
1661         Refresh snapshot icon styles when selected record changes.
1662
1663         * UserInterface/Views/HeapAllocationsTimelineView.js:
1664         (WebInspector.HeapAllocationsTimelineView.prototype.selectRecord):
1665         Show snapshot list if no record selected.
1666         (WebInspector.HeapAllocationsTimelineView.prototype.userSelectedRecordFromOverview): Deleted.
1667         No longer needed.
1668
1669         * UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
1670         (WebInspector.RenderingFrameTimelineOverviewGraph.prototype._updateFrameMarker):
1671         No need to call dispatchSelectedRecordChangedEvent manually anymore,
1672         method has been removed from base class.
1673
1674         * UserInterface/Views/TimelineOverviewGraph.js:
1675         (WebInspector.TimelineOverviewGraph.prototype._needsSelectedRecordLayout):
1676         (WebInspector.TimelineOverviewGraph):
1677         (WebInspector.TimelineOverviewGraph.prototype.dispatchSelectedRecordChangedEvent): Deleted.
1678         No longer needed. Event dispatched automatically by the rAF callback.
1679
1680         * UserInterface/Views/TimelineRecordingContentView.js:
1681         (WebInspector.TimelineRecordingContentView.prototype._recordSelected):
1682         Allow switching to another timeline, if the selected record does not
1683         belong to the current timeline.
1684
1685 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
1686
1687         Web Inspector: 3.5% of time in toFixed in TimelineRecordBar updating element positions
1688         https://bugs.webkit.org/show_bug.cgi?id=157608
1689
1690         Reviewed by Timothy Hatcher.
1691
1692         Avoid using toFixed to do an approximation comparison of two floating point numbers.
1693         Instead keep in Numbers by just doing the approximation with Math.round(num * 100).
1694         Since toFixed was doing stringification it was very expensive.
1695
1696         * UserInterface/Views/TimelineRecordBar.js:
1697         (WebInspector.TimelineRecordBar.prototype._updateElementPosition):
1698         (WebInspector.TimelineRecordBar):
1699         * UserInterface/Views/TimelineRecordFrame.js:
1700         (WebInspector.TimelineRecordFrame.prototype._updateElementPosition):
1701         (WebInspector.TimelineRecordFrame):
1702         * UserInterface/Views/TimelineRuler.js:
1703         (WebInspector.TimelineRuler.prototype._updatePositionOfElement):
1704
1705 2016-05-11  Joseph Pecoraro  <pecoraro@apple.com>
1706
1707         Web Inspector: 4% of time in TimelineOverviewGraph adding/removing classList styles on TimelineRecordBar
1708         https://bugs.webkit.org/show_bug.cgi?id=157607
1709
1710         Reviewed by Brian Burg.
1711
1712         This gets us down to about 0.5% of time.
1713
1714         * UserInterface/Views/TimelineRecordBar.js:
1715         (WebInspector.TimelineRecordBar.prototype.set records):
1716         Only modify the classLists when the record changes.
1717
1718         (WebInspector.TimelineRecordBar.prototype.refresh):
1719         Set unfinished once for either the uses active or not uses active cases.
1720
1721 2016-05-11  Joseph Pecoraro  <pecoraro@apple.com>
1722
1723         Web Inspector: Unexpected unread notification icon next to Log after clearing via clear()
1724         https://bugs.webkit.org/show_bug.cgi?id=157598
1725
1726         Reviewed by Timothy Hatcher.
1727
1728         We always show ConsoleCommand and ConsoleCommandResult messages no matter
1729         what the filter is. So it doesn't make sense to mark the "log" filter
1730         as having an unread notification for a ConsoleCommandResult when we can
1731         see the result.
1732
1733         * UserInterface/Views/LogContentView.js:
1734         (WebInspector.LogContentView.prototype.didAppendConsoleMessageView):
1735         (WebInspector.LogContentView.prototype._markScopeBarItemUnread):
1736
1737 2016-05-11  Joseph Pecoraro  <pecoraro@apple.com>
1738
1739         Web Inspector: Console unread indicators should be cleared however the console clears
1740         https://bugs.webkit.org/show_bug.cgi?id=157594
1741
1742         Reviewed by Timothy Hatcher.
1743
1744         * UserInterface/Views/LogContentView.js:
1745         (WebInspector.LogContentView.prototype._logCleared):
1746         (WebInspector.LogContentView.prototype._clearLog):
1747         Move code that clears unread indicators from clearLog to logCleared
1748         to handle all possible clear cases.
1749
1750 2016-05-11  Nikita Vasilyev  <nvasilyev@apple.com>
1751
1752         Web Inspector: Contents of Duration column are covered by always on (legacy) scroll bars
1753         https://bugs.webkit.org/show_bug.cgi?id=157590
1754
1755         Reviewed by Timothy Hatcher.
1756
1757         * UserInterface/Views/DataGrid.css:
1758         (.data-grid .data-container):
1759         Always show vertical scrollbars.
1760
1761         (.data-grid > .header-wrapper):
1762         (.data-grid > .header-wrapper::-webkit-scrollbar):
1763         Show invisible scrollbar for DataGrid's header to align the header table with the content.
1764
1765         (.data-grid.no-header > .header-wrapper > table.header):
1766         (.data-grid.no-header > table.header): Deleted.
1767         (.data-grid th): Deleted.
1768         * UserInterface/Views/DataGrid.js:
1769         (WebInspector.DataGrid):
1770         `overflow-y: scroll` doesn't work on a table element. Wrap table in a div.
1771
1772 2016-05-11  Matt Baker  <mattbaker@apple.com>
1773
1774         Web Inspector: Make it possible to do special styling on selected TimelineOverviewGraphs
1775         https://bugs.webkit.org/show_bug.cgi?id=157593
1776         <rdar://problem/26232886>
1777
1778         Reviewed by Timothy Hatcher.
1779
1780         * UserInterface/Views/TimelineOverview.js:
1781         (WebInspector.TimelineOverview.prototype._timelinesTreeSelectionDidChange.updateGraphSelectedState):
1782         (WebInspector.TimelineOverview.prototype._timelinesTreeSelectionDidChange):
1783         Select the new overview graph and deselect the old one.
1784
1785         * UserInterface/Views/TimelineOverviewGraph.js:
1786         (WebInspector.TimelineOverviewGraph):
1787         (WebInspector.TimelineOverviewGraph.prototype.get selected):
1788         (WebInspector.TimelineOverviewGraph.prototype.set selected):
1789         New property, toggles "selected" class on the graph element.
1790
1791 2016-05-11  Nikita Vasilyev  <nvasilyev@apple.com>
1792
1793         Web Inspector: "Selected Element" is hard to read when searching for "Element"
1794         https://bugs.webkit.org/show_bug.cgi?id=157542
1795         <rdar://problem/26207464>
1796
1797         Reviewed by Timothy Hatcher.
1798
1799         Change the style of highlighted text to match Xcode.
1800
1801         * UserInterface/Views/LogContentView.css:
1802         (.search-in-progress .console-item:not(.filtered-out-by-search).special-user-log .console-message-text .highlighted):
1803         * UserInterface/Views/OpenResourceDialog.css:
1804         (.open-resource-dialog > .tree-outline .item.selected .highlighted):
1805         * UserInterface/Views/Variables.css:
1806         (:root):
1807
1808 2016-05-11  Joseph Pecoraro  <pecoraro@apple.com>
1809
1810         Web Inspector: Hide filter bar in TimelineViews where it is not needed or not yet working
1811         https://bugs.webkit.org/show_bug.cgi?id=157583
1812
1813         Reviewed by Timothy Hatcher.
1814
1815         * UserInterface/Views/HeapAllocationsTimelineView.js:
1816         (WebInspector.HeapAllocationsTimelineView.prototype.get showsFilterBar):
1817         (WebInspector.HeapAllocationsTimelineView.prototype.layout):
1818         (WebInspector.HeapAllocationsTimelineView.prototype.updateFilter):
1819         Filter bar not yet hooked up for HeapSnapshot views.
1820         Make filtering work for the main timeline grid.
1821         It doesn't use the normal TimelineView filter based on selected range.
1822         This is intentional because it may be the case that a snapshot happens
1823         outside the selected time range (via the navigation bar button) and
1824         we want to show it. Otherwise a user might be confused why it is not
1825         showing up in the list.
1826
1827         * UserInterface/Views/MemoryTimelineView.js:
1828         (WebInspector.MemoryTimelineView.prototype.get showsFilterBar):
1829         Filter bar not needed in the Memory timeline view.
1830
1831         * UserInterface/Views/ScriptClusterTimelineView.js:
1832         (WebInspector.ScriptClusterTimelineView.prototype.get showsFilterBar):
1833         Filter bar works for the Events timeline view.
1834
1835         * UserInterface/Views/ScriptProfileTimelineView.js:
1836         (WebInspector.ScriptProfileTimelineView.prototype.get showsFilterBar):
1837         Filter bar not yet hooked up for Profile views.
1838
1839         * UserInterface/Views/TimelineRecordingContentView.js:
1840         (WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
1841         (WebInspector.TimelineRecordingContentView.prototype._contentViewSelectionPathComponentDidChange):
1842         (WebInspector.TimelineRecordingContentView.prototype._updateFilterBar):
1843         Update the filter bar when the selection path components change, since
1844         that triggers when arbitrarily deep sub-content-views change.
1845
1846         * UserInterface/Views/TimelineView.js:
1847         (WebInspector.TimelineView.prototype.get showsFilterBar):
1848         Default is yes.
1849
1850 2016-05-10  Joseph Pecoraro  <pecoraro@apple.com>
1851
1852         Web Inspector: Avoid unnecessary timeout identifier churn in TimelineManager
1853         https://bugs.webkit.org/show_bug.cgi?id=157535
1854
1855         Reviewed by Timothy Hatcher.
1856
1857         * UserInterface/Controllers/TimelineManager.js:
1858         (WebInspector.TimelineManager):
1859         (WebInspector.TimelineManager.prototype.capturingStarted):
1860         (WebInspector.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
1861         Don't re-tickle if we tickled in the last 10ms.
1862
1863 2016-05-10  Matt Baker  <mattbaker@apple.com>
1864
1865         Web Inspector: Can't select record bar in Frames timeline
1866         https://bugs.webkit.org/show_bug.cgi?id=156963
1867         <rdar://problem/25898256>
1868
1869         Reviewed by Timothy Hatcher.
1870
1871         Sync record selection between the Rendering Frames grid and overview graph.
1872
1873         * UserInterface/Views/DataGrid.js:
1874         (WebInspector.DataGridNode.prototype.hasAncestor):
1875         Add helper function needed by TimelineView.
1876
1877         * UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
1878         (WebInspector.RenderingFrameTimelineOverviewGraph.prototype._mouseClicked):
1879         Don't deselect the selected record when clicked. Initially this seemed
1880         like a good idea but it complicates the UI for no added value.
1881
1882         * UserInterface/Views/TimelineRecordingContentView.js:
1883         (WebInspector.TimelineRecordingContentView.prototype._contentViewSelectionPathComponentDidChange):
1884         Get path components from the current TimelineView instead of the
1885         TimelineRecordingContentView, now that the selected record appears
1886         in the bottom ContentBrowser's navigation bar.
1887
1888 2016-05-10  Joseph Pecoraro  <pecoraro@apple.com>
1889
1890         Web Inspector: Backend should initiate timeline recordings on page navigations to ensure nothing is missed
1891         https://bugs.webkit.org/show_bug.cgi?id=157504
1892         <rdar://problem/26188642>
1893
1894         Reviewed by Brian Burg.
1895
1896         * UserInterface/Controllers/TimelineManager.js:
1897         (WebInspector.TimelineManager):
1898         (WebInspector.TimelineManager.prototype.set autoCaptureOnPageLoad):
1899         (WebInspector.TimelineManager.prototype.set enabledTimelineTypes):
1900         (WebInspector.TimelineManager.prototype._updateAutoCaptureInstruments):
1901         For backends that support it, enable/disable auto capture and the instruments to use.
1902
1903         (WebInspector.TimelineManager.prototype.autoCaptureStarted):
1904         New event, stop and start a new recording. Set a flag that we should
1905         detect the auto capturing resource so we know when the stop the
1906         auto capture.
1907
1908         (WebInspector.TimelineManager.prototype._loadNewRecording):
1909         (WebInspector.TimelineManager.prototype._addRecord):
1910         (WebInspector.TimelineManager.prototype._startAutoCapturing): Renamed.
1911         (WebInspector.TimelineManager.prototype._attemptAutoCapturingForFrame):
1912         (WebInspector.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
1913         (WebInspector.TimelineManager.prototype._stopAutoRecordingSoon):
1914         (WebInspector.TimelineManager.prototype._resetAutoRecordingMaxTimeTimeout):
1915         (WebInspector.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
1916         (WebInspector.TimelineManager.prototype._mainResourceDidChange):
1917         (WebInspector.TimelineManager.prototype._mergeScriptProfileRecords):
1918         Factor out the new path, old path, and shared code for auto capturing.
1919         Renamed _startAutoCapturing to _attemptAutoCapturingForFrame which
1920         better matches what it tries to do.
1921
1922         * UserInterface/Protocol/TimelineObserver.js:
1923         (WebInspector.TimelineObserver.prototype.autoCaptureStarted):
1924         Inform TimelineManager.
1925
1926 2016-05-10  Matt Baker  <mattbaker@apple.com>
1927
1928         Web Inspector: Debugger sidebar should refresh when Debug UI enabled/disabled
1929         https://bugs.webkit.org/show_bug.cgi?id=157540
1930         <rdar://problem/26207064>
1931
1932         Reviewed by Timothy Hatcher.
1933
1934         * UserInterface/Views/DebuggerSidebarPanel.js:
1935         (WebInspector.DebuggerSidebarPanel.prototype._scriptRemoved.removeScript):
1936         (WebInspector.DebuggerSidebarPanel.prototype._scriptRemoved):
1937         Remove element from both tree outlines, if it exists.
1938
1939 2016-05-10  Matt Baker  <mattbaker@apple.com>
1940
1941         Web Inspector: TimelineOverview assertion failed: Missing overview graph for timeline type undefined
1942         https://bugs.webkit.org/show_bug.cgi?id=157533
1943         <rdar://problem/26204033>
1944
1945         Reviewed by Timothy Hatcher.
1946
1947         * UserInterface/Views/TimelineRecordingContentView.js:
1948         (WebInspector.TimelineRecordingContentView.prototype._recordWasFiltered):
1949         The OverviewTimelineView's represented object is the entire recording,
1950         and TimelineOverview.recordWasFiltered expects a timeline. Return early
1951         since no graph in the overview needs updating.
1952
1953 2016-05-10  Matt Baker  <mattbaker@apple.com>
1954
1955         Web Inspector: Call Trees and Memory view blank
1956         https://bugs.webkit.org/show_bug.cgi?id=157486
1957         <rdar://problem/26178404>
1958
1959         Reviewed by Timothy Hatcher.
1960
1961         * UserInterface/Views/TimelineRecordingContentView.js:
1962         (WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
1963         (WebInspector.TimelineRecordingContentView.prototype._updateTimes):
1964         Setting current time now handled by _updateTimelineViewTimes.
1965         (WebInspector.TimelineRecordingContentView.prototype._capturingStopped):
1966         Update times for the current TimelineView when the recording ends.
1967         This ensures that views that don't call TimelineView.setupDataGrid are
1968         able to update state that depends on the ruler selection.
1969
1970         (WebInspector.TimelineRecordingContentView.prototype._timeRangeSelectionChanged):
1971         (WebInspector.TimelineRecordingContentView.prototype._updateTimelineViewTimes):
1972         Renamed from _updateTimelineViewSelection. Sets start, end, and current times.
1973
1974 2016-05-10  Devin Rousso  <dcrousso+webkit@gmail.com>
1975
1976         Web Inspector: Cleanup super getter/setter now that underlying issue is fixed
1977         https://bugs.webkit.org/show_bug.cgi?id=157488
1978         <rdar://problem/26179120>
1979
1980         Reviewed by Brian Burg.
1981
1982         Addressed FIXMEs for bug 147064:
1983         <https://webkit.org/b/147064> Getter and setter on super are called with wrong "this" object
1984
1985         * UserInterface/Views/VisualStyleKeywordPicker.js:
1986         (WebInspector.VisualStyleKeywordPicker.prototype.get value):
1987         (WebInspector.VisualStyleKeywordPicker.prototype.set value):
1988         (WebInspector.VisualStyleKeywordPicker.prototype.get synthesizedValue):
1989         (WebInspector.VisualStyleKeywordPicker.prototype._getValue): Deleted.
1990         (WebInspector.VisualStyleKeywordPicker.prototype._setValue): Deleted.
1991         (WebInspector.VisualStyleKeywordPicker.prototype._generateSynthesizedValue): Deleted.
1992
1993         * UserInterface/Views/VisualStyleNumberInputBox.js:
1994         (WebInspector.VisualStyleNumberInputBox.prototype.set specialPropertyPlaceholderElementText):
1995
1996         * UserInterface/Views/VisualStyleTimingEditor.js:
1997         (WebInspector.VisualStyleTimingEditor.prototype.get value):
1998         (WebInspector.VisualStyleTimingEditor.prototype.set value):
1999         (WebInspector.VisualStyleTimingEditor.prototype.get synthesizedValue):
2000         (WebInspector.VisualStyleTimingEditor.prototype._getValue): Deleted.
2001         (WebInspector.VisualStyleTimingEditor.prototype._setValue): Deleted.
2002         (WebInspector.VisualStyleTimingEditor.prototype._generateSynthesizedValue): Deleted.
2003
2004 2016-05-09  Matt Baker  <mattbaker@apple.com>
2005
2006         Web Inspector: Filtering by Errors/Warnings should not filter Breakpoints list
2007         https://bugs.webkit.org/show_bug.cgi?id=157481
2008         <rdar://problem/26177346>
2009
2010         Reviewed by Timothy Hatcher.
2011
2012         * Localizations/en.lproj/localizedStrings.js:
2013         New UI strings.
2014
2015         * UserInterface/Views/DebuggerSidebarPanel.js:
2016         (WebInspector.DebuggerSidebarPanel.showResourcesWithIssuesOnlyFilterFunction):
2017         Only filter tree elements belonging to the scripts tree outline.
2018         (WebInspector.DebuggerSidebarPanel):
2019         Drive-by cleanup of Issues filter button tooltips.
2020
2021 2016-05-09  Nikita Vasilyev  <nvasilyev@apple.com>
2022
2023         REGRESSION: Web Inspector: DOM path bar blinks when modifying inline styles
2024         https://bugs.webkit.org/show_bug.cgi?id=149258
2025         <rdar://problem/22737843>
2026
2027         Reviewed by Timothy Hatcher.
2028
2029         * UserInterface/Base/Utilities.js:
2030         (Array.shallowEqual):
2031         * UserInterface/Views/ContentBrowser.js:
2032         (WebInspector.ContentBrowser.prototype._updateContentViewNavigationItems):
2033         (WebInspector.ContentBrowser.prototype._removeAllNavigationItems):
2034         Don't re-render the navigation bar when all new navigation items match the previous ones.
2035
2036         * UserInterface/Views/HierarchicalPathNavigationItem.js:
2037         (WebInspector.HierarchicalPathNavigationItem.set components.let.componentsEqual):
2038         (WebInspector.HierarchicalPathNavigationItem.prototype.set components):
2039         Don't re-render HierarchicalPathComponent when all new path components match the previous ones.
2040
2041 2016-05-09  Matt Baker  <mattbaker@apple.com>
2042
2043         Web Inspector: Remove Global Breakpoints folder
2044         https://bugs.webkit.org/show_bug.cgi?id=157478
2045         <rdar://problem/26176524>
2046
2047         Reviewed by Timothy Hatcher.
2048
2049         * Localizations/en.lproj/localizedStrings.js:
2050         Remove UI string.
2051
2052         * UserInterface/Views/DebuggerSidebarPanel.js:
2053         (WebInspector.DebuggerSidebarPanel):
2054         (WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineContextMenuTreeElement):
2055         (WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
2056         Remove references to folder tree element.
2057
2058         (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements.isSpecialBreakpoint):
2059         (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):
2060         Top level comparison should check for "special" breakpoints.
2061
2062 2016-05-09  Matt Baker  <mattbaker@apple.com>
2063
2064         Web Inspector: Heap Snapshot Timeline view can be live
2065         https://bugs.webkit.org/show_bug.cgi?id=157487
2066         <rdar://problem/26178439>
2067
2068         Reviewed by Joseph Pecoraro.
2069
2070         * UserInterface/Views/HeapAllocationsTimelineView.js:
2071         (WebInspector.HeapAllocationsTimelineView.prototype.get showsLiveRecordingData): Deleted.
2072         Don't override, should return true.
2073
2074 2016-05-09  Manuel Rego Casasnovas  <rego@igalia.com>
2075
2076         [css-grid] Update Grid Layout properties in CSSKeywordCompletions.js
2077         https://bugs.webkit.org/show_bug.cgi?id=157166
2078
2079         Reviewed by Timothy Hatcher.
2080
2081         The CSS Grid Layout properties have been changing on the spec,
2082         however they haven't been updated in CSSKeywordCompletions for a long time.
2083         Update them using the last spec draft:
2084         https://drafts.csswg.org/css-grid/#property-index
2085
2086         * UserInterface/Models/CSSKeywordCompletions.js:
2087
2088 2016-05-09  Matt Baker  <mattbaker@apple.com>
2089
2090         Web Inspector: Cleanup issue tree elements in the Debugger sidebar
2091         https://bugs.webkit.org/show_bug.cgi?id=157469
2092         <rdar://problem/26162999>
2093
2094         Reviewed by Timothy Hatcher.
2095
2096         * UserInterface/Views/DebuggerSidebarPanel.js:
2097         (WebInspector.DebuggerSidebarPanel):
2098         (WebInspector.DebuggerSidebarPanel.prototype._addIssue):
2099         Don't add duplicate issue tree elements.
2100         (WebInspector.DebuggerSidebarPanel.prototype._handleIssuesCleared):
2101         Remove issues from the correct tree outline.
2102
2103         * UserInterface/Views/IssueTreeElement.css:
2104         (.issue .icon):
2105         (.issue.warning .icon):
2106         (.issue.error .icon):
2107         Match dashboard icons.
2108
2109 2016-05-09  Matt Baker  <mattbaker@apple.com>
2110
2111         Web Inspector: Show in progress message in Timeline views that do not show data until the recording finishes
2112         https://bugs.webkit.org/show_bug.cgi?id=156761
2113         <rdar://problem/25970771>
2114
2115         Reviewed by Timothy Hatcher.
2116
2117         * Localizations/en.lproj/localizedStrings.js:
2118         New UI strings.
2119
2120         * UserInterface/Main.html:
2121         New view class.
2122
2123         * UserInterface/Views/HeapAllocationsTimelineView.js:
2124         (WebInspector.HeapAllocationsTimelineView.prototype.get showsLiveRecordingData):
2125         * UserInterface/Views/RenderingFrameTimelineView.js:
2126         (WebInspector.RenderingFrameTimelineView.prototype.get showsLiveRecordingData):
2127         * UserInterface/Views/ScriptDetailsTimelineView.js:
2128         (WebInspector.ScriptDetailsTimelineView.prototype.get showsLiveRecordingData):
2129         * UserInterface/Views/ScriptProfileTimelineView.js:
2130         (WebInspector.ScriptProfileTimelineView.prototype.get showsLiveRecordingData):
2131         Don't show live recording data.
2132
2133         * UserInterface/Views/ScriptClusterTimelineView.js:
2134         (WebInspector.ScriptClusterTimelineView.prototype.get showsLiveRecordingData):
2135         Forward property to current child TimelineView.
2136
2137         * UserInterface/Views/TimelineRecordingContentView.css:
2138         (.content-view.timeline-recording > .content-browser .recording-progress):
2139         (.content-view.timeline-recording > .content-browser .recording-progress > .status):
2140         (.content-view.timeline-recording > .content-browser .recording-progress > .status > .indeterminate-progress-spinner):
2141         New progress view styles.
2142
2143         * UserInterface/Views/TimelineRecordingContentView.js:
2144         (WebInspector.TimelineRecordingContentView):
2145         (WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
2146         (WebInspector.TimelineRecordingContentView.prototype._capturingStarted):
2147         (WebInspector.TimelineRecordingContentView.prototype._capturingStopped):
2148         Refresh progress view visibility.
2149
2150         (WebInspector.TimelineRecordingContentView.prototype._updateProgressView):
2151         Show the progress view if we're currently capturing, and showing a view
2152         that doesn't support showing live data.
2153
2154         * UserInterface/Views/TimelineRecordingProgressView.js:
2155         (WebInspector.TimelineRecordingProgressView):
2156         (WebInspector.TimelineRecordingProgressView.prototype.get visible):
2157         (WebInspector.TimelineRecordingProgressView.prototype.set visible):
2158         Show a status message, indeterminate progress spinner, and Stop Recording
2159         button while timeline data is being recorded.
2160
2161         * UserInterface/Views/TimelineView.js:
2162         (WebInspector.TimelineView.prototype.get showsLiveRecordingData):
2163         Implemented by TimelineViews that don't support showing data while recording.
2164
2165         * UserInterface/Views/Variables.css:
2166         (:root):
2167         Add --panel-background-color-light for the progress view.
2168
2169 2016-05-08  Matt Baker  <mattbaker@apple.com>
2170
2171         Web Inspector: Add Breakpoints and Scripts folders to Debugger sidebar
2172         https://bugs.webkit.org/show_bug.cgi?id=151119
2173         <rdar://problem/23488916>
2174
2175         Reviewed by Timothy Hatcher.
2176
2177         Add a collapsible Sources section to the Debugger beneath the existing
2178         Breakpoints section.
2179
2180         * UserInterface/Views/DebuggerSidebarPanel.css:
2181         Remove unused CSS class names.
2182
2183         (.sidebar > .panel.navigation.debugger .details-section.scripts:not(.collapsed)):
2184         Hide scripts section bottom border when expanded. As the last
2185         section, a border only adds visual clutter.
2186
2187         (.sidebar > .panel.navigation.debugger .details-section.scripts): Deleted.
2188         (.sidebar > .panel.navigation.debugger.paused .details-section.scripts): Deleted.
2189         (.sidebar > .panel.navigation.debugger .details-section.scripts .header): Deleted.
2190         (.sidebar > .panel.navigation.debugger.paused .details-section.scripts .header): Deleted.
2191         (.sidebar > .panel.navigation.debugger .details-section.scripts.collapsed > .content): Deleted.
2192         (.sidebar > .panel.navigation.debugger.paused .details-section.scripts.collapsed > .content): Deleted.
2193         No longer needed.
2194
2195         * UserInterface/Views/DebuggerSidebarPanel.js:
2196         (WebInspector.DebuggerSidebarPanel):
2197         Create separate "Breakpoints" and "Sources" sections, and make filter
2198         placeholder text generic. Remove unused class from breakpoints tree.
2199
2200         (WebInspector.DebuggerSidebarPanel.prototype.treeElementForRepresentedObject):
2201         Check both breakpoint and scripts tree outlines.
2202
2203         (WebInspector.DebuggerSidebarPanel.prototype._addBreakpoint):
2204         (WebInspector.DebuggerSidebarPanel.prototype._addTreeElementForSourceCodeToTreeOutline):
2205         Make helper function generic.
2206
2207         (WebInspector.DebuggerSidebarPanel.prototype._addResource):
2208         (WebInspector.DebuggerSidebarPanel.prototype._mainResourceDidChange):
2209         (WebInspector.DebuggerSidebarPanel.prototype._addScript):
2210         Add resources to the scripts tree.
2211
2212         (WebInspector.DebuggerSidebarPanel.prototype._scriptsCleared):
2213         Clear the scripts tree.
2214
2215         (WebInspector.DebuggerSidebarPanel.prototype._removeDebuggerTreeElement):
2216         Remove script element when last breakpoint is removed.
2217
2218         (WebInspector.DebuggerSidebarPanel.prototype._addIssue):
2219         (WebInspector.DebuggerSidebarPanel.prototype._addTreeElementForSourceCodeToContentTreeOutline): Deleted.
2220         Renamed _addTreeElementForSourceCodeToTreeOutline.
2221
2222 2016-05-08  Matt Baker  <mattbaker@apple.com>
2223
2224         Web Inspector: SourceCodeTextEditor issue widgets/line styles should reset when log is cleared
2225         https://bugs.webkit.org/show_bug.cgi?id=157460
2226         <rdar://problem/26159633>
2227
2228         Reviewed by Timothy Hatcher.
2229
2230         * UserInterface/Views/SourceCodeTextEditor.js:
2231         (WebInspector.SourceCodeTextEditor):
2232         (WebInspector.SourceCodeTextEditor.prototype._logCleared):
2233         Clear issue widgets and CodeMirror line class names when log cleared.
2234
2235 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
2236
2237         Web Inspector: Inspect Element and Element Selection searching should work with Shadow DOM Nodes
2238         https://bugs.webkit.org/show_bug.cgi?id=157446
2239         <rdar://problem/24688447>
2240
2241         Reviewed by Ryosuke Niwa.
2242
2243         * UserInterface/Models/DOMNode.js:
2244         (WebInspector.DOMNode):
2245         Shadow DOM nodes did not have a parent, and so when attempting
2246         to create DOM Tree elements up the chain, we were failing at
2247         shadow boundaries. Create the parent relationship, the parent
2248         already treats it as a child.
2249
2250         * UserInterface/Views/DOMTreeOutline.js:
2251         (WebInspector.DOMTreeOutline.prototype._revealAndSelectNode):
2252         Whenever we try to reveal and select an element in a shadow tree
2253         but the setting to show shadow DOM is disabled, walk up until
2254         we are out of the shadow tree.
2255
2256 2016-05-06  Nikita Vasilyev  <nvasilyev@apple.com>
2257
2258         Web Inspector: Unexpected white border at the bottom of Debugger filter bar
2259         https://bugs.webkit.org/show_bug.cgi?id=157430
2260         <rdar://problem/26146602>
2261
2262         Reviewed by Timothy Hatcher.
2263
2264         Remove the semi-transparent white borders.
2265
2266         * UserInterface/Views/NavigationBar.css:
2267         (.navigation-bar): Deleted.
2268         * UserInterface/Views/SearchSidebarPanel.css:
2269         (.sidebar > .panel.navigation.search > .search-bar): Deleted.
2270
2271 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
2272
2273         Web Inspector: Remove HeapSnapshot Summary View
2274         https://bugs.webkit.org/show_bug.cgi?id=157385
2275
2276         Reviewed by Timothy Hatcher.
2277
2278         * Localizations/en.lproj/localizedStrings.js:
2279         * UserInterface/Main.html:
2280         * UserInterface/Views/HeapSnapshotClusterContentView.js:
2281         (WebInspector.HeapSnapshotClusterContentView):
2282         (WebInspector.HeapSnapshotClusterContentView.prototype.get summaryContentView): Deleted.
2283         (WebInspector.HeapSnapshotClusterContentView.prototype.showSummary): Deleted.
2284         (WebInspector.HeapSnapshotClusterContentView.prototype._pathComponentForContentView):
2285         (WebInspector.HeapSnapshotClusterContentView.prototype._identifierForContentView):
2286         (WebInspector.HeapSnapshotClusterContentView.prototype._showContentViewForIdentifier):
2287         * UserInterface/Views/HeapSnapshotSummaryContentView.css: Removed.
2288         * UserInterface/Views/HeapSnapshotSummaryContentView.js: Removed.
2289         * UserInterface/Views/Variables.css:
2290         (:root):
2291
2292 2016-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
2293
2294         [css-grid] Unprefix CSS Grid Layout properties
2295         https://bugs.webkit.org/show_bug.cgi?id=157137
2296
2297         Reviewed by Simon Fraser.
2298
2299         Remove "-webkit" prefix from all the grid layout properties,
2300         including the display value.
2301         Update the source code to remove the prefix where it was used too.
2302
2303         * UserInterface/Models/CSSKeywordCompletions.js:
2304
2305 2016-05-05  Joseph Pecoraro  <pecoraro@apple.com>
2306
2307         REGRESSION(r200474): Exception in autocompletion - `getCompletions` not found
2308         https://bugs.webkit.org/show_bug.cgi?id=157408
2309
2310         Reviewed by Timothy Hatcher.
2311
2312         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2313         (WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
2314         This function was renamed, but this instance was missed.
2315
2316 2016-05-05  Joseph Pecoraro  <pecoraro@apple.com>
2317
2318         Web Inspector: Provide go-to links next to Functions in GC Root Path popover
2319         https://bugs.webkit.org/show_bug.cgi?id=157381
2320         <rdar://problem/26122531>
2321
2322         Reviewed by Timothy Hatcher.
2323
2324         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
2325         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
2326         For functions, create a go-to-link. Insert a placeholder to replace
2327         so that the popover sizes itself with a potential go-to arrow, as
2328         it won't resize when the go-to arrows get inserted.
2329
2330         * UserInterface/Views/HeapSnapshotInstancesContentView.css:
2331         (.heap-snapshot-instance-popover-content .node .go-to-link):
2332         Move down 1px to align better with the text.
2333
2334 2016-05-05  Joseph Pecoraro  <pecoraro@apple.com>
2335
2336         Web Inspector: HeapSnapshot should exploratory Object Graph view
2337         https://bugs.webkit.org/show_bug.cgi?id=157371
2338         <rdar://problem/26107304>
2339
2340         Reviewed by Timothy Hatcher.
2341
2342         HeapSnapshots now have two ContentViews for viewing the graph.
2343
2344         HeapSnapshotInstancesContentView:
2345           - top level are Class Categories nodes
2346           - categories expand to Instances
2347           - instances expand to show what they retain
2348           - retained sizes only shown for dominated nodes of the instance
2349
2350         HeapSnapshotObjectGraphContentView:
2351           - top level are GlobalObject or Window nodes
2352           - expand to show what they retain
2353           - retained sizes are shown for all nodes, everything is shown
2354
2355         This also provides a custom preview for Window instances. Instead of
2356         showing an ObjectPreview, it just shows the `window.location.href`
2357         for that instance, which is useful when there are multiple Window
2358         instances for different frames.
2359
2360         * Localizations/en.lproj/localizedStrings.js:
2361         * UserInterface/Main.html:
2362         New "Object Graph" string and new files.
2363
2364         * UserInterface/Images/HeapSnapshotObjectGraph.svg: Added.
2365         * UserInterface/Images/gtk/HeapSnapshotObjectGraph.svg: Added.
2366         * UserInterface/Views/PathComponentIcons.css:
2367         (.heap-snapshot-object-graph-icon .icon):
2368         Copy the red [{}] icon from Style Rules.
2369
2370         * UserInterface/Views/HeapSnapshotClusterContentView.js:
2371         (WebInspector.HeapSnapshotClusterContentView):
2372         (WebInspector.HeapSnapshotClusterContentView.prototype.get objectGraphContentView):
2373         (WebInspector.HeapSnapshotClusterContentView.prototype.showObjectGraph):
2374         (WebInspector.HeapSnapshotClusterContentView.prototype._supportsObjectGraph):
2375         (WebInspector.HeapSnapshotClusterContentView.prototype._pathComponentForContentView):
2376         (WebInspector.HeapSnapshotClusterContentView.prototype._identifierForContentView):
2377         (WebInspector.HeapSnapshotClusterContentView.prototype._showContentViewForIdentifier):
2378         Include an "Object Graph" content view. This is unavailable in Diff views
2379         but is available for individual HeapSnapshots.
2380
2381         * UserInterface/Views/HeapSnapshotContentView.js: Renamed from Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.js.
2382         (WebInspector.HeapSnapshotContentView):
2383         (WebInspector.HeapSnapshotContentView.prototype.shown):
2384         (WebInspector.HeapSnapshotContentView.prototype.hidden):
2385         (WebInspector.HeapSnapshotContentView.prototype._sortDataGrid):
2386         (WebInspector.HeapSnapshotContentView.prototype._heapSnapshotDataGridTreeDidPopulate):
2387         (WebInspector.HeapSnapshotInstancesContentView):
2388         (WebInspector.HeapSnapshotObjectGraphContentView):
2389         Share and generalize a HeapSnapshot ContentView. The only differences are
2390         the DataGrid columns, DataGridTree class, and identifier prefix for settings.
2391
2392         * UserInterface/Views/HeapSnapshotDataGridTree.js: Renamed from Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesDataGridTree.js.
2393         (WebInspector.HeapSnapshotDataGridTree):
2394         (WebInspector.HeapSnapshotDataGridTree.buildSortComparator):
2395         (WebInspector.HeapSnapshotDataGridTree.prototype.get heapSnapshot):
2396         (WebInspector.HeapSnapshotDataGridTree.prototype.get visible):
2397         (WebInspector.HeapSnapshotDataGridTree.prototype.get popover):
2398         (WebInspector.HeapSnapshotDataGridTree.prototype.get popoverNode):
2399         (WebInspector.HeapSnapshotDataGridTree.prototype.set popoverNode):
2400         (WebInspector.HeapSnapshotDataGridTree.prototype.get children):
2401         (WebInspector.HeapSnapshotDataGridTree.prototype.appendChild):
2402         (WebInspector.HeapSnapshotDataGridTree.prototype.insertChild):
2403         (WebInspector.HeapSnapshotDataGridTree.prototype.removeChildren):
2404         (WebInspector.HeapSnapshotDataGridTree.prototype.set sortComparator):
2405         (WebInspector.HeapSnapshotDataGridTree.prototype.sort):
2406         (WebInspector.HeapSnapshotDataGridTree.prototype.shown):
2407         (WebInspector.HeapSnapshotDataGridTree.prototype.hidden):
2408         (WebInspector.HeapSnapshotDataGridTree.prototype.willDismissPopover):
2409         (WebInspector.HeapSnapshotDataGridTree.prototype.get alwaysShowRetainedSize):
2410         (WebInspector.HeapSnapshotDataGridTree.prototype.populateTopLevel):
2411         (WebInspector.HeapSnapshotDataGridTree.prototype.didPopulate):
2412         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get alwaysShowRetainedSize):
2413         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
2414         (WebInspector.HeapSnapshotInstancesDataGridTree):
2415         (WebInspector.HeapSnapshotObjectGraphDataGridTree.prototype.get alwaysShowRetainedSize):
2416         (WebInspector.HeapSnapshotObjectGraphDataGridTree.prototype.populateTopLevel):
2417         (WebInspector.HeapSnapshotObjectGraphDataGridTree):
2418
2419         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
2420         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
2421         Start using different previews based on instance type.
2422
2423         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populateError):
2424         Common preview error logic. Also, don't output "Internal object" next to things
2425         like Structure, InferredType, etc. Just don't output anything. Eventually, if
2426         we provide preview data, something will show, but for now nothing is fine.
2427
2428         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populateWindowPreview.inspectedPage_window_getLocationHref):
2429         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populateWindowPreview):
2430         Custom preview logic for Window's gets `window.location.href` on the instance if it is alive.
2431
2432         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
2433         Normal preview logic.
2434
2435         * UserInterface/Views/HeapSnapshotInstancesContentView.css:
2436         (.heap-snapshot > .data-grid tr:not(.selected) td .preview-error): Deleted.
2437         The red text for errors was standing out too much. Make it the default black.
2438
2439         * UserInterface/Views/HeapAllocationsTimelineView.js:
2440         (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
2441         Better variable name.
2442
2443         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2444         (WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.inspectedPage_evalResult_getArrayCompletions):
2445         (WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.inspectedPage_evalResult_getCompletions):
2446         (WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.getArrayCompletions): Deleted.
2447         (WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.getCompletions): Deleted.
2448         (WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
2449         Try to be clearer about functions that run on the inspected page
2450         by using the pattern with inspectedPage_<thisObject>_functionName.
2451
2452 2016-05-05  Nikita Vasilyev  <nvasilyev@apple.com>
2453
2454         Web Inspector: Console is unresponsive for >10 seconds when it tries to render 10,000 messages
2455         https://bugs.webkit.org/show_bug.cgi?id=157368
2456         <rdar://problem/26103657>
2457
2458         Reviewed by Timothy Hatcher.
2459
2460         Render only up to 100 messages per animation frame to keep the Inspector's UI responsive.
2461
2462         * UserInterface/Controllers/JavaScriptLogViewController.js:
2463         (WebInspector.JavaScriptLogViewController.prototype.renderPendingMessages):
2464
2465 2016-05-05  Joseph Pecoraro  <pecoraro@apple.com>
2466
2467         Crash if you type "debugger" in the console and continue
2468         https://bugs.webkit.org/show_bug.cgi?id=156924
2469         <rdar://problem/25884189>
2470
2471         Reviewed by Mark Lam.
2472
2473         * UserInterface/Test/InspectorProtocol.js:
2474         (InspectorProtocol.sendCommand):
2475         Simplify sending a command with no parameters.
2476
2477 2016-05-04  Nikita Vasilyev  <nvasilyev@apple.com>
2478
2479         REGRESSION (r200401): Web Inspector: TypeError: undefined is not an object (evaluating 'messageElement.classList')
2480         https://bugs.webkit.org/show_bug.cgi?id=157356
2481         <rdar://problem/26097424>
2482
2483         Reviewed by Timothy Hatcher.
2484
2485         * UserInterface/Views/LogContentView.js:
2486         (WebInspector.LogContentView.prototype._reappendProvisionalMessages):
2487         Don't filter messages since we already do that in didAppendConsoleMessageView.
2488
2489 2016-05-04  Joseph Pecoraro  <pecoraro@apple.com>
2490
2491         Web Inspector: GC Root Path sometimes does not go up to Window
2492         https://bugs.webkit.org/show_bug.cgi?id=156768
2493         <rdar://problem/25816131>
2494
2495         Reviewed by Geoffrey Garen.
2496
2497         * UserInterface/Proxies/HeapSnapshotNodeProxy.js:
2498         (WebInspector.HeapSnapshotNodeProxy.prototype.retainers):
2499         Include paths for debugging.
2500
2501         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
2502         (HeapSnapshot.prototype.shortestGCRootPath):
2503         (HeapSnapshot.prototype._isNodeGlobalObject):
2504         Prefer the shortest GC Root Path that contains a known
2505         global object, otherwise fallback to the shortest.
2506
2507         (HeapSnapshot.prototype.retainers):
2508         Include paths for debugging.
2509
2510 2016-05-03  Nikita Vasilyev  <nvasilyev@apple.com>
2511
2512         Web Inspector: Adding a new console message shouldn't modify DOM when the console log is hidden
2513         https://bugs.webkit.org/show_bug.cgi?id=155629
2514         <rdar://problem/25235470>
2515
2516         Reviewed by Timothy Hatcher.
2517
2518         Instead of rendering console messages right away, store them (in _pendingMessages)
2519         and render only when the console tab or the split console is visible.
2520         Also, batch rendering operations using requestAnimationFrame.
2521
2522         * UserInterface/Controllers/JavaScriptLogViewController.js:
2523         (WebInspector.JavaScriptLogViewController):
2524         Store console message views in _pendingMessages.
2525
2526         (WebInspector.JavaScriptLogViewController.prototype._appendConsoleMessageView):
2527         (WebInspector.JavaScriptLogViewController.prototype.renderPendingMessages):
2528         Use requestAnimationFrame batching. Run isScrolledToBottom() at most only once
2529         per batch.
2530
2531         (WebInspector.JavaScriptLogViewController.prototype.renderPendingMessagesSoon):
2532         (WebInspector.JavaScriptLogViewController.prototype._didRenderConsoleMessageView):
2533         There is no need to run scrollToBottom again.
2534
2535         * UserInterface/Views/ConsoleCommandView.js:
2536         (WebInspector.ConsoleCommandView):
2537         Move all DOM operations to a new render method.
2538
2539         (WebInspector.ConsoleCommandView.prototype.render):
2540         * UserInterface/Views/ConsoleMessageView.js:
2541         (WebInspector.ConsoleMessageView):
2542         (WebInspector.ConsoleMessageView.prototype.render):
2543         (WebInspector.ConsoleMessageView.prototype.set repeatCount):
2544         (WebInspector.ConsoleMessageView.prototype._renderRepeatCount):
2545         * UserInterface/Views/LogContentView.js:
2546         (WebInspector.LogContentView.prototype.shown):
2547         When the console tab or the split console is opened render all pending messages.
2548
2549         (WebInspector.LogContentView.prototype.didAppendConsoleMessageView):
2550         Don't call needsLayout on every added console message. Call it only once per
2551         requestAnimationFrame. Also, no need to scrollToBottom once again.
2552
2553         (WebInspector.LogContentView.prototype._messageAdded):
2554         (WebInspector.LogContentView.prototype._previousMessageRepeatCountUpdated):
2555         (WebInspector.LogContentView.prototype._scopeFromMessageLevel): Deleted.
2556         (WebInspector.LogContentView.prototype._markScopeBarItemUnread): Added.
2557         Rename _pulseScopeBarItemBorder. In the very first version the border was pulsing,
2558         but now we use small colored circles instead.
2559
2560 2016-05-03  Joseph Pecoraro  <pecoraro@apple.com>
2561
2562         Web Inspector: Give console.time/timeEnd a default label and warnings
2563         https://bugs.webkit.org/show_bug.cgi?id=157325
2564         <rdar://problem/26073290>
2565
2566         Reviewed by Timothy Hatcher.
2567
2568         * UserInterface/Models/NativeFunctionParameters.js:
2569         Update the convenience signature.
2570
2571 2016-05-03  Joseph Pecoraro  <pecoraro@apple.com>
2572
2573         Web Inspector: Update window.console function API description strings in Console
2574         https://bugs.webkit.org/show_bug.cgi?id=157298
2575
2576         Reviewed by Timothy Hatcher.
2577
2578         * UserInterface/Models/NativeFunctionParameters.js:
2579         * UserInterface/Views/ObjectTreePropertyTreeElement.js:
2580         (WebInspector.ObjectTreePropertyTreeElement.prototype._functionParameterString):
2581         The Console object changed how it works. Work with the new
2582         structure, and the older structure for legacy backends.
2583
2584 2016-05-03  Joseph Pecoraro  <pecoraro@apple.com>
2585
2586         Web Inspector: Allow format specifiers in console.assert and console.trace
2587         https://bugs.webkit.org/show_bug.cgi?id=157295
2588         <rdar://problem/26056039>
2589
2590         Reviewed by Timothy Hatcher.
2591
2592         * UserInterface/Views/ConsoleMessageView.js:
2593         (WebInspector.ConsoleMessageView.prototype._appendMessageTextAndArguments):
2594         Treat the first argument as a format specifier.
2595
2596 2016-05-02  Commit Queue  <commit-queue@webkit.org>
2597
2598         Unreviewed, rolling out r200337.
2599         https://bugs.webkit.org/show_bug.cgi?id=157294
2600
2601         Console hangs when evaluating expresisons (Requested by
2602         JoePeck on #webkit).
2603
2604         Reverted changeset:
2605
2606         "Web Inspector: Adding a new console message shouldn't modify
2607         DOM when the console log is hidden"
2608         https://bugs.webkit.org/show_bug.cgi?id=155629
2609         http://trac.webkit.org/changeset/200337
2610
2611 2016-05-02  Joseph Pecoraro  <pecoraro@apple.com>
2612
2613         Web Inspector: Unexpected "Script Element #" resources in Debugger Sidebar
2614         https://bugs.webkit.org/show_bug.cgi?id=157280
2615
2616         Reviewed by Timothy Hatcher.
2617
2618         * UserInterface/Views/DebuggerSidebarPanel.js:
2619         (WebInspector.DebuggerSidebarPanel.prototype._addScript):
2620         Don't include Script Element resources in the debugger sidebar by default.
2621
2622 2016-05-02  Joseph Pecoraro  <pecoraro@apple.com>
2623
2624         Web Inspector: Prefer "Console Evaluation" to "Eval Code" if we know it was a console evaluation
2625         https://bugs.webkit.org/show_bug.cgi?id=157278
2626
2627         Reviewed by Timothy Hatcher.
2628
2629         * Localizations/en.lproj/localizedStrings.js:
2630         "Console Evaluation" string.
2631
2632         * UserInterface/Controllers/DebuggerManager.js:
2633         (WebInspector.DebuggerManager.prototype._sourceCodeLocationFromPayload): Deleted.
2634         Delete an assert that would throw when the location is noSourceID:-1:-1.
2635
2636         * UserInterface/Models/CallFrame.js:
2637         (WebInspector.CallFrame.fromDebuggerPayload):
2638         (WebInspector.CallFrame.fromPayload):
2639         (WebInspector.CallFrame):
2640         When this is in a Console Evalution provide better values.
2641
2642         * UserInterface/Models/GarbageCollection.js:
2643         (WebInspector.GarbageCollection):
2644         Drive-by address a common assertions seen while paused.
2645
2646 2016-05-02  Nikita Vasilyev  <nvasilyev@apple.com>
2647
2648         Web Inspector: Adding a new console message shouldn't modify DOM when the console log is hidden
2649         https://bugs.webkit.org/show_bug.cgi?id=155629
2650         <rdar://problem/25235470>
2651
2652         Reviewed by Timothy Hatcher.
2653
2654         Instead of rendering console messages right away, store them (in _pendingMessages)
2655         and render only when the console tab or the split console is visible.
2656         Also, batch rendering operations using requestAnimationFrame.
2657
2658         * UserInterface/Controllers/JavaScriptLogViewController.js:
2659         (WebInspector.JavaScriptLogViewController):
2660         Store console message views in _pendingMessages.
2661
2662         (WebInspector.JavaScriptLogViewController.prototype._appendConsoleMessageView):
2663         (WebInspector.JavaScriptLogViewController.prototype.renderPendingMessages):
2664         Use requestAnimationFrame batching. Run isScrolledToBottom() at most only once
2665         per batch.
2666
2667         (WebInspector.JavaScriptLogViewController.prototype.renderPendingMessagesSoon):
2668         (WebInspector.JavaScriptLogViewController.prototype._didRenderConsoleMessageView):
2669         There is no need to run scrollToBottom again.
2670
2671         * UserInterface/Views/ConsoleCommandView.js:
2672         (WebInspector.ConsoleCommandView):
2673         Move all DOM operations to a new render method.
2674
2675         (WebInspector.ConsoleCommandView.prototype.render):
2676         * UserInterface/Views/ConsoleMessageView.js:
2677         (WebInspector.ConsoleMessageView):
2678         (WebInspector.ConsoleMessageView.prototype.render):
2679         (WebInspector.ConsoleMessageView.prototype.set repeatCount):
2680         (WebInspector.ConsoleMessageView.prototype._renderRepeatCount):
2681         * UserInterface/Views/LogContentView.js:
2682         (WebInspector.LogContentView.prototype.shown):
2683         When the console tab or the split console is opened render all pending messages.
2684
2685         (WebInspector.LogContentView.prototype.didAppendConsoleMessageView):
2686         No need to scrollToBottom once again.
2687
2688         (WebInspector.LogContentView.prototype._messageAdded):
2689         (WebInspector.LogContentView.prototype._previousMessageRepeatCountUpdated):
2690         (WebInspector.LogContentView.prototype._scopeFromMessageLevel): Deleted.
2691         (WebInspector.LogContentView.prototype._markScopeBarItemUnread): Added.
2692         Rename _pulseScopeBarItemBorder. In the very first version the border was pulsing,
2693         but now we use small colored circles instead.
2694
2695 2016-05-02  Joseph Pecoraro  <pecoraro@apple.com>
2696
2697         Uncaught Exception: TypeError: null is not an object (evaluating 'sourceCodeLocation.formattedLineNumber')
2698         https://bugs.webkit.org/show_bug.cgi?id=157239
2699         <rdar://problem/26030791>
2700
2701         Reviewed by Timothy Hatcher.
2702
2703         * UserInterface/Controllers/IssueManager.js:
2704         (WebInspector.IssueManager.issueMatchSourceCode):
2705         Require a sourceCodeLocation for Script errors.
2706
2707         * UserInterface/Views/SourceCodeTextEditor.js:
2708         (WebInspector.SourceCodeTextEditor.prototype._addIssue):
2709         Be safe against a missing sourceCodeLocation.
2710
2711         * UserInterface/Views/SourceCodeTextEditor.css:
2712         (.source-code.text-editor > .CodeMirror .issue-widget.inline > .arrow):
2713         (@media (-webkit-min-device-pixel-ratio: 2)):
2714         Adjust the style, on non-Retina the inline message arrow would sometimes
2715         be detached from the warning message.
2716
2717 2016-05-02  Timothy Hatcher  <timothy@apple.com>
2718
2719         Web Inspector: Zooming of docked Web Inspector affects the webpage, but reset to 0 does not
2720         https://bugs.webkit.org/show_bug.cgi?id=157234
2721         rdar://problem/26027177
2722
2723         Always prevent default for the zoom keyboard shortcuts to avoid passing the event back to
2724         Safari to handle and add explicit beeps when max/min is hit.
2725
2726         Reviewed by Brian Burg.
2727
2728         * UserInterface/Base/Main.js:
2729         (WebInspector.contentLoaded): Removed setting implicitlyPreventsDefault on zoom keyboard shortcuts.
2730         (WebInspector._increaseZoom): Add explicit beep and remove preventDefault call.
2731         (WebInspector._decreaseZoom): Ditto.
2732
2733 2016-05-01  Dan Bernstein  <mitz@apple.com>
2734
2735         WebInspectorUI.framework/Versions/A/Resources/Images/Legacy is empty
2736         https://bugs.webkit.org/show_bug.cgi?id=157248
2737
2738         Reviewed by Timothy Hatcher.
2739
2740         * UserInterface/Images/Legacy: Removed.
2741
2742 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2743
2744         Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load
2745         https://bugs.webkit.org/show_bug.cgi?id=157198
2746         <rdar://problem/26011049>
2747
2748         Reviewed by Timothy Hatcher.
2749
2750         * UserInterface/Protocol/InspectorBackend.js:
2751         (InspectorBackendClass.prototype._sendCommandToBackendWithCallback):
2752         (InspectorBackendClass.prototype._sendCommandToBackendExpectingPromise):
2753         While auditing, use simpler check.
2754
2755         * UserInterface/Proxies/FormatterWorkerProxy.js:
2756         (WebInspector.FormatterWorkerProxy.canFormat): Deleted.
2757         While auditing, remove dead code.
2758
2759 2016-04-29  Timothy Hatcher  <timothy@apple.com>
2760
2761         Web Inspector: Scrolling in Timelines causes flashing of the DataGrid
2762         https://bugs.webkit.org/show_bug.cgi?id=157212
2763         rdar://problem/25994717
2764
2765         Listen for mousewheel events too so we can update the visible rows sooner.
2766
2767         Reviewed by Joseph Pecoraro.
2768
2769         * UserInterface/Views/DataGrid.js:
2770         (WebInspector.DataGrid): Call _updateScrollListeners.
2771         (WebInspector.DataGrid.prototype.set inline): Use _updateScrollListeners.
2772         (WebInspector.DataGrid.prototype.set variableHeightRows): Use _updateScrollListeners.
2773         (WebInspector.DataGrid.prototype._updateScrollListeners): Added. Listen for mousewheel too.
2774
2775 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2776
2777         Web Inspector: Jump to Line in auto formatted JavaScript does not work the first time
2778         https://bugs.webkit.org/show_bug.cgi?id=157194
2779         <rdar://problem/26008471>
2780
2781         Reviewed by Timothy Hatcher.
2782
2783         When doing asynchronous formatting we set the content of the editor
2784         twice. First to prime the editors back/foward list with the original
2785         content, and then again after we get the formatted content from the
2786         Worker, and then display the content.
2787
2788         The TextEditor attempts to reveal a position when the initial string
2789         has been set. Back when autoformatting was synchronous this was fine.
2790         Asynchronously however, this ends up happening between the original
2791         and formatted value. Also, the TextEditor has no idea that the
2792         SourceCodeTextEditor is going to format / defer displaying the
2793         contents. Add a "defer" property to the TextEditor that the
2794         SourceCodeTextEditor can use in this circumstance.
2795
2796         * UserInterface/Views/SourceCodeTextEditor.js:
2797         (WebInspector.SourceCodeTextEditor.prototype._populateWithContent):
2798         Avoid revealing a position when setting the original content. We will
2799         be formatting and we will want to reveal the position afterwards.
2800
2801         * UserInterface/Views/TextEditor.js:
2802         (WebInspector.TextEditor):
2803         (WebInspector.TextEditor.prototype.set deferReveal):
2804         Provide another reason to defer revealing.
2805
2806 2016-04-28  Joseph Pecoraro  <pecoraro@apple.com>
2807
2808         Web Inspector: FormatterWorker fails to find "External/Esprima.js" in Production builds
2809         https://bugs.webkit.org/show_bug.cgi?id=157162
2810         <rdar://problem/25996556>
2811
2812         Reviewed by Timothy Hatcher.
2813
2814         Workers have relative include paths. FormatterWorker has an includes
2815         that looks like:
2816
2817             importScripts(...[
2818                 "../../External/Esprima/esprima.js",
2819                 ...
2820             ]);
2821
2822         In optimized builds (Production) the esprima resources are combined
2823         and moved out of an External directory to "Esprima.js". We need to
2824         update the path of this include in optimized builds.
2825
2826         This adds a script to do some basic rewrites of paths. It will also
2827         produce a build error if there are any other External paths that
2828         may have been unhandled.
2829
2830         * Scripts/copy-user-interface-resources.pl:
2831         Run a new script to fix up the Worker imports for new pathes.
2832
2833         * Scripts/fix-worker-imports-for-optimized-builds.pl: Added.
2834         (fixWorkerImportsInFile):
2835         (fixWorkerImportsInDirectory):
2836         Replace "/External/Esprima/esprima.js" with "/Esprima.js" in imports.
2837         Fatal error for any unhandled "/External" lines that were not replaced.
2838
2839 2016-04-27  Joseph Pecoraro  <pecoraro@apple.com>
2840
2841         Web Inspector: Missing CSS autocompletion suggestions for -webkit-user-select
2842         https://bugs.webkit.org/show_bug.cgi?id=157104
2843
2844         Reviewed by Timothy Hatcher.
2845
2846         * UserInterface/Models/CSSKeywordCompletions.js:
2847
2848 2016-04-26  Joseph Pecoraro  <pecoraro@apple.com>
2849
2850         Web Inspector: Clarify Heap Snapshot instance Retained Size by hiding retained size of non-dominated children
2851         https://bugs.webkit.org/show_bug.cgi?id=157018
2852
2853         Reviewed by Timothy Hatcher.
2854
2855         * UserInterface/Proxies/HeapSnapshotNodeProxy.js:
2856         (WebInspector.HeapSnapshotNodeProxy):
2857         (WebInspector.HeapSnapshotNodeProxy.deserialize):
2858         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
2859         (HeapSnapshot.prototype.serializeNode):
2860         Include dominatorNodeIdentifier in the default proxy properties.
2861
2862         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
2863         (WebInspector.HeapSnapshotInstanceDataGridNode):
2864         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.get node):
2865         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
2866         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._isDominatedByBase):
2867         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._isDominatedByNonBaseParent):
2868         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populate):
2869         * UserInterface/Views/HeapSnapshotInstancesContentView.css:
2870         (.heap-snapshot > .data-grid td .sub-retained):
2871         Save the base HeapSnapshotInstanceDataGridNode so that it can be referenced by
2872         children. When expanding an instance, hide the retained size for children
2873         that are not dominated by the base object. Show the retained size for children
2874         for children that are dominated. If dominated directly, show the size in the
2875         normal black. If dominated transitively, show the size in a dimmed gray.
2876
2877 2016-04-25  Matt Baker  <mattbaker@apple.com>
2878
2879         Web Inspector: hook up grid row filtering in the new Timelines UI
2880         https://bugs.webkit.org/show_bug.cgi?id=154924
2881         <rdar://problem/24934607>
2882
2883         Reviewed by Timothy Hatcher.
2884
2885         Re-implement timeline data grid filtering that previously existed in the
2886         navigation sidebar. This patch adds support for filter text, scope bars,
2887         and filtering based on ruler selection.
2888
2889         Multi-column filter support is now part of DataGrid. The grid checks compares
2890         filter text against cell data of type string. DataGridNode subclasses may
2891         provide custom string data for columns that format complex objects (such
2892         as SourceCodeLocations). Cells containing data of type number are not
2893         considered for filtering at this time.
2894
2895         * UserInterface/Views/DataGrid.js:
2896         (WebInspector.DataGrid):
2897         (WebInspector.DataGrid.prototype.set filterText):
2898         (WebInspector.DataGrid.prototype.get filterDelegate):
2899         (WebInspector.DataGrid.prototype.set filterDelegate):
2900         (WebInspector.DataGrid.prototype.filterDidChange):
2901         Called internally by the grid whenever the filter text or delegate changes.
2902         Also called by clients that implement a filter delegate, to inform the
2903         grid that a custom filter has changed.
2904
2905         (WebInspector.DataGrid.prototype.hasCustomFilters):
2906         (WebInspector.DataGrid.prototype.matchNodeAgainstCustomFilters):
2907         Calls the filter delegate, if it exists, and provides a hook for
2908         subclasses to provide custom filtering.
2909
2910         (WebInspector.DataGrid.prototype._applyFiltersToNode.matchTextFilter):
2911         (WebInspector.DataGrid.prototype._applyFiltersToNode.makeVisible):
2912         (WebInspector.DataGrid.prototype._applyFiltersToNode):
2913         Filters data grid nodes and fires filter events as needed.
2914         (WebInspector.DataGrid.prototype._hasFilterDelegate):
2915         Helper function.
2916         (WebInspector.DataGrid.prototype._updateVisibleRows):
2917         Exclude hidden nodes from revealed rows.
2918         (WebInspector.DataGrid.prototype._updateFilter):
2919         Filtering entry point, called on an animation frame. Updates visible
2920         rows if any node was filtered/unfiltered.
2921
2922         (WebInspector.DataGridNode):
2923         (WebInspector.DataGridNode.prototype.get filterableData):
2924         Gets an array of filterable strings for the node.
2925         (WebInspector.DataGridNode.prototype.refresh):
2926         Resets cached filterable strings.
2927         (WebInspector.DataGridNode.prototype.filterableDataForColumn):
2928         Can be overridden by subclasses to provide filterable text for complex
2929         cell data, like as objects formatted as document fragments.
2930
2931         * UserInterface/Views/LayoutTimelineDataGridNode.js:
2932         (WebInspector.LayoutTimelineDataGridNode.prototype.get data):
2933
2934         * UserInterface/Views/LayoutTimelineView.js:
2935         (WebInspector.LayoutTimelineView):
2936         Register grid and remove logic that has been moved to the base class.
2937         (WebInspector.LayoutTimelineView.prototype.filterDidChange):
2938         Update highlight after grid filter change.
2939         (WebInspector.LayoutTimelineView.prototype._dataGridSelectedNodeChanged):
2940         Update highlight when selection changes.
2941         (WebInspector.LayoutTimelineView.prototype.matchTreeElementAgainstCustomFilters): Deleted.
2942         (WebInspector.LayoutTimelineView.prototype.treeElementDeselected): Deleted.
2943         (WebInspector.LayoutTimelineView.prototype._dataGridFiltersDidChange): Deleted.
2944         (WebInspector.LayoutTimelineView.prototype._dataGridNodeSelected): Deleted.
2945         No longer needed.
2946
2947         * UserInterface/Views/NetworkTimelineView.js:
2948         (WebInspector.NetworkTimelineView):
2949         Register grid and remove logic that has been moved to the base class.
2950         (WebInspector.NetworkTimelineView.prototype.matchTreeElementAgainstCustomFilters): Deleted.
2951         (WebInspector.NetworkTimelineView.prototype._dataGridFiltersDidChange): Deleted.
2952         (WebInspector.NetworkTimelineView.prototype._dataGridNodeSelected): Deleted.
2953         No longer needed.
2954
2955         * UserInterface/Views/OverviewTimelineView.js:
2956         (WebInspector.OverviewTimelineView):
2957         Register grid and remove logic that has been moved to the base class.
2958         (WebInspector.OverviewTimelineView.prototype._dataGridNodeSelected): Deleted.
2959         No longer needed.
2960
2961         * UserInterface/Views/RenderingFrameTimelineView.js:
2962         (WebInspector.RenderingFrameTimelineView):
2963         Register grid and remove logic that has been moved to the base class.
2964         (WebInspector.RenderingFrameTimelineView.prototype.get filterStartTime):
2965         (WebInspector.RenderingFrameTimelineView.prototype.get filterEndTime):
2966         Convert selection indices into filter start and end times.
2967         (WebInspector.RenderingFrameTimelineView.prototype.matchDataGridNodeAgainstCustomFilters):
2968         Perform custom filtering on rendering frame duration.
2969         (WebInspector.RenderingFrameTimelineView.prototype._scopeBarSelectionDidChange):
2970         Inform grid of custom filter change.
2971         (WebInspector.RenderingFrameTimelineView.prototype.matchTreeElementAgainstCustomFilters): Deleted.
2972         (WebInspector.RenderingFrameTimelineView.prototype._dataGridNodeSelected): Deleted.
2973         No longer needed.
2974
2975         * UserInterface/Views/ResourceTimelineDataGridNode.js:
2976         (WebInspector.ResourceTimelineDataGridNode.prototype.filterableDataForColumn):
2977         Use URL string for filtering "name" column.
2978
2979         * UserInterface/Views/ScriptClusterTimelineView.js:
2980         (WebInspector.ScriptClusterTimelineView.prototype.updateFilter):
2981         Forwarding for TimelineView API.
2982         (WebInspector.ScriptClusterTimelineView.prototype.matchDataGridNodeAgainstCustomFilters):
2983         (WebInspector.ScriptClusterTimelineView.prototype.matchTreeElementAgainstCustomFilters): Deleted.
2984         Renamed to matchDataGridNodeAgainstCustomFilters.
2985         (WebInspector.ScriptClusterTimelineView.prototype._scriptClusterViewCurrentContentViewDidChange): Deleted.
2986         Removed FIXME comment. Updating TimelineView times is sufficient to trigger filtering.
2987
2988         * UserInterface/Views/ScriptDetailsTimelineView.js:
2989         (WebInspector.ScriptDetailsTimelineView):
2990         Register grid and remove logic that has been moved to the base class.
2991         (WebInspector.ScriptDetailsTimelineView.prototype._dataGridFiltersDidChange): Deleted.
2992         (WebInspector.ScriptDetailsTimelineView.prototype._dataGridNodeSelected): Deleted.
2993         No longer needed.
2994
2995         * UserInterface/Views/ScriptTimelineDataGridNode.js:
2996         (WebInspector.ScriptTimelineDataGridNode.prototype.filterableDataForColumn):
2997         Use main title and subtitle strings for filtering "name" column.
2998         (WebInspector.ScriptTimelineDataGridNode.prototype._createNameCellDocumentFragment):
2999         (WebInspector.ScriptTimelineDataGridNode.prototype._subtitle):
3000         Break out for use in filterableDataForColumn.
3001
3002         * UserInterface/Views/TimelineDataGrid.js:
3003         (WebInspector.TimelineDataGrid):
3004         Cleanup variable names.
3005         (WebInspector.TimelineDataGrid.prototype.hasCustomFilters):
3006         Always true because filtering on ruler selection always occurs.
3007         (WebInspector.TimelineDataGrid.prototype.matchNodeAgainstCustomFilters):
3008         Match nodes against scope bar filters.
3009         (WebInspector.TimelineDataGrid.prototype._scopeBarSelectedItemsDidChange):
3010         Inform grid of custom filter change.
3011         (WebInspector.TimelineDataGrid.prototype.treeElementMatchesActiveScopeFilters): Deleted.
3012         Re-implemented as _nodeMatchesActiveScopeFilters.
3013         (WebInspector.TimelineDataGrid.prototype._updateScopeBarForcedVisibility): Deleted.
3014         Old UI. No longer needed.
3015
3016         * UserInterface/Views/TimelineDataGridNode.js:
3017         (WebInspector.TimelineDataGridNode.prototype.filterableDataForColumn):
3018         Filter strings for SourceCodeLocation and CallFrame objects.
3019
3020         * UserInterface/Views/TimelineRecordingContentView.js:
3021         (WebInspector.TimelineRecordingContentView):
3022         Listen for FilterBar changes and TimelineView record filtering.
3023         (WebInspector.TimelineRecordingContentView.prototype._filterDidChange):
3024         Update grid filters when filter bar changes.
3025         (WebInspector.TimelineRecordingContentView.prototype._recordWasFiltered):
3026         Update overview when records are filtered/unfiltered.
3027         (WebInspector.TimelineRecordingContentView.prototype.filterDidChange): Deleted.
3028         (WebInspector.TimelineRecordingContentView.prototype.recordWasFiltered): Deleted.
3029         (WebInspector.TimelineRecordingContentView.prototype.matchTreeElementAgainstCustomFilters.checkTimeBounds): Deleted.
3030         (WebInspector.TimelineRecordingContentView.prototype.matchTreeElementAgainstCustomFilters): Deleted.
3031         Re-implemented in DataGrid.
3032         (WebInspector.TimelineRecordingContentView.prototype._updateTimes): Deleted.
3033         FIXME comment removed. Filtering occurs when TimelineView times are updated.
3034         (WebInspector.TimelineRecordingContentView.prototype._timeRangeSelectionChanged): Deleted.
3035
3036         * UserInterface/Views/TimelineView.js:
3037         (WebInspector.TimelineView):
3038         (WebInspector.TimelineView.prototype.get navigationItems):
3039         Used by TimelineRecordingContentView to add scope bar items to the
3040         lower content browser's navigation bar.
3041
3042         (WebInspector.TimelineView.prototype.set startTime):
3043         (WebInspector.TimelineView.prototype.set endTime):
3044         (WebInspector.TimelineView.prototype.set currentTime):
3045         Update grid filter when recording times change.
3046         (WebInspector.TimelineView.prototype.get filterStartTime):
3047         (WebInspector.TimelineView.prototype.get filterEndTime):
3048         Let subclasses (RenderingFrameTimelineView) provide filter start/end times.
3049         (WebInspector.TimelineView.prototype.setupDataGrid):
3050         Register the grid used by the TimelineView subclass, allowing the base
3051         class to hook into common event listeners and provide boilerplate functionality.
3052
3053         (WebInspector.TimelineView.prototype.updateFilter):
3054         For data grid views, updates grid filters and sets new filter text.
3055         (WebInspector.TimelineView.prototype.matchDataGridNodeAgainstCustomFilters):
3056         (WebInspector.TimelineView.prototype.dataGridMatchNodeAgainstCustomFilters.checkTimeBounds):
3057         (WebInspector.TimelineView.prototype.dataGridMatchNodeAgainstCustomFilters):
3058         DataGrid filter delegate. Lets subclasses apply custom filters first,
3059         then filters based on ruler selection if needed.
3060
3061         (WebInspector.TimelineView.prototype.filterDidChange):
3062         Hook for subclasses to respond to filter changes.
3063         (WebInspector.TimelineView.prototype._filterTimesDidChange.delayedWork):
3064         (WebInspector.TimelineView.prototype._filterTimesDidChange):
3065         Helper function for coalescing ruler selection updates into a single
3066         filter update.
3067
3068         (WebInspector.TimelineView.prototype.matchTreeElementAgainstCustomFilters): Deleted.
3069         (WebInspector.TimelineView.prototype.filterUpdated): Deleted.
3070         No longer needed.
3071
3072 2016-04-25  Joseph Pecoraro  <pecoraro@apple.com>
3073
3074         Web Inspector: React.js JSXTransformer produces bogus error locations
3075         https://bugs.webkit.org/show_bug.cgi?id=150010
3076         <rdar://problem/23062233>
3077
3078         Reviewed by Timothy Hatcher.
3079
3080         Show dynamically added <script> elements added to a frame as resources.
3081         For cases where the scripts had source map resources or error messages
3082         we have a root from which to associate them to.
3083
3084         * Localizations/en.lproj/localizedStrings.js:
3085         "Script Element %d" tree element title.
3086
3087         * UserInterface/Models/Frame.js:
3088         (WebInspector.Frame.prototype.commitProvisionalLoad):
3089         (WebInspector.Frame.prototype.get extraScripts):
3090         (WebInspector.Frame.prototype.addExtraScript):
3091         Have a frame keep a list of its extra scripts.
3092
3093         * UserInterface/Models/Script.js:
3094         (WebInspector.Script):
3095         (WebInspector.Script.prototype.get displayName):
3096         (WebInspector.Script.prototype.get dynamicallyAddedScriptElement):
3097         Identify dynamically added script elements and associate them
3098         with the frame, instead of the frame's main resource.
3099
3100         * UserInterface/Views/FrameTreeElement.js:
3101         (WebInspector.FrameTreeElement.prototype.onpopulate):
3102         (WebInspector.FrameTreeElement.prototype._extraScriptAdded):
3103         Show named / source mapped dynamic script elements under a frame.
3104
3105         * UserInterface/Views/ResourceSidebarPanel.js:
3106         (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
3107         Dynamically added script element Scripts will be added by the frame that
3108         owns them.
3109
3110         * UserInterface/Views/ScriptTreeElement.js:
3111         (WebInspector.ScriptTreeElement):
3112         Don't include a subtitle for dynamicallyAddedScriptElement, details match
3113         the frame that owns them.
3114
3115 2016-04-25  Joseph Pecoraro  <pecoraro@apple.com>
3116
3117         Web Inspector: Line error widget showed in the wrong resource
3118         https://bugs.webkit.org/show_bug.cgi?id=150009
3119         <rdar://problem/23062199>
3120
3121         Reviewed by Timothy Hatcher.
3122
3123         This addresses a few long standing issues:
3124
3125             - IssueMessage and ConsoleMessage should not fight eachother
3126             - Displayed issue messages now correctly have format string formatting, e.g. console.error("Foo %s", str)
3127             - IssueMessage wraps a ConsoleMessage, so we don't duplicate everything
3128             - Gives ConsoleMessage a sourceCodeLocation (lazy)
3129                 - Since a sourceCodeLocation can have the exact SourceCode, if it was a Script
3130                   without a Resource, we can only show the error in the Script's editor.            
3131
3132         * UserInterface/Models/CallFrame.js:
3133         (WebInspector.CallFrame.fromPayload):
3134         Prefer the script identifier lookup first. And from the Script go
3135         to a resource if possible. This allows us to distinguish a location
3136         that should be in a Script that doesn't have a Resource when there
3137         exists a Resource with the same URL. This will soon be the case
3138         for dyanamic <script> elements append to a document.
3139
3140         * UserInterface/Controllers/IssueManager.js:
3141         (WebInspector.IssueManager.issueMatchSourceCode):
3142         Consolidate all the different checks to this one function.
3143
3144         (WebInspector.IssueManager.prototype.issueWasAdded):
3145         Create IssueMessages with ConsoleMessages.
3146
3147         (WebInspector.IssueManager.prototype.issuesForSourceCode):
3148         Simplify now that we have the better check.
3149
3150         * UserInterface/Controllers/LogManager.js:
3151         (WebInspector.LogManager.prototype.messageWasAdded):
3152         Once a ConsoleMessage has been created (and modified `parameters` for us)
3153         create the IssueMessage if it was an issue.
3154
3155         * UserInterface/Models/ConsoleMessage.js:
3156         (WebInspector.ConsoleMessage.prototype.get sourceCodeLocation):
3157         Lazily create a source code from the best possible location. This can
3158         be the top call frame or the url/line/column combination.
3159
3160         * UserInterface/Models/IssueMessage.js:
3161         (WebInspector.IssueMessage):
3162         Creation and most properties just call through to a ConsoleMessage.
3163         The `type` and `text` are Issue specific. Anything that uses location
3164         data should use the sourceCodeLocation.
3165         
3166         (WebInspector.IssueMessage.prototype.saveIdentityToCookie):
3167         Fix implementation that didn't account for a null sourceCodeLocation.
3168
3169         (WebInspector.IssueMessage.prototype._formatTextIfNecessary):
3170         Basic text format message formatting.
3171
3172         * UserInterface/Protocol/ConsoleObserver.js:
3173         (WebInspector.ConsoleObserver.prototype.messageAdded):
3174         No longer call IssueMessage from the observer. Let LogManager trigger issues.
3175
3176         * UserInterface/Views/ContentView.js:
3177         (WebInspector.ContentView.createFromRepresentedObject):
3178         (WebInspector.ContentView.resolvedRepresentedObjectForRepresentedObject):
3179         (WebInspector.ContentView.isViewable):
3180         An IssueMessage represented object for an IssueMessageTreeElement should be
3181         restorable by just going to the sourceCodeLocation it references. This is
3182         identical to a Breakpoint.
3183
3184         * UserInterface/Views/IssueTreeElement.js:
3185         (WebInspector.IssueTreeElement.prototype._updateTitles):
3186         (WebInspector.IssueTreeElement):
3187         * UserInterface/Views/ResourceContentView.js:
3188         (WebInspector.ResourceContentView.prototype._issueWasAdded):
3189         * UserInterface/Views/SourceCodeTextEditor.js:
3190         (WebInspector.SourceCodeTextEditor.prototype._issueWasAdded):
3191         (WebInspector.SourceCodeTextEditor.prototype._addIssue):
3192         (WebInspector.SourceCodeTextEditor.prototype._reinsertAllIssues):
3193         (WebInspector.SourceCodeTextEditor.prototype._matchesIssue): Deleted.
3194         Update to use Issue's sourceCodeLocation or IssueManager's new APIs.
3195
3196 2016-04-24  Matt Baker  <mattbaker@apple.com>
3197
3198         Web Inspector: Can't sort by name/source code location columns in Timeline data grids
3199         https://bugs.webkit.org/show_bug.cgi?id=156965
3200         <rdar://problem/25898716>
3201
3202         Reviewed by Timothy Hatcher.
3203
3204         Add support for sorting SourceCodeLocation objects to TimelineDataGrid,
3205         and include a grid delegate so that views can extend sorting logic for
3206         other document fragment columns.
3207
3208         * UserInterface/Views/NetworkTimelineView.js:
3209         (WebInspector.NetworkTimelineView):
3210         (WebInspector.NetworkTimelineView.prototype.dataGridSortComparator):
3211         Sort "name" column by display name first, then resource URL.
3212
3213         * UserInterface/Views/ScriptDetailsTimelineView.js:
3214         (WebInspector.ScriptDetailsTimelineView):
3215         (WebInspector.ScriptDetailsTimelineView.prototype.dataGridSortComparator):
3216         Sort "name" column by display name first, then subtitle.
3217
3218         * UserInterface/Views/ScriptTimelineDataGridNode.js:
3219         (WebInspector.ScriptTimelineDataGridNode.prototype.get subtitle):
3220         Make subtitle accessible externally for sorting.
3221         (WebInspector.ScriptTimelineDataGridNode.prototype._createNameCellDocumentFragment):
3222         (WebInspector.ScriptTimelineDataGridNode):
3223
3224         * UserInterface/Views/TimelineDataGrid.js:
3225         (WebInspector.TimelineDataGrid):
3226         (WebInspector.TimelineDataGrid.prototype.get sortDelegate):
3227         (WebInspector.TimelineDataGrid.prototype.set sortDelegate):
3228         Fire a SortChanged event if the delegate changed and the grid is sorted.
3229         (WebInspector.TimelineDataGrid.prototype._sort):
3230         If a sort delegate exists, and it returns a numeric value, skip the
3231         default compare.
3232
3233         (WebInspector.TimelineDataGrid.prototype._sortComparator):
3234         Add support for sorting SourceCodeLocation columns.
3235
3236 2016-04-24  Matt Baker  <mattbaker@apple.com>
3237
3238         Web Inspector: Error when selecting a bar in the Frames timeline
3239         https://bugs.webkit.org/show_bug.cgi?id=156960
3240         <rdar://problem/25897955>
3241
3242         Reviewed by Timothy Hatcher.
3243
3244         Fixes timeline grid node selection when record selected in the overview.
3245         Adds general purpose `findNode` method to DataGrid.
3246
3247         * UserInterface/Views/DataGrid.js:
3248         (WebInspector.DataGrid.prototype.findNode):
3249         Basic find function for locating a grid node in linear time.
3250
3251         * UserInterface/Views/TimelineRecordingContentView.js:
3252         (WebInspector.TimelineRecordingContentView.prototype._recordSelected):
3253         Remove tree outline references, call generic select method.
3254
3255         * UserInterface/Views/TimelineView.js:
3256         (WebInspector.TimelineView.prototype.selectRecord):
3257         If a data grid was set, deselect current selection and select the node
3258         associated with the timeline record.
3259
3260 2016-04-24  Matt Baker  <mattbaker@apple.com>
3261
3262         Web Inspector: Events in JavaScript & Events timeline have no profile children
3263         https://bugs.webkit.org/show_bug.cgi?id=156627
3264         <rdar://problem/25749740>
3265
3266         Reviewed by Timothy Hatcher.
3267
3268         ProfileNodeDataGridNode should handle `populate` events when expanded.
3269         This was previously done by ProfileNodeTreeElement, which is no longer
3270         used in the Timelines tab.
3271
3272         * UserInterface/Views/ProfileDataGridNode.js:
3273         (WebInspector.ProfileDataGridNode.prototype._updateChildrenForModifiers):
3274         (WebInspector.ProfileDataGridNode.prototype._populate):
3275         (WebInspector.ProfileDataGridNode):
3276         DataGridNode sets `shouldRefreshChildren` to false after populating
3277         child nodes. No need to track with a separate flag.
3278
3279         * UserInterface/Views/ProfileNodeDataGridNode.js:
3280         (WebInspector.ProfileNodeDataGridNode):
3281         (WebInspector.ProfileNodeDataGridNode.prototype._populate):
3282
3283 2016-04-22  Matt Baker  <mattbaker@apple.com>
3284
3285         Web Inspector: HeapAllocationsTimeline grid should use built-in grid column icons
3286         https://bugs.webkit.org/show_bug.cgi?id=156934
3287
3288         Reviewed by Timothy Hatcher.
3289
3290         * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
3291         (WebInspector.HeapAllocationsTimelineDataGridNode):
3292         Use existing base class helper function to create main title text.
3293         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
3294         Add icon class names to cell, remove icon element.
3295
3296         * UserInterface/Views/HeapAllocationsTimelineView.js:
3297         (WebInspector.HeapAllocationsTimelineView):
3298         Turn on icons for the column.
3299
3300 2016-04-22  Timothy Hatcher  <timothy@apple.com>
3301
3302         Change an assert to a warn based on post review feedback.
3303
3304         https://bugs.webkit.org/show_bug.cgi?id=156919
3305         rdar://problem/25857118
3306
3307         Rubber-stamped by Joseph Pecoraro.
3308
3309         * UserInterface/Controllers/DebuggerManager.js:
3310         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
3311
3312 2016-04-22  Timothy Hatcher  <timothy@apple.com>
3313
3314         Web Inspector: Debugger statement in console does not provide any call frames and debugger UI is confused
3315
3316         https://bugs.webkit.org/show_bug.cgi?id=156919
3317         rdar://problem/25857118
3318
3319         This makes console expressions show up in the Debugger tab sidebar if a ScriptContentView is shown for them.
3320         We now also show call frames that originate from a console expression, so the call frames in the sidebar is not empty.
3321         Also fix a bug where when there are no call frames we auto resume the debugger and don't leave it in a broken state.
3322