Web Inspector: Line error widget showed in the wrong resource
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2016-04-25  Joseph Pecoraro  <pecoraro@apple.com>
2
3         Web Inspector: Line error widget showed in the wrong resource
4         https://bugs.webkit.org/show_bug.cgi?id=150009
5         <rdar://problem/23062199>
6
7         Reviewed by Timothy Hatcher.
8
9         This addresses a few long standing issues:
10
11             - IssueMessage and ConsoleMessage should not fight eachother
12             - Displayed issue messages now correctly have format string formatting, e.g. console.error("Foo %s", str)
13             - IssueMessage wraps a ConsoleMessage, so we don't duplicate everything
14             - Gives ConsoleMessage a sourceCodeLocation (lazy)
15                 - Since a sourceCodeLocation can have the exact SourceCode, if it was a Script
16                   without a Resource, we can only show the error in the Script's editor.            
17
18         * UserInterface/Models/CallFrame.js:
19         (WebInspector.CallFrame.fromPayload):
20         Prefer the script identifier lookup first. And from the Script go
21         to a resource if possible. This allows us to distinguish a location
22         that should be in a Script that doesn't have a Resource when there
23         exists a Resource with the same URL. This will soon be the case
24         for dyanamic <script> elements append to a document.
25
26         * UserInterface/Controllers/IssueManager.js:
27         (WebInspector.IssueManager.issueMatchSourceCode):
28         Consolidate all the different checks to this one function.
29
30         (WebInspector.IssueManager.prototype.issueWasAdded):
31         Create IssueMessages with ConsoleMessages.
32
33         (WebInspector.IssueManager.prototype.issuesForSourceCode):
34         Simplify now that we have the better check.
35
36         * UserInterface/Controllers/LogManager.js:
37         (WebInspector.LogManager.prototype.messageWasAdded):
38         Once a ConsoleMessage has been created (and modified `parameters` for us)
39         create the IssueMessage if it was an issue.
40
41         * UserInterface/Models/ConsoleMessage.js:
42         (WebInspector.ConsoleMessage.prototype.get sourceCodeLocation):
43         Lazily create a source code from the best possible location. This can
44         be the top call frame or the url/line/column combination.
45
46         * UserInterface/Models/IssueMessage.js:
47         (WebInspector.IssueMessage):
48         Creation and most properties just call through to a ConsoleMessage.
49         The `type` and `text` are Issue specific. Anything that uses location
50         data should use the sourceCodeLocation.
51         
52         (WebInspector.IssueMessage.prototype.saveIdentityToCookie):
53         Fix implementation that didn't account for a null sourceCodeLocation.
54
55         (WebInspector.IssueMessage.prototype._formatTextIfNecessary):
56         Basic text format message formatting.
57
58         * UserInterface/Protocol/ConsoleObserver.js:
59         (WebInspector.ConsoleObserver.prototype.messageAdded):
60         No longer call IssueMessage from the observer. Let LogManager trigger issues.
61
62         * UserInterface/Views/ContentView.js:
63         (WebInspector.ContentView.createFromRepresentedObject):
64         (WebInspector.ContentView.resolvedRepresentedObjectForRepresentedObject):
65         (WebInspector.ContentView.isViewable):
66         An IssueMessage represented object for an IssueMessageTreeElement should be
67         restorable by just going to the sourceCodeLocation it references. This is
68         identical to a Breakpoint.
69
70         * UserInterface/Views/IssueTreeElement.js:
71         (WebInspector.IssueTreeElement.prototype._updateTitles):
72         (WebInspector.IssueTreeElement):
73         * UserInterface/Views/ResourceContentView.js:
74         (WebInspector.ResourceContentView.prototype._issueWasAdded):
75         * UserInterface/Views/SourceCodeTextEditor.js:
76         (WebInspector.SourceCodeTextEditor.prototype._issueWasAdded):
77         (WebInspector.SourceCodeTextEditor.prototype._addIssue):
78         (WebInspector.SourceCodeTextEditor.prototype._reinsertAllIssues):
79         (WebInspector.SourceCodeTextEditor.prototype._matchesIssue): Deleted.
80         Update to use Issue's sourceCodeLocation or IssueManager's new APIs.
81
82 2016-04-24  Matt Baker  <mattbaker@apple.com>
83
84         Web Inspector: Can't sort by name/source code location columns in Timeline data grids
85         https://bugs.webkit.org/show_bug.cgi?id=156965
86         <rdar://problem/25898716>
87
88         Reviewed by Timothy Hatcher.
89
90         Add support for sorting SourceCodeLocation objects to TimelineDataGrid,
91         and include a grid delegate so that views can extend sorting logic for
92         other document fragment columns.
93
94         * UserInterface/Views/NetworkTimelineView.js:
95         (WebInspector.NetworkTimelineView):
96         (WebInspector.NetworkTimelineView.prototype.dataGridSortComparator):
97         Sort "name" column by display name first, then resource URL.
98
99         * UserInterface/Views/ScriptDetailsTimelineView.js:
100         (WebInspector.ScriptDetailsTimelineView):
101         (WebInspector.ScriptDetailsTimelineView.prototype.dataGridSortComparator):
102         Sort "name" column by display name first, then subtitle.
103
104         * UserInterface/Views/ScriptTimelineDataGridNode.js:
105         (WebInspector.ScriptTimelineDataGridNode.prototype.get subtitle):
106         Make subtitle accessible externally for sorting.
107         (WebInspector.ScriptTimelineDataGridNode.prototype._createNameCellDocumentFragment):
108         (WebInspector.ScriptTimelineDataGridNode):
109
110         * UserInterface/Views/TimelineDataGrid.js:
111         (WebInspector.TimelineDataGrid):
112         (WebInspector.TimelineDataGrid.prototype.get sortDelegate):
113         (WebInspector.TimelineDataGrid.prototype.set sortDelegate):
114         Fire a SortChanged event if the delegate changed and the grid is sorted.
115         (WebInspector.TimelineDataGrid.prototype._sort):
116         If a sort delegate exists, and it returns a numeric value, skip the
117         default compare.
118
119         (WebInspector.TimelineDataGrid.prototype._sortComparator):
120         Add support for sorting SourceCodeLocation columns.
121
122 2016-04-24  Matt Baker  <mattbaker@apple.com>
123
124         Web Inspector: Error when selecting a bar in the Frames timeline
125         https://bugs.webkit.org/show_bug.cgi?id=156960
126         <rdar://problem/25897955>
127
128         Reviewed by Timothy Hatcher.
129
130         Fixes timeline grid node selection when record selected in the overview.
131         Adds general purpose `findNode` method to DataGrid.
132
133         * UserInterface/Views/DataGrid.js:
134         (WebInspector.DataGrid.prototype.findNode):
135         Basic find function for locating a grid node in linear time.
136
137         * UserInterface/Views/TimelineRecordingContentView.js:
138         (WebInspector.TimelineRecordingContentView.prototype._recordSelected):
139         Remove tree outline references, call generic select method.
140
141         * UserInterface/Views/TimelineView.js:
142         (WebInspector.TimelineView.prototype.selectRecord):
143         If a data grid was set, deselect current selection and select the node
144         associated with the timeline record.
145
146 2016-04-24  Matt Baker  <mattbaker@apple.com>
147
148         Web Inspector: Events in JavaScript & Events timeline have no profile children
149         https://bugs.webkit.org/show_bug.cgi?id=156627
150         <rdar://problem/25749740>
151
152         Reviewed by Timothy Hatcher.
153
154         ProfileNodeDataGridNode should handle `populate` events when expanded.
155         This was previously done by ProfileNodeTreeElement, which is no longer
156         used in the Timelines tab.
157
158         * UserInterface/Views/ProfileDataGridNode.js:
159         (WebInspector.ProfileDataGridNode.prototype._updateChildrenForModifiers):
160         (WebInspector.ProfileDataGridNode.prototype._populate):
161         (WebInspector.ProfileDataGridNode):
162         DataGridNode sets `shouldRefreshChildren` to false after populating
163         child nodes. No need to track with a separate flag.
164
165         * UserInterface/Views/ProfileNodeDataGridNode.js:
166         (WebInspector.ProfileNodeDataGridNode):
167         (WebInspector.ProfileNodeDataGridNode.prototype._populate):
168
169 2016-04-22  Matt Baker  <mattbaker@apple.com>
170
171         Web Inspector: HeapAllocationsTimeline grid should use built-in grid column icons
172         https://bugs.webkit.org/show_bug.cgi?id=156934
173
174         Reviewed by Timothy Hatcher.
175
176         * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
177         (WebInspector.HeapAllocationsTimelineDataGridNode):
178         Use existing base class helper function to create main title text.
179         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
180         Add icon class names to cell, remove icon element.
181
182         * UserInterface/Views/HeapAllocationsTimelineView.js:
183         (WebInspector.HeapAllocationsTimelineView):
184         Turn on icons for the column.
185
186 2016-04-22  Timothy Hatcher  <timothy@apple.com>
187
188         Change an assert to a warn based on post review feedback.
189
190         https://bugs.webkit.org/show_bug.cgi?id=156919
191         rdar://problem/25857118
192
193         Rubber-stamped by Joseph Pecoraro.
194
195         * UserInterface/Controllers/DebuggerManager.js:
196         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
197
198 2016-04-22  Timothy Hatcher  <timothy@apple.com>
199
200         Web Inspector: Debugger statement in console does not provide any call frames and debugger UI is confused
201
202         https://bugs.webkit.org/show_bug.cgi?id=156919
203         rdar://problem/25857118
204
205         This makes console expressions show up in the Debugger tab sidebar if a ScriptContentView is shown for them.
206         We now also show call frames that originate from a console expression, so the call frames in the sidebar is not empty.
207         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.
208
209         Reviewed by Joseph Pecoraro.
210
211         * Localizations/en.lproj/localizedStrings.js: Updated.
212
213         * UserInterface/Base/Utilities.js:
214         (appendWebInspectorSourceURL): Don't append if another sourceURL is already added.
215         (appendWebInspectorConsoleEvaluationSourceURL): Added.
216         (isWebInspectorConsoleEvaluationScript): Added.
217         (isWebKitInternalScript): Return false for isWebInspectorConsoleEvaluationScript().
218
219         * UserInterface/Controllers/DebuggerManager.js:
220         (WebInspector.DebuggerManager.prototype.debuggerDidPause): Resume if call frames is empty. This is not as common now
221         since console expression call frames are not skipped.
222         (WebInspector.DebuggerManager.prototype.scriptDidParse): Change an early return for isWebInspectorInternalScript() that
223         was skipping adding internal scripts to the known script lists, but it should only do that when the debug UI is disabled.
224
225         * UserInterface/Controllers/JavaScriptLogViewController.js:
226         (WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
227         Call appendWebInspectorConsoleEvaluationSourceURL so the console expressions are tagged before evaluateInInspectedWindow
228         added the internal sourceURL name.
229
230         * UserInterface/Models/Script.js:
231         (WebInspector.Script): Assign unique identifiers to console scripts so they are named correctly.
232         (WebInspector.Script.resetUniqueDisplayNameNumbers): Reset _nextUniqueConsoleDisplayNameNumber.
233         (WebInspector.Script.prototype.get displayName): Special case console expressions with a better name.
234
235         * UserInterface/Views/DebuggerSidebarPanel.js:
236         (WebInspector.DebuggerSidebarPanel.prototype.treeElementForRepresentedObject): Add a script tree element on demand
237         like the ResourceSidebarPanel does for anonymous scripts.
238         (WebInspector.DebuggerSidebarPanel.prototype._addScript): Return treeElement so treeElementForRepresentedObject can use it.
239
240 2016-04-21  Joseph Pecoraro  <pecoraro@apple.com>
241
242         Web Inspector: sourceMappingURL not loaded in generated script
243         https://bugs.webkit.org/show_bug.cgi?id=156022
244         <rdar://problem/25438595>
245
246         Reviewed by Geoffrey Garen.
247
248         * UserInterface/Controllers/SourceMapManager.js:
249         (WebInspector.SourceMapManager.prototype.downloadSourceMap):
250         If the sourceMapURL is a dataURL at this point, we can just pass it on,
251         otherwise we would have returned and skipped it.
252         
253         * UserInterface/Models/CallFrame.js:
254         (WebInspector.CallFrame.fromPayload):
255         Add handling for "scriptId" if it is available in the Console.CallFrame.
256         Don't automatically mark CallFrames that didn't have a "url" as native,
257         instead try to get a SourceCode.
258
259         * UserInterface/Models/Script.js:
260         (WebInspector.Script.prototype.get displayURL):
261         Used by SourceCodeLocation formatting, so behave more like Resources
262         when we have only have a sourceURL name. This produces output like:
263         "foo.js:#:#" instead of "foo.js (line #:#)"
264
265         (WebInspector.Script.prototype.get anonymous):
266         Easy accessor to see if this would be treated as anonymous or not.
267
268         * UserInterface/Models/SourceMap.js:
269         (WebInspector.SourceMap.prototype.get sourceMappingBasePathURLComponents):
270         Gracefully handle no path.
271
272         * UserInterface/Models/StackTrace.js:
273         (WebInspector.StackTrace.prototype.get firstNonNativeCallFrame):
274         (WebInspector.StackTrace.prototype.get firstNonNativeNonAnonymousCallFrame):
275         * UserInterface/Views/ConsoleMessageView.js:
276         (WebInspector.ConsoleMessageView.prototype._appendLocationLink):
277         Now that "Eval Code" with a sourceURL is no longer native, we still don't
278         want to show it in the Web Inspector if it is anonymous. So include a stricter
279         version that skips native and anonymous call frames.
280
281 2016-04-21  Joseph Pecoraro  <pecoraro@apple.com>
282
283         Web Inspector: Debugger statement gets a space after it when pretty printed
284         https://bugs.webkit.org/show_bug.cgi?id=156867
285         <rdar://problem/25862308>
286
287         Reviewed by Geoffrey Garen.
288
289         * Tools/Formatting/index.html:
290         * UserInterface/Workers/Formatter/EsprimaFormatter.js:
291         (EsprimaFormatter.prototype._handleTokenAtNode):
292         Handle the unhandled DebuggerStatement node type.
293
294 2016-04-20  Joseph Pecoraro  <pecoraro@apple.com>
295
296         Web Inspector: console.table(navigator) throws exception about `rowPreview.propertyPreviews.length`
297         https://bugs.webkit.org/show_bug.cgi?id=156698
298         <rdar://problem/25778244>
299
300         Reviewed by Timothy Hatcher.
301
302         * UserInterface/Views/ConsoleMessageView.js:
303         (WebInspector.ConsoleMessageView.prototype._formatParameterAsTable):
304         Handle a row with a value preview but no sub-property previews (a function).
305
306 2016-04-19  Timothy Hatcher  <timothy@apple.com>
307
308         Web Inspector: Use debounce proxies in a couple more places
309
310         https://bugs.webkit.org/show_bug.cgi?id=156759
311
312         Reviewed by Joseph Pecoraro.
313
314         * UserInterface/Views/ContentBrowser.js:
315         (WebInspector.ContentBrowser.prototype._dispatchCurrentRepresentedObjectsDidChangeEvent):
316         (WebInspector.ContentBrowser.prototype._contentViewSelectionPathComponentDidChange):
317         (WebInspector.ContentBrowser.prototype._contentViewSupplementalRepresentedObjectsDidChange):
318         (WebInspector.ContentBrowser.prototype._dispatchCurrentRepresentedObjectsDidChangeEventSoon): Deleted.
319         * UserInterface/Views/DOMTreeUpdater.js:
320         (WebInspector.DOMTreeUpdater.prototype._attributesUpdated):
321         (WebInspector.DOMTreeUpdater.prototype._characterDataModified):
322         (WebInspector.DOMTreeUpdater.prototype._nodeInserted):
323         (WebInspector.DOMTreeUpdater.prototype._nodeRemoved):
324         (WebInspector.DOMTreeUpdater.prototype._updateModifiedNodes):
325         (WebInspector.DOMTreeUpdater.prototype._updateModifiedNodesSoon): Deleted.
326         * UserInterface/Views/NavigationSidebarPanel.js:
327         (WebInspector.NavigationSidebarPanel):
328         (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
329         (WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
330         (WebInspector.NavigationSidebarPanel.prototype._treeElementDisclosureDidChange):
331         (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibilitySoon): Deleted.
332
333 2016-04-19  Timothy Hatcher  <timothy@apple.com>
334
335         Web Inspector: Make debounce use an ES6 Proxy
336
337         https://bugs.webkit.org/show_bug.cgi?id=156756
338         rdar://problem/25809771
339
340         Reviewed by Joseph Pecoraro.
341
342         * UserInterface/Base/Utilities.js:
343         (Object.prototype.soon): Added.
344         (Object.prototype.debounce): Added.
345         (Function.prototype.debounce): Deleted.
346         (Function.prototype.cancelDebounce): Added.
347
348         * UserInterface/Views/BezierEditor.js:
349         (WebInspector.BezierEditor.createBezierInput): Use new debounce proxy.
350         * UserInterface/Views/VisualStyleBackgroundPicker.js:
351         (WebInspector.VisualStyleBackgroundPicker): Ditto.
352         * UserInterface/Views/VisualStyleURLInput.js:
353         (WebInspector.VisualStyleURLInput): Ditto.
354
355 2016-04-19  Joseph Pecoraro  <pecoraro@apple.com>
356
357         Web Inspector: Picking Snapshot from navigation bar popup does to switch views
358         https://bugs.webkit.org/show_bug.cgi?id=156762
359
360         Reviewed by Timothy Hatcher.
361
362         * UserInterface/Views/TimelineDataGridNodePathComponent.js:
363         (WebInspector.TimelineDataGridNodePathComponent.prototype.get previousSibling):
364         (WebInspector.TimelineDataGridNodePathComponent.prototype.get nextSibling):
365         Wrong represented object provided by TimelineDataGridNodePathComponent.
366
367 2016-04-18  Timothy Hatcher  <timothy@apple.com>
368
369         Web Inspector: DataGrid should be virtualized so it only renders visible rows
370
371         https://bugs.webkit.org/show_bug.cgi?id=156663
372         rdar://problem/25765256
373
374         Reviewed by Joseph Pecoraro.
375
376         * UserInterface/Views/ComputedStyleDetailsPanel.js:
377         (WebInspector.ComputedStyleDetailsPanel.prototype.set containerRegions):
378         Call updateLayoutIfNeeded since we don't use views here.
379
380         * UserInterface/Views/ConsoleMessageView.js:
381         (WebInspector.ConsoleMessageView.prototype._formatParameterAsTable):
382         Set inline and variableHeightRows to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.
383
384         * UserInterface/Views/DOMTreeDataGrid.js:
385         (WebInspector.DOMTreeDataGrid):
386         Set inline to true, remove direct classList add.
387
388         * UserInterface/Views/DataGrid.css:
389         (.data-grid td):
390         (.data-grid table.data):
391         (.data-grid:not(.variable-height-rows) table.data):
392         (.data-grid:not(.variable-height-rows) table.data.odd-first-zebra-stripe):
393         (.data-grid.variable-height-rows table.data tr:nth-child(odd)):
394         (.data-grid.variable-height-rows table.data tr:nth-child(even)):
395         (.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(odd)):
396         (.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(even)):
397         (.data-grid.variable-height-rows table.data tr.filler):
398         Updated styles to support variable height rows directly and flipping the order of the stripes
399         when the virtual table starts at an odd row.
400
401         * UserInterface/Views/DataGrid.js:
402         (WebInspector.DataGrid): Added rowHeight and rows.
403         (WebInspector.DataGrid.prototype.get inline): Added.
404         (WebInspector.DataGrid.prototype.set inline): Added.
405         (WebInspector.DataGrid.prototype.get variableHeightRows): Added.
406         (WebInspector.DataGrid.prototype.set variableHeightRows): Added.
407         (WebInspector.DataGrid.prototype.layout): Call _updateVisibleRows.
408         (WebInspector.DataGrid.prototype._noteRowsChanged): Added.
409         (WebInspector.DataGrid.prototype._updateVisibleRows): Added.
410         (WebInspector.DataGrid.prototype._sortNodesCallback): Update to not use the DOM.
411         (WebInspector.DataGridNode.prototype.set hasChildren): Call needsLayout.
412         (WebInspector.DataGridNode.prototype.collapse): Call needsLayout.
413         (WebInspector.DataGridNode.prototype.expand): Call needsLayout.
414         (WebInspector.DataGridNode.prototype._attach): Call _noteRowsChanged.
415         (WebInspector.DataGridNode.prototype._detach): Call _noteRowsChanged.
416
417         * UserInterface/Views/DatabaseUserQuerySuccessView.js:
418         (WebInspector.DatabaseUserQuerySuccessView):
419         Set inline to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.
420
421         * UserInterface/Views/DetailsSection.css:
422         (.details-section > .content .data-grid td.value-column):
423         (.details-section > .content .data-grid table.data): Deleted.
424         (.details-section > .content .data-grid tr:nth-child(even)): Deleted.
425         (.details-section > .content .data-grid tr:nth-child(odd)): Deleted.
426         Now handled by DataGrid.css directly.
427
428         * UserInterface/Views/DetailsSectionDataGridRow.js:
429         (WebInspector.DetailsSectionDataGridRow.prototype.set dataGrid):
430         Set inline and variableHeightRows to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.
431
432         * UserInterface/Views/HeapSnapshotInstancesContentView.css:
433         (.heap-snapshot > .data-grid tr:matches(.selected, :hover) td .go-to-arrow):
434         (.heap-snapshot .icon):
435         Remove margin-top to fit inside 20px row instead of 21px.
436
437         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.css:
438         (.content-view.indexed-database-object-store > .data-grid table.data): Deleted.
439         (.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(even)): Deleted.
440         (.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(odd)): Deleted.
441         (.content-view.indexed-database-object-store > .data-grid table.data tr.filler): Deleted.
442         Now handled by DataGrid.css directly.
443
444         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
445         (WebInspector.IndexedDatabaseObjectStoreContentView):
446         Set variableHeightRows to true.
447
448         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
449         (WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
450         Set inline to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.
451
452         * UserInterface/Views/LogContentView.css:
453         (.console-item .data-grid table.data): Deleted.
454         (.console-item .data-grid table.data tr:nth-child(even)): Deleted.
455         Now handled by DataGrid.css directly.
456
457         * UserInterface/Views/NetworkGridContentView.css:
458         (.content-view.network-grid > .data-grid td): Deleted.
459         (.content-view.network-grid > .data-grid table.data): Deleted.
460         Now handled by DataGrid.css directly.
461
462         * UserInterface/Views/ProbeSetDataGrid.js:
463         (WebInspector.ProbeSetDataGrid):
464         Set inline to true, remove direct classList add.
465
466         * UserInterface/Views/ProfileView.css:
467         (.profile > .data-grid td .icon):
468         (.profile > .data-grid tr:matches(.selected, :hover) .go-to-arrow):
469         Remove margin-top to fit inside 20px row instead of 21px.
470
471         * UserInterface/Views/TimelineRecordingContentView.css:
472         (.content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid td): Deleted.
473         (.content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid table.data): Deleted.
474         Now handled by DataGrid.css directly.
475
476         * UserInterface/Views/Variables.css:
477         (:root): Added zebra stripe colors.
478
479 2016-04-19  Joseph Pecoraro  <pecoraro@apple.com>
480
481         REGRESSION (r199635) Web Inspector: Percentages in Heap Allocations view are too large
482         https://bugs.webkit.org/show_bug.cgi?id=156729
483         <rdar://problem/25796002>
484
485         Reviewed by Timothy Hatcher.
486
487         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
488         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
489         Fix callsite that failed to be updated once percentageString
490         required 0..1 input instead of 0..100.
491
492 2016-04-18  Timothy Hatcher  <timothy@apple.com>
493
494         Web Inspector: NavigationSidebarPanel does a lot of style recalc and layout on busy sites
495
496         https://bugs.webkit.org/show_bug.cgi?id=156704
497         rdar://problem/25778744
498
499         Reviewed by Brian Burg.
500
501         * UserInterface/Views/NavigationSidebarPanel.js:
502         (WebInspector.NavigationSidebarPanel):
503         (WebInspector.NavigationSidebarPanel.prototype._treeElementDisclosureDidChange):
504         Use _updateContentOverflowShadowVisibilitySoon in more places so the style recalc
505         and layout changes are coalesced into one action after all rapid fire calls.
506
507 2016-04-18  Timothy Hatcher  <timothy@apple.com>
508
509         Web Inspector: Database query result DataGrids have misaligned header columns
510
511         https://bugs.webkit.org/show_bug.cgi?id=156701
512         rdar://problem/25778310
513
514         Reviewed by Brian Burg.
515
516         * UserInterface/Views/DataGrid.js:
517         (WebInspector.DataGrid.prototype.autoSizeColumns): Set the width on the <col> element
518         for the body table to match the <col> in the header.
519
520 2016-04-18  Timothy Hatcher  <timothy@apple.com>
521
522         Web Inspector: Fix the debounce function
523
524         https://bugs.webkit.org/show_bug.cgi?id=156696
525         rdar://problem/25778133
526
527         Reviewed by Brian Burg.
528
529         * UserInterface/Base/Utilities.js:
530         (Function.prototype.debounce): Store the timeout on the original function instead
531         of the bound function. Also simplify the implementation with arrow functions
532         and eliminate the bind altogether.
533
534 2016-04-16  Matt Baker  <mattbaker@apple.com>
535
536         Web Inspector: Adopt Number.prototype.toLocaleString For All Sizes and Times
537         https://bugs.webkit.org/show_bug.cgi?id=152033
538         <rdar://problem/23815589>
539
540         Reviewed by Timothy Hatcher.
541
542         Update string formatters to localize float and percentage strings. Hook up
543         console message formatters to use String.standardFormatters so that console
544         statements (e.g. console.log("%.3f", 3.14159)) are properly formatted.
545
546         * Localizations/en.lproj/localizedStrings.js:
547         * UserInterface/Base/Utilities.js:
548         (value):
549         tokenizeFormatString should default to 6 digits when no precision
550         sub-specifier is provided.
551
552         percentageString should localize formatting, and take a fraction value
553         (0 to 1) instead of a percentage.
554
555         secondsToString should perform special-case formatting for zero values
556         ("0ms") instead of the general purpose float formatter.
557
558         (value.d):
559         Switch to parseInt to floor floating point values and support numeric strings.
560         Return NaN instead of zero when passed a value that can't be converted to integer.
561
562         (value.f):
563         Switch to parseFloat to support numeric strings, and localize formatting.
564         Remove precision check, as it will never be less than zero. Return NaN
565         instead of zero when passed a value that can't be converted to float.
566
567         (prettyFunctionName):
568         Convert substitutions (an arguments object) to an array before calling join.
569
570         * UserInterface/Views/ConsoleMessageView.js:
571         (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.floatFormatter):
572         Use String.standardFormatters.f.
573
574         (WebInspector.ConsoleMessageView.prototype._formatWithSubstitutionString.integerFormatter):
575         Use String.standardFormatters.d.
576
577         * UserInterface/Views/LayoutTimelineDataGridNode.js:
578         (WebInspector.LayoutTimelineDataGridNode.prototype.createCellContent):
579         (WebInspector.LayoutTimelineDataGridNode):
580         Use integer formatting for pixel values.
581
582         * UserInterface/Views/ProfileDataGridNode.js:
583         (WebInspector.ProfileDataGridNode.prototype._recalculateData):
584         (WebInspector.ProfileDataGridNode.prototype._totalTimeContent):
585         Treat percentage as a fraction from 0 to 1.
586
587         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
588         (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection):
589         Use integer formatting for pixel values.
590
591 2016-04-16  Matt Baker  <mattbaker@apple.com>
592
593         display:inline on the tbody is causing the width of the iframe to be shrunk to the minimum size of its text.
594         https://bugs.webkit.org/show_bug.cgi?id=15666
595
596         Reviewed by Timothy Hatcher.
597
598         Fix a regression caused by the recent Timelines UI redesign, and
599         reorder TimelineDataGrid's constructor arguments now that most
600         timeline views no longer have an associated tree outline.
601
602         * UserInterface/Views/HeapAllocationsTimelineView.js:
603         (WebInspector.HeapAllocationsTimelineView):
604         * UserInterface/Views/LayoutTimelineView.js:
605         (WebInspector.LayoutTimelineView):
606         * UserInterface/Views/NetworkGridContentView.js:
607         (WebInspector.NetworkGridContentView):
608         * UserInterface/Views/NetworkTimelineView.js:
609         (WebInspector.NetworkTimelineView):
610         * UserInterface/Views/RenderingFrameTimelineView.js:
611         (WebInspector.RenderingFrameTimelineView):
612         * UserInterface/Views/ScriptDetailsTimelineView.js:
613         (WebInspector.ScriptDetailsTimelineView):
614         Reorder constructor parameters and omit optional treeOutline and
615         synchronizerDelegate arguments when they aren't needed.
616
617         * UserInterface/Views/TimelineDataGrid.js:
618         (WebInspector.TimelineDataGrid):
619         Reorder constructor arguments so that treeOutline can be optional.
620         (WebInspector.TimelineDataGrid.prototype._refreshDirtyDataGridNodes):
621         Nodes should be refreshed and re-inserted in the data grid without
622         requiring a grid synchronizer. If a synchronizer exists, re-insert
623         the tree element for the node. Since the syncronizer is disabled the
624         order of grid/tree operations doesn't matter.
625
626 2016-04-15  Joseph Pecoraro  <pecoraro@apple.com>
627
628         Web Inspector: sourceMappingURL not used when sourceURL is set
629         https://bugs.webkit.org/show_bug.cgi?id=156021
630         <rdar://problem/25438417>
631
632         Reviewed by Timothy Hatcher.
633
634         Previously Debugger.sourceParsed only providing the sourceURL, and
635         wiping out the resourceURL, meant that a Script from a Resource that
636         set a sourceURL directive would fail to be associated with its Resource.
637
638         This would result in duplicated tree elements in the Resources Sidebar,
639         one for the Resource, and one for the Script. With the Script getting
640         ultimately getting the SourceMap resources. However, since the frontend
641         prefers Resources over Scripts when possible, an error that generated
642         from the script would point to a location in the Resource, not following
643         source maps.
644
645         By always providing the resource URL in Debugger.sourceParsed, a Script
646         can better be associated with its Resource. The result is now a single
647         shared tree element in the Resources Sidebar, and the Resource getting
648         the SourceMap resources. Now the script error goes through the Resource
649         to its SourceMap resources as we would expect.
650
651         * UserInterface/Protocol/DebuggerObserver.js:
652         (WebInspector.DebuggerObserver):
653         (WebInspector.DebuggerObserver.prototype.scriptParsed):
654         We now have to handle two different signatures of scriptParsed. One
655         for legacy, and one for non-legacy. Cache that value early on, since
656         scriptParsed happens a lot.
657
658         * UserInterface/Protocol/InspectorBackend.js:
659         (InspectorBackend.Agent.prototype.hasEventParameter):
660         Runtime check a protocol event to see if it has a parameter. This
661         is used to check if Debugger.sourceParsed is legacy or not based
662         on if it has the legacy "hasSourceURL" parameter.
663
664         * UserInterface/Models/Script.js:
665         (WebInspector.Script):
666         (WebInspector.Script.prototype.get sourceURL):
667         Treat sourceURL and url separately.
668
669         (WebInspector.Script.prototype.get displayName):
670         Handle both the url and sourceURL in displayName.
671
672         * UserInterface/Controllers/DebuggerManager.js:
673         (WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
674         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
675         (WebInspector.DebuggerManager.prototype.scriptDidParse):
676         * UserInterface/Protocol/RemoteObject.js:
677         (WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
678         Update code that checks the sourceURL to explicitly use sourceURL.
679
680         * UserInterface/Controllers/SourceMapManager.js:
681         (WebInspector.SourceMapManager.prototype.downloadSourceMap):
682         For legacy backends, or in case we get a resource that has an incomplete
683         baseURL, attempt to get an absolute URL based on the main resource.
684
685         * UserInterface/Views/DebuggerSidebarPanel.js:
686         (WebInspector.DebuggerSidebarPanel.prototype._addScript):
687         * UserInterface/Views/ResourceSidebarPanel.js:
688         (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
689         Ignore scripts without a url or sourceURL.
690
691 2016-04-14  Joseph Pecoraro  <pecoraro@apple.com>
692
693         Web Inspector: Cleanup inspector/debugger tests
694         https://bugs.webkit.org/show_bug.cgi?id=156619
695
696         Reviewed by Brian Burg.
697
698         * UserInterface/Base/Main.js:
699         (WebInspector.loaded):
700         * UserInterface/Controllers/DebuggerManager.js:
701         Remove agent checks for agents that are always available.
702
703 2016-04-14  Joseph Pecoraro  <pecoraro@apple.com>
704
705         Web Inspector: Add a JavaScript Formatting test for template strings
706         https://bugs.webkit.org/show_bug.cgi?id=156600
707
708         Reviewed by Brian Burg.
709
710         * Tools/Formatting/index.html:
711
712 2016-04-14  Carlos Garcia Campos  <cgarcia@igalia.com>
713
714         REGRESSION: Web Inspector: Remote inspector doesn't work
715         https://bugs.webkit.org/show_bug.cgi?id=156543
716
717         Reviewed by Timothy Hatcher.
718
719         WebSocket connection is blocked by CSP, but needed by the remote web inspector to work, so allow connect to ws
720         URLs from the web inspector. Also add stubs for zoomFactor and setZoomFactor to InspectorFrontendHostStub,
721         required after r199396.
722
723         * UserInterface/Base/InspectorFrontendHostStub.js:
724         (window.InspectorFrontendHost.WebInspector.InspectorFrontendHostStub.prototype.setZoomFactor):
725         (window.InspectorFrontendHost.WebInspector.InspectorFrontendHostStub.prototype.zoomFactor):
726         * UserInterface/Main.html:
727
728 2016-04-12  Brian Burg  <bburg@apple.com>
729
730         Web Inspector: save inspector's zoom factor as a persistent setting across sessions
731         https://bugs.webkit.org/show_bug.cgi?id=156522
732         <rdar://problem/25635774>
733
734         Reviewed by Timothy Hatcher.
735
736         * UserInterface/Base/Main.js:
737         (WebInspector.loaded):
738         Initialize the setting and immediately set the zoom before the frontend page loads.
739
740         (WebInspector._increaseZoom):
741         (WebInspector._decreaseZoom):
742         (WebInspector._resetZoom):
743         Use the internal get/set method which updates the WebInspector.Setting.
744
745         (WebInspector._setZoomFactor):
746         Added. Round-trip through the frontend host method in case it further clamps the value.
747
748         (WebInspector._zoomFactor):
749         Added. Just return the setting, since there's no other way for zoom to have changed.
750
751 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
752
753         Web Inspector: Show the normal Native icon for all Internal objects in Heap Snapshots
754         https://bugs.webkit.org/show_bug.cgi?id=156513
755
756         Reviewed by Timothy Hatcher.
757
758         * UserInterface/Views/HeapSnapshotClusterContentView.js:
759         (WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
760         Show the native icon for internal objects.
761
762 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
763
764         Web Inspector: Keyboard shortcut for "Inspect Element" only works when Web Inspector is open.
765         https://bugs.webkit.org/show_bug.cgi?id=111193
766         <rdar://problem/13325889>
767
768         Reviewed by Timothy Hatcher.
769
770         * UserInterface/Controllers/DOMTreeManager.js:
771         (WebInspector.DOMTreeManager.prototype.set inspectModeEnabled):
772         (WebInspector.DOMTreeManager.set inspectModeEnabled.callback):
773         * UserInterface/Protocol/InspectorFrontendAPI.js:
774         (InspectorFrontendAPI.setElementSelectionEnabled):
775         Frontend API to enable element selection.
776
777 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
778
779         Web Inspector: Should be able to expand Objects in Heap Allocations View to see exactly what it retains
780         https://bugs.webkit.org/show_bug.cgi?id=156419
781         <rdar://problem/25633863>
782
783         Reviewed by Timothy Hatcher.
784
785         * Localizations/en.lproj/localizedStrings.js:
786         * UserInterface/Main.html:
787         Remove strings, and fix sort.
788
789         * UserInterface/Models/HeapSnapshotRootPath.js:
790         (WebInspector.HeapSnapshotRootPath.pathComponentForIndividualEdge):
791         (WebInspector.HeapSnapshotRootPath.canPropertyNameBeDotAccess):
792         (WebInspector.HeapSnapshotRootPath.prototype.appendPropertyName):
793         (WebInspector.HeapSnapshotRootPath.prototype._canPropertyNameBeDotAccess):
794         Provide a helper to get an path component string for an individual edge.
795
796         * UserInterface/Models/PropertyPreview.js:
797         (WebInspector.PropertyPreview):
798         Fix an assert that may have errantly fired for an empty string name.
799
800         * UserInterface/Proxies/HeapSnapshotNodeProxy.js:
801         (WebInspector.HeapSnapshotNodeProxy):
802         (WebInspector.HeapSnapshotNodeProxy.deserialize):
803         Include "hasChildren" property in the original proxy message.
804
805         (WebInspector.HeapSnapshotNodeProxy.prototype.retainedNodes):
806         The method now also returns a list of edges for each of the retained nodes.
807
808         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
809         (WebInspector.HeapSnapshotInstanceDataGridNode):
810         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
811         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.sort):
812         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populate):
813         An instance DataGrid node can now show children. It can expand to show
814         its retained node graph.
815
816         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
817         (HeapSnapshot.instancesWithClassName):
818         (HeapSnapshot.prototype.dominatedNodes):
819         (HeapSnapshot.prototype.retainers):
820         (HeapSnapshot.prototype.serializeNode):
821         Remove unnecessary calls to bind in favor of using the `thisObject` argument.
822
823         (HeapSnapshot.prototype.retainedNodes):
824         Return a parallel list of edges for each of the nodes.
825
826         * UserInterface/Views/HeapSnapshotClassDataGridNode.js:
827         (WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):
828         (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate):
829         * UserInterface/Views/HeapSnapshotClusterContentView.js:
830         (WebInspector.HeapSnapshotClusterContentView.prototype.get summaryContentView):
831         (WebInspector.HeapSnapshotClusterContentView.prototype.get instancesContentView):
832         (WebInspector.HeapSnapshotClusterContentView.prototype.shown):
833         (WebInspector.HeapSnapshotClusterContentView):
834         (WebInspector.HeapSnapshotClusterContentView.prototype.get navigationItems): Deleted.
835         (WebInspector.HeapSnapshotClusterContentView.prototype._contentViewExtraArguments): Deleted.
836         (WebInspector.HeapSnapshotClusterContentView.prototype._toggleShowInternalObjectsSetting): Deleted.
837         (WebInspector.HeapSnapshotClusterContentView.prototype._updateViewsForShowInternalObjectsSettingValue): Deleted.
838         (WebInspector.HeapSnapshotClusterContentView.prototype._updateShowInternalObjectsButtonNavigationItem): Deleted.
839         * UserInterface/Views/HeapSnapshotInstancesContentView.js:
840         (WebInspector.HeapSnapshotInstancesContentView):
841         (WebInspector.HeapSnapshotInstancesContentView.prototype.get showInternalObjects): Deleted.
842         (WebInspector.HeapSnapshotInstancesContentView.prototype.set showInternalObjects): Deleted.
843         * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js:
844         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype._populateTopLevel):
845         (WebInspector.HeapSnapshotInstancesDataGridTree):
846         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get includeInternalObjects): Deleted.
847         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.set includeInternalObjects): Deleted.
848         * UserInterface/Views/HeapSnapshotSummaryContentView.js:
849         Remove the show/hide internal objects button. In the Instances view we will
850         only show non-Internal objects at the top level, and show internal objects
851         when those instances are expanded.
852
853 2016-04-12  Matt Baker  <mattbaker@apple.com>
854
855         Web Inspector: clearing the console should exit all console groups
856         https://bugs.webkit.org/show_bug.cgi?id=156496
857         <rdar://problem/25676416>
858
859         Reviewed by Timothy Hatcher.
860
861         * UserInterface/Views/LogContentView.js:
862         (WebInspector.LogContentView.prototype._logCleared):
863         Reset nesting level to zero.
864
865 2016-04-11  Joseph Pecoraro  <pecoraro@apple.com>
866
867         Web Inspector: Tab Bar items get unreadable at narrow window widths, should collapse earlier
868         https://bugs.webkit.org/show_bug.cgi?id=156477
869
870         Reviewed by Timothy Hatcher.
871
872         * UserInterface/Views/TabBar.js:
873         (WebInspector.TabBar.prototype.layout):
874         Hide-titles sooner since a width of 60 results in only a few characters
875         and looks poor.
876
877 2016-04-11  Joseph Pecoraro  <pecoraro@apple.com>
878
879         Web Inspector: Unstyled nodes in ObjectTree previews look poor
880         https://bugs.webkit.org/show_bug.cgi?id=156475
881         <rdar://problem/25667351>
882
883         Reviewed by Timothy Hatcher.
884
885         * UserInterface/Views/ObjectPreviewView.js:
886         (WebInspector.ObjectPreviewView.prototype._appendPreview):
887         Treat nodes as simple values.
888
889         (WebInspector.ObjectPreviewView.prototype._initTitleElement):
890         (WebInspector.ObjectPreviewView.prototype._appendValuePreview):
891         Format nodes nicely, and treat them as lossy since they have properties.
892
893 2016-04-11  Joseph Pecoraro  <pecoraro@apple.com>
894
895         Web Inspector: HeapSnapshot instance property path popover should include a descriptive header
896         https://bugs.webkit.org/show_bug.cgi?id=156431
897         <rdar://problem/25633594>
898
899         Reviewed by Timothy Hatcher.
900
901         * Localizations/en.lproj/localizedStrings.js:
902         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
903         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendTitle):
904         Title for the popover. Because localization may change the location of the @1234
905         in the string, localize first with a placeholder, and then replace the placeholder
906         with the @1234 link.
907
908         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPath):
909         Give the table a container for extra padding.
910
911         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
912         Do not include the space before @1234 as part of the clickable link.
913
914         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler):
915         Include a title when the popover shows a root path.
916
917         * UserInterface/Views/HeapSnapshotInstancesContentView.css:
918         (.heap-snapshot-instance-popover-content > .title):
919         (.heap-snapshot-instance-popover-content):
920         (.heap-snapshot-instance-popover-content > .table-container):
921         (.heap-snapshot-instance-popover-content table):
922         Provide styles for the title. Let the title extend across the entire
923         popover horizontally, but pad the table so that it appears more
924         centered under the title. Because the table has border collapse we have
925         to wrap it in a container to give it back the padding we want.
926
927 2016-04-08  Joseph Pecoraro  <pecoraro@apple.com>
928
929         Web Inspector: XHRs and Web Worker scripts are not searchable
930         https://bugs.webkit.org/show_bug.cgi?id=154214
931         <rdar://problem/24643587>
932
933         Reviewed by Timothy Hatcher.
934
935         * UserInterface/Views/SearchSidebarPanel.js:
936         (WebInspector.SearchSidebarPanel.prototype.performSearch.resourceCallback):
937         (WebInspector.SearchSidebarPanel.prototype.performSearch.resourcesCallback):
938         Carry forward the requestId property if it is available.
939
940 2016-04-08  Joseph Pecoraro  <pecoraro@apple.com>
941
942         Web Inspector: Allocation snapshot hover persists after switching tabs
943         https://bugs.webkit.org/show_bug.cgi?id=156430
944         <rdar://problem/25633800>
945
946         Reviewed by Timothy Hatcher.
947
948         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
949         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler):
950         Don't show the popover if the tree is no longer visible.
951
952         * UserInterface/Views/HeapSnapshotInstancesContentView.js:
953         (WebInspector.HeapSnapshotInstancesContentView.prototype.shown):
954         * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js:
955         (WebInspector.HeapSnapshotInstancesDataGridTree):
956         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get visible):
957         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.shown):
958         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.hidden):
959         Give the tree a visible state and have its containing ContentView
960         update it with normal ContentView shown/hidden.
961
962         * UserInterface/Views/Popover.js:
963         We are presenting while we were dismissing, so completely clear the
964         dismissing state.
965
966 2016-04-08  Joseph Pecoraro  <pecoraro@apple.com>
967
968         JSContext Inspector: Fix asserts and uncaught exception showing Timeline Tab
969         https://bugs.webkit.org/show_bug.cgi?id=156411
970
971         Reviewed by Timothy Hatcher.
972
973         * UserInterface/Views/OverviewTimelineView.js:
974         (WebInspector.OverviewTimelineView):
975         (WebInspector.OverviewTimelineView.prototype.closed):
976         Gracefully handle if we do not have a Network Timeline.
977
978         * UserInterface/Views/TimelineTabContentView.js:
979         (WebInspector.TimelineTabContentView.prototype._changeViewMode):
980         This function is always called by the constructor, so the assert
981         is not useful since it can be called when FPS is not supported.
982
983 2016-04-08  Matt Baker  <mattbaker@apple.com>
984
985         Web Inspector: Attempting to dismiss a popover that is already being dismissed causes an error
986         https://bugs.webkit.org/show_bug.cgi?id=156385
987         <rdar://problem/25617962>
988
989         Reviewed by Timothy Hatcher.
990
991         The Popover element is removed from the DOM once it's fade-out transition
992         completes. Since Popover.dismiss proceeds as long as it's element has a
993         parent, successive calls to dismiss can run before the popover is removed.
994
995         Rather than rely on the presence of the popover in the DOM, set a "dismissing"
996         flag the first time dismiss is called, before the fade-out animation begins.
997
998         * UserInterface/Controllers/BreakpointPopoverController.js:
999         (WebInspector.BreakpointPopoverController.prototype._conditionCodeMirrorEscapeOrEnterKey):
1000         Check for null popover.
1001
1002         * UserInterface/Views/Popover.js:
1003         (WebInspector.Popover):
1004         (WebInspector.Popover.prototype.dismiss):
1005         Do nothing if already dismissing.
1006
1007         (WebInspector.Popover.prototype.handleEvent):
1008         Reset dismissing flag after style transition completes.
1009
1010 2016-04-08  Matt Baker  <mattbaker@apple.com>
1011
1012         Web Inspector: Quick Open fails to match pattern "bB" in file "abBc"
1013         https://bugs.webkit.org/show_bug.cgi?id=156398
1014
1015         Reviewed by Timothy Hatcher.
1016
1017         Correct an off-by-one error in the backtrack routine that set the dead
1018         branch index to the character just before the match that was popped.
1019         The dead branch index should equal the index of the popped match.
1020
1021         * UserInterface/Controllers/ResourceQueryController.js:
1022         (WebInspector.ResourceQueryController.prototype._findQueryMatches.backtrack):
1023         (WebInspector.ResourceQueryController.prototype._findQueryMatches):
1024
1025 2016-04-07  Matt Baker  <mattbaker@apple.com>
1026
1027         Web Inspector: OpenResourceDialog should keep its resources list up-to-date
1028         https://bugs.webkit.org/show_bug.cgi?id=155321
1029         <rdar://problem/25093890>
1030
1031         Reviewed by Timothy Hatcher.
1032
1033         The Quick Open dialog should listen for resource change events, refreshing
1034         the resource list and current query results as needed.
1035
1036         * UserInterface/Views/OpenResourceDialog.js:
1037         (WebInspector.OpenResourceDialog):
1038         (WebInspector.OpenResourceDialog.prototype.didDismissDialog):
1039         Unregister resource event handlers.
1040
1041         (WebInspector.OpenResourceDialog.prototype.didPresentDialog):
1042         Register resource event handlers and add main frame resources.
1043
1044         (WebInspector.OpenResourceDialog.prototype._addResource):
1045         Add resource to the query controller, if valid. Optionally suppress
1046         the potentially expensive filter update, which is useful when adding
1047         multiple resources at once.
1048
1049         (WebInspector.OpenResourceDialog.prototype._addResourcesForFrame):
1050         Add the entire frame resource tree and update dialog filter.
1051
1052         (WebInspector.OpenResourceDialog.prototype._mainResourceDidChange):
1053         (WebInspector.OpenResourceDialog.prototype._resourceWasAdded):
1054
1055 2016-04-07  Joseph Pecoraro  <pecoraro@apple.com>
1056
1057         Web Inspector: ProfileView source links are off by 1 line, worse in pretty printed code
1058         https://bugs.webkit.org/show_bug.cgi?id=156371
1059
1060         Reviewed by Timothy Hatcher.
1061
1062         * UserInterface/Views/ProfileDataGridNode.js:
1063         (WebInspector.ProfileDataGridNode.prototype._displayContent):
1064         Switch the 1-based locations in the CCT data structure to 0-based for SourceCodeLocation.
1065
1066 2016-04-07  Joseph Pecoraro  <pecoraro@apple.com>
1067
1068         Web Inspector: Uncaught Exception: No resource with given URL found
1069         https://bugs.webkit.org/show_bug.cgi?id=156259
1070         <rdar://problem/25564749>
1071
1072         Reviewed by Timothy Hatcher.
1073
1074         * UserInterface/Views/SourceCodeTextEditor.js:
1075         (WebInspector.SourceCodeTextEditor):
1076         SourceCode.prototype.requestContent will reject if it cannot load
1077         content for the given resource. In that case, we already have an
1078         earlier catch handler that displays an error message in the
1079         ContentView, so we shouldn't show an Uncaught Exception page.
1080         Really, we should not reject the original promise here, and
1081         instead resolve it with an object describing the error, but
1082         short term we should remove the uncaught exception handler for
1083         this case.
1084
1085 2016-04-07  Joseph Pecoraro  <pecoraro@apple.com>
1086
1087         Web Inspector: Take snapshot navigation button should match navigation button styles
1088         https://bugs.webkit.org/show_bug.cgi?id=156355
1089         <rdar://problem/25325172>
1090
1091         Reviewed by Timothy Hatcher.
1092
1093         * UserInterface/Images/Camera.svg: Added.
1094         * UserInterface/Views/HeapAllocationsTimelineView.js:
1095         (WebInspector.HeapAllocationsTimelineView):
1096         Use the new image for the navigation bar button.
1097
1098 2016-04-07  Joseph Pecoraro  <pecoraro@apple.com>
1099
1100         Web Inspector: Inspector hangs when trying to view a large XHR resource
1101         https://bugs.webkit.org/show_bug.cgi?id=144107
1102         <rdar://problem/20669463>
1103
1104         Reviewed by Timothy Hatcher.
1105
1106         Previously auto formatting (initial pretty print of source code) in TextEditor
1107         was done synchronously in this order:
1108         
1109           (1) revealing the Editor as soon as we have content
1110           (2) set the CodeMirror value
1111           (3) pretty print with the CodeMirror editor
1112           (4) set the CodeMirror value
1113               => Layout
1114           
1115         At the end, CodeMirror would layout once with the new content. This approach
1116         performs very poorly when step (3) is an asynchronous action, because it would
1117         mean CodeMirror would layout for both (2) and at the end (4) and the layout
1118         itself can be very costly if the content is minified and so has very long
1119         lines at the top of the file that need to be syntax highlighted and visible
1120         since we do not wrap.
1121
1122         This patch changes the order of operations to benefit asynchronous formatting.
1123         When SourceCodeTextEditor determines that it can autoformat it:
1124
1125           (1) set the CodeMirror value
1126           (2) pretty print to source text
1127           (3) reveal the Editor when pretty printing is done
1128           (4) set the CodeMirror value
1129               => Layout
1130
1131         This maintains the fact that to undo pretty printing we can just "undo" the
1132         editor to get the original text. This also means we only do a single
1133         CodeMirror layout, with the pretty printed and therefore more manageable
1134         source text for highlighting. It also means we continue to show a loading
1135         indicator in the editor while we are pretty printing. If this is truely
1136         done asynchronously, which is the case for JavaScript with FormatterWorker,
1137         then the loading indicator will animate smoothly.
1138
1139         This sequence also works with the traditional synchronous formatters,
1140         which we still have for CSS.
1141
1142         * UserInterface/Views/ContentView.js:
1143         (WebInspector.ContentView.contentViewForRepresentedObject):
1144         * UserInterface/Views/NavigationSidebarPanel.js:
1145         (WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
1146         (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
1147         BreakpointTreeElements can now be restored and reselected when its
1148         source code is null. Avoid deleting the pending cookie data if a
1149         ContentView was not shown for the resource. When the Breakpoint
1150         and SourceCode get hooked up, this code will run again and work.
1151
1152         * UserInterface/Views/ScriptContentView.js:
1153         (WebInspector.ScriptContentView.prototype._togglePrettyPrint):
1154         * UserInterface/Views/TextResourceContentView.js:
1155         (WebInspector.TextResourceContentView.prototype._togglePrettyPrint):
1156         * UserInterface/Views/TextContentView.js:
1157         (WebInspector.TextContentView.prototype._togglePrettyPrint):
1158         New API for toggling formatting, now that it is an async operation.
1159
1160         * UserInterface/Views/SourceCodeTextEditor.js:
1161         (WebInspector.SourceCodeTextEditor):
1162         (WebInspector.SourceCodeTextEditor.prototype.toggleTypeAnnotations):
1163         (WebInspector.SourceCodeTextEditor.prototype.prettyPrint):
1164         (WebInspector.SourceCodeTextEditor.prototype._populateWithContent):
1165         (WebInspector.SourceCodeTextEditor.prototype._proceedPopulateWithContent):
1166         (WebInspector.SourceCodeTextEditor.prototype._prepareEditorForInitialContent):
1167         (WebInspector.SourceCodeTextEditor.prototype._populateWithInlineScriptContent.scriptContentAvailable):
1168         (WebInspector.SourceCodeTextEditor.prototype._populateWithInlineScriptContent):
1169         (WebInspector.SourceCodeTextEditor.prototype._populateWithScriptContent):
1170         (WebInspector.SourceCodeTextEditor.prototype.textEditorUpdatedFormatting):
1171         (WebInspector.SourceCodeTextEditor.prototype._contentWillPopulate): Deleted.
1172         Move auto formatting logic into SourceCodeTextEditor, because it
1173         determines if content should be auto formatted, and it loads the
1174         initial content so it can determine when to show the editor for
1175         the first time.
1176
1177         When we get the initial content and determine we have to autoformat,
1178         setup the TextEditor, but don't proceed with WillPopulate/DidPopulate
1179         until after we have formatted text.
1180
1181         * UserInterface/Views/TextEditor.js:
1182         (WebInspector.TextEditor):
1183         (WebInspector.TextEditor.set string.update):
1184         (WebInspector.TextEditor.prototype.set string):
1185         (WebInspector.TextEditor.prototype.updateFormattedState):
1186         (WebInspector.TextEditor.prototype.hasFormatter):
1187         (WebInspector.TextEditor.prototype._format):
1188         (WebInspector.TextEditor.prototype.prettyPrint):
1189         (WebInspector.TextEditor.prototype._canUseFormatterWorker):
1190         (WebInspector.TextEditor.prototype._startWorkerPrettyPrint):
1191         (WebInspector.TextEditor.prototype._startCodeMirrorPrettyPrint):
1192         (WebInspector.TextEditor.prototype._finishPrettyPrint):
1193         (WebInspector.TextEditor.prototype._undoFormatting):
1194         (WebInspector.TextEditor.prototype._updateAfterFormatting):
1195         Break up the synchronous pretty printing code into multiple steps.
1196         One path can be asynchronous formatting via FormatterWorker, another
1197         path may be synchronous formatting using the CodeMirror formatters.
1198
1199         (WebInspector.TextEditor.prototype.set formatted): Deleted.
1200         Remove the synchronous `set formatted` setter. Replace with
1201         updateFormattedState().
1202
1203         (WebInspector.TextEditor.prototype.set autoFormat): Deleted.
1204         Remove the TextEditor's autoformat. Since formatting can be async, having
1205         the TextEditor showing and asynchronously format its initial contents is
1206         a recipe for poor performance causing multiple layouts of different content.
1207         Instead, autoformatting is handled by SourceCodeTextEditor, and TextEditor
1208         can then be shown when it has the right data.
1209
1210 2016-04-07  Joseph Pecoraro  <pecoraro@apple.com>
1211
1212         Web Inspector: Improve JavaScript pretty printing
1213         https://bugs.webkit.org/show_bug.cgi?id=156178
1214         <rdar://problem/25535719>
1215
1216         Reviewed by Timothy Hatcher.
1217
1218         Add a new EsprimaFormatter which pretty prints JavaScript source text
1219         using the Esprima AST and Tokens. Currently we use CodeMirror's
1220         tokenizer for pretty printing. By moving to Esprima for pretty
1221         printing we get a few advantages: (1) can be used within a Worker
1222         as there are no dependencies on DOM objects, (2) a full featured AST
1223         gives more context to handling individual tokens. One disadvantage
1224         is that Esprima requires valid input, so scripts with syntax errors
1225         will not work.
1226
1227         EsprimaFormatter works by:
1228         - Getting the Esprima AST and token stream.
1229         - Walk all AST nodes:
1230           - when entering an AST node, handle any tokens before the start of this node
1231           - when leaving an AST node, handle any tokens that were inside the node
1232         - Whenever we handle a new node or token check if we should preserve any
1233           newlines or comments that do not show up in the AST or token stream.
1234
1235         This allows us to handle any token based on its context. Currently the
1236         formatter prefers to operate on tokens based on their context. So the
1237         formatter has a case for each AST node type and handles the tokens
1238         within that AST node. A small exception is made to special case the
1239         handling of semicolons.
1240
1241         * Scripts/copy-user-interface-resources-dryrun.rb:
1242         Add a generic check for -h, -help, --help to print usage.
1243
1244         * Tools/Formatting/EsprimaFormatterDebug.js: Added.
1245         (EsprimaFormatterDebug):
1246         (EsprimaFormatterDebug.prototype.get debugText):
1247         (EsprimaFormatterDebug.prototype._pad):
1248         (EsprimaFormatterDebug.prototype._debugHeader):
1249         (EsprimaFormatterDebug.prototype._debugFooter):
1250         (EsprimaFormatterDebug.prototype._debug):
1251         (EsprimaFormatterDebug.prototype._debugComments):
1252         (EsprimaFormatterDebug.prototype._debugAfterProgramNode):
1253         (EsprimaFormatterDebug.prototype._before):
1254         (EsprimaFormatterDebug.prototype._after):
1255         * Tools/Formatting/codemirror-additions.css: Copied from Source/WebInspectorUI/Tools/PrettyPrinting/codemirror-additions.css.
1256         * Tools/Formatting/index.html: Added.
1257         * Tools/PrettyPrinting/codemirror-additions.css:
1258         (pre): Deleted.
1259         (a.download): Deleted.
1260         * Tools/PrettyPrinting/index.html:
1261         * Tools/PrettyPrinting/populate/jquery.min.js: Removed.
1262         Add a Formatter tool that is similiar to the PrettyPrinting tool but
1263         outputs debug information for Esprima tokens. This is useful for
1264         iterating on tests, performance measurements, and general debugging
1265         of token stream for any input.
1266
1267         * UserInterface/Controllers/FormatterSourceMap.js:
1268         (WebInspector.FormatterSourceMap.fromSourceMapData):
1269         (WebInspector.FormatterSourceMap.fromBuilder): Deleted.
1270         Switch to constructing with a common data objects, instead of a Builder.
1271
1272         * UserInterface/Main.html:
1273         * UserInterface/Test.html:
1274         New files and moved files.
1275
1276         * UserInterface/Proxies/FormatterWorkerProxy.js: Added.
1277         (WebInspector.FormatterWorkerProxy):
1278         (WebInspector.FormatterWorkerProxy.singleton):
1279         (WebInspector.FormatterWorkerProxy.canFormat):
1280         (WebInspector.FormatterWorkerProxy.prototype.formatJavaScript):
1281         (WebInspector.FormatterWorkerProxy.prototype.performAction):
1282         (WebInspector.FormatterWorkerProxy.prototype._postMessage):
1283         (WebInspector.FormatterWorkerProxy.prototype._handleMessage):
1284         Main world object which provides a static formatJavaScript action.
1285
1286         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
1287         (WebInspector.CSSStyleDeclarationTextEditor.prototype._formattedContentFromEditor):
1288         * UserInterface/Views/TextEditor.js:
1289         (WebInspector.TextEditor.prototype.prettyPrint.prettyPrintAndUpdateEditor):
1290         (WebInspector.TextEditor.prototype.prettyPrint):
1291         * UserInterface/Workers/Formatter/FormatterContentBuilder.js: Renamed from Source/WebInspectorUI/UserInterface/Controllers/FormatterContentBuilder.js.
1292         (FormatterContentBuilder):
1293         Simplify construction of a Builder. The constructor objects were always
1294         the same and often unnecessary. Also move out of the WebInspector
1295         namespace signifying it can be used within a Worker.
1296
1297         (FormatterContentBuilder.prototype.get originalContent): Deleted.
1298         (FormatterContentBuilder.prototype.get formattedContent): Deleted.
1299         (FormatterContentBuilder.prototype.get sourceMapData): Added.
1300         Simplify getting all the data needed for SourceMaps.
1301
1302         (FormatterContentBuilder.prototype.setOriginalLineEndings):
1303         A client may wish to pre-fill line endings instead of filling
1304         while building.
1305
1306         (FormatterContentBuilder.prototype.appendNewline):
1307         Auto-clear trailing whitespace on the previous line.
1308
1309         * UserInterface/Workers/Formatter/ESTreeWalker.js: Added.
1310         (ESTreeWalker):
1311         (ESTreeWalker.prototype.walk):
1312         (ESTreeWalker.prototype._walk):
1313         (ESTreeWalker.prototype._walkArray):
1314         (ESTreeWalker.prototype._walkChildren):
1315         Walk AST nodes in an ESTree format. Due to the spec's incompleteness
1316         this is essentially Esprima's ESTree.
1317
1318         * UserInterface/Workers/Formatter/EsprimaFormatter.js: Added.
1319         (EsprimaFormatter):
1320         (EsprimaFormatter.isWhitespace):
1321         (EsprimaFormatter.prototype.get formattedText):
1322         (EsprimaFormatter.prototype.get sourceMapData):
1323         (EsprimaFormatter.prototype._insertNewlinesBeforeToken):
1324         (EsprimaFormatter.prototype._insertComment):
1325         (EsprimaFormatter.prototype._insertSameLineTrailingComments):
1326         (EsprimaFormatter.prototype._insertCommentsAndNewlines):
1327         (EsprimaFormatter.prototype._before):
1328         (EsprimaFormatter.prototype._after):
1329         (EsprimaFormatter.prototype._isInForHeader):
1330         (EsprimaFormatter.prototype._isRangeWhitespace):
1331         (EsprimaFormatter.prototype._handleTokenAtNode):
1332         (EsprimaFormatter.prototype._exitNode):
1333         (EsprimaFormatter.prototype._afterProgram):
1334         Pretty print source text.
1335
1336         * UserInterface/Workers/Formatter/FormatterUtilities.js: Added.
1337         (Array.prototype.lastValue):
1338         (String.prototype.lineEndings):
1339         (isECMAScriptWhitespace):
1340         (isECMAScriptLineTerminator):
1341         Helpers used by the classes in the Worker code.
1342         
1343         * UserInterface/Workers/Formatter/FormatterWorker.js: Added.
1344         (FormatterWorker):
1345         (FormatterWorker.prototype.formatJavaScript):
1346         (FormatterWorker.prototype._handleMessage):
1347         Handle the formatJavaScript action.
1348
1349 2016-04-06  Matt Baker  <mattbaker@apple.com>
1350
1351         Web Inspector: Improve filtering in OpenResourceDialog
1352         https://bugs.webkit.org/show_bug.cgi?id=155324
1353         <rdar://problem/25094504>
1354
1355         Reviewed by Joseph Pecoraro and Timothy Hatcher.
1356
1357         * UserInterface/Base/Utilities.js:
1358         (value):
1359         Added String methods isLowerCase, isUpperCase, removeWhitespace.
1360
1361         * UserInterface/Controllers/ResourceQueryController.js: Added.
1362         (WebInspector.ResourceQueryController):
1363         (WebInspector.ResourceQueryController.prototype.addResource):
1364         (WebInspector.ResourceQueryController.prototype.removeResource):
1365         Add and remove the resources to be queried.
1366
1367         (WebInspector.ResourceQueryController.prototype.reset):
1368         Reset controller state. Current just clears resources.
1369
1370         (WebInspector.ResourceQueryController.prototype.executeQuery):
1371         Executes a query against the list of resources and returns a list of
1372         QueryResult objects, with at most one result per resource, ordered by
1373         descending rank.
1374
1375         The query string is stripped of whitespace characters and lowercased
1376         before use. Prior to running the query, resources undergo a one-time
1377         pre-processing step to locate special characters.
1378
1379         (WebInspector.ResourceQueryController.prototype._findQueryMatches.pushMatch):
1380         (WebInspector.ResourceQueryController.prototype._findQueryMatches.matchNextSpecialCharacter):
1381         (WebInspector.ResourceQueryController.prototype._findQueryMatches.backtrack):
1382         (WebInspector.ResourceQueryController.prototype._findQueryMatches):
1383         Returns a list of query matches for a single resource, along with metadata
1384         which is used to rank the matches. The algorithm attempts to match the
1385         entire query, first comparing each query character against "special" characters
1386         in the resource (commonly used filename separators, the first character,
1387         and camel-case word boundaries).
1388
1389         If there are remaining query characters after exhausting special characters,
1390         regular characters are matched starting from the last matched special
1391         character. Failing that, the algorithm attempts to find a match by backtracking.
1392         To backtrack, the last match is discarded and the query position decremented.
1393         If a special match is now the last match, matching starts again from the
1394         next character in the filename after the match. If a normal match is now
1395         the last match, keep discarding until a special match is found or no matches
1396         remain. The query fails if no matches remain. For example, consider:
1397
1398            Query: "abcd"
1399            Filename: "AxBcdCx"
1400
1401         The capital A, B, and C are all special characters, and are successfully
1402         matched with the first three query characters. Having exhausted the special
1403         characters the "d" at the end of the query is compared with the "x" at
1404         the end of the filename, and fails to match. Backtracking then kicks in.
1405         The last match, "C", is discarded and the search position in the query
1406         decremented. The search resumes after the next to last match, "B", and now
1407         matches the non-special characters "cd", yielding the following: "A Bcd  ".
1408
1409         (WebInspector.ResourceQueryController.prototype._findSpecialCharacterIndices):
1410         Pre-processing step for resources. Locates the positions of special
1411         characters in the resource filename. Special characters are defined as:
1412
1413            1. The first character
1414            2. Common filename separators, and the character immediately following.
1415            3. A capital letter that follows a lowercase character.
1416
1417         * UserInterface/Models/ResourceQueryMatch.js: Added.
1418         Helper class used internally by the controller and QueryResult classes.
1419         (WebInspector.ResourceQueryMatch):
1420         (WebInspector.ResourceQueryMatch.prototype.get type):
1421         (WebInspector.ResourceQueryMatch.prototype.get index):
1422         (WebInspector.ResourceQueryMatch.prototype.get queryIndex):
1423
1424         * UserInterface/Models/ResourceQueryResult.js: Added.
1425         Holds a resource that matched the executed query.
1426         (WebInspector.ResourceQueryResult):
1427         (WebInspector.ResourceQueryResult.prototype.get resource):
1428         (WebInspector.ResourceQueryResult.prototype.get rank):
1429         Ranking relative to other results returned by the query. Used by
1430         the ResourceQueryController to sort results.
1431
1432         (WebInspector.ResourceQueryResult.prototype.get matchingTextRanges):
1433         Get TextRanges for matching substrings in the resource display name.
1434
1435         (WebInspector.ResourceQueryResult.prototype._calculateRank):
1436         Calculate the rank of the result. Matches are scored based on the type
1437         of match (Special vs. Normal), the location of the match within the filename
1438         (matches closer to the beginning are scored higher), and whether the match
1439         is adjacent to the previous match.
1440
1441         Values assigned to each ranking criteria are somewhat arbitrary, and may
1442         be fine-tuned over time to produce better results.
1443
1444         (WebInspector.ResourceQueryResult.prototype._createMatchingTextRanges):
1445         (WebInspector.ResourceQueryResult.prototype.__test_createMatchesMask):
1446         Test API for visualizing matches. For a result returned from the query
1447         "abce", run against a filename "abcde", the mask is "a c e".
1448
1449         * UserInterface/Main.html:
1450         * UserInterface/Test.html:
1451         New files.
1452
1453         * UserInterface/Views/Dialog.js:
1454         (WebInspector.Dialog.prototype.dismiss):
1455         (WebInspector.Dialog.prototype.didDismissDialog):
1456         Add hook for subclasses to perform actions after on dialog dismissal.
1457
1458         * UserInterface/Views/OpenResourceDialog.js:
1459         (WebInspector.OpenResourceDialog):
1460         (WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline.createHighlightedTitleFragment):
1461         (WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline):
1462         Add tree elements for each QueryResult returned by the last query, creating
1463         titles with contiguous matching query characters wrapped in highlight spans.
1464
1465         (WebInspector.OpenResourceDialog.prototype.didDismissDialog):
1466         Clear resources from the ResourceQueryController.
1467         (WebInspector.OpenResourceDialog.prototype.didPresentDialog):
1468         Add resources to the ResourceQueryController.
1469         (WebInspector.OpenResourceDialog.prototype._updateFilter):
1470         Execute the filter text as a resource query.
1471
1472         * UserInterface/Views/TreeOutline.css:
1473         (.tree-outline.large .item .titles): Deleted.
1474         Line height too small, hid the bottom border of highlighted matches in
1475         tree element title spans. Removing the style had no negative visual impact
1476         on the Quick Open or Timelines tree outlines (the only "large" trees).
1477
1478 2016-04-05  Joseph Pecoraro  <pecoraro@apple.com>
1479
1480         Web Inspector: Do not create CodeMirror color/gradient markers in JavaScript resources
1481         https://bugs.webkit.org/show_bug.cgi?id=156278
1482         <rdar://problem/25570404>
1483
1484         Reviewed by Timothy Hatcher.
1485
1486         * UserInterface/Views/SourceCodeTextEditor.js:
1487         (WebInspector.SourceCodeTextEditor.prototype._hasStyleSheetContents):
1488         (WebInspector.SourceCodeTextEditor.prototype._updateEditableMarkers):
1489         Only spend the time to create style markers for style sheet contents.
1490
1491 2016-04-05  Timothy Hatcher  <timothy@apple.com>
1492
1493         Web Inspector: Make the Timelines sidebar wider
1494
1495         https://bugs.webkit.org/show_bug.cgi?id=156257
1496         rdar://problem/25564218
1497
1498         Reviewed by Joseph Pecoraro.
1499
1500         * UserInterface/Views/TimelineOverview.css:
1501         (.timeline-overview): Added. Set define --timeline-sidebar-width.
1502         (.timeline-overview > .navigation-bar.timelines): Use --timeline-sidebar-width.
1503         (.timeline-overview > .tree-outline.timelines): Ditto.
1504         (.timeline-overview > .scroll-container): Ditto.
1505         (.timeline-overview > .timeline-ruler): Ditto.
1506         (.timeline-overview > .graphs-container): Ditto.
1507
1508 2016-04-05  Timothy Hatcher  <timothy@apple.com>
1509
1510         Web Inspector: Command-Option-R opens Inspector details sidebar or Responsive Design Mode, should only do one
1511
1512         https://bugs.webkit.org/show_bug.cgi?id=156258
1513         rdar://problem/25483871
1514
1515         Reviewed by Joseph Pecoraro.
1516
1517         * UserInterface/Base/Main.js:
1518         (WebInspector.contentLoaded): Change shortcuts to Command-Option-0 and Command-Shift-0.
1519
1520 2016-04-05  Matt Baker  <mattbaker@apple.com>
1521
1522         Web Inspector: Should not allow selecting no Timelines when editing in Timeline tab
1523         https://bugs.webkit.org/show_bug.cgi?id=156223
1524         <rdar://problem/25552221>
1525
1526         Reviewed by Joseph Pecoraro.
1527
1528         * UserInterface/Views/TimelineOverview.js:
1529         (WebInspector.TimelineOverview):
1530         (WebInspector.TimelineOverview.prototype._startEditingInstruments):
1531         Register EnabledDidChange event handler for all tree elements.
1532
1533         (WebInspector.TimelineOverview.prototype._stopEditingInstruments):
1534         Unregister event handler for enabled tree elements. The rest are removed
1535         from the tree outline once editing has completed.
1536
1537         (WebInspector.TimelineOverview.prototype._timelineTreeElementEnabledDidChange):
1538         Enable "Done" button if at least one timeline is enabled.
1539
1540         * UserInterface/Views/TimelineTreeElement.js:
1541         Dispatch a new event, EnabledDidChange, when the checkbox state changes.
1542
1543         (WebInspector.TimelineTreeElement.prototype._showCheckbox):
1544         (WebInspector.TimelineTreeElement.prototype._clickHandler):
1545         (WebInspector.TimelineTreeElement.prototype._dispatchEnabledDidChangeEvent):
1546         (WebInspector.TimelineTreeElement):
1547
1548 2016-04-04  Joseph Pecoraro  <pecoraro@apple.com>
1549
1550         Uncaught Exception: Error: Can't make a ContentView for an unknown representedObject (ApplicationCacheManifest)
1551         https://bugs.webkit.org/show_bug.cgi?id=156139
1552         <rdar://problem/25511926>
1553
1554         Reviewed by Timothy Hatcher.
1555
1556         * UserInterface/Views/ContentView.js:
1557         (WebInspector.ContentView.createFromRepresentedObject):
1558         Improve the error message to get the name of the represented object.
1559
1560         * UserInterface/Views/NavigationSidebarPanel.js:
1561         (WebInspector.NavigationSidebarPanel.prototype._isTreeElementWithoutRepresentedObject):
1562         Treat ApplicationCacheManifestTreeElement like other Host elements. Nothing to save/show.
1563
1564         * UserInterface/Views/ApplicationCacheManifestTreeElement.js:
1565         (WebInspector.ApplicationCacheManifestTreeElement):
1566         * UserInterface/Views/DatabaseHostTreeElement.js:
1567         (WebInspector.DatabaseHostTreeElement):
1568         * UserInterface/Views/IndexedDatabaseHostTreeElement.js:
1569         (WebInspector.IndexedDatabaseHostTreeElement):
1570         Auto-expand these folders, as they are not useful when collapsed.
1571
1572 2016-04-04  Joseph Pecoraro  <pecoraro@apple.com>
1573
1574         Web Inspector: Uncaught exception in CSS with string "constructor" (WebInspector.Color.fromString())
1575         https://bugs.webkit.org/show_bug.cgi?id=156183
1576         <rdar://problem/25539279>
1577
1578         Reviewed by Brian Burg.
1579
1580         * UserInterface/Models/Color.js:
1581         (WebInspector.Color.fromString):
1582         Fix the uncaught exception issue. Only look at own properties of
1583         our keyword map to avoid values like "toString" and "constructor".
1584
1585         * UserInterface/Debug/UncaughtExceptionReporter.js:
1586         (handleError):
1587         (handleUncaughtException):
1588         (handleUncaughtExceptionRecord):
1589         Generalize uncaught exception handler error sheet to get
1590         exception records from both uncaught exceptions (window.onerror)
1591         and general Runtime Error objects (TypeError, etc).
1592
1593         * UserInterface/Base/Utilities.js:
1594         (window.promiseLogError.window.promiseLogError):
1595         Add a fallback log exception helper.
1596
1597         * UserInterface/Controllers/AnalyzerManager.js:
1598         (WebInspector.AnalyzerManager.prototype.getAnalyzerMessagesForSourceCode):
1599         * UserInterface/Views/SourceCodeTextEditor.js:
1600         (WebInspector.SourceCodeTextEditor):
1601         Add catch handlers to Promises to log exceptions.
1602
1603 2016-04-01  Joseph Pecoraro  <pecoraro@apple.com>
1604
1605         Unreviewed follow-up to r198968. Remove debug statements.
1606
1607         * Scripts/remove-console-asserts.pl:
1608         (removeConsoleAssertsInFile):
1609
1610 2016-04-01  Joseph Pecoraro  <pecoraro@apple.com>
1611
1612         Web Inspector: Remove console.asserts from Worker code in optimized builds
1613         https://bugs.webkit.org/show_bug.cgi?id=156124
1614         <rdar://problem/25505031>
1615
1616         Reviewed by Timothy Hatcher.
1617
1618         * Scripts/copy-user-interface-resources.pl:
1619         Remove console asserts on the Worker results directory.
1620
1621         * Scripts/remove-console-asserts.pl:
1622         (removeConsoleAssertsInFile):
1623         (removeConsoleAssertsInDirectory):
1624         Refactor into functions for a file and a file for
1625         recursing through directories.
1626
1627 2016-03-31  Joseph Pecoraro  <pecoraro@apple.com>
1628
1629         Web Inspector: ScriptSyntaxTree doesn't handle RestElement AST nodes
1630         https://bugs.webkit.org/show_bug.cgi?id=156085
1631
1632         Reviewed by Saam Barati.
1633
1634         * UserInterface/Models/ScriptSyntaxTree.js:
1635         (WebInspector.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration.gatherIdentifiers):
1636         (WebInspector.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration):
1637         When searching for identifiers in Function parameters, pass
1638         through the RestElement to its argument.
1639
1640         (WebInspector.ScriptSyntaxTree.prototype._recurse):
1641         (WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
1642         Create a ScriptSyntaxTree RestElement node.
1643         Also, every case in recurse visits the current
1644         node, so simplify the code!
1645
1646 2016-03-30  Joseph Pecoraro  <pecoraro@apple.com>
1647
1648         Remove unused ScriptProfiler.Samples.totalTime
1649         https://bugs.webkit.org/show_bug.cgi?id=156002
1650
1651         Reviewed by Saam Barati.
1652
1653         * UserInterface/Controllers/TimelineManager.js:
1654         (WebInspector.TimelineManager.prototype.scriptProfilerTrackingCompleted):
1655         * UserInterface/Models/CallingContextTree.js:
1656         (WebInspector.CallingContextTree.prototype.get totalExecutionTime): Deleted.
1657         (WebInspector.CallingContextTree.prototype.reset): Deleted.
1658         (WebInspector.CallingContextTree.prototype.increaseExecutionTime): Deleted.
1659         Remove unused totalExecutionTime.
1660
1661 2016-03-30  Joseph Pecoraro  <pecoraro@apple.com>
1662
1663         Web Inspector: Calculate more accurate time per-sample instead of assuming 1ms
1664         https://bugs.webkit.org/show_bug.cgi?id=155961
1665         <rdar://problem/25404505>
1666
1667         Reviewed by Geoffrey Garen.
1668
1669         Give each sample a duration based on the best time bounds we have available.
1670         Script Profiler Events give us time bounds for (nearly) all script evaluations.
1671         The only evaluations that are missed are Inspector scripts.
1672
1673         The duration per-sample is computed per-event:
1674
1675             durationPerSample = (event.endTime - event.startTime) / numSamplesInTimeRange.
1676
1677         If a 10ms Script Event contains 5 samples, they would each get a 2ms duration.
1678         If a 0.5ms Script Event contains 1 sample, it would get a 0.5ms duration.
1679
1680         We were seeing an average of 1.6-1.8ms per sample for events that had more
1681         than 3 samples.
1682
1683         * UserInterface/Controllers/TimelineManager.js:
1684         (WebInspector.TimelineManager.prototype.scriptProfilerTrackingCompleted):
1685         Associate a time duration per sample. For each Script Event we compute
1686         an average time for all the samples in the event and assign it to the sample.
1687
1688         * UserInterface/Models/CallingContextTree.js:
1689         (WebInspector.CallingContextTree.prototype.totalDurationInTimeRange):
1690         (WebInspector.CallingContextTree.prototype.numberOfSamplesInTimeRange): Deleted.
1691         Accumulate the duration by checking each sample. Number of samples
1692         is now meaningless.
1693         
1694         (WebInspector.CallingContextTree.prototype.updateTreeWithStackTrace):
1695         (WebInspector.CCTNode):
1696         (WebInspector.CCTNode.prototype.addTimestampAndExpressionLocation):
1697         Give CCTNodes a list of durations and leafDurations that parallels
1698         the timestamps and leafTimestamps lists of individual samples.
1699
1700         (WebInspector.CCTNode.prototype.filteredTimestampsAndDuration):
1701         (WebInspector.CCTNode.prototype.filteredLeafTimestampsAndDuration):
1702         (WebInspector.CCTNode.prototype.filteredTimestamps): Deleted.
1703         (WebInspector.CCTNode.prototype.numberOfLeafTimestamps): Deleted.
1704         Whenever we get a list of timestamps, also compute the duration
1705         of those timestamps at the same time.
1706
1707         * UserInterface/Views/ProfileDataGridNode.js:
1708         (WebInspector.ProfileDataGridNode):
1709         (WebInspector.ProfileDataGridNode.prototype._updateChildrenForModifiers):
1710         (WebInspector.ProfileDataGridNode.prototype._recalculateData):
1711         * UserInterface/Views/ProfileDataGridTree.js:
1712         (WebInspector.ProfileDataGridTree):
1713         (WebInspector.ProfileDataGridTree.prototype.get totalSampleTime):
1714         (WebInspector.ProfileDataGridTree.prototype._updateCurrentFocusDetails):
1715         (WebInspector.ProfileDataGridTree.prototype.get sampleInterval): Deleted.
1716         (WebInspector.ProfileDataGridTree.prototype.get numberOfSamples): Deleted.
1717         Instead of computing total time from (samples * sampleInterval),
1718         accumulate it by adding up the duration of each individual sample.
1719         Update the Profile Data Grid nodes to use the new calculations.
1720
1721 2016-03-29  Dana Burkart and Matthew Hanson  <dburkart@apple.com>
1722
1723         Web Inspector: JS PrettyPrinting in do/while loops, "while" should be on the same line as "}" if there was a closing brace
1724         https://bugs.webkit.org/show_bug.cgi?id=117616
1725         <rdar://problem/15796884>
1726
1727         Reviewed by Joseph Pecoraro.
1728
1729         This patch fixes the formatting of do / while loops in the WebInspector CodeFormatter.
1730
1731         Before:
1732             do {
1733               "x"
1734             }
1735             while (0);
1736
1737         After:
1738             do {
1739               "x"
1740             } while (0);
1741
1742         * UserInterface/Views/CodeMirrorFormatters.js:
1743         (shouldHaveSpaceBeforeToken):
1744         If we encounter a while token and the last token was a closing brace, we *should* add a space if that closing
1745         brace was closing a do block.
1746
1747         (removeLastNewline):
1748         If we encounter a while token and the last token was a closing brace, we *should not* add a newline if that closing
1749         brace closes a do block.
1750
1751         (modifyStateForTokenPre):
1752         We should keep track of the last token that we encountered before entering into a block. We do this by setting
1753         a lastContentBeforeBlock property on openBraceStartMarker / state objects.
1754
1755         In addition, this fixes a bug where we do not pop a state object off of openBraceStartMarkers if our indentCount
1756         is 0. Without doing this, we cannot reliably determine whether or not our while token needs to be inline or not.
1757
1758 2016-03-29  Joseph Pecoraro  <pecoraro@apple.com>
1759
1760         Web Inspector: REGRESSION: ⌘E and ⌘G text searching does not work
1761         https://bugs.webkit.org/show_bug.cgi?id=155981
1762         <rdar://problem/25418983>
1763
1764         Reviewed by Timothy Hatcher.
1765
1766         Disable the unused find banner in the RecordingContentView's
1767         ContentBrowser. This is a workaround for the background tab
1768         thinking it is visible, but still useful since the find
1769         banner wouldn't be used in the TimelineContentView anyways so
1770         can avoid being created.
1771
1772         * UserInterface/Views/ContentBrowser.js:
1773         (WebInspector.ContentBrowser):
1774         Add a construction option to not create a FindBanner.
1775         
1776         (WebInspector.ContentBrowser.prototype.handleFindEvent):
1777         (WebInspector.ContentBrowser.prototype.shown):
1778         (WebInspector.ContentBrowser.prototype.hidden):
1779         (WebInspector.ContentBrowser.prototype._contentViewNumberOfSearchResultsDidChange):
1780         (WebInspector.ContentBrowser.prototype._updateFindBanner):
1781         Handle when we don't have a find banner.
1782
1783         * UserInterface/Views/TimelineRecordingContentView.js:
1784         (WebInspector.TimelineRecordingContentView):
1785         Do not create a FindBanner in the RecordingContentView.
1786
1787         * UserInterface/Base/Main.js:
1788         (WebInspector.contentLoaded):
1789         This global content browser can also avoid creating a FindBanner.
1790
1791 2016-03-29  Joseph Pecoraro  <pecoraro@apple.com>
1792
1793         Web Inspector: We should have a way to capture heap snapshots programatically.
1794         https://bugs.webkit.org/show_bug.cgi?id=154407
1795         <rdar://problem/24726292>
1796
1797         Reviewed by Timothy Hatcher.
1798
1799         * Localizations/en.lproj/localizedStrings.js:
1800         * UserInterface/Protocol/ConsoleObserver.js:
1801         (WebInspector.ConsoleObserver.prototype.heapSnapshot):
1802         (WebInspector.ConsoleObserver):
1803         Create a HeapSnapshot with an optional title and add to the timeline.
1804
1805         (WebInspector.HeapAllocationsTimelineDataGridNode):
1806         * UserInterface/Views/TimelineTabContentView.js:
1807         (WebInspector.TimelineTabContentView.displayNameForRecord):
1808         Share code for snapshot display names which may now include a title.
1809
1810         * UserInterface/Proxies/HeapSnapshotProxy.js:
1811         (WebInspector.HeapSnapshotProxy):
1812         (WebInspector.HeapSnapshotProxy.deserialize):
1813         (WebInspector.HeapSnapshotProxy.prototype.get title):
1814         * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
1815         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
1816         (HeapSnapshot):
1817         (HeapSnapshot.prototype.serialize):
1818         * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
1819         (HeapSnapshotWorker.prototype.createSnapshot):
1820         Include an optional title in a HeapSnapshot.
1821
1822 2016-03-28  Joseph Pecoraro  <pecoraro@apple.com>
1823
1824         Web Inspector: Ensure maximum accuracy while profiling
1825         https://bugs.webkit.org/show_bug.cgi?id=155809
1826         <rdar://problem/25325035>
1827
1828         Reviewed by Timothy Hatcher.
1829
1830         * Localizations/en.lproj/localizedStrings.js:
1831         New strings.
1832
1833         * UserInterface/Controllers/DebuggerManager.js:
1834         (WebInspector.DebuggerManager):
1835         When starting the inspector, if it was previously closed while
1836         breakpoints were temporarily disabled, restore the correct
1837         breakpoints enabled state.
1838
1839         (WebInspector.DebuggerManager.prototype.set breakpointsEnabled):
1840         Warn if we ever try to enable breakpoints during timeline recordings.
1841
1842         (WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily):
1843         (WebInspector.DebuggerManager.prototype.startDisablingBreakpointsTemporarily):
1844         (WebInspector.DebuggerManager.prototype.stopDisablingBreakpointsTemporarily):
1845         Method to start/stop temporarily disabling breakpoints.
1846
1847         (WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
1848         (WebInspector.DebuggerManager.prototype._setBreakpoint):
1849         When temporarily disabling breakpoints avoid the convenience behavior of
1850         enabling all breakpoints when enabling or setting a single breakpoint.
1851
1852         * UserInterface/Controllers/TimelineManager.js:
1853         (WebInspector.TimelineManager.prototype.startCapturing):
1854         Emit a will start capturing event to do work before enabling instruments.
1855
1856         * UserInterface/Views/DebuggerSidebarPanel.css:
1857         (.sidebar > .panel.navigation.debugger .timeline-recording-warning):
1858         (.sidebar > .panel.navigation.debugger .timeline-recording-warning > a):
1859         Styles for a warning section in the Debugger Sidebar when the Debugger
1860         is temporarily disabled due to a Timeline recording.
1861
1862         * UserInterface/Views/DebuggerSidebarPanel.js:
1863         (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingWillStart):
1864         (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingStopped):
1865         Modify the Debugger state and UI before and after a Timeline recording.
1866
1867 2016-03-28  Nikita Vasilyev  <nvasilyev@apple.com>
1868
1869         Web Inspector: Use font-variant-numeric: tabular-nums instead of -apple-system-monospaced-numbers
1870         https://bugs.webkit.org/show_bug.cgi?id=155826
1871         <rdar://problem/25330631>
1872
1873         Reviewed by Myles C. Maxfield.
1874
1875         * UserInterface/Views/CodeMirrorOverrides.css:
1876         (.CodeMirror .CodeMirror-linenumber):
1877         * UserInterface/Views/DataGrid.css:
1878         (.data-grid td):
1879         * UserInterface/Views/DefaultDashboardView.css:
1880         (.toolbar .dashboard.default > .item):
1881         * UserInterface/Views/ObjectTreeArrayIndexTreeElement.css:
1882         (.object-tree-array-index .index-name):
1883
1884 2016-03-28  Nikita Vasilyev  <nvasilyev@apple.com>
1885
1886         Web Inspector: Add font-variant-numeric to CSS autocompletions
1887         https://bugs.webkit.org/show_bug.cgi?id=155941
1888         <rdar://problem/25381735>
1889
1890         Reviewed by Timothy Hatcher.
1891
1892         Also, remove -apple-system-monospaced-numbers.
1893         `font-variant-numeric: tabular-nuns` should be used instead.
1894
1895         * UserInterface/Models/CSSKeywordCompletions.js:
1896
1897 2016-03-28  Matt Baker  <mattbaker@apple.com>
1898
1899         REGRESSION (r195303): Web Inspector: Wrong indentation in the type coverage profiler popovers
1900         https://bugs.webkit.org/show_bug.cgi?id=155930
1901         <rdar://problem/25377042>
1902
1903         Reviewed by Timothy Hatcher.
1904
1905         Increased specificity of TypeTreeView CSS selectors, and added new
1906         overrides for rules made global by r195303, which don't apply to the
1907         TypeTreeView's or its tree elements.
1908
1909         * UserInterface/Views/TypeTreeElement.css:
1910         (.item.type-tree-element):
1911         (.item.type-tree-element > .titles):
1912         (.item.type-tree-element > .disclosure-button):
1913         (.item.type-tree-element.parent > .disclosure-button):
1914         (.item.type-tree-element.parent.expanded > .disclosure-button):
1915         (.item.type-tree-element > .icon):
1916         (.item.type-tree-element.prototype):
1917         (.item.type-tree-element.prototype:focus):
1918         (.item.type-tree-element.prototype + ol):
1919         (.type-tree-element): Deleted.
1920         (.type-tree-element > .titles): Deleted.
1921         (.type-tree-element > .disclosure-button): Deleted.
1922         (.type-tree-element.parent > .disclosure-button): Deleted.
1923         (.type-tree-element.parent.expanded > .disclosure-button): Deleted.
1924         (.type-tree-element > .icon): Deleted.
1925         (.type-tree-element.prototype): Deleted.
1926         (.type-tree-element.prototype:focus): Deleted.
1927         (.type-tree-element.prototype + ol): Deleted.
1928
1929         * UserInterface/Views/TypeTreeView.css:
1930         (.tree-outline.type li):
1931
1932         * UserInterface/Views/TypeTreeView.js:
1933         (WebInspector.TypeTreeView):
1934         Use custom indentation.
1935
1936 2016-03-28  Nikita Vasilyev  <nvasilyev@apple.com>
1937
1938         Web Inspector: Large repaints while typing in the console tab
1939         https://bugs.webkit.org/show_bug.cgi?id=155627
1940         <rdar://problem/25234875>
1941
1942         Reviewed by Timothy Hatcher.
1943
1944         Specify the height of flexbox elements to reduce repaint areas.
1945
1946         * UserInterface/Views/Main.css:
1947         (#navigation-sidebar):
1948         (#content): z-index doesn't affect repaint areas once the height is set.
1949         (#details-sidebar):
1950
1951 2016-03-25  Joseph Pecoraro  <pecoraro@apple.com>
1952
1953         Web Inspector: Sometimes clearing focused nodes in ProfileView leaves a dangling call stack that can never be removed
1954         https://bugs.webkit.org/show_bug.cgi?id=155915
1955
1956         Reviewed by Timothy Hatcher.
1957
1958         * UserInterface/Views/ProfileDataGridTree.js:
1959         (WebInspector.ProfileDataGridTree.prototype.addFocusNode):
1960         (WebInspector.ProfileDataGridTree.prototype.rollbackFocusNode):
1961         (WebInspector.ProfileDataGridTree.prototype.clearFocusNodes):
1962         (WebInspector.ProfileDataGridTree.prototype._focusChanged):
1963         (WebInspector.ProfileDataGridTree.prototype._saveFocusedNodeOriginalParent):
1964         (WebInspector.ProfileDataGridTree.prototype._restoreFocusedNodeToOriginalParent):
1965         Be a little more explicit about saving and resotring nodes.
1966         When restoring, work around a DataGrid issue by temporarily
1967         collapsing and expanding the part of the node we are being
1968         reattached to. This is a cheap workaround for an otherwise
1969         complex DataGrid / DataGridTree issue.
1970
1971 2016-03-25  Matt Baker  <mattbaker@apple.com>
1972
1973         Web Inspector: Clicking a result in Quick Open dialog dismisses the dialog, does nothing
1974         https://bugs.webkit.org/show_bug.cgi?id=155892
1975         <rdar://problem/25361220>
1976
1977         Reviewed by Timothy Hatcher.
1978
1979         * UserInterface/Views/OpenResourceDialog.js:
1980         (WebInspector.OpenResourceDialog):
1981         Allow repeat selection so clicking a selected element makes a selection
1982         and dismisses the dialog.
1983
1984         (WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline):
1985         Suppress select and deselect. Only user clicks should cause a selection event.
1986
1987         (WebInspector.OpenResourceDialog.prototype._handleBlurEvent):
1988         Prevent the dialog from being dismissed before tree item selection occurs.
1989
1990         (WebInspector.OpenResourceDialog.prototype._treeSelectionDidChange):
1991         Set the represented object (dialog result) and dismiss.
1992
1993 2016-03-25  Commit Queue  <commit-queue@webkit.org>
1994
1995         Unreviewed, rolling out r198619.
1996         https://bugs.webkit.org/show_bug.cgi?id=155902
1997
1998         Switching to Console tab sometimes results in blank tab.
1999         (Requested by JoePeck on #webkit).
2000
2001         Reverted changeset:
2002
2003         "Web Inspector: Large repaints while typing in the console
2004         tab"
2005         https://bugs.webkit.org/show_bug.cgi?id=155627
2006         http://trac.webkit.org/changeset/198619
2007
2008 2016-03-25  Matt Baker  <mattbaker@apple.com>
2009
2010         Web Inspector: Scrolling/selection is broken in Quick Open dialog resource tree
2011         https://bugs.webkit.org/show_bug.cgi?id=155877
2012         <rdar://problem/25356149>
2013
2014         Reviewed by Timothy Hatcher.
2015
2016         Dialog and tree outline now use "display: flex", causing the height of the
2017         tree outline to be based on the height of the dialog. Overflow scrolling
2018         in the tree outline now has the expected behavior.
2019
2020         * UserInterface/Views/OpenResourceDialog.css:
2021         (.open-resource-dialog):
2022         (.open-resource-dialog > .tree-outline):
2023
2024 2016-03-24  Joseph Pecoraro  <pecoraro@apple.com>
2025
2026         Web Inspector: Reduce forced layouts
2027         https://bugs.webkit.org/show_bug.cgi?id=155852
2028         <rdar://problem/25345197>
2029
2030         Reviewed by Timothy Hatcher.
2031
2032         * UserInterface/Views/DataGrid.js:
2033         (WebInspector.DataGrid.prototype.layout):
2034         (WebInspector.DataGrid.prototype._positionResizerElements):
2035         (WebInspector.DataGrid.prototype._positionHeaderViews):
2036         In loops, force layout once, calculate values, then set styles.
2037
2038         * UserInterface/Views/RadioButtonNavigationItem.js:
2039         (WebInspector.RadioButtonNavigationItem):
2040         (WebInspector.RadioButtonNavigationItem.prototype.updateLayout):
2041         Force layout once to calculate the min-width, then never again.
2042
2043 2016-03-24  Joseph Pecoraro  <pecoraro@apple.com>
2044
2045         Web Inspector: Open Resource Dialog should not system beep when using Enter to select an item
2046         https://bugs.webkit.org/show_bug.cgi?id=155853
2047
2048         Reviewed by Timothy Hatcher.
2049
2050         * UserInterface/Views/OpenResourceDialog.js:
2051         (WebInspector.OpenResourceDialog.prototype._handleKeydownEvent):
2052         Prevent default when handling Enter with a selected result.
2053
2054 2016-03-24  Joseph Pecoraro  <pecoraro@apple.com>
2055
2056         Web Inspector: Miscellaneous performance fixes in Timeline recording
2057         https://bugs.webkit.org/show_bug.cgi?id=155832
2058
2059         Reviewed by Timothy Hatcher.
2060
2061         * UserInterface/Models/CallingContextTree.js:
2062         (WebInspector.CCTNode.prototype.hasChildren):
2063         No need to allocate an array with all of the properties, we can just
2064         check if there is at least one property using a short circuit for..in.
2065         Performance was always faster for empty, small, and large objects
2066         in micro benchmarks.
2067
2068         * UserInterface/Views/DataGrid.js:
2069         (WebInspector.DataGrid.prototype.layout):
2070         Avoid causing DOM layout when positioning resizers. They only need
2071         a layout if we are resizing the DataGrid, or the initial layout.
2072
2073         * UserInterface/Views/NavigationBar.js:
2074         (WebInspector.NavigationBar):
2075         (WebInspector.NavigationBar.prototype.needsLayout):
2076         (WebInspector.NavigationBar.prototype.layout):
2077         Avoid causing DOM layout every View layout. In fact, only do a
2078         DOM layout when someone has triggered a needsLayout on this
2079         navigation bar. A basic dirty layout (triggered by a parent)
2080         should not have caused us to resize.
2081
2082         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
2083         * UserInterface/Views/LayoutTimelineOverviewGraph.js:
2084         (WebInspector.LayoutTimelineOverviewGraph.prototype.layout):
2085         * UserInterface/Views/MemoryTimelineOverviewGraph.js:
2086         (WebInspector.MemoryTimelineOverviewGraph.prototype.reset):
2087         (WebInspector.MemoryTimelineOverviewGraph.prototype._updateLegend):
2088         * UserInterface/Views/NetworkTimelineOverviewGraph.js:
2089         * UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
2090         (WebInspector.RenderingFrameTimelineOverviewGraph.prototype.layout):
2091         * UserInterface/Views/ScriptTimelineOverviewGraph.js:
2092         Avoid doing any work in non-visible graphs. This was very common
2093         because the RenderingFrameTimelineOverviewGraph is never visible
2094         when the other timeline graphs are, but was performing lots of work.
2095
2096         * UserInterface/Views/MemoryCategoryView.js:
2097         (WebInspector.MemoryCategoryView.prototype.clear):
2098         (WebInspector.MemoryCategoryView.prototype._updateDetails):
2099         (WebInspector.MemoryCategoryView):
2100         * UserInterface/Views/MemoryTimelineView.js:
2101         (WebInspector.MemoryTimelineView.prototype.reset):
2102         (WebInspector.MemoryTimelineView.prototype._updateUsageLegend):
2103         (WebInspector.MemoryTimelineView.prototype._updateMaxComparisonLegend):
2104         Cache values to avoid textContent calls even if the content did not change.
2105         This reduces unnecessary work when the values wouldn't change.
2106
2107         * UserInterface/Views/TimelineRecordBar.js:
2108         (WebInspector.TimelineRecordBar.createCombinedBars):
2109         (WebInspector.TimelineRecordBar.prototype.set records):
2110         Revert to fast loop and as this code path is very hot and for..of iteration
2111         was showing up in profiles. Remove assert which seems rather pointless but
2112         showed up in profiles.
2113
2114 2016-03-24  Nikita Vasilyev  <nvasilyev@apple.com>
2115
2116         Web Inspector: Large repaints while typing in the console tab
2117         https://bugs.webkit.org/show_bug.cgi?id=155627
2118         <rdar://problem/25234875>
2119
2120         Reviewed by Timothy Hatcher.
2121
2122         Use a `position: absolute` workaround to reduce large repaint areas caused by flexbox.
2123
2124         * UserInterface/Views/LogContentView.css:
2125         (body.selected-tab-console #content):
2126         This selector must only affect the console tab as it breaks sidebars in other tabs.
2127
2128         * UserInterface/Base/Main.js:
2129         (WebInspector.contentLoaded):
2130         (WebInspector._tabBarItemSelected):
2131         * UserInterface/Views/TabBar.js:
2132         (WebInspector.TabBar.prototype.set selectedTabBarItem):
2133         Add "selected-tab-console" class to <body> when the console tab is selected.
2134
2135 2016-03-23  Joseph Pecoraro  <pecoraro@apple.com>
2136
2137         Web Inspector: Timeline range selection changes with ProfileView should not cause navigation bar items to flicker
2138         https://bugs.webkit.org/show_bug.cgi?id=155834
2139
2140         Reviewed by Timothy Hatcher.
2141
2142         * UserInterface/Views/ProfileView.js:
2143         (WebInspector.ProfileView.prototype._recreate):
2144         The only reason our selection path components would change is if we
2145         had focus nodes before and do not anymore.
2146
2147 2016-03-23  Joseph Pecoraro  <pecoraro@apple.com>
2148
2149         Web Inspector: Allow clicking the Timeline in Editing Mode to toggle the checkbox
2150         https://bugs.webkit.org/show_bug.cgi?id=155815
2151
2152         Reviewed by Timothy Hatcher.
2153
2154         * UserInterface/Views/TimelineOverview.js:
2155         (WebInspector.TimelineOverview.prototype._startEditingInstruments):
2156         Remove unused variable.
2157         
2158         * UserInterface/Views/TimelineTreeElement.js:
2159         (WebInspector.TimelineTreeElement.prototype.onattach):
2160         (WebInspector.TimelineTreeElement.prototype._clickHandler):
2161         Make clicking on the tree element toggle the checkbox.
2162
2163 2016-03-23  Joseph Pecoraro  <pecoraro@apple.com>
2164
2165         Web Inspector: Timeline Tab sometimes restores as blank
2166         https://bugs.webkit.org/show_bug.cgi?id=155811
2167
2168         Reviewed by Timothy Hatcher.
2169
2170         * UserInterface/Views/TimelineTabContentView.js:
2171         (WebInspector.TimelineTabContentView.prototype.restoreFromCookie):
2172         When early bailing in restore, if there is no content view to restore,
2173         then at least fallback to showing the Overview.
2174
2175 2016-03-23  Joseph Pecoraro  <pecoraro@apple.com>
2176
2177         Web Inspector: REGRESSION: Timeline Reset does not clear datagrids
2178         https://bugs.webkit.org/show_bug.cgi?id=155804
2179
2180         Reviewed by Timothy Hatcher.
2181
2182         * UserInterface/Views/HeapAllocationsTimelineView.js:
2183         (WebInspector.HeapAllocationsTimelineView.prototype.shown):
2184         (WebInspector.HeapAllocationsTimelineView.prototype.hidden):
2185         (WebInspector.HeapAllocationsTimelineView.prototype.closed):
2186         (WebInspector.HeapAllocationsTimelineView.prototype.reset):
2187         Although we don't use the popover features of TimelineDataGrid,
2188         be a good citizen and call methods on the datagrid.
2189
2190         * UserInterface/Views/OverviewTimelineView.js:
2191         (WebInspector.OverviewTimelineView.prototype.reset):
2192         Clear the datagrid on reset.
2193
2194         * UserInterface/Views/TimelineDataGrid.js:
2195         (WebInspector.TimelineDataGrid.prototype.reset):
2196         Clear the datagrid on reset.
2197
2198 2016-03-23  Joseph Pecoraro  <pecoraro@apple.com>
2199
2200         Web Inspector: Uncaught exceptions closing Timeline tab
2201         https://bugs.webkit.org/show_bug.cgi?id=155805
2202
2203         Reviewed by Timothy Hatcher.
2204
2205         * UserInterface/Views/ScriptClusterTimelineView.js:
2206         (WebInspector.ScriptClusterTimelineView.prototype._scriptClusterViewCurrentContentViewDidChange):
2207         Gracefully handle if there is no content view.
2208
2209         * UserInterface/Views/TimelineRecordingContentView.js:
2210         (WebInspector.TimelineRecordingContentView.prototype.closed): Deleted.
2211         Fix typo.
2212
2213 2016-03-23  Matt Baker  <mattbaker@apple.com>
2214
2215         Web Inspector: Quick Open dialog has fuzzy icons at 1x
2216         https://bugs.webkit.org/show_bug.cgi?id=155557
2217         <rdar://problem/25200217>
2218
2219         Reviewed by Timothy Hatcher.
2220
2221         New resource icons (documents and clippings) for large  tree items,
2222         for use in the Quick Open dialog's tree outline.
2223
2224         * UserInterface/Images/ClippingCSSLarge.png: Added.
2225         * UserInterface/Images/ClippingCSSLarge@2x.png: Added.
2226         * UserInterface/Images/ClippingGenericLarge.png: Added.
2227         * UserInterface/Images/ClippingGenericLarge@2x.png: Added.
2228         * UserInterface/Images/ClippingJSLarge.png: Added.
2229         * UserInterface/Images/ClippingJSLarge@2x.png: Added.
2230         * UserInterface/Images/DocumentCSSLarge.png: Added.
2231         * UserInterface/Images/DocumentCSSLarge@2x.png: Added.
2232         * UserInterface/Images/DocumentFontLarge.png: Added.
2233         * UserInterface/Images/DocumentFontLarge@2x.png: Added.
2234         * UserInterface/Images/DocumentGenericLarge.png: Added.
2235         * UserInterface/Images/DocumentGenericLarge@2x.png: Added.
2236         * UserInterface/Images/DocumentImageLarge.png: Added.
2237         * UserInterface/Images/DocumentImageLarge@2x.png: Added.
2238         * UserInterface/Images/DocumentJSLarge.png: Added.
2239         * UserInterface/Images/DocumentJSLarge@2x.png: Added.
2240         * UserInterface/Images/DocumentMarkupLarge.png: Added.
2241         * UserInterface/Images/DocumentMarkupLarge@2x.png: Added.
2242         32px icons at 1x and 2x.
2243
2244         * UserInterface/Views/ResourceIcons.css:
2245         (.large .resource-icon .icon):
2246         (.large .resource-icon.resource-type-document .icon):
2247         (.large .resource-icon.resource-type-image .icon):
2248         (.large .resource-icon.resource-type-font .icon):
2249         (.large .resource-icon.resource-type-stylesheet .icon):
2250         (.large .resource-icon.resource-type-script .icon):
2251         (.large .anonymous-script-icon .icon):
2252         (.large .source-map-resource.resource-icon .icon):
2253         (.large .source-map-resource.resource-icon.resource-type-stylesheet .icon):
2254         (.large .source-map-resource.resource-icon.resource-type-script .icon):
2255         Large icon styles.
2256
2257 2016-03-22  Timothy Hatcher  <timothy@apple.com>
2258
2259         Web Inspector: String double quoting in the console and elsewhere needs to escape backslash too
2260
2261         https://bugs.webkit.org/show_bug.cgi?id=155752
2262         rdar://problem/25293141
2263
2264         Reviewed by Joseph Pecoraro.
2265
2266         * UserInterface/Base/Utilities.js:
2267         (doubleQuotedString): Escape backslashes too.
2268         * UserInterface/Views/FormattedValue.js:
2269         (WebInspector.FormattedValue.createLinkifiedElementString): Ditto.
2270
2271 2016-03-22  Joseph Pecoraro  <pecoraro@apple.com>
2272
2273         Web Inspector: REGRESSION: Switching Timelines via Path Component does not work
2274         https://bugs.webkit.org/show_bug.cgi?id=155767
2275         <rdar://problem/25298945>
2276
2277         Reviewed by Timothy Hatcher.
2278
2279         * UserInterface/Views/TimelineRecordingContentView.js:
2280         (WebInspector.TimelineRecordingContentView.prototype._timelinePathComponentSelected):
2281         (WebInspector.TimelineRecordingContentView.prototype._instrumentAdded):
2282
2283 2016-03-22  Timothy Hatcher  <timothy@apple.com>
2284
2285         Web Inspector: Consider Automation script names as internal and hide them
2286
2287         https://bugs.webkit.org/show_bug.cgi?id=155753
2288         rdar://problem/25293310
2289
2290         Reviewed by Joseph Pecoraro.
2291
2292         * UserInterface/Base/Utilities.js:
2293         (isWebKitInternalScript): Renamed from isWebInspectorDebugScript.
2294         Check for "__Web" prefix and "__" suffix.
2295
2296         * UserInterface/Controllers/DebuggerManager.js:
2297         (WebInspector.DebuggerManager):
2298         (WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
2299         (WebInspector.DebuggerManager.prototype.reset):
2300         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
2301         (WebInspector.DebuggerManager.prototype.scriptDidParse):
2302         (WebInspector.DebuggerManager.prototype._debugUIEnabledDidChange):
2303         Renamed _inspectorDebugScripts to _internalWebKitScripts. And renamed
2304         isWebInspectorDebugScript to isWebKitInternalScript.
2305
2306         * UserInterface/Protocol/RemoteObject.js:
2307         (WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
2308         Renamed isWebInspectorDebugScript to isWebKitInternalScript.
2309
2310 2016-03-22  Joseph Pecoraro  <pecoraro@apple.com>
2311
2312         Web Inspector: REGRESSION: Shift + Click on record button should create a new recording
2313         https://bugs.webkit.org/show_bug.cgi?id=155763
2314
2315         Reviewed by Timothy Hatcher.
2316
2317         * UserInterface/Views/TimelineTabContentView.js:
2318         (WebInspector.TimelineTabContentView.prototype._recordButtonClicked):
2319         Use the shiftKey from the DOM Event.
2320
2321 2016-03-22  Joseph Pecoraro  <pecoraro@apple.com>
2322
2323         Web Inspector: Switching Away and Back to Timelines Tab may select a different Timeline
2324         https://bugs.webkit.org/show_bug.cgi?id=155742
2325         <rdar://problem/25284330>
2326
2327         Reviewed by Timothy Hatcher.
2328
2329         When switching to the Timeline tab, or switching recordings within the
2330         the Timeline tab, the TimelineTabContentView does work to correctly
2331         save/restore its view state.
2332
2333         When switching to the Timeline tab, the TimelineTabContentView correctly
2334         restores the state of the tab, but when showing the RecordingContentView
2335         the RecordingContentView restores its state from a stale cookie.
2336
2337         Since TimelineTabContentView already seems to handle correctly restoring
2338         RecordingContentViews on its own. Removing the RecordingContentView's
2339         implementation of save/restore made everything work as expected.
2340
2341         * UserInterface/Views/TimelineRecordingContentView.js:
2342         (WebInspector.TimelineRecordingContentView.prototype.saveToCookie): Deleted.
2343         (WebInspector.TimelineRecordingContentView.prototype.restoreFromCookie): Deleted.
2344
2345 2016-03-22  Matt Baker  <mattbaker@apple.com>
2346
2347         Web Inspector: remove the remaining TimelineSidebarPanel references
2348         https://bugs.webkit.org/show_bug.cgi?id=155765
2349         <rdar://problem/25296980>
2350
2351         Reviewed by Timothy Hatcher.
2352
2353         Remove dead code from TimelineView and TimelineTabContentView.
2354
2355         * UserInterface/Views/OverviewTimelineView.js:
2356         (WebInspector.OverviewTimelineView.prototype.canShowContentViewForTreeElement): Deleted.
2357         (WebInspector.OverviewTimelineView.prototype.showContentViewForTreeElement): Deleted.
2358
2359         * UserInterface/Views/RenderingFrameTimelineView.js:
2360         (WebInspector.RenderingFrameTimelineView.prototype.canShowContentViewForTreeElement): Deleted.
2361         (WebInspector.RenderingFrameTimelineView.prototype.showContentViewForTreeElement): Deleted.
2362
2363         * UserInterface/Views/ScriptDetailsTimelineView.js:
2364         (WebInspector.ScriptDetailsTimelineView.prototype.canShowContentViewForTreeElement): Deleted.
2365         (WebInspector.ScriptDetailsTimelineView.prototype.showContentViewForTreeElement): Deleted.
2366
2367         * UserInterface/Views/TimelineTabContentView.js:
2368         (WebInspector.TimelineTabContentView):
2369
2370         * UserInterface/Views/TimelineView.js:
2371         (WebInspector.TimelineView.prototype.canShowContentViewForTreeElement): Deleted.
2372         (WebInspector.TimelineView.prototype.showContentViewForTreeElement): Deleted.
2373
2374 2016-03-22  Matt Baker  <mattbaker@apple.com>
2375
2376         Web Inspector: Timelines UI redesign: Provide a way to configure which instruments to use
2377         https://bugs.webkit.org/show_bug.cgi?id=153672
2378         <rdar://problem/24417575>
2379
2380         Reviewed by Timothy Hatcher.
2381
2382         Adds UI for configuring a timeline recording's instrument list. TimelineManager
2383         maintains the list of supported timeline types, and tracks the subset
2384         of user-configured timelines which are used to create the instrument list
2385         that is passed to new recordings.
2386
2387         * Localizations/en.lproj/localizedStrings.js:
2388         New strings for "Edit" Timelines button.
2389
2390         * UserInterface/Controllers/TimelineManager.js:
2391         (WebInspector.TimelineManager):
2392         Added setting for user-configured (enabled) timeline types.
2393         Initialized to the default timeline types.
2394
2395         (WebInspector.TimelineManager.defaultTimelineTypes):
2396         (WebInspector.TimelineManager.availableTimelineTypes):
2397         Get the list of all supported timeline types, which is a superset
2398         of the list of default timeline types.
2399
2400         (WebInspector.TimelineManager.prototype.get enabledTimelineTypes):
2401         (WebInspector.TimelineManager.prototype.set enabledTimelineTypes):
2402         List of user-configured timeline types, backed by a Setting.
2403         (WebInspector.TimelineManager.prototype._loadNewRecording):
2404         Create new recordings with the current user-configured instrument list.
2405         (WebInspector.TimelineManager.defaultInstruments): Deleted.
2406         Renamed defaultTimelineTypes.
2407
2408         * UserInterface/Main.html:
2409         New class, TimelineTreeElement.
2410
2411         * UserInterface/Models/Instrument.js:
2412         (WebInspector.Instrument.createForTimelineType):
2413         Factory method for creating Instruments.
2414
2415         * UserInterface/Models/TimelineRecording.js:
2416         (WebInspector.TimelineRecording):
2417         Replace fixed instrument list with TimelineManager's list.
2418         (WebInspector.TimelineRecording.prototype.instrumentForTimeline):
2419         Get the instrument in the recording for a given timeline.
2420         (WebInspector.TimelineRecording.prototype.addInstrument):
2421         (WebInspector.TimelineRecording.prototype.removeInstrument):
2422         Drive-by syntax error fixes: Array.prototype.contains doesn't exist.
2423
2424         * UserInterface/Views/TimelineOverview.css:
2425         (.timeline-overview > .navigation-bar.timelines):
2426         (.navigation-bar.timelines .item.button.toggle-edit-instruments:not(.disabled):matches(:focus, .activate.activated, .radio.selected)):
2427         (.navigation-bar.timelines .item.button.toggle-edit-instruments:not(.disabled):active:matches(:focus, .activate.activated, .radio.selected)):
2428         (.navigation-bar.timelines .item.button.toggle-edit-instruments.disabled):
2429         (.navigation-bar.timelines .toggle-edit-instruments:not(.disabled):active):
2430         (.timeline-overview > .tree-outline.timelines):
2431         (.timeline-overview.edit-instruments > .tree-outline.timelines):
2432         (.timeline-overview.edit-instruments > .tree-outline.timelines .item.selected):
2433         (.timeline-overview > .tree-outline.timelines input[type=checkbox].status-button):
2434         (.timeline-overview.frames > :matches(.tree-outline.timelines, .navigation-bar.timelines)):
2435         (.timeline-overview > .tree-outline.timelines::before): Deleted.
2436         (.timeline-overview.frames > .tree-outline.timelines): Deleted.
2437         Styles for the "Edit" navigation bar above the timelines tree outline,
2438         and tree element styles for showing checkboxes and hiding the current
2439         selection while in edit mode.
2440
2441         * UserInterface/Views/TimelineOverview.js:
2442         (WebInspector.TimelineOverview):
2443         Create "Edit" button and navigation bar and add event handlers for
2444         capturing events, so that timeline editing can be closed and
2445         disabled when capturing begins.
2446
2447         (WebInspector.TimelineOverview.prototype.set selectedTimeline):
2448         Prevent timeline selection while in edit mode.
2449         (WebInspector.TimelineOverview.prototype.get editingInstruments):
2450         (WebInspector.TimelineOverview.prototype.set viewMode):
2451         Prevent view mode change while in edit mode.
2452
2453         (WebInspector.TimelineOverview.prototype._instrumentAdded):
2454         Create a TimelineTreeElement, and insert into the tree outline and graph
2455         container in sorted order instead of appending timeline elements.
2456
2457         (WebInspector.TimelineOverview.prototype._toggleEditingInstruments):
2458         Handler for Edit button click event.
2459         (WebInspector.TimelineOverview.prototype._editingInstrumentsDidChange):
2460         Update UI in response to editing mode change: toggle CSS, enable/disable
2461         the timeline ruler and wheel/gesture events, and update Edit button appearance.
2462
2463         (WebInspector.TimelineOverview.prototype._updateEditInstrumentsButton):
2464         Update label text and button state.
2465         (WebInspector.TimelineOverview.prototype._updateWheelAndGestureHandlers):
2466         Add/remove event handlers based on editing state.
2467
2468         (WebInspector.TimelineOverview.prototype._startEditingInstruments):
2469         Enable edit mode UI. Placeholder elements are added for timelines that
2470         aren't included in the recording, and all tree elements have checkboxes
2471         for toggling their associated timelines.
2472
2473         (WebInspector.TimelineOverview.prototype._stopEditingInstruments):
2474         Disable edit mode UI. Unchecked instruments are first removed from the
2475         recording, then placeholder tree elements are removed, and their instruments
2476         added, as needed. TimelineManager's list of user-configured timeline types
2477         is then updated.
2478
2479         (WebInspector.TimelineOverview.prototype._capturingStarted):
2480         (WebInspector.TimelineOverview.prototype._capturingStopped):
2481         Enable/disable the Edit button. Quit editing mode when capturing starts.
2482         (WebInspector.TimelineOverview.prototype._compareTimelineTreeElements):
2483         Special sorting for the timelines tree outline. The sort order is:
2484             1. Instruments that are in the recording, except Rendering Frames.
2485             2. Instruments that aren't in the recording (placeholders).
2486             3. Rendering Frames.
2487
2488         Timelines in groups 1 & 2 are sorted based on the order of the list returned
2489         by TimelineManager.availableTimelineTypes(). The Rendering Frames tree
2490         element must be last, since it's always hidden and would otherwise interfere
2491         with the alternating tree element CSS styles.
2492
2493         * UserInterface/Views/TimelineRecordingContentView.css:
2494         (.content-view.timeline-recording.edit-instruments > .timeline-overview):
2495         (.content-view.timeline-recording.edit-instruments > .content-browser):
2496         Hide lower content browser and extend timelines tree height in edit mode.
2497
2498         * UserInterface/Views/TimelineRecordingContentView.js:
2499         (WebInspector.TimelineRecordingContentView):
2500         Listen for edit mode changes on TimelineOverview.
2501         (WebInspector.TimelineRecordingContentView.prototype.contentBrowserTreeElementForRepresentedObject):
2502         (WebInspector.TimelineRecordingContentView.prototype._updateTimelineOverviewHeight):
2503         When in edit mode, remove inline style rule for TimelineOverview height.
2504         (WebInspector.TimelineRecordingContentView.prototype._instrumentAdded):
2505         (WebInspector.TimelineRecordingContentView.prototype._editingInstrumentsDidChange):
2506         Update CSS and TimelineOverview height when edit mode changes.
2507         (WebInspector.TimelineRecordingContentView.prototype.get timelineOverviewHeight): Deleted.
2508         No longer used.
2509
2510         * UserInterface/Views/TimelineTabContentView.js:
2511         (WebInspector.TimelineTabContentView.displayNameForTimelineType):
2512         (WebInspector.TimelineTabContentView.iconClassNameForTimelineType):
2513         (WebInspector.TimelineTabContentView.genericClassNameForTimelineType):
2514         (WebInspector.TimelineTabContentView.displayNameForTimeline): Deleted.
2515         (WebInspector.TimelineTabContentView.iconClassNameForTimeline): Deleted.
2516         (WebInspector.TimelineTabContentView.genericClassNameForTimeline): Deleted.
2517         Helper functions now take a timeline type instead of a timeline object.
2518
2519         * UserInterface/Views/TimelineTreeElement.js: Added.
2520         New tree element class to encapsulate behavior specific to the timelines
2521         tree outline, such as status element changes and disabling selection
2522         when editing.
2523
2524         (WebInspector.TimelineTreeElement):
2525         (WebInspector.TimelineTreeElement.prototype.get placeholder):
2526         (WebInspector.TimelineTreeElement.prototype.get editing):
2527         (WebInspector.TimelineTreeElement.prototype.set editing):
2528         (WebInspector.TimelineTreeElement.prototype._showCloseButton):
2529         (WebInspector.TimelineTreeElement.prototype._showCheckbox):
2530         (WebInspector.TimelineTreeElement.prototype._updateStatusButton):
2531
2532 2016-03-21  Matt Baker  <mattbaker@apple.com>
2533
2534         Web Inspector: New icon for Heap Allocations timeline
2535         https://bugs.webkit.org/show_bug.cgi?id=155731
2536         <rdar://problem/25275494>
2537
2538         Reviewed by Joseph Pecoraro and Timothy Hatcher.
2539
2540         * UserInterface/Images/HeapAllocationsInstrument.svg: Added.
2541         New artwork from Jon Davis.
2542
2543         * UserInterface/Views/TimelineIcons.css:
2544         (.heap-allocations-icon .icon):
2545         (body:not(.mac-platform, .windows-platform) .memory-icon .icon):
2546         (body:not(.mac-platform, .windows-platform) .heap-allocations-icon .icon):
2547         New icon styles/fallbacks for GTK.
2548
2549         * UserInterface/Views/TimelineTabContentView.js:
2550         (WebInspector.TimelineTabContentView.iconClassNameForTimeline):
2551         Add new icon class to UI helper method.
2552
2553 2016-03-20  Dan Bernstein  <mitz@apple.com>
2554
2555         [Mac] Determine TARGET_MAC_OS_X_VERSION_MAJOR from MACOSX_DEPLOYMENT_TARGET rather than from MAC_OS_X_VERSION_MAJOR
2556         https://bugs.webkit.org/show_bug.cgi?id=155707
2557         <rdar://problem/24980691>
2558
2559         Reviewed by Darin Adler.
2560
2561         * Configurations/Base.xcconfig: Set TARGET_MAC_OS_X_VERSION_MAJOR based on the last
2562           component of MACOSX_DEPLOYMENT_TARGET.
2563         * Configurations/DebugRelease.xcconfig: For engineering builds, preserve the behavior of
2564           TARGET_MAC_OS_X_VERSION_MAJOR being the host’s OS version.
2565
2566 2016-03-20  Dan Bernstein  <mitz@apple.com>
2567
2568         Update build settings
2569
2570         Rubber-stamped by Andy Estes.
2571
2572         * Configurations/DebugRelease.xcconfig:
2573         * Configurations/Version.xcconfig:
2574
2575 2016-03-18  Joseph Pecoraro  <pecoraro@apple.com>
2576
2577         Web Inspector: Bullet misaligned when expanding console log message
2578         https://bugs.webkit.org/show_bug.cgi?id=155669
2579         <rdar://problem/25250721>
2580
2581         Reviewed by Timothy Hatcher.
2582
2583         * UserInterface/Views/ObjectTreeView.css:
2584         (.object-tree):
2585         (.object-tree .object-tree): Deleted.
2586         Make object tree's inline-block again.
2587
2588         * UserInterface/Views/ConsoleMessageView.css:
2589         (.console-top-level-message .object-tree):
2590         (.console-top-level-message .object-tree .object-tree):
2591         Since the Console is the only place that requires a non-inline-block
2592         object-tree, and only at the top level, have the console override
2593         the styles of object trees as it needs.
2594
2595 2016-03-18  Joseph Pecoraro  <pecoraro@apple.com>
2596
2597         Uncaught Exception: TypeError: undefined is not an object (evaluating 'this._treeOutlineDataGridSynchronizer.treeElementForDataGridNode')
2598         https://bugs.webkit.org/show_bug.cgi?id=155671
2599         <rdar://problem/25249401>
2600
2601         Reviewed by Timothy Hatcher.
2602
2603         * UserInterface/Views/TimelineDataGrid.js:
2604         (WebInspector.TimelineDataGrid.prototype._sort):
2605
2606 2016-03-18  Joseph Pecoraro  <pecoraro@apple.com>
2607
2608         Web Inspector: Fix ObjectTree Map styling, key/value look cramped
2609         https://bugs.webkit.org/show_bug.cgi?id=155668
2610
2611         Reviewed by Timothy Hatcher.
2612
2613         * UserInterface/Views/ObjectTreeArrayIndexTreeElement.css:
2614         (.tree-outline .item.object-tree-array-index):
2615         * UserInterface/Views/ObjectTreeMapEntryTreeElement.css:
2616         (.tree-outline .item.object-tree-map-entry):
2617         When creating generic tree outline styles generic object tree
2618         styles were getting overriden by generic tree outline styles
2619         with higher specificity.
2620
2621 2016-03-18  Joseph Pecoraro  <pecoraro@apple.com>
2622
2623         Web Inspector: Timeline reset issues after Navigation Sidebar removal
2624         https://bugs.webkit.org/show_bug.cgi?id=155658
2625         <rdar://problem/25245292>
2626
2627         Reviewed by Timothy Hatcher.
2628
2629         * UserInterface/Views/CircleChart.js:
2630         (WebInspector.CircleChart.prototype.set values):
2631         If the segments have never been set the values list will be empty.
2632         Allow clearing to set empty values again.
2633
2634         * UserInterface/Views/ScriptClusterTimelineView.js:
2635         (WebInspector.ScriptClusterTimelineView.prototype._scriptClusterViewCurrentContentViewDidChange):
2636         (WebInspector.ScriptClusterTimelineView):
2637         Timeline sidebar no longer exists. Replace with the common
2638         FIXME added to the other TimelineViews.
2639
2640         * UserInterface/Views/TimelineView.js:
2641         (WebInspector.TimelineView.prototype.reset):
2642         Timeline sidebar and content tree outline no longer exist.
2643         Replace with the common comment indicating this method
2644         is intended for subclasses.
2645
2646 2016-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2647
2648         REGRESSION (r197724): [GTK] Web Inspector: Images being blocked by CSP 2.0
2649         https://bugs.webkit.org/show_bug.cgi?id=155432
2650
2651         Reviewed by Daniel Bates.
2652
2653         Allow Web Inspector to load resource: image resources.
2654
2655         * UserInterface/Main.html:
2656
2657 2016-03-17  Joseph Pecoraro  <pecoraro@apple.com>
2658
2659         Web Inspector: Prefer retained size to the shallow size in Heap Snapshot data grids
2660         https://bugs.webkit.org/show_bug.cgi?id=155597
2661         <rdar://problem/25225087>
2662
2663         Reviewed by Timothy Hatcher.
2664
2665         * Localizations/en.lproj/localizedStrings.js:
2666         New datagrid column and tooltip strings.
2667
2668         * UserInterface/Views/DataGrid.js:
2669         (WebInspector.DataGrid.prototype.insertColumn):
2670         Allow a column definition to provide a tooltip for the header cell.
2671
2672         * UserInterface/Views/HeapSnapshotClassDataGridNode.js:
2673         (WebInspector.HeapSnapshotClassDataGridNode.prototype.createCellContent):
2674         Include retained size column data.
2675
2676         (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate):
2677         Fix non-batched populate to sort instances on first population.
2678
2679         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
2680         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
2681         Include retained size column data.
2682
2683         * UserInterface/Views/HeapSnapshotInstancesContentView.js:
2684         (WebInspector.HeapSnapshotInstancesContentView):
2685         Include a retained size column. Update initial sort and column widths.
2686
2687         * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js:
2688         (WebInspector.HeapSnapshotInstancesDataGridTree.buildSortComparator):
2689         Include a numeric sort comparator for the new retained size column.
2690
2691         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype._populateTopLevel):
2692         Include retained size, and lazily calculate percentage later.
2693
2694 2016-03-17  Joseph Pecoraro  <pecoraro@apple.com>
2695
2696         Web Inspector: HeapSnapshots are slow and use too much memory
2697         https://bugs.webkit.org/show_bug.cgi?id=155571
2698
2699         Reviewed by Timothy Hatcher.
2700
2701         This is the first inclusion of Workers into Web Inspector. In this case
2702         the Main side merely needs to make requests of the Worker and get back
2703         objects that it can interact with more.
2704         
2705         New file heirarchies:
2706
2707             UserInterface/Proxies
2708                 - new Proxy classes in the Main page.
2709                 - treat like Model classes, but not quite model.
2710
2711             UserInterface/Workers/HeapSnapshotWorker
2712                 - new Worker classes for Workers. No WebInspector namespace.
2713                 - no minification of these resources, they are simply copied.
2714
2715         Remote procedure call interface between the Main/Worker page happens
2716         through the WorkerProxy and Worker classes. There are simple ways
2717         to perform factory style methods and call methods on objects, and
2718         get the result in a callback. Similiar to frontend <-> backend agent
2719         communication:
2720
2721             HeapSnapshotWorkerProxy: (Main world)
2722                 - creates the worker
2723                 - performAction("actionName", arguments, callback)
2724                 - callMethod(objectId, "methodName", arguments, callback)
2725                 - handle message => dispatch event or invoke callback
2726
2727             HeapSnapshotWorker: (Worker world)
2728                 - sendEvent("eventName", eventData)
2729                 - handle message => dispatch action or method on object
2730         
2731         Proxy object methods are boilerplate calls to performAction/callMethod
2732         with deserialization of responses. The rest of the frontend can just
2733         treat Proxy objects as Model objects with some data and async methods.
2734
2735         Because the Node/Edge data is so small, objects are cheaply created
2736         when needed and not cached. This means that there may be duplicate
2737         HeapSnapshotNode's for the same node. For example if different Views
2738         both request instancesWithClassName("Foo"). This is fine, as none
2739         of our Views really care about object uniqueness, they are only
2740         interested in the data or querying for more data.
2741
2742         * Scripts/combine-resources.pl:
2743         * Scripts/copy-user-interface-resources.pl:
2744         Copy the Workers directory to the resources directory.
2745         Its code is only meant to be loaded by Workers, so it
2746         shouldn't be included in the Main page.
2747
2748         * UserInterface/Main.html:
2749         * UserInterface/Test.html:
2750         * UserInterface/Models/HeapSnapshot.js: Removed.
2751         * UserInterface/Models/HeapSnapshotDiff.js: Removed.
2752         * UserInterface/Models/HeapSnapshotEdge.js: Removed.
2753         * UserInterface/Models/HeapSnapshotNode.js: Removed.
2754         Replace the old simple Model classes with Proxy classes that interact
2755         with the Worker.
2756
2757         * UserInterface/Models/HeapAllocationsInstrument.js:
2758         (WebInspector.HeapAllocationsInstrument.prototype._takeHeapSnapshot):
2759         (WebInspector.HeapAllocationsInstrument):
2760         * UserInterface/Models/HeapAllocationsTimelineRecord.js:
2761         (WebInspector.HeapAllocationsTimelineRecord):
2762         * UserInterface/Models/HeapSnapshotRootPath.js:
2763         (WebInspector.HeapSnapshotRootPath):
2764         (WebInspector.HeapSnapshotRootPath.prototype.appendEdge):
2765         * UserInterface/Protocol/HeapObserver.js:
2766         (WebInspector.HeapObserver.prototype.trackingStart):
2767         (WebInspector.HeapObserver.prototype.trackingComplete):
2768         * UserInterface/Views/ContentView.js:
2769         (WebInspector.ContentView.createFromRepresentedObject):
2770         (WebInspector.ContentView.isViewable):
2771         * UserInterface/Views/HeapAllocationsTimelineView.js:
2772         (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotDiff):
2773         (WebInspector.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
2774         (WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected):
2775         (WebInspector.HeapAllocationsTimelineView):
2776         * UserInterface/Views/HeapSnapshotClassDataGridNode.js:
2777         (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate):
2778         * UserInterface/Views/HeapSnapshotClusterContentView.js:
2779         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
2780         (WebInspector.HeapSnapshotInstanceDataGridNode):
2781         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.):
2782         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
2783         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPath):
2784         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.stringifyEdge):
2785         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler):
2786         * UserInterface/Views/HeapSnapshotInstancesContentView.js:
2787         (WebInspector.HeapSnapshotInstancesContentView):
2788         * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js:
2789         (WebInspector.HeapSnapshotInstancesDataGridTree):
2790         * UserInterface/Views/HeapSnapshotSummaryContentView.js:
2791         (WebInspector.HeapSnapshotSummaryContentView):
2792         Update existing code to expect the new Proxy objects or create
2793         the new HeapSnapshot using workers.
2794
2795         * UserInterface/Proxies/HeapSnapshotDiffProxy.js: Added.
2796         (WebInspector.HeapSnapshotDiffProxy):
2797         (WebInspector.HeapSnapshotDiffProxy.deserialize):
2798         (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot1):
2799         (WebInspector.HeapSnapshotDiffProxy.prototype.get snapshot2):
2800         (WebInspector.HeapSnapshotDiffProxy.prototype.get totalSize):
2801         (WebInspector.HeapSnapshotDiffProxy.prototype.get totalObjectCount):
2802         (WebInspector.HeapSnapshotDiffProxy.prototype.get categories):
2803         (WebInspector.HeapSnapshotDiffProxy.prototype.allocationBucketCounts):
2804         (WebInspector.HeapSnapshotDiffProxy.prototype.instancesWithClassName):
2805         (WebInspector.HeapSnapshotDiffProxy.prototype.nodeWithIdentifier):
2806         A HeapSnapshotDiffProxy looks like a HeapSnapshotProxy and responds to
2807         the same methods, but has the extra snapshot1/2 pointers.
2808
2809         * UserInterface/Proxies/HeapSnapshotEdgeProxy.js:
2810         (WebInspector.HeapSnapshotEdgeProxy):
2811         (WebInspector.HeapSnapshotEdgeProxy.deserialize):
2812         Edge data. No methods are proxied at this point.
2813
2814         * UserInterface/Proxies/HeapSnapshotNodeProxy.js: Added.
2815         (WebInspector.HeapSnapshotNodeProxy):
2816         (WebInspector.HeapSnapshotNodeProxy.deserialize):
2817         (WebInspector.HeapSnapshotNodeProxy.prototype.shortestGCRootPath):
2818         (WebInspector.HeapSnapshotNodeProxy.prototype.dominatedNodes):
2819         (WebInspector.HeapSnapshotNodeProxy.prototype.retainedNodes):
2820         (WebInspector.HeapSnapshotNodeProxy.prototype.retainers):
2821         Node data and methods to query for node relationships.
2822
2823         * UserInterface/Proxies/HeapSnapshotProxy.js: Added.
2824         (WebInspector.HeapSnapshotProxy):
2825         (WebInspector.HeapSnapshotProxy.deserialize):
2826         (WebInspector.HeapSnapshotProxy.prototype.get proxyObjectId):
2827         (WebInspector.HeapSnapshotProxy.prototype.get identifier):
2828         (WebInspector.HeapSnapshotProxy.prototype.get totalSize):
2829         (WebInspector.HeapSnapshotProxy.prototype.get totalObjectCount):
2830         (WebInspector.HeapSnapshotProxy.prototype.get categories):
2831         (WebInspector.HeapSnapshotProxy.prototype.allocationBucketCounts):
2832         (WebInspector.HeapSnapshotProxy.prototype.instancesWithClassName):
2833         (WebInspector.HeapSnapshotProxy.prototype.nodeWithIdentifier):
2834         Snapshot data and methods to query for nodes.
2835
2836         * UserInterface/Proxies/HeapSnapshotWorkerProxy.js: Added.
2837         (WebInspector.HeapSnapshotWorkerProxy):
2838         (WebInspector.HeapSnapshotWorkerProxy.singleton):
2839         (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshot):
2840         (WebInspector.HeapSnapshotWorkerProxy.prototype.createSnapshotDiff):
2841         (WebInspector.HeapSnapshotWorkerProxy.prototype.performAction):
2842         (WebInspector.HeapSnapshotWorkerProxy.prototype.callMethod):
2843         (WebInspector.HeapSnapshotWorkerProxy.prototype._postMessage):
2844         (WebInspector.HeapSnapshotWorkerProxy.prototype._handleMessage):
2845         Singleton factory for the worker and proxied communication with the worker.
2846         Provide means for invoking "factory actions" and "object methods".
2847
2848         * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js: Added.
2849         (HeapSnapshotWorker):
2850         (HeapSnapshotWorker.prototype.createSnapshot):
2851         (HeapSnapshotWorker.prototype.createSnapshotDiff):
2852         (HeapSnapshotWorker.prototype.sendEvent):
2853         (HeapSnapshotWorker.prototype._handleMessage):
2854         Main worker code. Handle dispatching actions and methods.
2855
2856         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js: Added.
2857         (HeapSnapshot):
2858         (HeapSnapshot.buildCategories):
2859         (HeapSnapshot.allocationBucketCounts):
2860         (HeapSnapshot.instancesWithClassName):
2861         (HeapSnapshot.prototype.allocationBucketCounts):
2862         (HeapSnapshot.prototype.instancesWithClassName):
2863         (HeapSnapshot.prototype.nodeWithIdentifier):
2864         (HeapSnapshot.prototype.shortestGCRootPath):
2865         (HeapSnapshot.prototype.dominatedNodes):
2866         (HeapSnapshot.prototype.retainedNodes):
2867         (HeapSnapshot.prototype.retainers):
2868         (HeapSnapshot.prototype.serialize):
2869         (HeapSnapshot.prototype.serializeNode):
2870         (HeapSnapshot.prototype.serializeEdge):
2871         (HeapSnapshot.prototype._buildOutgoingEdges):
2872         (HeapSnapshot.prototype._buildIncomingEdges):
2873         (HeapSnapshot.prototype._buildPostOrderIndexes):
2874         (HeapSnapshot.prototype._buildDominatorIndexes):
2875         (HeapSnapshot.prototype._buildRetainedSizes):
2876         (HeapSnapshot.prototype._gcRootPathes.visitNode):
2877         (HeapSnapshot.prototype._gcRootPathes):
2878         (HeapSnapshotDiff):
2879         (HeapSnapshotDiff.prototype.allocationBucketCounts):
2880         (HeapSnapshotDiff.prototype.instancesWithClassName):
2881         (HeapSnapshotDiff.prototype.nodeWithIdentifier):
2882         (HeapSnapshotDiff.prototype.shortestGCRootPath):
2883         (HeapSnapshotDiff.prototype.dominatedNodes):
2884         (HeapSnapshotDiff.prototype.retainedNodes):
2885         (HeapSnapshotDiff.prototype.retainers):
2886         (HeapSnapshotDiff.prototype.serialize):
2887         New HeapSnapshot data processing implementation. Instead of creating
2888         a new object per Node or per Edge create data arrays containing data
2889         per-Node. Operate on these lists of data instead of creating many objects.
2890
2891 2016-03-17  Nikita Vasilyev  <nvasilyev@apple.com>
2892
2893         Web Inspector: Large repaints when typing any character in console
2894         https://bugs.webkit.org/show_bug.cgi?id=155387
2895         <rdar://problem/25125720>
2896
2897         Reviewed by Timothy Hatcher.
2898
2899         * UserInterface/Views/Main.css:
2900         (#content):
2901
2902 2016-03-16  Matt Baker  <mattbaker@apple.com>
2903
2904         Uncaught Exception: SyntaxError: Invalid regular expression: \ at end of pattern
2905         https://bugs.webkit.org/show_bug.cgi?id=155556
2906         <rdar://problem/25200058>
2907
2908         Reviewed by Timothy Hatcher.
2909
2910         Use simpleGlobStringToRegExp, which returns a valid regular expression
2911         for strings with trailing backslashes, and also provides globbing.
2912         String.escapeForRegExp returns a JS string ending in "\\", which isn't
2913         a valid regular expression.
2914
2915         * UserInterface/Views/OpenResourceDialog.js:
2916         (WebInspector.OpenResourceDialog):
2917         (WebInspector.OpenResourceDialog.prototype._handleMousedownEvent):
2918         Fixed typo.
2919
2920         (WebInspector.OpenResourceDialog.prototype._updateFilter):
2921         Switch to simpleGlobStringToRegExp.
2922
2923 2016-03-14  Joseph Pecoraro  <pecoraro@apple.com>
2924
2925         Web Inspector: Show path from root to instances in the Heap Snapshot content view
2926         https://bugs.webkit.org/show_bug.cgi?id=155478
2927         <rdar://problem/25157408>
2928
2929         Reviewed by Timothy Hatcher.
2930
2931         * Localizations/en.lproj/localizedStrings.js:
2932         * UserInterface/Main.html:
2933         New strings and resources.
2934
2935         * UserInterface/Models/HeapSnapshotNode.js:
2936         (WebInspector.HeapSnapshotNode.prototype.get shortestGCRootPath):
2937         (WebInspector.HeapSnapshotNode.prototype._gcRootPaths.visitNode):
2938         (WebInspector.HeapSnapshotNode.prototype._gcRootPaths):
2939         Helper to get the shortest path from a GC root to the node.
2940
2941         * UserInterface/Models/HeapSnapshotRootPath.js: Added.
2942         (WebInspector.HeapSnapshotRootPath):
2943         (WebInspector.HeapSnapshotRootPath.emptyPath):
2944         (WebInspector.HeapSnapshotRootPath.prototype.get node):
2945         (WebInspector.HeapSnapshotRootPath.prototype.get parent):
2946         (WebInspector.HeapSnapshotRootPath.prototype.get pathComponent):
2947         (WebInspector.HeapSnapshotRootPath.prototype.get rootNode):
2948         (WebInspector.HeapSnapshotRootPath.prototype.get fullPath):
2949         (WebInspector.HeapSnapshotRootPath.prototype.isRoot):
2950         (WebInspector.HeapSnapshotRootPath.prototype.isEmpty):
2951         (WebInspector.HeapSnapshotRootPath.prototype.isGlobalScope):
2952         (WebInspector.HeapSnapshotRootPath.prototype.isPathComponentImpossible):
2953         (WebInspector.HeapSnapshotRootPath.prototype.isFullPathImpossible):
2954         (WebInspector.HeapSnapshotRootPath.prototype.appendInternal):
2955         (WebInspector.HeapSnapshotRootPath.prototype.appendArrayIndex):
2956         (WebInspector.HeapSnapshotRootPath.prototype.appendPropertyName):
2957         (WebInspector.HeapSnapshotRootPath.prototype.appendVariableName):
2958         (WebInspector.HeapSnapshotRootPath.prototype.appendGlobalScopeName):
2959         (WebInspector.HeapSnapshotRootPath.prototype.appendEdge):
2960         (WebInspector.HeapSnapshotRootPath.prototype._canPropertyNameBeDotAccess):
2961         Helper class, like PropertyPath, for building a string path to
2962         a HeapSnapshotNode. Typically the path is built up with
2963         HeapSnapshotEdges and so you can build a string such as:
2964         `window.foo[0]["prop erty"]._foo`.
2965
2966         * UserInterface/Views/HeapAllocationsTimelineView.js:
2967         (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotList):
2968         (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
2969         (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotDiff):
2970         (WebInspector.HeapAllocationsTimelineView.prototype.shown):
2971         (WebInspector.HeapAllocationsTimelineView.prototype.hidden):
2972         (WebInspector.HeapAllocationsTimelineView.prototype.closed):
2973         Propogate shown/hidden to the contentViewContainer.
2974         Cleanup the contentViewContainer when closing.
2975
2976         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
2977         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
2978         Helper for logging a HeapSnapshotNode value to the console. If the
2979         path is possible from the root, just output the path in the console
2980         otherwise use a synthetic "Heap Snapshot Object (@1234)" like string.
2981         For strings, just get the preview as we won't get a real RemoteObject.
2982
2983         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
2984         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPath):
2985         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
2986         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.sanitizeClassName):
2987         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.stringifyEdge):
2988         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler):
2989         Give the @1234 id element a mouseover handler to display a popover
2990         with the path from a root. Stop the path at "Window" if possible
2991         to avoid displaying internals like "JSDOMWindowShell".
2992
2993         * UserInterface/Views/HeapSnapshotInstancesContentView.css:
2994         (.heap-snapshot .object-id):
2995         (.heap-snapshot .object-id:hover):
2996         (.heap-snapshot > .data-grid tr:not(.selected) td .object-id): Deleted.
2997         (.heap-snapshot .icon):
2998         (.heap-snapshot-instance-popover-content):
2999         (.heap-snapshot-instance-popover-content table):
3000         (.heap-snapshot-instance-popover-content tr):
3001         (.heap-snapshot-instance-popover-content td):
3002         (.heap-snapshot-instance-popover-content td.edge-name):
3003         (.heap-snapshot-instance-popover-content td.object-data):
3004         (.heap-snapshot-instance-popover-content .node):
3005         (.heap-snapshot-instance-popover-content .node *):
3006         Styles for contents of the popover.
3007
3008         * UserInterface/Views/HeapSnapshotInstancesContentView.js:
3009         (WebInspector.HeapSnapshotInstancesContentView.prototype.hidden):
3010         * UserInterface/Views/HeapSnapshotInstancesDataGridTree.js:
3011         (WebInspector.HeapSnapshotInstancesDataGridTree):
3012         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get popover):
3013         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.get popoverNode):
3014         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.set popoverNode):
3015         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.hidden):
3016         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.willDismissPopover):
3017         Have a single popover for the entire tree. Cache and clear
3018         contents of the popover when appropriate.
3019
3020 2016-03-14  Daniel Bates  <dabates@apple.com>
3021
3022         Web Inspector: Display Content Security Policy hash in details sidebar for script and style elements
3023         https://bugs.webkit.org/show_bug.cgi?id=155466
3024         <rdar://problem/25152480>
3025
3026         Reviewed by Joseph Pecoraro and Timothy Hatcher.
3027
3028         * Localizations/en.lproj/localizedStrings.js: Add English localized string for the CSP hash UI label.
3029         * UserInterface/Models/DOMNode.js:
3030         (WebInspector.DOMNode): Initialize the instance variable this._contentSecurityPolicyHash
3031         with the value passed from the Inspector back end.
3032         (WebInspector.DOMNode.prototype.contentSecurityPolicyHash): Returns the CSP hash for this node.
3033         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
3034         (WebInspector.DOMNodeDetailsSidebarPanel): Append a row to the end of section Identity to display
3035         the CSP hash (if applicable).
3036         (WebInspector.DOMNodeDetailsSidebarPanel.prototype.refresh): Query the underlying WebInspector.DOMNode
3037         for the CSP hash of the selected node.
3038
3039 2016-03-14  Joseph Pecoraro  <pecoraro@apple.com>
3040
3041         Web Inspector: REGRESSION(r197974): HeapAllocationsTimelineView broken, doesn't handle Timeline Sidebar Navigation removal
3042         https://bugs.webkit.org/show_bug.cgi?id=155458
3043         <rdar://problem/25150803>
3044
3045         Reviewed by Timothy Hatcher.
3046
3047         * UserInterface/Views/HeapAllocationsTimelineView.js:
3048         (WebInspector.HeapAllocationsTimelineView):
3049         (WebInspector.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
3050         (WebInspector.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
3051         (WebInspector.HeapAllocationsTimelineView.prototype.layout):
3052         (WebInspector.HeapAllocationsTimelineView.prototype._compareHeapSnapshotsClicked):
3053         (WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected):
3054         (WebInspector.HeapAllocationsTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
3055         Update the TimelineView now that there is no sidebar.
3056         Remove any TreeOutline logic and replace with DataGrid logic.
3057
3058 2016-03-14  Joseph Pecoraro  <pecoraro@apple.com>
3059
3060         Web Inspector: REGRESSION(r198026): Can't click on Snapshot in Timeline Overview
3061         https://bugs.webkit.org/show_bug.cgi?id=155457
3062         <rdar://problem/25150706>
3063
3064         Reviewed by Timothy Hatcher.
3065
3066         * UserInterface/Views/TimelineRuler.js:
3067         (WebInspector.TimelineRuler.prototype._handleClick):
3068         The conditional was accidentally inverted in r198026.
3069
3070 2016-03-14  Timothy Hatcher  <timothy@apple.com>
3071
3072         Web Inspector: cssmin.py does not handle calc(var(--toolbar-height) + var(--tab-bar-height))
3073
3074         https://bugs.webkit.org/show_bug.cgi?id=155464
3075         rdar://problem/25152196
3076
3077         Reviewed by Joseph Pecoraro.
3078
3079         * Scripts/cssmin.py:
3080         (cssminify): Check for var when stripping spaces around + and -.
3081
3082         * UserInterface/Views/TimelineOverview.js:
3083         (WebInspector.TimelineOverview.prototype._viewModeDidChange):
3084         Drive-by fix to add a missing semi-colon found by the copy-user-interface-resources-dryrun.rb script.
3085
3086 2016-03-14  Joseph Pecoraro  <pecoraro@apple.com>
3087
3088         Reduce generated JSON HeapSnapshot size
3089         https://bugs.webkit.org/show_bug.cgi?id=155460
3090
3091         Reviewed by Geoffrey Garen.
3092
3093         * UserInterface/Models/HeapSnapshot.js:
3094         (WebInspector.HeapSnapshot.fromPayload):
3095         Update for the slightly modified format.
3096
3097 2016-03-14  Commit Queue  <commit-queue@webkit.org>
3098
3099         Unreviewed, rolling out r198095.
3100         https://bugs.webkit.org/show_bug.cgi?id=155467
3101
3102         Made text look poor (Requested by JoePeck on #webkit).
3103
3104         Reverted changeset:
3105
3106         "Web Inspector: Large repaints when typing any character in
3107         console"
3108         https://bugs.webkit.org/show_bug.cgi?id=155387
3109         http://trac.webkit.org/changeset/198095
3110
3111 2016-03-14  Nikita Vasilyev  <nvasilyev@apple.com>
3112
3113         Web Inspector: Reduce unnecessary dashboard repaints
3114         https://bugs.webkit.org/show_bug.cgi?id=155425
3115         <rdar://problem/25138247>
3116
3117         Reviewed by Timothy Hatcher.
3118
3119         * UserInterface/Views/DefaultDashboardView.js:
3120         (WebInspector.DefaultDashboardView.prototype._appendElementForNamedItem.):
3121         newText is a number for console message counters.
3122
3123 2016-03-13  Nikita Vasilyev  <nvasilyev@apple.com>
3124
3125         Web Inspector: Large repaints when typing any character in console
3126         https://bugs.webkit.org/show_bug.cgi?id=155387
3127         <rdar://problem/25125720>
3128
3129         Reviewed by Timothy Hatcher.
3130
3131         * UserInterface/Views/Main.css:
3132         (#content):
3133
3134 2016-03-13  Devin Rousso  <dcrousso+webkit@gmail.com>
3135
3136         Web Inspector: Memory timeline pie charts are misaligned when there is no recording
3137         https://bugs.webkit.org/show_bug.cgi?id=155421
3138
3139         Reviewed by Timothy Hatcher.
3140
3141         * UserInterface/Views/MemoryTimelineView.css:
3142         (.timeline-view.memory > .content > .overview):
3143         Removed top padding to match bottom padding.
3144
3145         (.timeline-view.memory .legend > .row):
3146         (.timeline-view.memory .legend):
3147         Moved specified width to prevent unrecorded timelines from having graphs
3148         that are offset horizontally.
3149
3150 2016-03-13  Devin Rousso  <dcrousso+webkit@gmail.com>
3151
3152         Web Inspector: REGRESSION: Styles sidebar inline swatches are oddly shaped
3153         https://bugs.webkit.org/show_bug.cgi?id=155410
3154
3155         Reviewed by Timothy Hatcher.
3156
3157         * UserInterface/Views/InlineSwatch.css:
3158         (.inline-swatch):
3159         (.inline-swatch > span):
3160         Added more consistent border-radius with UserInterface/Images/CubicBezier.svg.
3161
3162         * UserInterface/Views/VisualStyleColorPicker.css:
3163         (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .inline-swatch.color):
3164         Made border-radius consistent with the adjacent input field.
3165
3166 2016-03-12  Nikita Vasilyev  <nvasilyev@apple.com>
3167
3168         Web Inspector: Convert toolbar and tab bar to position absolute to reduce repaint areas
3169         https://bugs.webkit.org/show_bug.cgi?id=155386
3170
3171         Reviewed by Timothy Hatcher.
3172
3173         Using CSS flexbox causes unnecessary large repaints.
3174         Convert top level elements (.toolbar, .tab-bar, #main)
3175         from flexbox to "position: absolute".
3176
3177         * UserInterface/Views/Main.css:
3178         (#main):
3179         * UserInterface/Views/TabBar.css:
3180         (.tab-bar):
3181         * UserInterface/Views/Toolbar.css:
3182         (.toolbar):
3183         (body.mac-platform:not(.docked, .mavericks) .toolbar):
3184         (body.mac-platform:not(.docked, .mavericks)):
3185         (body.window-inactive:not(.mavericks) .toolbar): Deleted.
3186         * UserInterface/Views/Variables.css:
3187         (:root):
3188
3189 2016-03-11  Matt Baker  <mattbaker@apple.com>
3190
3191         Web Inspector: Wrong TimelineOverview height after switching from Events to Frames
3192         https://bugs.webkit.org/show_bug.cgi?id=155366
3193         <rdar://problem/25111028>
3194
3195         Reviewed by Timothy Hatcher.
3196
3197         * UserInterface/Views/TimelineRecordingContentView.js:
3198         (WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
3199         Update the overview height after setting a new view mode.
3200
3201 2016-03-11  Matt Baker  <mattbaker@apple.com>
3202
3203         Web Inspector: Make it possible to disable TimelineRuler UI
3204         https://bugs.webkit.org/show_bug.cgi?id=155348
3205         <rdar://problem/25103505>
3206
3207         Reviewed by Timothy Hatcher.
3208
3209         Adds an "enabled" property to TimelineRuler, allowing the selection UI
3210         to be disabled without removing the current selection.
3211
3212         * UserInterface/Views/TimelineRuler.css:
3213         (.timeline-ruler.allows-time-range-selection:not(.disabled)):
3214         (.timeline-ruler > .selection-drag):
3215         (.timeline-ruler:not(.disabled) > .selection-drag):
3216         (.timeline-ruler:not(.disabled) > .selection-drag:active):
3217         (.timeline-ruler.disabled > .selection-handle):
3218         (.timeline-ruler.allows-time-range-selection): Deleted.
3219         (.timeline-ruler > .selection-drag:active): Deleted.
3220         Updated ruler styles for "disabled" state: pointer events are disabled,
3221         selection handles hidden, and the default cursor is shown.
3222
3223         * UserInterface/Views/TimelineRuler.js:
3224         (WebInspector.TimelineRuler):
3225         (WebInspector.TimelineRuler.prototype.get enabled):
3226         (WebInspector.TimelineRuler.prototype.set enabled):
3227         New property.
3228         (WebInspector.TimelineRuler.prototype._handleClick):
3229         Corrected code which always reset the pointer events to "all", instead
3230         of setting it back to the original value.
3231
3232 2016-03-10  Daniel Strokis  <dstrokis@icloud.com>
3233
3234         Web Inspector: color swatch and border are misaligned in Visual Styles sidebar
3235         https://bugs.webkit.org/show_bug.cgi?id=154471
3236
3237         Reviewed by Timothy Hatcher.
3238
3239         Color swatches in the Visual Styles sidebar now have only their left corners rounded (thanks to Matt Baker for the idea).
3240
3241         * UserInterface/Views/InlineSwatch.css:
3242         (.inline-swatch > span):
3243         (.inline-swatch): Deleted.
3244         * UserInterface/Views/VisualStyleColorPicker.css:
3245         (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .inline-swatch.color):
3246
3247 2016-03-10  Matt Baker  <mattbaker@apple.com>
3248
3249         Web Inspector: Timelines UI redesign: remove navigation sidebar
3250         https://bugs.webkit.org/show_bug.cgi?id=153036
3251         <rdar://problem/24195627>
3252
3253         Reviewed by Timothy Hatcher.
3254
3255         Removed TimelineView methods used by the sidebar to setup the content tree
3256         outline and handle tree element events, which are no longer used. Tree elements
3257         are no longer created by TimelineViews as records are processed.
3258
3259         * UserInterface/Main.html:
3260         Removed files.
3261
3262         * UserInterface/Views/LayoutTimelineView.js:
3263         (WebInspector.LayoutTimelineView):
3264         Removed tree outline event listeners and data grid parameter.
3265         (WebInspector.LayoutTimelineView.prototype._processPendingRecords):
3266         (WebInspector.LayoutTimelineView.prototype._dataGridFiltersDidChange):
3267         (WebInspector.LayoutTimelineView.prototype._hoveredOrSelectedRecord):
3268         Get record from data grid node instead of tree element.
3269         (WebInspector.LayoutTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
3270         (WebInspector.LayoutTimelineView.prototype._mouseOverTreeOutline): Deleted.
3271         (WebInspector.LayoutTimelineView.prototype._mouseLeaveTreeOutline): Deleted.
3272         No longer needed, highlighting performed by data grid event handlers.
3273
3274         * UserInterface/Views/MemoryTimelineView.js:
3275         (WebInspector.MemoryTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
3276         No longer needed.
3277
3278         * UserInterface/Views/NavigationSidebarPanel.js:
3279         (WebInspector.NavigationSidebarPanel.prototype._updateFilter): Deleted.
3280         Removed hack which was specific to TimelineSidebarPanel.
3281
3282         * UserInterface/Views/NetworkTimelineView.js:
3283         (WebInspector.NetworkTimelineView):
3284         Removed sidebar styles and tree outline data grid parameter.
3285         (WebInspector.NetworkTimelineView.prototype._processPendingRecords):
3286         (WebInspector.NetworkTimelineView.prototype._dataGridFiltersDidChange):
3287         (WebInspector.NetworkTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
3288         (WebInspector.NetworkTimelineView.prototype.treeElementSelected): Deleted.
3289         No longer needed.
3290
3291         * UserInterface/Views/OverviewTimelineView.js:
3292         (WebInspector.OverviewTimelineView):
3293         (WebInspector.OverviewTimelineView.prototype.get selectionPathComponents):
3294         (WebInspector.OverviewTimelineView.prototype.dataGridNodePathComponentSelected):
3295         Create path components from the grid selection. This should have been
3296         included in https://webkit.org/b/154954.
3297
3298         (WebInspector.OverviewTimelineView.prototype._compareDataGridNodesByStartTime.getStartTime):
3299         (WebInspector.OverviewTimelineView.prototype._compareDataGridNodesByStartTime):
3300         (WebInspector.OverviewTimelineView.prototype._insertDataGridNode):
3301         (WebInspector.OverviewTimelineView.prototype._addResourceToDataGridIfNeeded):
3302         (WebInspector.OverviewTimelineView.prototype._addSourceCodeTimeline):
3303         Refactored to accept grid nodes instead of tree elements.
3304
3305         (WebInspector.OverviewTimelineView.prototype._processPendingRepresentedObjects):
3306         (WebInspector.OverviewTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
3307         (WebInspector.OverviewTimelineView.prototype.shown):
3308         (WebInspector.OverviewTimelineView.prototype.treeElementPathComponentSelected): Deleted.
3309         (WebInspector.OverviewTimelineView.prototype._compareTreeElementsByDetails): Deleted.
3310         Not used anywhere.
3311
3312         (WebInspector.OverviewTimelineView.prototype._compareTreeElementsByStartTime.getStartTime): Deleted.
3313         (WebInspector.OverviewTimelineView.prototype._compareTreeElementsByStartTime): Deleted.
3314         (WebInspector.OverviewTimelineView.prototype._insertTreeElement): Deleted.
3315         (WebInspector.OverviewTimelineView.prototype._addResourceToTreeIfNeeded): Deleted.
3316         Reimplemented as _compareDataGridNodesByStartTime, _insertDataGridNode and _addResourceToDataGridIfNeeded.
3317
3318         * UserInterface/Views/RenderingFrameTimelineView.js:
3319