032931c799ae4e3b69951bb52715dc61e11e5def
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2016-06-30  Brian Burg  <bburg@apple.com>
2
3         Web Inspector: the last normal tab cannot be closed with "Close Tab" context menu item
4         https://bugs.webkit.org/show_bug.cgi?id=159317
5         <rdar://problem/27042491>
6
7         Reviewed by Timothy Hatcher.
8
9         * UserInterface/Views/TabBarItem.js:
10         (WebInspector.TabBarItem.prototype._handleContextMenuEvent):
11         (WebInspector.TabBarItem): fix the expression that controls whether the item is disabled.
12
13 2016-06-30  Nikita Vasilyev  <nvasilyev@apple.com>
14
15         Web Inspector: Add "spring" to transition-timing-function value autocompletion
16         https://bugs.webkit.org/show_bug.cgi?id=159313
17         <rdar://problem/27114269>
18
19         Reviewed by Timothy Hatcher.
20
21         * UserInterface/Models/CSSKeywordCompletions.js:
22
23 2016-06-30  Commit Queue  <commit-queue@webkit.org>
24
25         Unreviewed, rolling out r202659.
26         https://bugs.webkit.org/show_bug.cgi?id=159305
27
28         The test for this change times out on mac-wk2 debug and caused
29         an existing test to crash. (Requested by ryanhaddad on
30         #webkit).
31
32         Reverted changeset:
33
34         "Web Inspector: Wrong function name next to scope"
35         https://bugs.webkit.org/show_bug.cgi?id=158210
36         http://trac.webkit.org/changeset/202659
37
38 2016-06-29  Joseph Pecoraro  <pecoraro@apple.com>
39
40         Web Inspector: Wrong function name next to scope
41         https://bugs.webkit.org/show_bug.cgi?id=158210
42         <rdar://problem/26543093>
43
44         Reviewed by Brian Burg.
45
46         * UserInterface/Controllers/DebuggerManager.js:
47         (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload):
48         Include new payload data in the construction call.
49         All the new data is optional, so we gracefully handle
50         legacy backends.
51
52         * UserInterface/Models/ScopeChainNode.js:
53         (WebInspector.ScopeChainNode):
54         (WebInspector.ScopeChainNode.prototype.get type):
55         (WebInspector.ScopeChainNode.prototype.get objects):
56         (WebInspector.ScopeChainNode.prototype.get name):
57         (WebInspector.ScopeChainNode.prototype.get location):
58         (WebInspector.ScopeChainNode.prototype.get hash):
59         Hash is a rough (name:sourceId:line:column) string for quick comparisons.
60
61         (WebInspector.ScopeChainNode.prototype.makeLocalScope):
62         Make this an action you take on a scope, to avoid having to
63         do it at construction time, or making it a generic setting.
64
65         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
66         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
67         This was wrong before. Move the work to CallFrame
68         and change it to be correct.
69
70         * UserInterface/CallFrame.js:
71         (WebInspector.CallFrame.prototype.mergedScopeChain):
72
73         This transforms the scope chain for a call frame from:
74         
75              scope1  scope2  scope3  scope4  scope5  scope6  scope7
76               foo     foo     foo     bar     bar      -       -
77              Block  Closure Closure Closure Closure   GLE     GBL
78
79         To:
80              scope1  scope2&3   scope4&5  scope6  scope7
81               foo      foo*       bar*      -       -
82              Block    Local     Closure    GLE     GBL
83
84         Doing a few things:
85
86             - Merge the first two Closure scopes sharing a location.
87               These are the "var" and "let" Closure scopes in a function,
88               and it is better to present these together in the UI.
89
90             - Mark the first Closure scope within a function (*). When
91               this is displayed in the UI, we can provide the name of
92               the function: "Closure Scope (name)", and we even have
93               location information that we can use to display a goto
94               arrow if needed.
95
96             - Make the first Closure scope the Local scope if it
97               matches the Call Frame's function name. This lets us
98               display the section as "Local Variables".
99
100 2016-06-29  Brian Burg  <bburg@apple.com>
101
102         Web Inspector: Uncaught Exception page never shows if exception is thrown while processing a protocol event
103         https://bugs.webkit.org/show_bug.cgi?id=159182
104
105         Reviewed by Joseph Pecoraro.
106
107         Since we catch exceptions raised during the handling of protocol responses and events, there
108         is no way for these exceptions to trigger the global exception handler that shows the Uncaught
109         Exception Reporter sheet. We should show these in the sheet because it makes them get fixed faster.
110
111         Add a new entry point, WebInspector.reportInternalError, that takes an error or string and
112         a free-form map of strings to strings for storing additional information such as message data.
113         Pass the error and any other relevant details to this entry point, which decides whether to
114         show the uncaught exception reporter or quietly log the error to Inspector^2 console.
115
116         In future patches, I would like to do the following once the common errors are fixed:
117          - enable reporting via Uncaught Exception Reporter for all engineering builds
118          - move internal console.error call sites to use WebInspector.reportInternalError
119
120         * UserInterface/Base/Main.js: Add reportInternalError, which redirects to the uncaught
121         exception reporter sheet or does console.error. It also adds a console.assert that could
122         cause the debugger to pause if desired.
123
124         * UserInterface/Debug/UncaughtExceptionReporter.css:
125         (.sheet-container): Make the report scrollable now that we could potentially show a lot of text.
126
127         * UserInterface/Debug/UncaughtExceptionReporter.js:
128         (handleError): Also pass along the 'details' poperty.
129         (formattedEntry): Refactor the code so it additionally prints out the keys and values of
130         the 'details' property. It does not do any coercions, so callers must convert values to strings.
131
132         * UserInterface/Protocol/InspectorBackend.js:
133         (InspectorBackendClass.prototype._dispatchResponse): Inlined a function.
134         (InspectorBackendClass.prototype._dispatchResponseToCallback):
135         (InspectorBackendClass.prototype._dispatchEvent):
136         Report uncaught exceptions via WebInspector.reportInternalError.
137
138         (InspectorBackendClass.prototype._reportProtocolError): Deleted, inlined into the single use site.
139
140 2016-06-29  Joseph Pecoraro  <pecoraro@apple.com>
141
142         Web Inspector: Show Shadow Root type in DOM Tree
143         https://bugs.webkit.org/show_bug.cgi?id=159236
144         <rdar://problem/27068521>
145
146         Reviewed by Timothy Hatcher.
147
148         * Localizations/en.lproj/localizedStrings.js:
149         "Shadow Content (type)" string.
150
151         * UserInterface/Models/DOMNode.js:
152         (WebInspector.DOMNode):
153         (WebInspector.DOMNode.prototype.shadowRoots):
154         (WebInspector.DOMNode.prototype.shadowRootType):
155         Initialize state and add accessors.
156
157         * UserInterface/Views/DOMTreeElement.js:
158         (WebInspector.DOMTreeElement.shadowRootTypeDisplayName):
159         (WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
160         Better string when an element is a Shadow Root.
161
162         * UserInterface/Views/DOMTreeElementPathComponent.js:
163         (WebInspector.DOMTreeElementPathComponent):
164         Better to check the Shadow Root type.
165
166         * UserInterface/Views/DOMTreeOutline.css:
167         (.tree-outline.dom .html-fragment.shadow):
168         Opacity looks poor when there is a selection. Switch to gray.
169
170 2016-06-28  Nikita Vasilyev  <nvasilyev@apple.com>
171
172         REGRESSION (r188730): Web Inspector: Warning icons incorrectly positioned in CSS Rules sidebar
173         https://bugs.webkit.org/show_bug.cgi?id=157869
174         <rdar://problem/26356520>
175
176         Reviewed by Timothy Hatcher.
177
178         Before r188730, CSS text always had a line break as a prefix. r188730 started trimming text.
179         This patch keeps trimming unnecessary whitespace but brings back required line break prefix.
180
181         * UserInterface/Models/CSSStyleDeclaration.js:
182         (WebInspector.CSSStyleDeclaration.prototype.set text):
183         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
184         Make PrefixWhitespace and SuffixWhitespace public.
185
186         (WebInspector.CSSStyleDeclarationTextEditor.prototype._formattedContent):
187         (WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers.update):
188         (WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers):
189         Remove an if conditional as it's always true.
190
191 2016-06-28  Brian Burg  <bburg@apple.com>
192
193         Web Inspector: QuickConsole should update its selection when RuntimeManager.defaultExecutionContextIdentifier changes
194         https://bugs.webkit.org/show_bug.cgi?id=159183
195
196         Reviewed by Timothy Hatcher.
197
198         Currently, the UI listens for state changes in the Frame tree to decide when to reset
199         the selected execution context back to its default value. This is no good, because this
200         should happen even if we have no UI (i.e., testing models only). The UI should simply
201         display changes to the model rather than driving them based on other model changes.
202
203         Move the logic to reset the execution context into RuntimeManager. When the selected
204         context changes, an event is fired which causes the QuickConsole to rebuild its path components.
205
206         * UserInterface/Controllers/RuntimeManager.js:
207         (WebInspector.RuntimeManager):
208         (WebInspector.RuntimeManager.prototype.set defaultExecutionContextIdentifier):
209         Fire an event when the execution context actually changes.
210
211         (WebInspector.RuntimeManager.prototype._frameExecutionContextsCleared):
212         Added. If the selected context was cleared, reset back to default.
213
214         * UserInterface/Models/Frame.js:
215         (WebInspector.Frame.prototype.clearExecutionContexts):
216         Include the contexts that were cleared so clients can match against them.
217
218         * UserInterface/Views/QuickConsole.js:
219         (WebInspector.QuickConsole):
220         Use the proper constant name. Both the old and new names evaluated to `undefined`.
221         No need to keep track of the selected path component, it will always match the
222         defaultExecutionContextIdentifier in RuntimeManager.
223
224         (WebInspector.QuickConsole.prototype.get selectedExecutionContextIdentifier):
225         (WebInspector.QuickConsole.prototype.set selectedExecutionContextIdentifier):
226         Forward to RuntimeManager. This name is less awkward for the UI code that manages selections.
227
228         (WebInspector.QuickConsole.prototype._executionContextPathComponentsToDisplay):
229         Special-case for the main frame execution context.
230
231         (WebInspector.QuickConsole.prototype._framePageExecutionContextsChanged):
232         Remove indirection.
233
234         (WebInspector.QuickConsole.prototype._frameExecutionContextsCleared):
235         Fix the guard to handle undefined execution contexts in the case where it represents the main frame (undefined).
236
237         (WebInspector.QuickConsole.prototype._defaultExecutionContextChanged):
238         Rebuild when the model changes.
239
240         (WebInspector.QuickConsole.prototype._pathComponentSelected): Simplify.
241         (WebInspector.QuickConsole.prototype.get executionContextIdentifier):
242         (WebInspector.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
243         Move the fallback selection behavior into RuntimeManager.
244
245         (WebInspector.QuickConsole.prototype._updateExecutionContextPathComponentForFrame): Deleted.
246         This has been dead code ever since we removed iOS 6 legacy support.
247
248 2016-06-27  Joseph Pecoraro  <pecoraro@apple.com>
249
250         Web Inspector: When modifying sessionStorage, localStorage gets updated
251         https://bugs.webkit.org/show_bug.cgi?id=159181
252         <rdar://problem/27043447>
253
254         Reviewed by Timothy Hatcher.
255
256         * UserInterface/Test/Test.js:
257         (WebInspector.loaded):
258         Add registration for StorageManager and StorageObserver.
259
260 2016-06-27  Brian Burg  <bburg@apple.com>
261
262         Web Inspector: RuntimeManager should not use view object WebInspector.quickConsole
263         https://bugs.webkit.org/show_bug.cgi?id=128092
264         <rdar://problem/15966526>
265
266         Reviewed by Timothy Hatcher.
267
268         This is a layering violation which makes it harder to use RuntimeManager.evaluateInInspectedWindow
269         from a testing context where the QuickConsole view does not exist.
270
271         Store the selected execution context identifier on RuntimeManager and use it
272         when doing subsequent evaluations that act on the currently selected frame.
273
274         * UserInterface/Controllers/RuntimeManager.js:
275         (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
276         (WebInspector.RuntimeManager.prototype.saveResult):
277         Use local state.
278
279         (WebInspector.RuntimeManager.prototype.get defaultExecutionContextIdentifier):
280         (WebInspector.RuntimeManager.prototype.set defaultExecutionContextIdentifier):
281         Added.
282
283         (WebInspector.RuntimeManager):
284         * UserInterface/Models/ExecutionContext.js:
285         (WebInspector.ExecutionContext):
286         Move the symbolic name for the top level execution context to RuntimeManager.
287
288         * UserInterface/Test/Test.js:
289         (WebInspector.loaded): No need to stub out WebInspector.QuickConsole any more.
290
291         * UserInterface/Views/QuickConsole.js:
292         (WebInspector.QuickConsole.prototype._framePageExecutionContextsChanged):
293         (WebInspector.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
294         (WebInspector.QuickConsole.prototype._updateExecutionContextPathComponentForFrame):
295         (WebInspector.QuickConsole.prototype._pathComponentSelected):
296         For now, set RuntimeManager's selected execution context whenever we set the
297         selected path component. In a future patch, we should invert the dependency and have
298         the selected component change whenever RuntimeManager.defaultExecutionContext changes.
299
300 2016-06-23  Joseph Pecoraro  <pecoraro@apple.com>
301
302         Web Inspector: first heap snapshot taken when a page is reloaded happens before the reload navigation
303         https://bugs.webkit.org/show_bug.cgi?id=158995
304         <rdar://problem/26923778>
305
306         Reviewed by Brian Burg.
307
308         Let instruments decide to do work or not based on programmatic
309         (backend initiated) starts and stop.
310
311         Programmatic start can happen due to Auto Capture or console.profile.
312         Programmatic stop can happen due to console.profileEnd.
313
314         For example, this allows the frontend to avoid sending agents start/stop
315         messages when the backend would have already started/stopped the agents.
316
317         * UserInterface/Controllers/TimelineManager.js:
318         (WebInspector.TimelineManager):
319         (WebInspector.TimelineManager.prototype.startCapturing):
320         (WebInspector.TimelineManager.prototype.capturingStopped):
321         (WebInspector.TimelineManager.prototype.autoCaptureStarted):
322         (WebInspector.TimelineManager.prototype.programmaticCaptureStarted):
323         Call Recording.start/stop with a programmatic flag so the frontend
324         instruments can perform a more informed start/stop.
325
326         * UserInterface/Models/TimelineRecording.js:
327         (WebInspector.TimelineRecording.prototype.start):
328         (WebInspector.TimelineRecording.prototype.stop):
329         Let the instruments decide to do work based on the start/stop
330         being initiated by the backend or not.
331
332         * UserInterface/Models/HeapAllocationsInstrument.js:
333         (WebInspector.HeapAllocationsInstrument.prototype.startInstrumentation):
334         (WebInspector.HeapAllocationsInstrument.prototype.stopInstrumentation):
335         * UserInterface/Models/Instrument.js:
336         (WebInspector.Instrument.startLegacyTimelineAgent):
337         (WebInspector.Instrument.prototype.startInstrumentation):
338         (WebInspector.Instrument.prototype.stopInstrumentation):
339         (WebInspector.Instrument):
340         * UserInterface/Models/MemoryInstrument.js:
341         (WebInspector.MemoryInstrument.prototype.startInstrumentation):
342         (WebInspector.MemoryInstrument.prototype.stopInstrumentation):
343         (WebInspector.MemoryInstrument):
344         * UserInterface/Models/NetworkInstrument.js:
345         * UserInterface/Models/ScriptInstrument.js:
346         (WebInspector.ScriptInstrument.prototype.startInstrumentation):
347         (WebInspector.ScriptInstrument.prototype.stopInstrumentation):
348         (WebInspector.ScriptInstrument):
349         Avoid sending start/stop tracking messages when programmatic.
350         This still allows the instruments to do their own frontend tracking,
351         such as the Heap agent triggering periodic snapshots.
352
353 2016-06-23  Joseph Pecoraro  <pecoraro@apple.com>
354
355         Web Inspector: Snapshots should be cleared at some point
356         https://bugs.webkit.org/show_bug.cgi?id=157907
357         <rdar://problem/26373610>
358
359         Reviewed by Timothy Hatcher.
360
361         Invalidate HeapSnapshotProxy objects when the page navigates.
362         This allows us to clear our frontend data for the snapshots.
363         When a snapshot is invalidated, it is disabled in the UI.
364         This means you cannot select the snapshot or see content
365         views for the snapshot. If you are in a snapshot when it is
366         invalidated, you are taken out to the snapshot list.
367
368         * UserInterface/Main.html:
369         New files.
370
371         * UserInterface/Proxies/HeapSnapshotProxy.js:
372         (WebInspector.HeapSnapshotProxy):
373         (WebInspector.HeapSnapshotProxy.invalidateSnapshotProxies):
374         (WebInspector.HeapSnapshotProxy.prototype.get invalid):
375         (WebInspector.HeapSnapshotProxy.prototype._invalidate):
376         Keep track of valid snapshots, and provide a static method to invalidate them.
377
378         (WebInspector.HeapSnapshotProxy.prototype.updateForCollectionEvent):
379         (WebInspector.HeapSnapshotProxy.prototype.allocationBucketCounts):
380         (WebInspector.HeapSnapshotProxy.prototype.instancesWithClassName):
381         (WebInspector.HeapSnapshotProxy.prototype.update):
382         (WebInspector.HeapSnapshotProxy.prototype.nodeWithIdentifier):
383         UI should only act on valid snapshots.
384
385         * UserInterface/Proxies/HeapSnapshotDiffProxy.js:
386         (WebInspector.HeapSnapshotDiffProxy.prototype.get invalid):
387         (WebInspector.HeapSnapshotDiffProxy.prototype.updateForCollectionEvent):
388         (WebInspector.HeapSnapshotDiffProxy.prototype.allocationBucketCounts):
389         (WebInspector.HeapSnapshotDiffProxy.prototype.instancesWithClassName):
390         (WebInspector.HeapSnapshotDiffProxy.prototype.update):
391         (WebInspector.HeapSnapshotDiffProxy.prototype.nodeWithIdentifier):
392         UI should only act on valid snapshots.
393
394         * UserInterface/Proxies/HeapSnapshotWorkerProxy.js:
395         (WebInspector.HeapSnapshotWorkerProxy.prototype._mainResourceDidChange):
396         Invalidate and discard snapshots when the main frame navigates.
397
398         (WebInspector.HeapSnapshotWorkerProxy.prototype._handleMessage):
399         (WebInspector.HeapSnapshotWorkerProxy):
400         * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
401         (HeapSnapshotWorker.prototype.clearSnapshots):
402         (HeapSnapshotWorker.prototype._handleMessage):
403         (HeapSnapshotWorker):
404         A message may come in for a snapshot before it has been cleared.
405         If that is the case, the object may not exist. Return an error so
406         that the callback can be deleted on the calling side.
407
408         * UserInterface/Views/HeapAllocationsTimelineDataGridNodePathComponent.js:
409         (WebInspector.HeapAllocationsTimelineDataGridNodePathComponent.prototype.get previousSibling):
410         (WebInspector.HeapAllocationsTimelineDataGridNodePathComponent.prototype.get nextSibling):
411         (WebInspector.HeapAllocationsTimelineDataGridNodePathComponent):
412         Don't show invalid snapshots in page component picker.
413
414         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css:
415         (.timeline-overview-graph.heap-allocations > img.snapshot.invalid):
416         * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
417         (WebInspector.HeapAllocationsTimelineDataGridNode):
418         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
419         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCells):
420         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype._heapSnapshotInvalidated):
421         Give invalid snapshots an invalidated appearance in the snapshot list.
422
423         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
424         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout):
425         * UserInterface/Views/HeapAllocationsTimelineView.css:
426         (.timeline-view.heap-allocations > .data-grid tr.invalid):
427         (.timeline-view.heap-allocations > .data-grid:not(:focus, .force-focus) tr.selected.invalid):
428         Give invalid snapshots an invalidated appearance in the overview graph.
429
430         * UserInterface/Views/HeapAllocationsTimelineView.js:
431         (WebInspector.HeapAllocationsTimelineView):
432         (WebInspector.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
433         (WebInspector.HeapAllocationsTimelineView.prototype.closed):
434         (WebInspector.HeapAllocationsTimelineView.prototype._heapSnapshotCollectionEvent.updateHeapSnapshotForEvent):
435         (WebInspector.HeapAllocationsTimelineView.prototype._heapSnapshotCollectionEvent):
436         (WebInspector.HeapAllocationsTimelineView.prototype._heapSnapshotInvalidated):
437         (WebInspector.HeapAllocationsTimelineView.prototype._updateCompareHeapSnapshotButton):
438         (WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected):
439         Handle interactions when snapshots in the list are invalidated.
440
441 2016-06-22  Brian Burg  <bburg@apple.com>
442
443         Web Inspector: don't start auto capturing if the Inspector window is not visible
444         https://bugs.webkit.org/show_bug.cgi?id=159014
445
446         Reviewed by Joseph Pecoraro.
447         <rdar://problem/26931269>
448
449         Followup, add a missing super.closed() call mentioned in review comments.
450
451         * UserInterface/Views/TimelineTabContentView.js:
452         (WebInspector.TimelineTabContentView.prototype.closed):
453
454 2016-06-22  Brian Burg  <bburg@apple.com>
455
456         Web Inspector: don't start auto capturing if the Inspector window is not visible
457         https://bugs.webkit.org/show_bug.cgi?id=159014
458         <rdar://problem/26931269>
459
460         Reviewed by Joseph Pecoraro.
461
462         TimelineTabContentView should not tell the timeline manager to enable
463         auto-capturing unless the Web Inspector UI is visible. If it is preloaded
464         but not shown to the user, then auto-capturing may inadvertently disable
465         the debugger, causing it to miss `debugger` statements and not bring the
466         inspector to front.
467
468         * UserInterface/Controllers/TimelineManager.js:
469         (WebInspector.TimelineManager.prototype.set autoCaptureOnPageLoad):
470         Bail out if nothing changed. Coerce to a boolean since the backend requires a boolean.
471
472         * UserInterface/Views/TimelineTabContentView.js:
473         (WebInspector.TimelineTabContentView): Listen for UI visibility changes.
474         (WebInspector.TimelineTabContentView.prototype.shown):
475         Enable auto-capturing if the UI is visible.
476
477         (WebInspector.TimelineTabContentView.prototype.closed): Added.
478         Remove listeners on global objects so this tab doesn't leak.
479
480         (WebInspector.TimelineTabContentView.prototype._inspectorVisibilityChanged):
481         Update the auto-capturing setting if the UI became visible or not visible.
482
483 2016-06-22  Nikita Vasilyev  <nvasilyev@apple.com>
484
485         Web Inspector: Simplify CSS rule for ContentBrowser navigation bar items
486         https://bugs.webkit.org/show_bug.cgi?id=159000
487
488         Reviewed by Timothy Hatcher.
489
490         * UserInterface/Views/ContentBrowser.css:
491         (.content-browser > .navigation-bar > .item):
492         Both these values result in 28px, but `100%` is simplier.
493
494 2016-06-21  Nikita Vasilyev  <nvasilyev@apple.com>
495
496         REGRESSION(r201177): Web Inspector: ContentBrowser navigation bar should fit on a single line
497         https://bugs.webkit.org/show_bug.cgi?id=158700
498         <rdar://problem/26772058>
499
500         Reviewed by Joseph Pecoraro.
501
502         * UserInterface/Views/ContentBrowser.css:
503         (.content-browser > .navigation-bar > .item):
504         Set the height to 28px, as it was before r201177.
505         Make it one pixel shorter than the navigation bar for better vertical alignment.
506
507 2016-06-20  Joseph Pecoraro  <pecoraro@apple.com>
508
509         Web Inspector: UncaughtExceptionReporter should handle null event.error
510         https://bugs.webkit.org/show_bug.cgi?id=158971
511
512         Reviewed by Brian Burg.
513
514         * UserInterface/Debug/UncaughtExceptionReporter.js:
515         Since `typeof null === "object"` handle uncaught exceptions where the
516         Error object itself is null.
517
518 2016-06-20  Joseph Pecoraro  <pecoraro@apple.com>
519
520         Web Inspector: Snapshot List should show the total size and the total live size
521         https://bugs.webkit.org/show_bug.cgi?id=157904
522         <rdar://problem/26372833>
523
524         Reviewed by Brian Burg.
525
526         Include the live size of a snapshot in the snapshot list.
527
528         * Localizations/en.lproj/localizedStrings.js:
529         New "Live Size" string.
530
531         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
532         (HeapSnapshot):
533         (HeapSnapshot.updateCategoriesAndMetadata):
534         (HeapSnapshot.prototype.update):
535         (HeapSnapshot.prototype.serialize):
536         (HeapSnapshotDiff):
537         (HeapSnapshotDiff.prototype.update):
538         (HeapSnapshot.buildCategories): Deleted.
539         (HeapSnapshot.prototype.updateCategories): Deleted.
540         (HeapSnapshotDiff.prototype.updateCategories): Deleted.
541         * UserInterface/Proxies/HeapSnapshotDiffProxy.js:
542         (WebInspector.HeapSnapshotDiffProxy.prototype.updateForCollectionEvent):
543         (WebInspector.HeapSnapshotDiffProxy.prototype.update):
544         (WebInspector.HeapSnapshotDiffProxy.prototype.updateCategories): Deleted.
545         * UserInterface/Proxies/HeapSnapshotProxy.js:
546         (WebInspector.HeapSnapshotProxy):
547         (WebInspector.HeapSnapshotProxy.deserialize):
548         (WebInspector.HeapSnapshotProxy.prototype.get liveSize):
549         (WebInspector.HeapSnapshotProxy.prototype.updateForCollectionEvent):
550         (WebInspector.HeapSnapshotProxy.prototype.update):
551         (WebInspector.HeapSnapshotProxy.prototype.updateCategories): Deleted.
552         Rename "updateCategories" to "update" and update both categories
553         and metadata, like the liveSize.
554
555         * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
556         (WebInspector.HeapAllocationsTimelineDataGridNode):
557         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
558         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype._heapSnapshotCollectedNodes):
559         Update live size after collection.
560
561         * UserInterface/Views/HeapAllocationsTimelineView.js:
562         (WebInspector.HeapAllocationsTimelineView):
563         Include a live size column in the DataGrid.
564         (WebInspector.HeapAllocationsTimelineView.prototype.closed):
565         Cleanup listeners appropriately.
566
567 2016-06-20  Joseph Pecoraro  <pecoraro@apple.com>
568
569         Web Inspector: console.profile should use the new Sampling Profiler
570         https://bugs.webkit.org/show_bug.cgi?id=153499
571         <rdar://problem/24352431>
572
573         Reviewed by Timothy Hatcher.
574
575         * UserInterface/Controllers/TimelineManager.js:
576         (WebInspector.TimelineManager.prototype.programmaticCaptureStarted):
577         (WebInspector.TimelineManager.prototype.programmaticCaptureStopped):
578         (WebInspector.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted):
579         (WebInspector.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped):
580         For programmatic captures, automatically show the Script Timeline, since
581         that is guarenteed to have been started by the backend. Start capturing
582         without creating a new recording.
583
584         * UserInterface/Models/TimelineRecording.js:
585         (WebInspector.TimelineRecording.prototype.stop):
586         (WebInspector.TimelineRecording.prototype.addScriptInstrumentForProgrammaticCapture):
587         When stopping for programmatic capture we don't need to disable
588         instruments, the backend would have already done this.
589
590         * UserInterface/Protocol/ScriptProfilerObserver.js:
591         (WebInspector.ScriptProfilerObserver.prototype.programmaticCaptureStarted):
592         (WebInspector.ScriptProfilerObserver.prototype.programmaticCaptureStopped):
593         (WebInspector.ScriptProfilerObserver):
594         * UserInterface/Protocol/TimelineObserver.js:
595         (WebInspector.TimelineObserver.prototype.programmaticCaptureStarted):
596         (WebInspector.TimelineObserver.prototype.programmaticCaptureStopped):
597         (WebInspector.TimelineObserver):
598         Pass through Web and JSContext programmatic capture events.
599
600 2016-06-19  Nikita Vasilyev  <nvasilyev@apple.com>
601
602         Web Inspector: Remove Sidebar z-index:0 workaround for scrollbars and position:sticky section headers
603         https://bugs.webkit.org/show_bug.cgi?id=158882
604
605         Reviewed by Darin Adler.
606
607         The z-index:0 workaround is no longer needed as it doesn't change anything.
608
609         * UserInterface/Views/Sidebar.css:
610         (.sidebar > .panel): Deleted.
611
612 2016-06-17  Commit Queue  <commit-queue@webkit.org>
613
614         Unreviewed, rolling out r202152.
615         https://bugs.webkit.org/show_bug.cgi?id=158897
616
617         The new test is very unstable, timing out frequently
618         (Requested by ap on #webkit).
619
620         Reverted changeset:
621
622         "Web Inspector: console.profile should use the new Sampling
623         Profiler"
624         https://bugs.webkit.org/show_bug.cgi?id=153499
625         http://trac.webkit.org/changeset/202152
626
627 2016-06-16  Joseph Pecoraro  <pecoraro@apple.com>
628
629         Web Inspector: console.profile should use the new Sampling Profiler
630         https://bugs.webkit.org/show_bug.cgi?id=153499
631         <rdar://problem/24352431>
632
633         Reviewed by Timothy Hatcher.
634
635         * UserInterface/Controllers/TimelineManager.js:
636         (WebInspector.TimelineManager.prototype.programmaticCaptureStarted):
637         (WebInspector.TimelineManager.prototype.programmaticCaptureStopped):
638         (WebInspector.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted):
639         (WebInspector.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped):
640         For programmatic captures, automatically show the Script Timeline, since
641         that is guarenteed to have been started by the backend. Start capturing
642         without creating a new recording.
643
644         * UserInterface/Models/TimelineRecording.js:
645         (WebInspector.TimelineRecording.prototype.stop):
646         (WebInspector.TimelineRecording.prototype.addScriptInstrumentForProgrammaticCapture):
647         When stopping for programmatic capture we don't need to disable
648         instruments, the backend would have already done this.
649
650         * UserInterface/Protocol/ScriptProfilerObserver.js:
651         (WebInspector.ScriptProfilerObserver.prototype.programmaticCaptureStarted):
652         (WebInspector.ScriptProfilerObserver.prototype.programmaticCaptureStopped):
653         (WebInspector.ScriptProfilerObserver):
654         * UserInterface/Protocol/TimelineObserver.js:
655         (WebInspector.TimelineObserver.prototype.programmaticCaptureStarted):
656         (WebInspector.TimelineObserver.prototype.programmaticCaptureStopped):
657         (WebInspector.TimelineObserver):
658         Pass through Web and JSContext programmatic capture events.
659
660 2016-06-16  Joseph Pecoraro  <pecoraro@apple.com>
661
662         REGRESSION (r201538): Web Inspector: Border over Allocations Views is too thick
663         https://bugs.webkit.org/show_bug.cgi?id=158846
664
665         Reviewed by Timothy Hatcher.
666
667         * UserInterface/Views/HeapAllocationsTimelineView.css:
668         (.timeline-view.heap-allocations > .content-view-container > .content-view): Deleted.
669
670 2016-06-16  Matt Baker  <mattbaker@apple.com>
671
672         Unreviewed build fix.
673
674         * UserInterface/Views/DataGrid.js:
675         (WebInspector.DataGrid.prototype.createSettings):
676         "showColumn" -> "setColumnVisible".
677
678 2016-06-16  Matt Baker  <mattbaker@apple.com>
679
680         Web Inspector: DataGrid should manage its own settings
681         https://bugs.webkit.org/show_bug.cgi?id=158675
682         <rdar://problem/26761338>
683
684         Reviewed by Timothy Hatcher.
685
686         Move grid sorting settings (sort order, column identifier) into DataGrid,
687         removing duplicated code from various views. A new grid method, "createSettings",
688         takes an identifier which is used as a prefix for naming the grid's settings.
689
690         So that the new behavior is easy to use and hard to misuse, default values
691         for each setting are set to the current value of the associated property.
692         The result is that:
693
694             grid.sortColumnIdentifier = "columnA";
695             grid.createSettings("myGrid");
696
697         will use "columnA" as the default value the first time the setting is created.
698
699         * UserInterface/Views/ApplicationCacheFrameContentView.js:
700         (WebInspector.ApplicationCacheFrameContentView.prototype._createDataGrid):
701         * UserInterface/Views/CookieStorageContentView.js:
702         (WebInspector.CookieStorageContentView.prototype._rebuildTable):
703         * UserInterface/Views/DOMStorageContentView.js:
704         (WebInspector.DOMStorageContentView):
705         * UserInterface/Views/DataGrid.js:
706         (WebInspector.DataGrid):
707         (WebInspector.DataGrid.prototype.createSettings):
708         (WebInspector.DataGrid.prototype.get identifier): Deleted.
709         (WebInspector.DataGrid.prototype.set identifier): Deleted.
710         (WebInspector.DataGrid.prototype.set sortOrderSetting): Deleted.
711         (WebInspector.DataGrid.prototype.set sortColumnIdentifierSetting): Deleted.
712         * UserInterface/Views/HeapAllocationsTimelineView.js:
713         (WebInspector.HeapAllocationsTimelineView):
714         * UserInterface/Views/HeapSnapshotContentView.js:
715         (WebInspector.HeapSnapshotContentView):
716         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
717         (WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
718         * UserInterface/Views/LayoutTimelineView.js:
719         (WebInspector.LayoutTimelineView):
720         * UserInterface/Views/NetworkGridContentView.js:
721         (WebInspector.NetworkGridContentView):
722         * UserInterface/Views/NetworkTimelineView.js:
723         (WebInspector.NetworkTimelineView):
724         * UserInterface/Views/ProfileView.js:
725         (WebInspector.ProfileView):
726         * UserInterface/Views/RenderingFrameTimelineView.js:
727         (WebInspector.RenderingFrameTimelineView):
728         * UserInterface/Views/ScriptDetailsTimelineView.js:
729         (WebInspector.ScriptDetailsTimelineView):
730
731 2016-06-15  Joseph Pecoraro  <pecoraro@apple.com>
732
733         Uncaught Exception: TypeError: undefined is not an object (evaluating 'imageElement.classList')
734         https://bugs.webkit.org/show_bug.cgi?id=158808
735         <rdar://problem/26821034>
736
737         Reviewed by Brian Burg.
738
739         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
740         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._updateSnapshotMarkers):
741         If the record is out of the layout bounds of the overview graph, the overview graph
742         may not have created an image element yet, so bail. Later, when the image element
743         is created, it would get the appropriate style if the record is selected.
744
745 2016-06-14  Matt Baker  <mattbaker@apple.com>
746
747         Web Inspector: Rename DataGrid.showColumn to setColumnVisible
748         https://bugs.webkit.org/show_bug.cgi?id=158764
749         <rdar://problem/26801448>
750
751         Reviewed by Joseph Pecoraro.
752
753         * UserInterface/Views/DataGrid.js:
754         (WebInspector.DataGrid):
755         Drive-by update to initialize "this._columnChooserEnabled".
756
757         (WebInspector.DataGrid.prototype.set identifier):
758         (WebInspector.DataGrid.prototype.insertColumn):
759         (WebInspector.DataGrid.prototype._collapseColumnGroupWithCell):
760         Use new method name.
761
762         (WebInspector.DataGrid.prototype._contextMenuInHeader):
763         Drive-by style update.
764
765 2016-06-14  Matt Baker  <mattbaker@apple.com>
766
767         Web Inspector: Storage tab should allow hiding columns in the cookies grid
768         https://bugs.webkit.org/show_bug.cgi?id=158767
769         <rdar://problem/26803568>
770
771         Reviewed by Joseph Pecoraro.
772
773         * UserInterface/Views/CookieStorageContentView.js:
774         (WebInspector.CookieStorageContentView.prototype._rebuildTable):
775         Enable column chooser, exclude Name and Value columns.
776
777 2016-06-14  Nikita Vasilyev  <nvasilyev@apple.com>
778
779         Web Inspector: Visual Sidebar: Remove "Text -> Content" subsection
780         https://bugs.webkit.org/show_bug.cgi?id=158758
781         <rdar://problem/26799628>
782
783         Reviewed by Timothy Hatcher.
784
785         "content" CSS property only works with pseudo elements ::before and ::after.
786         It doesn't do anything for regular (non pseudo) elements. Remove it to
787         reduce UI clutter.
788
789         * UserInterface/Views/VisualStyleDetailsPanel.js:
790         (WebInspector.VisualStyleDetailsPanel.prototype.initialLayout):
791         (WebInspector.VisualStyleDetailsPanel.prototype._populateContentSection): Deleted.
792         * UserInterface/Views/VisualStylePropertyEditor.css:
793         (.visual-style-property-container > *:first-child:matches(.visual-style-property-value-container)): Deleted.
794
795 2016-06-14  Joseph Pecoraro  <pecoraro@apple.com>
796
797         Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
798         https://bugs.webkit.org/show_bug.cgi?id=158762
799
800         Reviewed by Timothy Hatcher.
801
802         * UserInterface/Controllers/TimelineManager.js:
803         (WebInspector.TimelineManager.prototype._updateAutoCaptureInstruments):
804         (WebInspector.TimelineManager):
805
806 2016-06-14  Benjamin Poulain  <bpoulain@apple.com>
807
808         Add the unprefixed version of the pseudo element ::placeholder
809         https://bugs.webkit.org/show_bug.cgi?id=158653
810
811         Reviewed by Dean Jackson.
812
813         * UserInterface/Views/FilterBar.css:
814         (.filter-bar > input[type="search"]::placeholder):
815         (.filter-bar > input[type="search"]::-webkit-input-placeholder): Deleted.
816         * UserInterface/Views/FindBanner.css:
817         (.find-banner.console-find-banner > input[type="search"]::placeholder):
818         (.find-banner.console-find-banner > input[type="search"]::-webkit-input-placeholder): Deleted.
819         * UserInterface/Views/GoToLineDialog.css:
820         (.go-to-line-dialog > div > input::placeholder):
821         (.go-to-line-dialog > div > input::-webkit-input-placeholder): Deleted.
822         * UserInterface/Views/OpenResourceDialog.css:
823         (.open-resource-dialog > .field > input::placeholder):
824         (.open-resource-dialog > .field > input::-webkit-input-placeholder): Deleted.
825         * UserInterface/Views/SearchBar.css:
826         (.search-bar > input[type="search"]::placeholder):
827         (.search-bar > input[type="search"]::-webkit-input-placeholder): Deleted.
828         * UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.css:
829
830 2016-06-14  Nikita Vasilyev  <nvasilyev@apple.com>
831
832         Web Inspector: Introduce --navigation-bar-height CSS variable
833         https://bugs.webkit.org/show_bug.cgi?id=158752
834
835         Reviewed by Timothy Hatcher.
836
837         Abstract a commonly repeated height value (29px) into a variable.
838
839         * UserInterface/Views/CSSStyleDetailsSidebarPanel.css:
840         (.sidebar > .panel.details.css-style > .content.has-filter-bar):
841         * UserInterface/Views/DebuggerSidebarPanel.css:
842         (.sidebar > .panel.navigation.debugger > :matches(.content, .empty-content-placeholder)):
843         * UserInterface/Views/FilterBar.css:
844         (.filter-bar):
845         * UserInterface/Views/NavigationBar.css:
846         (.navigation-bar):
847         * UserInterface/Views/NavigationSidebarPanel.css:
848         (.sidebar > .panel.navigation > .content):
849         (.sidebar > .panel.navigation > .overflow-shadow.top):
850         * UserInterface/Views/NetworkSidebarPanel.css:
851         (.sidebar > .panel.navigation.network > .title-bar):
852         * UserInterface/Views/ResourceSidebarPanel.css:
853         (.sidebar > .panel.navigation.resource > :matches(.content, .empty-content-placeholder)):
854         * UserInterface/Views/SearchSidebarPanel.css:
855         (.sidebar > .panel.navigation.search > :matches(.content, .empty-content-placeholder)):
856         (.sidebar > .panel.navigation.search > .search-bar):
857         * UserInterface/Views/Sidebar.css:
858         (.sidebar.has-navigation-bar > .panel):
859         * UserInterface/Views/StorageSidebarPanel.css:
860         (.sidebar > .panel.navigation.storage > :matches(.content, .empty-content-placeholder)):
861         * UserInterface/Views/TimelineRecordingContentView.css:
862         (.content-view.timeline-recording > .content-browser .recording-progress):
863         * UserInterface/Views/Variables.css:
864         (:root):
865
866 2016-06-14  Saam Barati  <sbarati@apple.com>
867
868         Follow up to: Web Inspector: Call Trees view should have a 'Top Functions'-like mode
869         https://bugs.webkit.org/show_bug.cgi?id=158555
870         <rdar://problem/26712544>
871
872         Unreviewed follow up patch.
873
874         - Move a long if-else sequence to a switch statement.
875         - Fix a copy-paste typo in a Symbol(.) enum.
876
877         * UserInterface/Models/CallingContextTree.js:
878         (WebInspector.CallingContextTree.prototype.updateTreeWithStackTrace):
879
880 2016-06-13  Joseph Pecoraro  <pecoraro@apple.com>
881
882         Web Inspector: Show Exception Stack in UncaughtExceptionReporter view
883         https://bugs.webkit.org/show_bug.cgi?id=158657
884         <rdar://problem/26754441>
885
886         Reviewed by Darin Adler.
887
888         * UserInterface/Debug/UncaughtExceptionReporter.css:
889         (.uncaught-exception-sheet li):
890         Make newlines significant.
891
892         * UserInterface/Debug/UncaughtExceptionReporter.js:
893         (unblockEventHandlers):
894         (handleError):
895         (handleLinkClick):
896         (formattedEntry):
897         Format the exception and a possible stack with a bit of sanitizing.
898
899 2016-06-13  Matt Baker  <mattbaker@apple.com>
900
901         Web Inspector: Filter Records not applying to new records
902         https://bugs.webkit.org/show_bug.cgi?id=158213
903         <rdar://problem/26543912>
904
905         Reviewed by Timothy Hatcher.
906
907         This patch makes the following improvements to timeline grid filtering:
908
909             - Records are filtered as they are added to the grid.
910             - Timeline view no longer triggers a filter refresh while the
911               current time changes while recording.
912             - Filters are refreshed whenever the current timeline view changes.
913
914         * UserInterface/Views/DataGrid.js:
915         (WebInspector.DataGrid.prototype.hasFilters):
916         Helper function to check for custom and text filters.
917
918         (WebInspector.DataGrid.prototype._applyFiltersToNodeAndDispatchEvent):
919         Encapsulate node state change and event dispatch, which was previously
920         done in multiple places.
921
922         (WebInspector.DataGrid.prototype.insertChild):
923         Filter incoming node if needed.
924
925         (WebInspector.DataGrid.prototype._updateFilter.createIteratorForNodesToBeFiltered):
926         (WebInspector.DataGrid.prototype._updateFilter):
927         (WebInspector.DataGrid.prototype.yieldableTaskWillProcessItem):
928         Use new convenience functions.
929
930         (WebInspector.DataGrid.prototype.hasCustomFilters): Deleted.
931         Renamed `hasFilters`.
932
933         * UserInterface/Views/TimelineRecordingContentView.js:
934         (WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
935         Refresh grid filters on view change.
936
937         * UserInterface/Views/TimelineView.js:
938         (WebInspector.TimelineView.prototype.set startTime):
939         (WebInspector.TimelineView.prototype.set endTime):
940         Schedule filter change notification when selection bounds changes.
941
942         (WebInspector.TimelineView.prototype._timesDidChange):
943         (WebInspector.TimelineView.prototype._scheduleFilterDidChange):
944         (WebInspector.TimelineView):
945
946 2016-06-13  Saam Barati  <sbarati@apple.com>
947
948         Web Inspector: Call Trees view should have a 'Top Functions'-like mode
949         https://bugs.webkit.org/show_bug.cgi?id=158555
950         <rdar://problem/26712544>
951
952         Reviewed by Timothy Hatcher.
953
954         This patch adds a Top Functions view that is similar to Instruments'
955         Top Functions view. I really wanted to add this view because I've
956         been doing a lot of performance debugging and I've exclusively 
957         used the Top Functions view and I want the Inspector to also have
958         this view. I like to think of it as a more sophisticated version of the bottom-up view.
959         
960         Top Functions works by treating every frame as a root in the tree.
961         Top functions view then presents a list of "roots". This is the same
962         as all other views, which also present a list of roots, but in this case,
963         every frame is a root. Bottom Up is great for nailing in specific performance
964         problems in exactly one frame. But Bottom Up doesn't give you good context about where
965         a specific frame is in the call tree and how frames are related by having
966         a caller or some path of shared callers. For example, consider this call tree:
967                  (program)
968                  /        \
969                 /          \
970            (many nodes...)  
971               / 
972              /
973             (parent)
974             /   \
975            /     \
976          (leaf1)  (leaf2)
977         
978         Suppose that 'leaf1' is super hot, and 'leaf2' is moderately hot.
979         If we look at this through Bottom Up view, we will see 'leaf1'
980         is super hot, but it will take more scrolling to see that 'leaf2'
981         is moderately hot. Lets say that 'parent' is also moderately hot,
982         but that the majority of its time isn't self time. With Bottom Up view,
983         there is no good way to see that 'leaf1' and 'leaf2' are both nodes under 'parent'.
984         With Top Down, you can find this information, but it requires a ton of drilling down into
985         the tree (i.e, you must expand past the 'many nodes...' I drew above). It's inconvenient to
986         use Top Down here for indentation alone. Bottom up will tell you that 'leaf1' is super hot,
987         and that 'leaf2' and 'parent' are moderately hot, but it doesn't show how they're related
988         in the original tree. It's important to see that 'parent's total time is very high
989         because it itself is moderately hot, and it has a child node that is super hot, and
990         another child that's moderately 'hot'. For the sake of this example, let's pretend
991         that 85% of the program's time is spent inside 'parent'. Seeing this information through
992         'Top Functions' is easy because this information filters to the top of the list. Specifically,
993         when using 'Top Functions' sorted by Total Time. Because every node is a root, there will be
994         a top-level entry for every frame in the program. Specifically, there will be a top-level node
995         for 'parent' in my above example. Because I've sorted this view by Total Time, I will see '(program)'
996         first. That's because 100% of execution time is under the '(program)' frame. Then, I might see
997         a few other nodes that also run the entire time because '(program)' calls them, and they eventually
998         call into other things that never leave the stack. These will also have time ranges near 100%.
999         But, only a few nodes after that, I'll see 'parent' in the list because it accounts for 85% of
1000         execution time. Immediately, I will see that it has some self time, and that it has two child
1001         nodes that have self time. This is really helpful.
1002         
1003         Let's consider another example where it's not easy in Top Down to get the full picture of 'parent':
1004                    (program)
1005                     /  |  \
1006                  (... many nodes...)
1007                   /           \
1008             (many nodes...)   (many nodes...)
1009                  /             \
1010                parent         parent
1011                  |              |
1012                 leaf1          leaf2
1013         
1014         
1015         If we viewed this program in Top Down, we don't get a full picture of 'parent'
1016         because it has its time distributed in two different subsections of the tree.
1017         Specifically, lets say it has 70% of time in the leaf1 path, and 30% of the
1018         time in the leaf2 path. We want a way to see these things together. It's impossible
1019         to do this in Top Down or Bottom Up. But, in Top Functions view, we get the view that
1020         we want to see because we treat 'parent' as a root of the tree. Because we do this,
1021         we will create the following sub tree in the Top Functions view:
1022                 parent
1023                /      \
1024              leaf1   leaf2
1025         This happens naturally because when 'parent' is a root, we add all its children
1026         to its subtree.
1027         
1028         Constructing this tree is really easy. What we do is take any arbitrary stack
1029         trace of length n, and treat is as n separate stack traces. Specifically, we
1030         perform the following operation for any stack trace S.
1031         
1032         S = [A, B, C, D]
1033         (A is the entry frame, and D is the top of the stack).
1034         We will transform this into a list of stack traces S' like so:
1035         S' = [[A, B, C, D], [B, C, D], [C, D], [D]]
1036         
1037         If we then run the normal top down tree algorithm on this set of stack
1038         traces, all nodes get treated as roots, and voila, we get the Top Functions view.
1039
1040         * Localizations/en.lproj/localizedStrings.js:
1041         * UserInterface/Controllers/TimelineManager.js:
1042         * UserInterface/Main.html:
1043         * UserInterface/Models/CallingContextTree.js:
1044         * UserInterface/Models/TimelineRecording.js:
1045         * UserInterface/Views/ScriptProfileTimelineView.js:
1046         * UserInterface/Views/TextToggleButtonNavigationItem.css: Added.
1047         * UserInterface/Views/TextToggleButtonNavigationItem.js: Added.
1048
1049 2016-06-13  Matt Baker  <mattbaker@apple.com>
1050
1051         Web Inspector: Add ability to show/hide DataGird columns
1052         https://bugs.webkit.org/show_bug.cgi?id=158676
1053         <rdar://problem/26761573>
1054
1055         Reviewed by Timothy Hatcher.
1056
1057         Make it possible to show/hide grid columns using the grid header
1058         context menu. This patch enables the new behavior for most of the
1059         timeline grids.
1060
1061         * UserInterface/Views/DataGrid.js:
1062         (WebInspector.DataGrid):
1063         (WebInspector.DataGrid.prototype.get identifier):
1064         (WebInspector.DataGrid.prototype.set identifier):
1065         An identifier for the grid instance, for managing per-grid settings.
1066         Setting the id causes settings to be created, and their values to be
1067         applied to the grid.
1068
1069         (WebInspector.DataGrid.prototype.get columnChooserEnabled):
1070         (WebInspector.DataGrid.prototype.set columnChooserEnabled):
1071         Enable showing/hiding columns via the grid header.
1072
1073         (WebInspector.DataGrid.prototype.insertColumn):
1074         (WebInspector.DataGrid.prototype.showColumn):
1075         Set column visibility and hidden column setting, then perform layout.
1076
1077         (WebInspector.DataGrid.prototype._collapseColumnGroupWithCell):
1078         (WebInspector.DataGrid.prototype._contextMenuInHeader):
1079         Create column chooser menu items if necessary.
1080
1081         (WebInspector.DataGrid.prototype._showColumn): Deleted.
1082         (WebInspector.DataGrid.prototype._hideColumn): Deleted.
1083         Replaced by `showColumn`.
1084
1085         * UserInterface/Views/LayoutTimelineView.js:
1086         (WebInspector.LayoutTimelineView):
1087         Always show "type" and "name" columns.
1088
1089         * UserInterface/Views/NetworkTimelineView.js:
1090         (WebInspector.NetworkTimelineView):
1091         * UserInterface/Views/RenderingFrameTimelineView.js:
1092         (WebInspector.RenderingFrameTimelineView):
1093         * UserInterface/Views/ScriptDetailsTimelineView.js:
1094         (WebInspector.ScriptDetailsTimelineView):
1095         Always show "name" column.
1096
1097         * UserInterface/Views/TimelineDataGrid.js:
1098         (WebInspector.TimelineDataGrid):
1099         Enable column chooser.
1100
1101 2016-06-10  Joseph Pecoraro  <pecoraro@apple.com>
1102
1103         Web Inspector: <template> content should not be hidden as Shadow Content
1104         https://bugs.webkit.org/show_bug.cgi?id=158654
1105
1106         Reviewed by Ryosuke Niwa.
1107
1108         * Localizations/en.lproj/localizedStrings.js:
1109         New "Template Content" string.
1110
1111         * UserInterface/Models/DOMNode.js:
1112         (WebInspector.DOMNode):
1113         Don't treat template content as shadow content.
1114
1115         * UserInterface/Views/DOMTreeElement.js:
1116         (WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
1117         Custom string for template content fragment.
1118
1119 2016-06-10  Matt Baker  <mattbaker@apple.com>
1120
1121         Web Inspector: heap snapshot comparison view shows nothing if later snapshot is chosen first
1122         https://bugs.webkit.org/show_bug.cgi?id=158584
1123         <rdar://problem/26727849>
1124
1125         Reviewed by Timothy Hatcher.
1126
1127         ALways compare the the later snapshot to the earlier snapshot,
1128         regardless of selection order.
1129
1130         * UserInterface/Views/HeapAllocationsTimelineView.js:
1131         (WebInspector.HeapAllocationsTimelineView):
1132         (WebInspector.HeapAllocationsTimelineView.prototype._dataGridNodeSelected):
1133         Swap shapshots if the first has a greater identifier than the second.
1134         Drive-by cleanup: null out `_baselineDataGridNode` since it isn't used
1135         after the comparison completes.
1136
1137 2016-06-10  Matt Baker  <mattbaker@apple.com>
1138
1139         Web Inspector: rendering frames timeline "60fps" horizontal guide is mispositioned after switching timeline modes
1140         https://bugs.webkit.org/show_bug.cgi?id=158587
1141         <rdar://problem/26728174>
1142
1143         Reviewed by Timothy Hatcher.
1144
1145         When the view mode changes we iterate over all overview graphs, updating
1146         their visibility as needed. Graphs being shown perform layout, even though
1147         the overview's state is in transition: its offset height may still change.
1148
1149         A simple fix is to use TimelineOverviewGraph.height instead of the graph
1150         element's offset height when performing layout.
1151
1152         * UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
1153         (WebInspector.RenderingFrameTimelineOverviewGraph.prototype.layout):
1154
1155 2016-06-10  Matt Baker  <mattbaker@apple.com>
1156
1157         REGRESSION (r201538): Web Inspector: 1px gap above timeline progress view
1158         https://bugs.webkit.org/show_bug.cgi?id=158626
1159
1160         Reviewed by Joseph Pecoraro.
1161
1162         Adjust progress view top position to account for grid border changes.
1163
1164         * UserInterface/Views/TimelineRecordingContentView.css:
1165         (.content-view.timeline-recording > .content-browser .recording-progress):
1166
1167 2016-06-10  Matt Baker  <mattbaker@apple.com>
1168
1169         Web Inspector: REGRESSION (r201538): Web Inspector: Border under JS Call Trees content view is too thick
1170         https://bugs.webkit.org/show_bug.cgi?id=158624
1171         <rdar://problem/26743633>
1172
1173         Reviewed by Joseph Pecoraro.
1174
1175         Remove top border from <th> elements.
1176
1177         * UserInterface/Views/ProfileView.css:
1178         (.profile > .data-grid th): Deleted.
1179
1180 2016-06-09  Joseph Pecoraro  <pecoraro@apple.com>
1181
1182         REGRESSION: Web Inspector: IndexedDB does not show ObjectStore data
1183         https://bugs.webkit.org/show_bug.cgi?id=158592
1184         <rdar://problem/26730696>
1185
1186         Reviewed by Timothy Hatcher.
1187
1188         * UserInterface/Views/DataGrid.js:
1189         (WebInspector.DataGrid.prototype._noteRowRemoved):
1190         (WebInspector.DataGridNode.prototype._detach):
1191         When rows are removed in the non-Virtual DataGrids, we should
1192         actually remove the row.
1193
1194         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
1195         (WebInspector.IndexedDatabaseObjectStoreContentView):
1196         (WebInspector.IndexedDatabaseObjectStoreContentView.prototype._fetchMoreData.processEntries):
1197         (WebInspector.IndexedDatabaseObjectStoreContentView.prototype._fetchMoreData):
1198         Don't use the delete operator. Use a boolean.
1199
1200 2016-06-09  Nikita Vasilyev  <nvasilyev@apple.com>
1201
1202         Web Inspector: Support Command-P for quick open
1203         https://bugs.webkit.org/show_bug.cgi?id=158579
1204         <rdar://problem/26726751>
1205
1206         Reviewed by Timothy Hatcher.
1207
1208         * UserInterface/Base/Main.js:
1209         (WebInspector.contentLoaded):
1210
1211 2016-06-09  Nikita Vasilyev  <nvasilyev@apple.com>
1212
1213         REGRESSION (r194717): Web Inspector: Elements tab: an element loses focus when selected by Up/Down key
1214         https://bugs.webkit.org/show_bug.cgi?id=157768
1215         <rdar://problem/26311155>
1216
1217         Reviewed by Timothy Hatcher.
1218
1219         Remove _previousFocusedSection and _newInspectorRuleSelector since it was used only
1220         to focus on a newly created section (added by clicking on "+" button).
1221
1222         Introduce _inspectorSection and _isInspectorSectionPendingFocus.
1223
1224         * UserInterface/Views/CSSStyleDeclarationSection.js:
1225         (WebInspector.CSSStyleDeclarationSection.prototype.cssStyleDeclarationTextEditorBlurActiveEditor): Deleted.
1226         (WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste): Deleted.
1227         No longer needed, it was only used by _previousFocusedSection and _newInspectorRuleSelector.
1228
1229         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
1230         (WebInspector.CSSStyleDeclarationTextEditor.): Deleted.
1231         No londer needed, it was only used by _previousFocusedSection.
1232
1233         * UserInterface/Views/RulesStyleDetailsPanel.js:
1234         (WebInspector.RulesStyleDetailsPanel):
1235         (WebInspector.RulesStyleDetailsPanel.prototype.refresh.appendStyleSection):
1236         (WebInspector.RulesStyleDetailsPanel.prototype.newRuleButtonClicked):
1237         (WebInspector.RulesStyleDetailsPanel.prototype.nodeStylesRefreshed):
1238         (WebInspector.RulesStyleDetailsPanel.prototype.cssStyleDeclarationSectionEditorFocused): Deleted.
1239         (WebInspector.RulesStyleDetailsPanel.prototype.cssStyleDeclarationSectionBlurActiveEditor): Deleted.
1240         (WebInspector.RulesStyleDetailsPanel.prototype.cssStyleDeclarationSectionFocusNewInspectorRuleWithSelector): Deleted.
1241
1242 2016-06-08  Joseph Pecoraro  <pecoraro@apple.com>
1243
1244         REGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console
1245         https://bugs.webkit.org/show_bug.cgi?id=158548
1246         <rdar://problem/26708513>
1247
1248         Reviewed by Timothy Hatcher.
1249
1250         * UserInterface/Controllers/RuntimeManager.js:
1251         (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
1252         Switch the many parameters to an options dictionary.
1253         Include a new option for sourceURL appender, so that
1254         Console evaluations can have its own append.
1255
1256         * UserInterface/Controllers/JavaScriptLogViewController.js:
1257         (WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
1258         Use the appendWebInspectorConsoleEvaluationSourceURL appender.
1259
1260         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
1261         (WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
1262         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
1263         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection.):
1264         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
1265         Use the new options dictionary.
1266
1267 2016-06-08  Brian Burg  <bburg@apple.com>
1268
1269         Web Inspector: an error is encountered when trying to delete nodes that have children
1270         https://bugs.webkit.org/show_bug.cgi?id=158541
1271         <rdar://problem/26705901>
1272
1273         Reviewed by Timothy Hatcher.
1274
1275         * UserInterface/Views/DOMTreeElement.js:
1276         (WebInspector.DOMTreeElement.prototype.adjustCollapsedRange):
1277         Offset into the array variable instead of a variable holding its length.
1278
1279 2016-06-08  Brian Burg  <bburg@apple.com>
1280
1281         Web Inspector: DOMTreeOutline selection areas should be created and updated lazily
1282         https://bugs.webkit.org/show_bug.cgi?id=158513
1283         <rdar://problem/26689646>
1284
1285         Reviewed by Timothy Hatcher.
1286
1287         Selection areas for DOMTreeElements are used for several things: drag markers,
1288         element hover styles, element selection styles, and showing forced pseudo states
1289         for an element. Fortunately it's easy to tell when any of these things is necessary.
1290
1291         Change DOMTreeOutline and DOMTreeElement so they don't create selection areas
1292         unless they are needed for one of these tasks. This significantly reduces
1293         forced layouts that are required to update the selection area height in case the
1294         element has new attributes that cause the tag to become more or less wrapped.
1295
1296         * UserInterface/Views/DOMTreeElement.js:
1297         (WebInspector.DOMTreeElement.prototype.set hovered):
1298         Modernize this method a bit.
1299
1300         (WebInspector.DOMTreeElement.prototype.updateSelectionArea):
1301         If a selection area is not necessary, don't create one.
1302         If one exists and it's not needed, then remove it.
1303
1304         (WebInspector.DOMTreeElement.prototype.onattach):
1305         Remove redundant calls to updateSelection(). This is already called in
1306         updateTitle().
1307
1308         (WebInspector.DOMTreeElement.prototype.onselect):
1309         Ask the DOMTreeOutline to update the selection rather than forcing the
1310         element to do it. This is consistent with other updates to user selection.
1311
1312         (WebInspector.DOMTreeElement.prototype._insertInLastAttributePosition):
1313         (WebInspector.DOMTreeElement.prototype._startEditingAsHTML.dispose):
1314         (WebInspector.DOMTreeElement.prototype._startEditingAsHTML):
1315         Use renamed method.
1316
1317         (WebInspector.DOMTreeElement.prototype.updateTitle):
1318         Add a comment to explain why the selection area is nulled out here.
1319
1320         (WebInspector.DOMTreeElement.prototype.get pseudoClassesEnabled):
1321         (WebInspector.DOMTreeElement.prototype._nodePseudoClassesDidChange):
1322         Update the selection area in case one does not exist for this tree element.
1323         The indicator for forced pseudo classes is a pseudo element of the selection area.
1324
1325         (WebInspector.DOMTreeElement.prototype.updateSelection): Renamed.
1326         (WebInspector.DOMTreeElement.prototype.onexpand):
1327         (WebInspector.DOMTreeElement.prototype.oncollapse):
1328         Remove redundant calls to updateSelection(). This is already called in
1329         updateTitle().
1330
1331         * UserInterface/Views/DOMTreeOutline.css:
1332         (.tree-outline.dom):
1333         (.tree-outline.dom li.hovered:not(.selected) .selection-area):
1334         (.tree-outline.dom li .selection-area):
1335         (.tree-outline.dom li.selected .selection-area):
1336         (.tree-outline.dom li.elements-drag-over .selection-area):
1337         (.tree-outline.dom:focus li.selected .selection-area):
1338         (.tree-outline.dom li.pseudo-class-enabled > .selection-area::before):
1339         (.tree-outline.dom:focus li.selected.pseudo-class-enabled > .selection-area::before):
1340         (.tree-outline.dom li.hovered:not(.selected) .selection): Deleted.
1341         (.tree-outline.dom li .selection): Deleted.
1342         (.tree-outline.dom li.selected .selection): Deleted.
1343         (.tree-outline.dom li.elements-drag-over .selection): Deleted.
1344         (.tree-outline.dom:focus li.selected .selection): Deleted.
1345         (.tree-outline.dom li.pseudo-class-enabled > .selection::before): Deleted.
1346         (.tree-outline.dom:focus li.selected.pseudo-class-enabled > .selection::before): Deleted.
1347         Rename the selector to be less ambiguous.
1348
1349         * UserInterface/Views/DOMTreeOutline.js:
1350         (WebInspector.DOMTreeOutline.prototype.updateSelection): Simplify. The call
1351         to update the selection area will bail out if there is nothing to be done.
1352
1353         (WebInspector.DOMTreeOutline.prototype.findTreeElement):
1354         (WebInspector.DOMTreeOutline.prototype._onmousemove):
1355         (WebInspector.DOMTreeOutline.prototype._onmouseout):
1356         Clean up and use let and arrow functions.
1357
1358         (WebInspector.DOMTreeOutline.prototype._ondragover):
1359         (WebInspector.DOMTreeOutline.prototype._clearDragOverTreeElementMarker):
1360         Clear the dragging element before updating the selection area since it looks at
1361         the dragging element to determine whether anything needs to be done.
1362
1363         * UserInterface/Views/FormattedValue.css:
1364         (.formatted-node > .tree-outline.dom li.hovered:not(.selected) .selection-area):
1365         (.formatted-node > .tree-outline.dom li.hovered:not(.selected) .selection): Deleted.
1366         Rename the selector to be less ambiguous.
1367
1368 2016-06-08  Brian Burg  <bburg@apple.com>
1369
1370         Uncaught Exception in TimelineDataGrid._updatePopoverForSelectedNode()
1371         https://bugs.webkit.org/show_bug.cgi?id=158502
1372         <rdar://problem/26687038>
1373
1374         Reviewed by Joseph Pecoraro.
1375
1376         * UserInterface/Views/TimelineDataGrid.js:
1377         (WebInspector.TimelineDataGrid.prototype._updatePopoverForSelectedNode):
1378         It appears that this expression was moved around since it accesses
1379         targetFrame before it's initialized. Check rect.size.height directly.
1380
1381 2016-06-08  Brian Burg  <bburg@apple.com>
1382
1383         Web Inspector: reduce redundant attribute modification updates in DOMTreeUpdater and DOMTreeElement
1384         https://bugs.webkit.org/show_bug.cgi?id=158504
1385         <rdar://problem/25561452>
1386
1387         Reviewed by Timothy Hatcher.
1388
1389         When the frontend gets lots of DOM.attributeModified events, it forwards these on to
1390         DOMTreeUpdater, which pushes a record for every single modification. It then updates
1391         the DOM elements with the attibute changes on an animation frame. However, since it
1392         doesn't do any deduplication of the modification records, a lot of time is wasted
1393         on updating DOMTreeElements with intermediate (non-final) attribute values.
1394
1395         This patch rewrites DOMTreeUpdater to precisely track which nodes and attributes
1396         of each node need to be updated on the next animation frame. This is done using
1397         Sets and Maps that only hold onto the most recent attribute values rather than
1398         pushing a record object for every single mutation.
1399
1400         This improves the performance of the Elements tab on an SVG particle simulator
1401         dramatically so that the Inspector will not immediately hang. It still only achieves
1402         a few updates per second in this case, so there is still optimization to be done on
1403         the frontend and throttling to be done on the backend.
1404
1405         * UserInterface/Views/DOMTreeElement.js:
1406         (WebInspector.DOMTreeElement):
1407         (WebInspector.DOMTreeElement.prototype.attributeDidChange):
1408         (WebInspector.DOMTreeElement.prototype._buildAttributeDOM):
1409         (WebInspector.DOMTreeElement.prototype._markNodeChanged):
1410         (WebInspector.DOMTreeElement.prototype._nodeChangedAnimationEnd):
1411         (WebInspector.DOMTreeElement.prototype._fireDidChange):
1412         (WebInspector.DOMTreeElement.prototype.nodeStateChanged): Deleted.
1413         Simplify the list of modified attributes a little bit. This still uses a worklist
1414         approach, so it's possible that duplicate updates for the same attribute could accumulate
1415         if DOMTreeUpdater pushes updates faster than DOMTreeElement can render them.
1416
1417         * UserInterface/Views/DOMTreeUpdater.js:
1418         (WebInspector.DOMTreeUpdater):
1419         (WebInspector.DOMTreeUpdater.prototype._attributesUpdated):
1420         (WebInspector.DOMTreeUpdater.prototype._characterDataModified):
1421         (WebInspector.DOMTreeUpdater.prototype._nodeAttributeModified):
1422         (WebInspector.DOMTreeUpdater.prototype._nodeInserted):
1423         (WebInspector.DOMTreeUpdater.prototype._nodeRemoved):
1424         (WebInspector.DOMTreeUpdater.prototype._childNodeCountUpdated):
1425         (WebInspector.DOMTreeUpdater.prototype._updateModifiedNodes):
1426         (WebInspector.DOMTreeUpdater.prototype._reset):
1427         Rewrite this class to separately track insertions, deletions, and modifications. Use
1428         Sets and Maps so redundant entries are not kept around. Split the main work loop
1429         and use fewer enum-like properties to control how each DOM element change is handled.
1430
1431         Attempt to update all inserted children before modifying their attributes. This
1432         wasn't done previously, but enough duplicate attribute modifications occurred that
1433         usually some of them would be processed after being added to the tree. There is only
1434         one chance to do this now.
1435
1436 2016-06-08  Nikita Vasilyev  <nvasilyev@apple.com>
1437
1438         REGRESSION (r158219): Web Inspector: Border under the default Timeline content view is too thick
1439         https://bugs.webkit.org/show_bug.cgi?id=158533
1440
1441         Reviewed by Timothy Hatcher.
1442
1443         * UserInterface/Views/OverviewTimelineView.css:
1444         (.timeline-view.overview > .data-grid th): Deleted.
1445
1446 2016-06-08  Timothy Hatcher  <timothy@apple.com>
1447
1448         Web Inspector: Command-W should not close Web Inspector tabs; it should close the window
1449         https://bugs.webkit.org/show_bug.cgi?id=158538
1450         rdar://problem/26699215
1451
1452         Reviewed by Brian Burg.
1453
1454         * UserInterface/Views/TabBrowser.js:
1455         (WebInspector.TabBrowser): Change shortcut to Command-Shift-W.
1456
1457 2016-06-07  Brian Burg  <bburg@apple.com>
1458
1459         Web Inspector: reduce timer churn when processing many DOM.attributeModified messages
1460         https://bugs.webkit.org/show_bug.cgi?id=158491
1461         <rdar://problem/25561452>
1462
1463         Reviewed by Timothy Hatcher.
1464
1465         When the backend sends thousands of DOM.attributeModified events to the frontend, it
1466         slows to a crawl. This is partly because redundant messages are being sent, and
1467         because the frontend is taking too long to render attribute updates in the elements tab.
1468
1469         This patch is a first step to improve performance by reducing unnecessary work. It
1470         coalesces all attribute state updates to only happen once per animation frame. This
1471         reduces timer churn because we previously used a debouncing timer with interval of 0ms,
1472         and that had to be cleared and restarted on every call. This change also eliminates
1473         forced layouts when updating the selection highlights, since the DOM tree outline has
1474         been reflowed by the time we start updating selections in a requestAnimationFrame callback.
1475
1476         There is still a lot of optimization to be done here, but this reduces the problem
1477         considerably by keeping the event loop clear and making it obvious which selection
1478         update operations are still too expensive.
1479
1480         * UserInterface/Base/Utilities.js:
1481         Add a 'onNextFrame' proxy to Object. It works like debounce, except it coalesces calls
1482         up until the next animation frame rather than a fixed timeout. It also does not extend
1483         the timeout interval for each call.
1484
1485         * UserInterface/Views/DOMTreeUpdater.js:
1486         (WebInspector.DOMTreeUpdater.prototype._attributesUpdated):
1487         (WebInspector.DOMTreeUpdater.prototype._characterDataModified):
1488         (WebInspector.DOMTreeUpdater.prototype._nodeInserted):
1489         (WebInspector.DOMTreeUpdater.prototype._nodeRemoved):
1490         (WebInspector.DOMTreeUpdater.prototype._updateModifiedNodes):
1491         Update on the next frame rather than on a zero delay timeout.
1492
1493         * UserInterface/Views/TreeOutline.js:
1494         (WebInspector.TreeOutline.WebInspector.TreeElement.prototype.didChange):
1495         (WebInspector.TreeOutline.WebInspector.TreeElement.prototype._fireDidChange):
1496         Update on the next frame rather than on a zero delay timeout.
1497
1498 2016-06-07  Nikita Vasilyev  <nvasilyev@apple.com>
1499
1500         REGRESSION (r158219): Web Inspector: Border under Memory content view is too thick
1501         https://bugs.webkit.org/show_bug.cgi?id=158495
1502         <rdar://problem/26683428>
1503
1504         Reviewed by Timothy Hatcher.
1505
1506         * UserInterface/Views/MemoryTimelineView.css:
1507         (.timeline-view.memory): Deleted.
1508
1509 2016-06-07  Brian Burg  <bburg@apple.com>
1510
1511         Web Inspector: add a keyboard shortcut to open the new tab tab
1512         https://bugs.webkit.org/show_bug.cgi?id=158365
1513         <rdar://problem/26631897>
1514
1515         Unreviewed, fix a typo introduced in r201692.
1516         This caused the new tab button to stop working.
1517
1518         * UserInterface/Base/Main.js:
1519         (WebInspector._updateNewTabButtonState):
1520
1521 2016-06-05  Matt Baker  <mattbaker@apple.com>
1522
1523         REGRESSION (r201686): Web Inspector: Fix typo causing an internal error
1524         https://bugs.webkit.org/show_bug.cgi?id=158392
1525         <rdar://problem/26640467>
1526
1527         Reviewed by Joseph Pecoraro.
1528
1529         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
1530         Fixed typo.
1531
1532 2016-06-04  Brian Burg  <bburg@apple.com>
1533
1534         Web Inspector: add a keyboard shortcut to open the new tab tab
1535         https://bugs.webkit.org/show_bug.cgi?id=158365
1536         <rdar://problem/26631897>
1537
1538         Reviewed by Timothy Hatcher.
1539
1540         Make Cmd-t show the new tab tab if it's not already open and
1541         there is at least one tab type that's not currently in the tab bar.
1542
1543         * UserInterface/Base/Main.js:
1544         (WebInspector.contentLoaded):
1545         (WebInspector._updateNewTabButtonState):
1546         (WebInspector.showNewTabTab):
1547         (WebInspector.isNewTabWithTypeAllowed):
1548         Clean up the code that decides whether we can show the new tab tab.
1549         It is now a special case inside WebInspector.isNewTabWithTypeAllowed.
1550
1551         * UserInterface/Views/NewTabContentView.js:
1552         (WebInspector.NewTabContentView.prototype._updateShownTabs):
1553         Use Array.from.
1554
1555 2016-06-04  Matt Baker  <mattbaker@apple.com>
1556
1557         Web Inspector: discontinuous recordings should have discontinuities in the timeline memory graph
1558         https://bugs.webkit.org/show_bug.cgi?id=158052
1559         <rdar://problem/26516695>
1560
1561         Reviewed by Joseph Pecoraro.
1562
1563         Add gaps to the overview and category line charts where discontinuities
1564         exist in the timeline recording.
1565
1566         * UserInterface/Models/Timeline.js:
1567         (WebInspector.Timeline.prototype.recordsInTimeRange):
1568         Replaces `_visibleRecords` methods found in various views.
1569
1570         * UserInterface/Models/TimelineRecording.js:
1571         (WebInspector.TimelineRecording.prototype.reset):
1572         (WebInspector.TimelineRecording.prototype.addDiscontinuity):
1573         (WebInspector.TimelineRecording.prototype.discontinuitiesInTimeRange):
1574         Allow discontinuities to be added to the recording, and have a means to
1575         look up gaps within a time range.
1576
1577         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
1578         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._visibleRecords): Deleted.
1579         Replaced by Timeline helper method.
1580
1581         * UserInterface/Views/MemoryTimelineOverviewGraph.js:
1582         (WebInspector.MemoryTimelineOverviewGraph.prototype.layout.insertDiscontinuity):
1583         (WebInspector.MemoryTimelineOverviewGraph.prototype.layout):
1584         Insert zero-points into the chart at discontinuity boundaries to create
1585         gaps. Data points for records immediately before or after a gap are extended
1586         to the edge of the discontinuity.
1587
1588         (WebInspector.MemoryTimelineOverviewGraph.prototype._visibleRecords): Deleted.
1589         Replaced by Timeline helper method.
1590
1591         * UserInterface/Views/MemoryTimelineView.js:
1592         (WebInspector.MemoryTimelineView.prototype.layout):
1593         Insert zero-points into each category chart at discontinuity boundaries
1594         to create gaps.
1595
1596         Insert zero-points into the chart to create gaps.
1597         (WebInspector.MemoryTimelineView.prototype._visibleRecords): Deleted.
1598         Replaced by Timeline helper method.
1599
1600         * UserInterface/Views/TimelineOverview.js:
1601         (WebInspector.TimelineOverview.prototype.discontinuitiesInTimeRange):
1602         Forward to the TimelineRecording, which isn't exposed to clients.
1603
1604         * UserInterface/Views/TimelineRecordingContentView.js:
1605         (WebInspector.TimelineRecordingContentView):
1606         (WebInspector.TimelineRecordingContentView.prototype._capturingStarted):
1607         (WebInspector.TimelineRecordingContentView.prototype._capturingStopped):
1608         (WebInspector.TimelineRecordingContentView.prototype._recordingReset):
1609         Track discontinuities (recording stop followed by a start) and add them
1610         to the current recording.
1611
1612 2016-06-03  Brian Burg  <bburg@apple.com>
1613
1614         Web Inspector: add a keyboard shortcut to close the current tab bar item
1615         https://bugs.webkit.org/show_bug.cgi?id=158363
1616         <rdar://problem/22677254>
1617
1618         Reviewed by Timothy Hatcher.
1619
1620         Make Cmd-w close the current tab. This matches Safari's keyboard shortcut.
1621
1622         * UserInterface/Views/TabBrowser.js:
1623         (WebInspector.TabBrowser):
1624         Don't do anything if the New Tab tab is the only tab bar item besides the
1625         pinned "new tab" button.
1626
1627 2016-06-03  Brian Burg  <bburg@apple.com>
1628
1629         Web Inspector: setter for debugging flag InspectorBackend.dumpInspectorTimeStats does not work
1630         https://bugs.webkit.org/show_bug.cgi?id=158366
1631
1632         Reviewed by Timothy Hatcher.
1633
1634         * UserInterface/Protocol/InspectorBackend.js:
1635         (InspectorBackendClass.prototype.set dumpInspectorTimeStats):
1636         Actually update the backing member when the setter is called.
1637
1638 2016-06-03  Nikita Vasilyev  <nvasilyev@apple.com>
1639
1640         Web Inspector: Remove unused WebInspector.CSSCompletions methods
1641         https://bugs.webkit.org/show_bug.cgi?id=158352
1642
1643         Reviewed by Joseph Pecoraro.
1644
1645         * UserInterface/Models/CSSCompletions.js:
1646         (WebInspector.CSSCompletions.prototype.firstStartsWith): Deleted.
1647         (WebInspector.CSSCompletions.prototype.isLonghandPropertyName): Deleted.
1648         (WebInspector.CSSCompletions.prototype.longhandsForShorthand): Deleted.
1649
1650 2016-06-03  Joseph Pecoraro  <pecoraro@apple.com>
1651
1652         Web Inspector: Update NativeFunctionParameters (FontFaceSet, HTMLSlotElement, EventTarget)
1653         https://bugs.webkit.org/show_bug.cgi?id=158333
1654
1655         Reviewed by Brian Burg.
1656
1657         * UserInterface/Models/NativeFunctionParameters.js:
1658         Replace FontLoader with FontFaceSet. Add HTMLSlotElement API.
1659         EventTarget is now actually in the prototype chain, so add it as
1660         a first class citizen and keep mixing it in for legacy backends.
1661
1662 2016-06-02  Joseph Pecoraro  <pecoraro@apple.com>
1663
1664         Web Inspector: Modernize Array.prototype.every/some callsites to arrow functions
1665         https://bugs.webkit.org/show_bug.cgi?id=158330
1666
1667         Reviewed by Brian Burg.
1668
1669         * UserInterface/Controllers/DOMTreeManager.js:
1670         (WebInspector.DOMTreeManager.prototype._updateContentFlowFromPayload):
1671         * UserInterface/Models/ProfileNode.js:
1672         (WebInspector.ProfileNode):
1673         * UserInterface/Models/ScopeChainNode.js:
1674         (WebInspector.ScopeChainNode):
1675         * UserInterface/Models/StackTrace.js:
1676         (WebInspector.StackTrace):
1677         * UserInterface/Models/StructureDescription.js:
1678         (WebInspector.StructureDescription):
1679         * UserInterface/Models/TypeDescription.js:
1680         (WebInspector.TypeDescription):
1681         * UserInterface/Protocol/InspectorBackend.js:
1682         (InspectorBackend.Command.prototype.supports):
1683         * UserInterface/Views/ContentViewContainer.js:
1684         (WebInspector.ContentViewContainer.prototype.showContentView):
1685         * UserInterface/Views/NavigationSidebarPanel.js:
1686         (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie.treeElementMatchesCookie):
1687         (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
1688         * UserInterface/Views/ScopeBar.js:
1689         (WebInspector.ScopeBar.prototype.get selectedItems):
1690         (WebInspector.ScopeBar.prototype.hasNonDefaultItemSelected):
1691         * UserInterface/Views/TabContentView.js:
1692         (WebInspector.TabContentView):
1693         (WebInspector.TabContentView.console.assert): Deleted.
1694
1695 2016-06-02  Joseph Pecoraro  <pecoraro@apple.com>
1696
1697         Web Inspector: Modernize some function expressions that bind(this) to arrow functions
1698         https://bugs.webkit.org/show_bug.cgi?id=158315
1699
1700         Reviewed by Brian Burg.
1701
1702         Convert a common "function(x) { ... }.bind(this)" pattern to use arrow
1703         functions "(x) => { ... }", which lexically binds `this`, slightly faster,
1704         and uses less memory.
1705
1706         * UserInterface/Base/Main.js:
1707         (WebInspector._updateNewTabButtonState):
1708         * UserInterface/Controllers/BreakpointPopoverController.js:
1709         (WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
1710         * UserInterface/Controllers/TypeTokenAnnotator.js:
1711         (WebInspector.TypeTokenAnnotator.prototype.insertAnnotations):
1712         (WebInspector.TypeTokenAnnotator.prototype.insertAnnotations.): Deleted.
1713         * UserInterface/Models/RenderingFrameTimelineRecord.js:
1714         (WebInspector.RenderingFrameTimelineRecord.prototype._calculateDurationRemainder):
1715         (WebInspector.RenderingFrameTimelineRecord):
1716         * UserInterface/Models/Resource.js:
1717         (WebInspector.Resource.prototype.requestContent):
1718         * UserInterface/Models/Script.js:
1719         (WebInspector.Script.prototype.requestScriptSyntaxTree):
1720         (WebInspector.Script.prototype.requestScriptSyntaxTree.makeSyntaxTreeAndCallCallback): Deleted.
1721         * UserInterface/Models/SourceCodeLocation.js:
1722         (WebInspector.SourceCodeLocation.prototype.populateLiveDisplayLocationString):
1723         * UserInterface/Models/WrappedPromise.js:
1724         (WebInspector.WrappedPromise):
1725         * UserInterface/Views/BreakpointActionView.js:
1726         (WebInspector.BreakpointActionView.prototype._updateBody):
1727         * UserInterface/Views/BreakpointTreeElement.js:
1728         (WebInspector.BreakpointTreeElement.prototype._dataUpdated):
1729         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
1730         (WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers.update):
1731         (WebInspector.CSSStyleDeclarationTextEditor.prototype._updateTextMarkers):
1732         * UserInterface/Views/DefaultDashboardView.js:
1733         (WebInspector.DefaultDashboardView.prototype._appendElementForNamedItem.set item):
1734         (WebInspector.DefaultDashboardView.prototype._appendElementForNamedItem):
1735         * UserInterface/Views/ErrorObjectView.js:
1736         (WebInspector.ErrorObjectView.prototype.update):
1737         * UserInterface/Views/GeneralTreeElement.js:
1738         (WebInspector.GeneralTreeElement.prototype.onattach):
1739         (WebInspector.GeneralTreeElement.prototype.onattach.this._boundContextMenuEventHandler): Deleted.
1740         * UserInterface/Views/InlineSwatch.js:
1741         (WebInspector.InlineSwatch.prototype._getNextValidHEXFormat):
1742         (WebInspector.InlineSwatch):
1743         * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
1744         (WebInspector.LayerTreeDetailsSidebarPanel.prototype.refresh):
1745         (WebInspector.LayerTreeDetailsSidebarPanel.prototype._showPopoverForSelectedNode):
1746         (WebInspector.LayerTreeDetailsSidebarPanel.prototype._contentForPopover):
1747         * UserInterface/Views/LogContentView.js:
1748         (WebInspector.LogContentView.prototype._mouseup):
1749         * UserInterface/Views/NavigationSidebarPanel.js:
1750         (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
1751         * UserInterface/Views/ObjectTreeBaseTreeElement.js:
1752         (WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement):
1753         (WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement.): Deleted.
1754         * UserInterface/Views/ObjectTreePropertyTreeElement.js:
1755         (WebInspector.ObjectTreePropertyTreeElement.prototype._updateEntries):
1756         * UserInterface/Views/ObjectTreeView.js:
1757         (WebInspector.ObjectTreeView.prototype._updateEntries):
1758         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
1759         (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshImageSizeSection):
1760         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
1761         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
1762         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeElementAddContextMenuItems):
1763         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked.this._codeMirror.addKeyMap): Deleted.
1764         * UserInterface/Views/TabBar.js:
1765         * UserInterface/Views/VisualStylePropertyEditor.js:
1766         (WebInspector.VisualStylePropertyEditor.prototype._checkDependencies):
1767
1768 2016-05-31  Nikita Vasilyev  <nvasilyev@apple.com>
1769
1770         Web Inspector: Storage DataGrids have a half-pixel transparent/white border below the header
1771         https://bugs.webkit.org/show_bug.cgi?id=156699
1772         <rdar://problem/25778260>
1773
1774         Reviewed by Timothy Hatcher.
1775
1776         Increase the width of the border below the DataGrid's header to match the border in the left sidebar.
1777
1778         * UserInterface/Views/DataGrid.css:
1779         (.data-grid > .header-wrapper):
1780
1781 2016-05-31  Nikita Vasilyev  <nvasilyev@apple.com>
1782
1783         Web Inspector: Snapshot List scroll bar occludes border of containing view in top-right
1784         https://bugs.webkit.org/show_bug.cgi?id=158219
1785         <rdar://problem/26545018>
1786
1787         Reviewed by Timothy Hatcher.
1788
1789         * UserInterface/Views/TimelineDataGrid.css:
1790         (.data-grid.timeline th): Deleted.
1791         * UserInterface/Views/TimelineRecordingContentView.css:
1792         (.content-view.timeline-recording > .content-browser > .navigation-bar):
1793         Make the border line span across the whole navigation bar, not just its table cells.
1794
1795 2016-05-30  Brian Burg  <bburg@apple.com>
1796
1797         Web Inspector: Timelines: "-0.000ms" in Self Time
1798         https://bugs.webkit.org/show_bug.cgi?id=158162
1799         <rdar://problem/26523350>
1800
1801         Reviewed by Darin Adler.
1802
1803         Values such as -0.0000 and +0.00001 seem to indicate there is
1804         some floating point error accumulating in profile node data.
1805         Since the sampling profiler isn't accurate to that precision,
1806         let's clean up the data so near-zero numbers are simply zero.
1807
1808         * UserInterface/Models/ProfileNode.js:
1809         Round selfTime down to zero if it's less than the
1810         smallest value we would show in the user interface.
1811
1812 2016-05-30  Brian Burg  <bburg@apple.com>
1813
1814         Web Inspector: Uncaught exception page should pre-populate the bug's URL with the inspected page URL
1815         https://bugs.webkit.org/show_bug.cgi?id=158055
1816         <rdar://problem/26516693>
1817
1818         Reviewed by Saam Barati.
1819
1820         * UserInterface/Debug/UncaughtExceptionReporter.js:
1821         Include the encoded URL in the query string if it is not empty.
1822
1823 2016-05-30  Matt Baker  <mattbaker@apple.com>
1824
1825         Web Inspector: Right-clicking in Snapshot's DataGrid throws an exception
1826         https://bugs.webkit.org/show_bug.cgi?id=157934
1827         <rdar://problem/26380910>
1828
1829         Reviewed by Brian Burg.
1830
1831         Check that click event target is actually a cell, as it can be a row
1832         when focusing the table after dismissing a popup menu.
1833
1834         * UserInterface/Views/DataGrid.js:
1835         (WebInspector.DataGridNode.prototype.isEventWithinDisclosureTriangle):
1836
1837 2016-05-27  Joseph Pecoraro  <pecoraro@apple.com>
1838
1839         Web Inspector: Not all transitively dominated nodes display their retained size
1840         https://bugs.webkit.org/show_bug.cgi?id=158174
1841
1842         Reviewed by Timothy Hatcher.
1843
1844         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
1845         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._isDominatedByNonBaseParent):
1846         Use the parent reference changing in the loop instead of always using the same parent.
1847
1848 2016-05-27  Devin Rousso  <dcrousso+webkit@gmail.com>
1849
1850         Web Inspector: Add indicators to show nesting levels inside DOM Tree
1851         https://bugs.webkit.org/show_bug.cgi?id=157468
1852         <rdar://problem/26162640>
1853
1854         Reviewed by Timothy Hatcher.
1855
1856         Add CSS rules to give all expanded node children lists a small line on the
1857         left border indicating that all items under the line are descendants.
1858
1859         * UserInterface/Views/DOMTreeOutline.css:
1860         (.tree-outline.dom li .selection):
1861         (.tree-outline.dom li > span):
1862         (.tree-outline.dom ol):
1863         (.tree-outline.dom .tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded):
1864         (.tree-outline.dom li.selected + ol.children.expanded):
1865         (.tree-outline.dom li.parent::before):
1866
1867 2016-05-26  Matt Baker  <mattbaker@apple.com>
1868
1869         Uncaught Exception: TypeError: undefined is not an object (evaluating 'records[endIndex].endTime')
1870         https://bugs.webkit.org/show_bug.cgi?id=158057
1871
1872         Reviewed by Timothy Hatcher.
1873
1874         * UserInterface/Views/TimelineRecordingContentView.js:
1875         (WebInspector.TimelineRecordingContentView.prototype._updateTimelineViewTimes):
1876         When the entire recording is selected, rendering frames should use the
1877         record count as its end time instead of the recording's end time.
1878
1879 2016-05-25  Joseph Pecoraro  <pecoraro@apple.com>
1880
1881         Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'collectionData.affectedSnapshots')
1882         https://bugs.webkit.org/show_bug.cgi?id=158051
1883
1884         Reviewed by Brian Burg.
1885
1886         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
1887         (HeapSnapshot.prototype.updateDeadNodesAndGatherCollectionData):
1888         * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
1889         (HeapSnapshotWorker.prototype.createSnapshot):
1890         If by the time the timeout fires we had cleared our snapshot list, then
1891         updateDeadNodesAndGatherCollectionData could bail. Handle gracefully.
1892
1893 2016-05-23  Nikita Vasilyev  <nvasilyev@apple.com>
1894
1895         Web Inspector: Split console navigation bar doesn't wrap as expected
1896         https://bugs.webkit.org/show_bug.cgi?id=157950
1897         <rdar://problem/26395573>
1898
1899         Reviewed by Timothy Hatcher.
1900
1901         * UserInterface/Views/Main.css:
1902         (#split-content-browser > .navigation-bar .item):
1903         Fix the split console and don't touch any other navigation bars.
1904
1905 2016-05-22  Brady Eidson  <beidson@apple.com>
1906
1907         Move to C++14.
1908         https://bugs.webkit.org/show_bug.cgi?id=157948
1909
1910         Reviewed by Michael Catanzaro.
1911
1912         * Configurations/Base.xcconfig:
1913
1914 2016-05-21  Matt Baker  <mattbaker@apple.com>
1915
1916         Web Inspector: Creating the CSSStyleDetailsSidebarPanel takes about 50ms (20%) of main load
1917         https://bugs.webkit.org/show_bug.cgi?id=156707
1918         <rdar://problem/25780404>
1919
1920         Reviewed by Timothy Hatcher.
1921
1922         This patch adds new View concepts, `initialLayout` and `widthDidChange`,
1923         making it possible for hidden views to postpone the creation of their
1924         UI subtree until they are shown for the first time.
1925
1926         Sidebar panels get this performance improvement by virtue of SidebarPanel
1927         and StyleDetailsPanel, which trigger a layout when shown. This can be
1928         removed once <https://webkit.org/b/150741> is fixed, and this is done
1929         automatically by View.
1930
1931         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
1932         (WebInspector.CSSStyleDeclarationTextEditor):
1933         Should subclass View.
1934         (WebInspector.CSSStyleDeclarationTextEditor.prototype.layout):
1935         (WebInspector.CSSStyleDeclarationTextEditor.prototype.get element): Deleted.
1936         Handled in View base class.
1937         (WebInspector.CSSStyleDeclarationTextEditor.prototype.updateLayout): Deleted.
1938         Relocate to `layout` override, ignore unused parameter `force`.
1939
1940         * UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
1941         (WebInspector.CSSStyleDetailsSidebarPanel):
1942         Create the minimum required initial state and UI elements. Relocate
1943         anything that can be lazy loaded to `initialLayout`.
1944
1945         (WebInspector.CSSStyleDetailsSidebarPanel.prototype.initialLayout):
1946         (WebInspector.CSSStyleDetailsSidebarPanel.prototype.sizeDidChange):
1947         (WebInspector.CSSStyleDetailsSidebarPanel.prototype.widthDidChange): Deleted.
1948
1949         * UserInterface/Views/ComputedStyleDetailsPanel.js:
1950         (WebInspector.ComputedStyleDetailsPanel):
1951         Relocate anything that can be lazy loaded to `initialLayout`.
1952         (WebInspector.ComputedStyleDetailsPanel.prototype.initialLayout):
1953         (WebInspector.ComputedStyleDetailsPanel.prototype.shown): Deleted.
1954         (WebInspector.ComputedStyleDetailsPanel.prototype.widthDidChange): Deleted.
1955         Handled in View base class.
1956
1957         * UserInterface/Views/DataGrid.js:
1958         (WebInspector.DataGrid.prototype.layout):
1959         Resize logic can be safely moved to `sizeDidChange`, since columns are
1960         always initialized when the width changes.
1961         (WebInspector.DataGrid.prototype.sizeDidChange):
1962         Reposition headers, scrollbars.
1963         (WebInspector.DataGrid.prototype._updateHeaderAndScrollbar):
1964         Broke out header repositioning, which needs to be called whenever
1965         column widths are initialized or the view size changes.
1966
1967         * UserInterface/Views/NavigationBar.js:
1968         (WebInspector.NavigationBar.prototype.layout):
1969
1970         * UserInterface/Views/RulesStyleDetailsPanel.js:
1971         (WebInspector.RulesStyleDetailsPanel.prototype.sizeDidChange):
1972         (WebInspector.RulesStyleDetailsPanel.prototype.widthDidChange): Deleted.
1973
1974         * UserInterface/Views/Sidebar.js:
1975         (WebInspector.Sidebar.prototype._recalculateWidth):
1976         Width changes need to be coordinated by the View base class, since the
1977         initial layout must have occurred before handling a width change.
1978         Force a layout with a resize layout reason.
1979
1980         * UserInterface/Views/SidebarPanel.js:
1981         (WebInspector.SidebarPanel.prototype.get displayName):
1982         Drive-by style fix: add getter so that CSSStyleDetailsSidebarPanel
1983         doesn't have to read the private property directly.
1984
1985         (WebInspector.SidebarPanel.prototype.shown):
1986         Force a layout whenever the panel is shown.
1987         (WebInspector.SidebarPanel.prototype.sizeDidChange):
1988         (WebInspector.SidebarPanel):
1989         (WebInspector.SidebarPanel.prototype.widthDidChange): Deleted.
1990
1991         * UserInterface/Views/StyleDetailsPanel.js:
1992         (WebInspector.StyleDetailsPanel.prototype.shown):
1993         Schedule a layout when shown. A forced layout isn't necessary.
1994         Unlike SidebarPanels, the initial state of style panels doesn't depend
1995         on its layout, and can be safely initialized by the next rAF.
1996
1997         (WebInspector.StyleDetailsPanel.prototype.hidden):
1998         Cancel a pending layout if the panel is hidden before the next AF.
1999         (WebInspector.StyleDetailsPanel.prototype.widthDidChange): Deleted.
2000         Not needed, defined in View base class.
2001
2002         * UserInterface/Views/TimelineOverview.js:
2003         (WebInspector.TimelineOverview.prototype.sizeDidChange):
2004         (WebInspector.TimelineOverview.prototype.layout):
2005         Moved resize logic to `sizeDidChange`.
2006
2007         * UserInterface/Views/TimelineRuler.js:
2008         (WebInspector.TimelineRuler.prototype.sizeDidChange):
2009         (WebInspector.TimelineRuler.prototype.layout):
2010         Moved resize logic to `sizeDidChange`.
2011
2012         * UserInterface/Views/View.js:
2013         (WebInspector.View):
2014         (WebInspector.View.prototype.updateLayout):
2015         (WebInspector.View.prototype.cancelLayout):
2016         Allow a pending layout to be canceled. Useful when a view with a
2017         pending layout is hidden before the layout occurs.
2018
2019         (WebInspector.View.prototype.get layoutReason):
2020         Protected getter for subclasses that need to check the layout reason
2021         outside `sizeDidChange`.
2022
2023         (WebInspector.View.prototype.initialLayout):
2024         Subclass hook to create UI subtree the first time a layout occurs.
2025         Called only once during the lifetime of the View.
2026
2027         (WebInspector.View.prototype.layout):
2028         Drive-by comment fix.
2029         (WebInspector.View.prototype.sizeDidChange):
2030         New layout cycle hook for subclasses.
2031         (WebInspector.View.prototype._layoutSubtree):
2032         Do an initial layout the first time layout is called.
2033         Call the `sizeDidChange` hook so that subclasses can update state
2034         which depends on size/position before doing layout.
2035
2036         * UserInterface/Views/VisualStyleDetailsPanel.js:
2037         (WebInspector.VisualStyleDetailsPanel):
2038         Create the minimum required initial state and UI elements. Relocate
2039         anything that can be lazy loaded to `initialLayout`.
2040
2041         (WebInspector.VisualStyleDetailsPanel.prototype.refresh):
2042         No changes, shifting line numbers confused the diff.
2043         (WebInspector.VisualStyleDetailsPanel.prototype.initialLayout):
2044         (WebInspector.VisualStyleDetailsPanel.prototype.sizeDidChange):
2045         (WebInspector.VisualStyleDetailsPanel.prototype.widthDidChange): Deleted.
2046
2047 2016-05-21  Matt Baker  <mattbaker@apple.com>
2048
2049         Assertion Failed: StyleDetailsPanel.markAsNeedsRefresh() called with null domNode
2050         https://bugs.webkit.org/show_bug.cgi?id=157955
2051         <rdar://problem/26398943>
2052
2053         Reviewed by Timothy Hatcher.
2054
2055         CSSStyleDetailsSidebarPanel `visible` is true while the panel is being
2056         removed from the details sidebar, even after calling `hidden()`. This
2057         causes it to refresh its current StyleDetailsPanel with a null DOM node.
2058
2059         Unfortunately, SidebarPanel.visible isn't toggled by calling shown/hidden.
2060         Since SidebarPanel.visible is only true if the panel is selected, we should
2061         deselect panels before removing them.
2062
2063         * UserInterface/Views/Sidebar.js:
2064         (WebInspector.Sidebar.prototype.removeSidebarPanel):
2065         Deselect the panel being removed before calling visibiltyDidChange.
2066
2067         * UserInterface/Views/SidebarPanel.js:
2068         (WebInspector.SidebarPanel.prototype.toggle): Deleted.
2069         (WebInspector.SidebarPanel.prototype.willRemove): Deleted.
2070         Drive-by update to remove some unused methods.
2071
2072 2016-05-20  Joseph Pecoraro  <pecoraro@apple.com>
2073
2074         REGRESSION(r200740): Web Inspector: TimelineRecordBar class lists not properly cleared, bleeding colors when zooming in and out
2075         https://bugs.webkit.org/show_bug.cgi?id=157959
2076         <rdar://problem/26393067>
2077
2078         Reviewed by Brian Burg.
2079
2080         * UserInterface/Views/TimelineRecordBar.js:
2081         (WebInspector.TimelineRecordBar.prototype.set records):
2082         When records are cleared, clear all classes.
2083
2084 2016-05-20  Nikita Vasilyev  <nvasilyev@apple.com>
2085
2086         Web Inspector: Split Console is auto opening all the time when using Inspect Element context menu
2087         https://bugs.webkit.org/show_bug.cgi?id=157910
2088         <rdar://problem/26374066>
2089
2090         Reviewed by Timothy Hatcher.
2091
2092         Currently, "synthetic" property is only used to decide whether adding a console message should
2093         open the console or not. Replace it with "shouldRevealConsole".
2094
2095         * UserInterface/Controllers/DOMTreeManager.js:
2096         (WebInspector.DOMTreeManager.prototype.inspectNodeObject.nodeAvailable):
2097         (WebInspector.DOMTreeManager.prototype.inspectNodeObject):
2098         * UserInterface/Controllers/JavaScriptLogViewController.js:
2099         (WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult.saveResultCallback):
2100         (WebInspector.JavaScriptLogViewController.prototype.appendImmediateExecutionWithResult):
2101         (WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted.printResult):
2102         (WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted):
2103         (WebInspector.JavaScriptLogViewController.prototype._appendConsoleMessageView):
2104         * UserInterface/Models/ConsoleCommandResultMessage.js:
2105         (WebInspector.ConsoleCommandResultMessage):
2106         (WebInspector.ConsoleCommandResultMessage.prototype.get shouldRevealConsole):
2107         (WebInspector.ConsoleCommandResultMessage.prototype.get synthetic): Deleted.
2108         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
2109         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.):
2110         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
2111
2112 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
2113
2114         Web Inspector: Can't resume Debugger after breaking on exception in Promise
2115         https://bugs.webkit.org/show_bug.cgi?id=157240
2116         <rdar://problem/26030890>
2117
2118         Reviewed by Timothy Hatcher.
2119
2120         If we pause but have no source code to show we paused in purely internal
2121         code. In such cases we were attempting to resume without actually
2122         telling the backend to resume, so the backend and frontend were out of
2123         sync. The frontend thinking it is "paused" without an activeCallFrame
2124         and the backend actually being paused.
2125
2126         This change more gracefully handles this situation. It actually resumes
2127         both the frontend and the backend.
2128
2129         * UserInterface/Controllers/DebuggerManager.js:
2130         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
2131         Resume the backend and the frontend.
2132
2133         (WebInspector.DebuggerManager.prototype._didResumeInternal):
2134         Don't look at the active call frame, look at the paused state.
2135         This may issue a Resumed event without actually triggering a
2136         Paused event if this was the only pause, but that is harmless.
2137
2138 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
2139
2140         Web Inspector: Main Resource with <scripts> not showing up in debugger sidebar after reload
2141         https://bugs.webkit.org/show_bug.cgi?id=157939
2142         <rdar://problem/26385691>
2143
2144         Reviewed by Timothy Hatcher.
2145
2146         The order of events on a reload are:
2147
2148             - MainResourceChanged, add main resource
2149             - ScriptsCleared, remove all elements
2150
2151         This change makes it so ScriptsCleared add the main resource (and
2152         potentially other resources). This also avoids the work in
2153         MainResourceChanged on reloads / navigations that would be wasted if
2154         ScriptsCleared were to just remove it. However, this is still needed
2155         for initial load where ScriptsCleared does not happen.
2156
2157         * UserInterface/Views/DebuggerSidebarPanel.js:
2158         (WebInspector.DebuggerSidebarPanel.prototype._mainResourceDidChange):
2159         Only add the main resource tree here when we are first loading.
2160
2161         (WebInspector.DebuggerSidebarPanel.prototype._scriptsCleared):
2162         Add the main resource tree after we remove all children in navigations.
2163
2164         * UserInterface/Views/NavigationSidebarPanel.js:
2165         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
2166         This was not gracefully handling if there was no selected tree element.
2167
2168 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
2169
2170         Web Inspector: Visual Style connectors are not always centered properly
2171         https://bugs.webkit.org/show_bug.cgi?id=157932
2172
2173         Reviewed by Timothy Hatcher.
2174
2175         * UserInterface/Views/VisualStylePropertyEditorLink.css:
2176         (.visual-style-property-editor-link):
2177         Remove the 1px margin on @2x that would cause jitter at different
2178         sidebar widths. It is however needed on @1x.
2179
2180         (.visual-style-property-editor-link:not(.link-all)):
2181         Make the height 20 so these both move closer to the center of the
2182         <select> elements they are next to. They are not perfectly centered
2183         as that would require a half pixel.
2184
2185         (.visual-style-property-editor-link.link-vertical):
2186         Move the top line up a pixel so it is "up 0.5" from center and
2187         the bottom one is already "down 0.5" from the center.
2188
2189 2016-05-19  Nikita Vasilyev  <nvasilyev@apple.com>
2190
2191         REGRESSION (r189385): Web Inspector: CSS properties modified via JS don't update in the Styles sidebar
2192         https://bugs.webkit.org/show_bug.cgi?id=157918
2193
2194         Reviewed by Timothy Hatcher.
2195
2196         * UserInterface/Controllers/DOMTreeManager.js:
2197         (WebInspector.DOMTreeManager):
2198         (WebInspector.DOMTreeManager.prototype._inlineStyleInvalidated):
2199         (WebInspector.DOMTreeManager.prototype._loadNodeAttributes):
2200         Set the initial value of _loadNodeAttributesTimeout to be 0,
2201         as setTimeout always returns a positive integer.
2202
2203 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
2204
2205         Web Inspector: Heap Snapshots taken before timeline view has a zero time do not get shown
2206         https://bugs.webkit.org/show_bug.cgi?id=157923
2207         <rdar://problem/26377366>
2208
2209         Reviewed by Timothy Hatcher.
2210
2211         * UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
2212         (WebInspector.HeapAllocationsTimelineDataGridNode):
2213         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.createCellContent):
2214         (WebInspector.HeapAllocationsTimelineDataGridNode.prototype.updateTimestamp):
2215         Show emDash for the timestamp if we don't yet have a zero time.
2216         Update when we get a zero time.
2217
2218         * UserInterface/Views/HeapAllocationsTimelineView.js:
2219         (WebInspector.HeapAllocationsTimelineView):
2220         (WebInspector.HeapAllocationsTimelineView.prototype.layout):
2221         (WebInspector.HeapAllocationsTimelineView.prototype.reset):
2222         Save a list of nodes pre-zero time and update them when we get a zero time.
2223
2224 2016-05-19  Joseph Pecoraro  <pecoraro@apple.com>
2225
2226         Web Inspector: HeapSnapshot Instances view should remove dead objects
2227         https://bugs.webkit.org/show_bug.cgi?id=157920
2228         <rdar://problem/26375866>
2229
2230         Reviewed by Timothy Hatcher.
2231
2232         * UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
2233         (HeapSnapshotWorker):
2234         (HeapSnapshotWorker.prototype.clearSnapshots):
2235         (HeapSnapshotWorker.prototype.createSnapshot):
2236         Preserve a list of snapshots for this page's session. When
2237         new snapshots come in we can determine which nodes have died
2238         and update previous snapshots. Emit a CollectionEvent
2239         containing the nodes that were deleted and affected snapshots.
2240
2241         * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
2242         (HeapSnapshot):
2243         Stash the largest node identifier.
2244         Create a byte-per-node list to mark it as dead or alive.
2245         All snapshots start with all live nodes.
2246
2247         (HeapSnapshot.prototype.updateDeadNodesAndGatherCollectionData):
2248         (HeapSnapshot.prototype._markDeadNodes):
2249         When we get a new snapshot we can mark dead nodes in previous
2250         snapshots. Determine the nodeIdentifiers of dead nodes, and
2251         mark them as dead if they existed in previous snapshots.
2252
2253         (HeapSnapshot.buildCategories):
2254         (HeapSnapshot.prototype.updateCategories):
2255         (HeapSnapshotDiff.prototype.updateCategories):
2256         Include a "deadCount" in category data. And provide a method
2257         to return an updated category list.
2258
2259         (HeapSnapshot.prototype.serializeNode):
2260         Include a "dead" property on nodes when they are first fetched.
2261
2262         * UserInterface/Proxies/HeapSnapshotDiffProxy.js:
2263         (WebInspector.HeapSnapshotDiffProxy.prototype.updateForCollectionEvent):
2264         (WebInspector.HeapSnapshotDiffProxy.prototype.updateCategories):
2265         * UserInterface/Proxies/HeapSnapshotNodeProxy.js:
2266         (WebInspector.HeapSnapshotNodeProxy):
2267         (WebInspector.HeapSnapshotNodeProxy.deserialize):
2268         * UserInterface/Proxies/HeapSnapshotProxy.js:
2269         (WebInspector.HeapSnapshotProxy.prototype.updateForCollectionEvent):
2270         (WebInspector.HeapSnapshotProxy.prototype.updateCategories):
2271         Update snapshot proxies from a collection event by updating properties
2272         and dispatching an event from the model object.
2273
2274         * UserInterface/Proxies/HeapSnapshotWorkerProxy.js:
2275         (WebInspector.HeapSnapshotWorkerProxy):
2276         (WebInspector.HeapSnapshotWorkerProxy.prototype.clearSnapshots):
2277         (WebInspector.HeapSnapshotWorkerProxy.prototype._mainResourceDidChange):
2278         Clear the session snapshot list when the main resource changes.
2279         However we can't yet clear the HeapSnapshot objects on the worker
2280         because we may still have UI that interact with them.
2281
2282         * UserInterface/Views/HeapAllocationsTimelineView.js:
2283         (WebInspector.HeapAllocationsTimelineView):
2284         (WebInspector.HeapAllocationsTimelineView.prototype.closed):
2285         Register and unregister for HeapSnapshot collection events.
2286
2287         (WebInspector.HeapAllocationsTimelineView.prototype._heapSnapshotCollectionEvent.updateHeapSnapshotForEvent):
2288         (WebInspector.HeapAllocationsTimelineView.prototype._heapSnapshotCollectionEvent):
2289         Update all the snapshots we know about when a collection event happens.
2290
2291         * UserInterface/Views/HeapSnapshotClassDataGridNode.js:
2292         (WebInspector.HeapSnapshotClassDataGridNode.prototype.removeCollectedNodes):
2293         (WebInspector.HeapSnapshotClassDataGridNode.prototype.updateCount):
2294         (WebInspector.HeapSnapshotClassDataGridNode.prototype._populate):
2295         (WebInspector.HeapSnapshotClassDataGridNode.prototype._fetchBatch):
2296         * UserInterface/Views/HeapSnapshotContentView.js:
2297         (WebInspector.HeapSnapshotContentView.prototype._heapSnapshotDataGridTreeDidPopulate):
2298         (WebInspector.HeapSnapshotContentView):
2299         * UserInterface/Views/HeapSnapshotDataGridTree.js:
2300         (WebInspector.HeapSnapshotDataGridTree):
2301         (WebInspector.HeapSnapshotDataGridTree.prototype.removeChild):
2302         (WebInspector.HeapSnapshotDataGridTree.prototype.removeCollectedNodes):
2303         (WebInspector.HeapSnapshotDataGridTree.prototype._heapSnapshotCollectedNodes):
2304         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
2305         (WebInspector.HeapSnapshotInstancesDataGridTree.prototype.removeCollectedNodes):
2306         (WebInspector.HeapSnapshotInstancesDataGridTree):
2307         Update the Instances DataGridTree UI when a collection event happens.
2308         Remove any top level InstanceDataGridNodes that may be showing for collected nodes.
2309         Update the category counts on the ClassDataGridNodes.
2310         Update FetchMoreDataGridNodes to have updated counts (and replace removed nodes).
2311
2312 2016-05-19  Timothy Hatcher  <timothy@apple.com>
2313
2314         Web Inspector: REGRESSION: Search magnifying glass shifted in Search tab input field
2315         https://bugs.webkit.org/show_bug.cgi?id=157913
2316         rdar://problem/26374424
2317
2318         Reviewed by Joseph Pecoraro.
2319
2320         * UserInterface/Views/SearchSidebarPanel.css:
2321         (.sidebar > .panel.navigation.search > .search-bar > input[type="search"]): Removed padding-left.
2322         (.sidebar > .panel.navigation.search > .search-bar > input[type="search"]::-webkit-search-results-button):
2323         Added. Add margin-right here instead.
2324
2325 2016-05-19  Timothy Hatcher  <timothy@apple.com>
2326
2327         Web Inspector: Timelines "Edit" button should be right-aligned
2328         https://bugs.webkit.org/show_bug.cgi?id=157909
2329         rdar://problem/26373969
2330
2331         Reviewed by Joseph Pecoraro.
2332
2333         * UserInterface/Views/ButtonNavigationItem.css:
2334         (.navigation-bar .item.button.text-only): Deleted height: auto. Now inherited.
2335         * UserInterface/Views/NavigationBar.css:
2336         (.navigation-bar .item): Change height to auto to support any NavigationBar height.
2337         This is needed since the Timelines tab has a shorter NavigationBar height, and
2338         flexible items were overflowing.
2339         * UserInterface/Views/TextNavigationItem.css:
2340         (.navigation-bar .item.text): Deleted height: auto. Now inherited.
2341         * UserInterface/Views/TimelineOverview.js:
2342         (WebInspector.TimelineOverview): Add a FlexibleSpaceNavigationItem before the Edit button.
2343
2344 2016-05-19  Brian Burg  <bburg@apple.com>
2345
2346         Web Inspector: timelines should not update via requestAnimationFrame unless Web Inspector is visible
2347         https://bugs.webkit.org/show_bug.cgi?id=157897
2348         <rdar://problem/26330802>
2349
2350         Reviewed by Timothy Hatcher.
2351
2352         The timelines overview tries to animate using requestAnimationFrame, even if the
2353         inspector frontend is not really visible. When it does this, requestAnimationFrame
2354         simply stalls out until the inspector becomes visible. If a recording is started
2355         while the inspector is not visible, then when it is shown again, the timeline will
2356         start to animate from 0s instead of the current time. This happens because the
2357         requestAnimationFrame was requested when the current time actually was 0, and it
2358         finally executes some time later, when the current time is no longer accurate.
2359         Since the timelines animate by calculating time elapsed since the previous frame
2360         rather than using event timestamps, there is no way for the timelines to skip forward
2361         in their animations in scenarios where the current time becomes arbitrarily skewed.
2362
2363         To fix this, consider the visibility state of the frontend as reported by the UIProcess.
2364         Fire a global notification when visibility state changes, and start or stop updating
2365         the current time as the frontend becomes visible or not shown.
2366
2367         This does not affect most other uses of requestAnimationFrame, which are used as
2368         timers to call updateLayout at an appropriate time. The timelines case is different
2369         because the current time is fixed prior to requesting an animation frame, and
2370         later animation frames are only triggered by earlier requests, so there's nothing to
2371         coalesce.
2372
2373         * UserInterface/Base/Main.js:
2374         (WebInspector.loaded): Initialize WebInspector.visible.
2375
2376         * UserInterface/Base/Object.js: Add new event.
2377
2378         * UserInterface/Protocol/InspectorFrontendAPI.js:
2379         (InspectorFrontendAPI.setIsVisible): Added.
2380
2381         * UserInterface/Test/Test.js:
2382         (WebInspector.updateVisibilityState): Add a stub.
2383
2384         * UserInterface/Views/TimelineRecordingContentView.js:
2385         (WebInspector.TimelineRecordingContentView):
2386         (WebInspector.TimelineRecordingContentView.prototype._inspectorVisibilityStateChanged):
2387         If visibility state changes while capturing, then start or stop updating the
2388         current time as appropriate. Otherwise, refresh the timelines with updated
2389         times so that they know about the recording's updated start/current/end time.
2390
2391         (WebInspector.TimelineRecordingContentView.prototype._startUpdatingCurrentTime):
2392         Bail out if the Web Inspector frontend is not visible to the user and won't be
2393         able to service requestAnimationFrames immediately.
2394
2395 2016-05-18  Timothy Hatcher  <timothy@apple.com>
2396
2397         Web Inspector: Classes toggle wraps in some localizations
2398         https://bugs.webkit.org/show_bug.cgi?id=157878
2399         rdar://problem/26108859
2400
2401         Reviewed by Brian Burg.
2402
2403         * UserInterface/Views/CSSStyleDetailsSidebarPanel.css:
2404         (.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle):
2405         Add white-space: nowrap.
2406
2407 2016-05-18  Matt Baker  <mattbaker@apple.com>
2408
2409         Web Inspector: unable to switch between navigation tree outlines using up/down arrow keys
2410         https://bugs.webkit.org/show_bug.cgi?id=157713
2411         <rdar://problem/26287086>
2412
2413         Reviewed by Timothy Hatcher.
2414
2415         * UserInterface/Views/NavigationSidebarPanel.js:
2416         (WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
2417         Listen for TreeOutline focus changes, and associate trees and their DOM
2418         elements for quick lookup when handling focus events.
2419
2420         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineDidFocus):
2421         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
2422         When selecting a tree element causes an element in a different tree outline
2423         to be deselected, remember the old selection so that it can be restored
2424         the next time the tree outline get the focus.
2425
2426 2016-05-18  Matt Baker  <mattbaker@apple.com>
2427
2428         Web Inspector: Checkbox disappears when unchecking CSS property with value containing a semicolon
2429         https://bugs.webkit.org/show_bug.cgi?id=157862
2430         <rdar://problem/16214480>
2431
2432         Reviewed by Timothy Hatcher.
2433
2434         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
2435         (WebInspector.CSSStyleDeclarationTextEditor.prototype._createCommentedCheckboxMarker):
2436         Modify regex to match CSS properties with url() and quoted values,
2437         which can contain semicolons.
2438
2439 2016-05-18  Nikita Vasilyev  <nvasilyev@apple.com>
2440
2441         Web Inspector: ugly gaps in Call Trees data grid when expanding more than one level
2442         https://bugs.webkit.org/show_bug.cgi?id=157829
2443         <rdar://problem/26339922>
2444
2445         Reviewed by Timothy Hatcher.
2446
2447         Make a more specific CSS selector to avoid style conflicts.
2448
2449         * UserInterface/Views/DataGrid.css:
2450         (.data-grid:not(.variable-height-rows) > .data-container > table.data > tbody > tr > td > div): Deleted.
2451         (.data-grid:not(.variable-height-rows) > .data-container > table.data > tbody > tr > td > .cell-content):
2452         * UserInterface/Views/DataGrid.js:
2453         (WebInspector.DataGridNode.prototype.createCell):
2454
2455 2016-05-18  Brian Burg  <bburg@apple.com>
2456
2457         Web Inspector: InspectorFrontendAPI.setTimelineProfilingEnabled should not implicitly show Timelines tab
2458         https://bugs.webkit.org/show_bug.cgi?id=157846
2459
2460         Reviewed by Timothy Hatcher.
2461
2462         Currently, if the Web Inspector opens for an in-progress or finished automation session,
2463         it will always show the Timelines tab, disregarding any previous user view state. This
2464         is annoying and is a bad user experience when trying to debug the same test repeatedly.
2465
2466         * UserInterface/Protocol/InspectorFrontendAPI.js:
2467         (InspectorFrontendAPI.setTimelineProfilingEnabled): Don't implicitly show Timelines tab.
2468         (InspectorFrontendAPI.showTimelines): Added. This is called explicitly when desired.
2469
2470 2016-05-18  Brian Burg  <bburg@apple.com>
2471
2472         Web Inspector: DebuggerSidebarPanel doesn't need to help manage temporarily disabling breakpoints while capturing
2473         https://bugs.webkit.org/show_bug.cgi?id=157854
2474
2475         Reviewed by Timothy Hatcher.
2476
2477         Duplicate the event listeners in DebuggerManager and move non-view-related
2478         state updates out of DebuggerSidebarPanel's listeners into DebuggerManager's listeners.
2479         This allows a test to exercise the temporary-disablement code paths during capturing.
2480
2481         * UserInterface/Controllers/DebuggerManager.js:
2482         (WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily):
2483         Use this to make the code a bit more readable.
2484
2485         (WebInspector.DebuggerManager.prototype._startDisablingBreakpointsTemporarily):
2486         (WebInspector.DebuggerManager.prototype._stopDisablingBreakpointsTemporarily):
2487         (WebInspector.DebuggerManager.prototype.startDisablingBreakpointsTemporarily): Deleted.
2488         (WebInspector.DebuggerManager.prototype.stopDisablingBreakpointsTemporarily): Deleted.
2489         Make this private since it's not used by other classes anymore.
2490
2491         (WebInspector.DebuggerManager.prototype._timelineCapturingWillStart): Added.
2492         (WebInspector.DebuggerManager.prototype._timelineCapturingStopped): Added.
2493
2494         * UserInterface/Views/DebuggerSidebarPanel.js:
2495         (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingWillStart): Deleted.
2496         (WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingStopped): Deleted.
2497         (WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): Added.
2498         (WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingStopped): Added.
2499         Make the listener names consistent with TimelineManager: timelineCapturing{WillStart,Stopped}.
2500
2501 2016-05-18  Joseph Pecoraro  <pecoraro@apple.com>
2502
2503         Web Inspector: Improve console.takeHeapSnapshot documentation in console
2504         https://bugs.webkit.org/show_bug.cgi?id=157853
2505
2506         Reviewed by Timothy Hatcher.
2507
2508         * UserInterface/Models/NativeFunctionParameters.js:
2509         Mention optional label argument.
2510
2511 2016-05-18  Brian Burg  <bburg@apple.com>
2512
2513         Web Inspector: race between frontend and backend both starting timeline recordings causes console assert
2514         https://bugs.webkit.org/show_bug.cgi?id=157850
2515         <rdar://problem/26349229>
2516
2517         Reviewed by Joseph Pecoraro.
2518
2519         If TimelineManager has created a fresh recording and the Timeline.autoCaptureStarted
2520         event comes before Timeline.recordingStarted, then the manager will try to start the
2521         same recording twice. In this scenario, the manager should just wait until the
2522         Timeline.recordingStarted event comes, since it causes TimelineMangare to set up
2523         the isCapturing flag and other state.
2524
2525         * UserInterface/Controllers/TimelineManager.js:
2526         (WebInspector.TimelineManager):
2527         (WebInspector.TimelineManager.prototype.startCapturing):
2528         (WebInspector.TimelineManager.prototype.capturingStarted):
2529         (WebInspector.TimelineManager.prototype.autoCaptureStarted):
2530         Add a new flag, this._waitingForCapturingStartedEvent. If true, don't start the
2531         recording in response to this event.
2532
2533 2016-05-18  Matt Baker  <mattbaker@apple.com>
2534
2535         Web Inspector: REGRESSION(r197488): Incorrect start time in Rendering Frames timeline grid
2536         https://bugs.webkit.org/show_bug.cgi?id=157840
2537         <rdar://problem/26344937>
2538
2539         Reviewed by Brian Burg.
2540
2541         * UserInterface/Views/TimelineRecordingContentView.js:
2542         (WebInspector.TimelineRecordingContentView.prototype._updateTimes):
2543         The Rendering Frames timeline view needs a valid zero time.
2544         (WebInspector.TimelineRecordingContentView.prototype._timeRangeSelectionChanged):
2545         Adjust ruler selection path component values by the zero time unless
2546         the current view is the Rendering Frames timeline view.
2547
2548 2016-05-17  Matt Baker  <mattbaker@apple.com>
2549
2550         Web Inspector: NavigationSidebarPanel should coordinate item selection between its tree outlines
2551         https://bugs.webkit.org/show_bug.cgi?id=157813
2552         <rdar://problem/26331779>
2553
2554         Reviewed by Timothy Hatcher.
2555
2556         * UserInterface/Views/DebuggerSidebarPanel.js:
2557         (WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
2558         Deselecting elements in other tree outlines is now done in the base class.
2559
2560         * UserInterface/Views/NavigationSidebarPanel.js:
2561         (WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
2562         Listen for selection changed events on all content tree outlines.
2563         (WebInspector.NavigationSidebarPanel.prototype.treeElementAddedOrChanged):
2564         Moved stub from the public section to the protected section.
2565         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
2566         Deselect tree elements in any content tree outline that is not the
2567         parent of the selected element.
2568
2569         (WebInspector.NavigationSidebarPanel.prototype._treeSelectionDidChange): Deleted.
2570         Rename _contentTreeOutlineTreeSelectionDidChange, to prevent being
2571         shadowed by subclasses with _treeSelectionDidChange event handlers.
2572
2573 2016-05-17  Matt Baker  <mattbaker@apple.com>
2574
2575         Web Inspector: Remove TimelineSidebarPanel.js as it's no longer referenced anywhere
2576         https://bugs.webkit.org/show_bug.cgi?id=157819
2577
2578         Reviewed by Timothy Hatcher.
2579
2580         * UserInterface/Views/TimelineSidebarPanel.js: Removed.
2581         Removed unused file.
2582
2583 2016-05-17  Brian Burg  <bburg@apple.com>
2584
2585         Web Inspector: inspector tests should redirect and log console.trace() calls in test output
2586         https://bugs.webkit.org/show_bug.cgi?id=157802
2587         <rdar://problem/26325671>
2588
2589         Reviewed by Timothy Hatcher.
2590
2591         * UserInterface/Test/FrontendTestHarness.js:
2592         (FrontendTestHarness.prototype.redirectConsoleToTestOutput.createProxyConsoleHandler):
2593         Remove bind() that is now unnecessary. Also redirect console.warn.
2594
2595         (FrontendTestHarness.prototype.redirectConsoleToTestOutput):
2596         For console.trace(), throw and catch a dummy Error to get a stack trace.
2597         Do some post processing on it to remove useless frames and sanitize file paths.
2598
2599 2016-05-17  Brian Burg  <bburg@apple.com>
2600
2601         Web Inspector: Filtering huge data grids should yield occasionally so the UI remains responsive
2602         https://bugs.webkit.org/show_bug.cgi?id=157702
2603         <rdar://problem/26282898>
2604
2605         Based on a patch by Matt Baker <mattbaker@apple.com> on 2016-05-16
2606         Reviewed by Timothy Hatcher.
2607
2608         This patch adds a new class, YieldableTask, for processing large
2609         data sets without starving the runloop. A yieldable task takes a delegate,
2610         an iterator that produces the items to be processed by the delegate, and
2611         the "work interval" time slice and "idle interval" to wait between time slices.
2612         It works by using `yield` to suspend processing when the current time
2613         slice is exceeded, and setting a timeout to wait out the idle interval.
2614
2615         The iterator is responsible for deciding a good traversal order for items,
2616         and the delegate is responsible for processing each item in turn. Tasks
2617         cannot be reused once cancelled or processing completes.
2618
2619         Change DataGrid to use a yieldable task for filtering data grid nodes.
2620         When the filtering criteria changes, cancel the task and run a new task.
2621
2622         * UserInterface/Base/YieldableTask.js: Added.
2623         (WebInspector.YieldableTask.prototype.get processing):
2624         (WebInspector.YieldableTask.prototype.get cancelled):
2625         (WebInspector.YieldableTask.prototype.get idleInterval):
2626         (WebInspector.YieldableTask.prototype.get workInterval):
2627         Add getters.
2628
2629         (WebInspector.YieldableTask.prototype.start.createIteratorForProcessingItems):
2630         (WebInspector.YieldableTask.prototype.start):
2631         Set up an iterator that cranks through items to be processed until the
2632         time slice is exceeded. Check to see if the task is cancelled before and
2633         after calling out to the delegate to perform processing on the item.
2634
2635         (WebInspector.YieldableTask.prototype.cancel):
2636         Set the cancel flag. Tell the delegate the task is finished soon.
2637
2638         (WebInspector.YieldableTask.prototype._processPendingItems):
2639         Request the next item from the cranking iterator so it tries to process
2640         more items. If it yields but still has more items to process, set a timeout
2641         and continue processing more items after the idle interval.
2642
2643         (WebInspector.YieldableTask.prototype._willYield): Notify the delegate.
2644         (WebInspector.YieldableTask.prototype._didFinish): Clear state and notify.
2645         (WebInspector.YieldableTask):
2646
2647         * UserInterface/Main.html:
2648         * UserInterface/Test.html: Add new file.
2649
2650         * UserInterface/Views/DataGrid.js:
2651         (WebInspector.DataGrid):
2652         (WebInspector.DataGrid.prototype.filterDidChange):
2653         Cancel the currently running filter task, if any exists.
2654
2655         (WebInspector.DataGrid.prototype._updateFilter.createIteratorForNodesToBeFiltered):
2656         (WebInspector.DataGrid.prototype._updateFilter):
2657         Set up and start a new filtering task when the filter updates.
2658
2659         (WebInspector.DataGrid.prototype.yieldableTaskWillProcessItem):
2660         (WebInspector.DataGrid.prototype.yieldableTaskDidYield):
2661         (WebInspector.DataGrid.prototype.yieldableTaskDidFinish):
2662         Batch up notifications about filtered nodes changing since this can
2663         cause a lot of unnecessary work by event listeners.
2664
2665 2016-05-17  Brian Burg  <bburg@apple.com>
2666
2667         Web Inspector: breakpoints in sourceURL named scripts are not persisted
2668         https://bugs.webkit.org/show_bug.cgi?id=157714
2669         <rdar://problem/26287099>
2670
2671         Reviewed by Joseph Pecoraro.
2672
2673         The Inspector frontend doesn't try to persist a breakpoint that
2674         lacks a URL, even if the breakpoint has a sourceURL. Similarly, for
2675         breakpoints without a URL, the frontend asks the backend to create
2676         the breakpoint for a specific script identifier rather than a
2677         URL-based breakpoint. This prevents breakpoints in injected scripts
2678         from being resolved if the page is reloaded.
2679
2680         The Inspector backend knows how to resolve URL-based breakpoints
2681         by matching against the script's URL or sourceURL, so we just need
2682         to teach the frontend when either is appropriate to use.
2683
2684         This patch adds SourceCode.contentIdentifier, which is roughly
2685         `url || sourceURL` for content that is not emphemeral, such as
2686         console evaluations. Change breakpoint and debugger code to use
2687         `contentIdentifier` rather than `url`, and pass contentIdentifier
2688         to the backend when setting a breakpoint by URL.
2689
2690         * UserInterface/Controllers/DebuggerManager.js:
2691         (WebInspector.DebuggerManager.prototype.breakpointsForSourceCode):
2692         (WebInspector.DebuggerManager.prototype.scriptsForURL):
2693         (WebInspector.DebuggerManager.prototype.get searchableScripts):
2694         (WebInspector.DebuggerManager.prototype.removeBreakpoint):
2695         (WebInspector.DebuggerManager.prototype.reset):
2696         (WebInspector.DebuggerManager.prototype.scriptDidParse):
2697         (WebInspector.DebuggerManager.prototype._setBreakpoint):
2698         (WebInspector.DebuggerManager.prototype._saveBreakpoints):
2699         (WebInspector.DebuggerManager.prototype._associateBreakpointsWithSourceCode):
2700
2701         * UserInterface/Models/Breakpoint.js:
2702         (WebInspector.Breakpoint):
2703         (WebInspector.Breakpoint.prototype.get contentIdentifier):
2704         (WebInspector.Breakpoint.prototype.get info):
2705         (WebInspector.Breakpoint.prototype.saveIdentityToCookie):
2706         (WebInspector.Breakpoint.prototype.get url): Deleted.
2707         Replace uses of Breakpoint.prototype.get url with
2708         contentIdentifier inside the class and at all callsites.
2709
2710         * UserInterface/Models/Script.js:
2711         (WebInspector.Script.prototype.get contentIdentifier):
2712         Added. Use the URL, or the sourceURL unless the script is
2713         ephemeral and only run once, like as a console evaluation.
2714
2715         * UserInterface/Models/SourceCode.js:
2716         (WebInspector.SourceCode.prototype.get url): Added.
2717         All subclasses already override this getter. Add it here so that
2718         the default implementation of contentIdentifier can use it.
2719
2720         (WebInspector.SourceCode.prototype.get contentIdentifier): Added.
2721
2722         * UserInterface/Views/BreakpointTreeElement.js:
2723         (WebInspector.BreakpointTreeElement.prototype.get filterableData):
2724         * UserInterface/Views/ProbeSetDetailsSection.js:
2725         (WebInspector.ProbeSetDetailsSection.prototype._updateLinkElement):
2726         * UserInterface/Views/SourceCodeTextEditor.js:
2727         (WebInspector.SourceCodeTextEditor.prototype._matchesBreakpoint):
2728         * UserInterface/Views/TextResourceContentView.js:
2729         (WebInspector.TextResourceContentView.prototype.get supplementalRepresentedObjects):
2730
2731 2016-05-16  Joseph Pecoraro  <pecoraro@apple.com>
2732
2733         Uncaught Exception: TypeError: null is not an object (evaluating 'event.data.pathComponent.domTreeElement')
2734         https://bugs.webkit.org/show_bug.cgi?id=157759
2735         <rdar://problem/26309427>
2736
2737         Reviewed by Timothy Hatcher.
2738
2739         * UserInterface/Views/DOMTreeContentView.js:
2740         (WebInspector.DOMTreeContentView.prototype._pathComponentSelected):
2741         Handle possible null path components.
2742
2743         * UserInterface/Views/HierarchicalPathComponent.js:
2744         (WebInspector.HierarchicalPathComponent.prototype.get selectedPathComponent):
2745         When there is a list of just one that is triggered, the Clicked
2746         event should produce that one, to be consistent with clicking
2747         on a list of multiple elements and selecting the same value.
2748
2749 2016-05-16  Saam barati  <sbarati@apple.com>
2750
2751         Hook up ShadowChicken to the debugger to show tail deleted frames
2752         https://bugs.webkit.org/show_bug.cgi?id=156685
2753         <rdar://problem/25770521>
2754
2755         Reviewed by Filip Pizlo and Mark Lam and Joseph Pecoraro.
2756
2757         This patch makes the WebInspector display tail deleted frames.
2758         We show tail deleted frames with a gray [f] instead of a green
2759         [f]. We also put text in the tooltip to indicate that the frame
2760         is tail deleted. Other than that, tail deleted frames behave like
2761         normal frames. You can evaluate in them, inspect their scope, etc.
2762
2763         * Localizations/en.lproj/localizedStrings.js:
2764         * UserInterface/Images/TailDeletedFunction.svg: Added.
2765         * UserInterface/Images/gtk/TailDeletedFunction.svg: Added.
2766         * UserInterface/Models/CallFrame.js:
2767         * UserInterface/Views/CallFrameIcons.css:
2768         * UserInterface/Views/CallFrameTreeElement.js:
2769         * UserInterface/Views/CallFrameView.js:
2770
2771 2016-05-16  Nikita Vasilyev  <nvasilyev@apple.com>
2772
2773         Web Inspector: Contents of Duration column are covered by always on (legacy) scroll bars
2774         https://bugs.webkit.org/show_bug.cgi?id=157590
2775
2776         Reviewed by Timothy Hatcher.
2777
2778         Set the right padding of the DataGrid header to match the scrollbar width.
2779
2780         * UserInterface/Views/DataGrid.css:
2781         (.data-grid .data-container):
2782         (.data-grid.inline .data-container):
2783         Don't show scrollbars for inline data grids.
2784
2785         (.data-grid > .header-wrapper):
2786         (.data-grid.no-header > .header-wrapper > table.header):
2787         (.data-grid.no-header > table.header): Deleted.
2788         (.data-grid th): Deleted.
2789         * UserInterface/Views/DataGrid.js:
2790         (WebInspector.DataGrid):
2791         We can't add padding-rigth to a table. Wrap the table in div.header-wrapper.
2792
2793         (WebInspector.DataGrid.prototype._updateScrollbarPadding):
2794         (WebInspector.DataGrid.prototype.layout):
2795
2796 2016-05-16  Nikita Vasilyev  <nvasilyev@apple.com>
2797
2798         Web Inspector: Background stripes don't span the width of Network sidebar
2799         https://bugs.webkit.org/show_bug.cgi?id=157744
2800
2801         Reviewed by Timothy Hatcher.
2802
2803         * UserInterface/Views/NetworkSidebarPanel.css:
2804         (.sidebar > .panel.navigation.network.network-grid-content-view-showing > .content):
2805
2806 2016-05-16  Antoine Quint  <graouts@apple.com>
2807
2808         Web Inspector: Computed style shows both prefixed and unprefixed variants of properties
2809         https://bugs.webkit.org/show_bug.cgi?id=157674
2810         <rdar://problem/24339756>
2811
2812         Reviewed by Timothy Hatcher.
2813
2814         We make the CSSProperty `implicit` property read-write, and in the case where a computed style
2815         has a property marked as explicit, we also check that it's found in matching rules to consider
2816         it non-implicit. This correctly filters out variants of properties set explicitly.
2817
2818         * UserInterface/Models/CSSProperty.js:
2819         (WebInspector.CSSProperty.prototype.set implicit):
2820         * UserInterface/Models/DOMNodeStyles.js:
2821         (WebInspector.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
2822         (WebInspector.DOMNodeStyles.prototype.refresh):
2823         (WebInspector.DOMNodeStyles.prototype._isPropertyFoundInMatchingRules):
2824         (WebInspector.DOMNodeStyles):
2825
2826 2016-05-14  Timothy Hatcher  <timothy@apple.com>
2827
2828         Web Inspector: DataGrid _updateVisibleRows dominates profiles of timeline recordings when data grid (Overview or TimelineDataGrids) is showing
2829         https://bugs.webkit.org/show_bug.cgi?id=157664
2830         rdar://problem/26262219
2831
2832         Reviewed by Joseph Pecoraro.
2833
2834         * UserInterface/Views/DataGrid.js:
2835         (WebInspector.DataGrid): Added new members.
2836         (WebInspector.DataGrid.prototype.layout): Reset _cachedScrollTop and _cachedScrollHeight on resize.
2837         (WebInspector.DataGrid.prototype._noteScrollPositionChanged): Added.
2838         (WebInspector.DataGrid.prototype._updateVisibleRows): Cache sizes and positions when possible.
2839         (WebInspector.DataGridNode.prototype.set hidden): Added call to _noteRowsChanged.
2840         (WebInspector.DataGridNode.prototype.collapse): Call _noteRowsChanged instead of needsLayout.
2841         (WebInspector.DataGridNode.prototype.expand): Call _noteRowsChanged instead of needsLayout.
2842         (WebInspector.DataGrid.prototype._updateFilter): Removed direct call to _updateVisibleRows, this is
2843         better handled by DataGridNode's hidden setter.
2844
2845 2016-05-14  Timothy Hatcher  <timothy@apple.com>
2846
2847         Web Inspector: Many DataGrid instances do not save/restore their scroll position
2848         https://bugs.webkit.org/show_bug.cgi?id=157709
2849         rdar://problem/26286090
2850
2851         Reviewed by Brian Burg.
2852
2853         * UserInterface/Models/BackForwardEntry.js:
2854         (WebInspector.BackForwardEntry.prototype.makeCopy): Added.
2855         * UserInterface/Views/ContentViewContainer.js:
2856         (WebInspector.ContentViewContainer.prototype.showContentView): Copy the last entry for the view.
2857         * UserInterface/Views/DOMStorageContentView.js:
2858         (WebInspector.DOMStorageContentView.prototype.get scrollableElements): Added.
2859         * UserInterface/Views/HeapSnapshotContentView.js:
2860         (WebInspector.HeapSnapshotContentView.prototype.get scrollableElements): Added.
2861         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
2862         (WebInspector.IndexedDatabaseObjectStoreContentView.prototype.get scrollableElements): Added.
2863         * UserInterface/Views/MemoryTimelineView.js:
2864         (WebInspector.MemoryTimelineView.prototype.get scrollableElements): Added.
2865         * UserInterface/Views/ProfileView.js:
2866         (WebInspector.ProfileView.prototype.get scrollableElements): Added.
2867         (WebInspector.ProfileView.prototype._repopulateDataGridFromTree): Removed unused skipRefresh argument.
2868         * UserInterface/Views/ScriptClusterTimelineView.js:
2869         (WebInspector.ScriptClusterTimelineView.prototype.get scrollableElements): Added.
2870         * UserInterface/Views/ScriptProfileTimelineView.js:
2871         (WebInspector.ScriptProfileTimelineView.prototype.get scrollableElements): Added.
2872         * UserInterface/Views/TimelineView.js:
2873         (WebInspector.TimelineView.prototype.get scrollableElements): Added.
2874
2875 2016-05-14  Nikita Vasilyev  <nvasilyev@apple.com>
2876
2877         Web Inspector: Empty line shows arrow when hovering over Animation Frame Requested in timeline recording
2878         https://bugs.webkit.org/show_bug.cgi?id=157707
2879
2880         Reviewed by Timothy Hatcher.
2881
2882         * UserInterface/Views/DataGrid.css:
2883         (.data-grid:not(.variable-height-rows) > .data-container > table.data > tbody > tr > td > div):
2884
2885 2016-05-13  Simon Fraser  <simon.fraser@apple.com>
2886
2887         Unprefix -webkit-cross-fade()
2888         https://bugs.webkit.org/show_bug.cgi?id=157632
2889
2890         Reviewed by Darin Adler.
2891
2892         * UserInterface/Models/CSSKeywordCompletions.js:
2893
2894 2016-05-13  Matt Baker  <mattbaker@apple.com>
2895
2896         Web Inspector: Typing "layout" in filter for Layout and Rendering Timeline matches everything
2897         https://bugs.webkit.org/show_bug.cgi?id=157684
2898         <rdar://problem/26276588>
2899
2900         Reviewed by Joseph Pecoraro.
2901
2902         Hidden columns should not participate in built-in grid filtering
2903         using DataGrid.filterText. Hidden columns can still be custom filtered,
2904         which is how TimelineDataGrid filters scopebar columns.
2905
2906         * UserInterface/Views/DataGrid.js:
2907         (WebInspector.DataGridNode.prototype.get filterableData):
2908         Skip hidden columns.
2909
2910 2016-05-13  Matt Baker  <mattbaker@apple.com>
2911
2912         Web Inspector: Script ProfileViews should be searchable
2913         https://bugs.webkit.org/show_bug.cgi?id=157581
2914         <rdar://problem/26228530>
2915
2916         Reviewed by Joseph Pecoraro.
2917
2918         * UserInterface/Views/DataGrid.js:
2919         (WebInspector.DataGrid.prototype.get filterText):
2920         Make filterText readable.
2921
2922         * UserInterface/Views/ProfileDataGridNode.js:
2923         (WebInspector.ProfileDataGridNode.prototype.get callingContextTreeNode):
2924         (WebInspector.ProfileDataGridNode.prototype.filterableDataForColumn):
2925         Add filterable data for the "function" column.
2926         (WebInspector.ProfileDataGridNode.prototype._updateChildrenForModifiers):
2927         (WebInspector.ProfileDataGridNode.prototype.get node): Deleted.
2928         Renamed callingContextTreeNode to be less ambiguous.
2929
2930         * UserInterface/Views/ProfileDataGridTree.js:
2931         (WebInspector.ProfileDataGridTree.prototype._updateCurrentFocusDetails):
2932
2933         * UserInterface/Views/ProfileView.js:
2934         (WebInspector.ProfileView.prototype.get dataGrid):
2935         Expose data grid for use in parent view.
2936
2937         * UserInterface/Views/ScriptClusterTimelineView.js:
2938         (WebInspector.ScriptClusterTimelineView.prototype.selectRecord):
2939         Drive-by fix: forward property to current child TimelineView.
2940
2941         * UserInterface/Views/ScriptProfileTimelineView.js:
2942         (WebInspector.ScriptProfileTimelineView):
2943         (WebInspector.ScriptProfileTimelineView.prototype._scopeBarSelectionDidChange):
2944         (WebInspector.ScriptProfileTimelineView.prototype._showProfileViewForOrientation):
2945         Helper function to switch profile views. Persist filter text when
2946         switching to the new profile view.
2947
2948         (WebInspector.ScriptProfileTimelineView.prototype.get showsFilterBar): Deleted.
2949         Remove FIXME and show filter bar.
2950
2951         * UserInterface/Views/TimelineView.js:
2952         (WebInspector.TimelineView.prototype.setupDataGrid):
2953         Support switching to a new data grid.
2954         (WebInspector.TimelineView.prototype.dataGridMatchNodeAgainstCustomFilters):
2955         Hooking up filtering causes data grid nodes to be filtered based on the
2956         ruler selection. Although ScriptProfileTimelineView performs its own
2957         time-based filtering, this is necessary to prevent an assert.
2958
2959         (WebInspector.TimelineView.prototype._timelineDataGridSelectedNodeChanged):
2960         (WebInspector.TimelineView.prototype._timelineDataGridNodeWasFiltered):
2961         Converted arrow functions to member functions to allow unregistering
2962         event listeners on outgoing data grid when swapping grids.
2963
2964 2016-05-12  Matt Baker  <mattbaker@apple.com>
2965
2966         Web Inspector: Remove "Extra Scripts" folder from Resources sidebar if all children removed
2967         https://bugs.webkit.org/show_bug.cgi?id=157656
2968
2969         Reviewed by Timothy Hatcher.
2970
2971         * UserInterface/Views/ResourceSidebarPanel.js:
2972         (WebInspector.ResourceSidebarPanel.prototype._scriptWasRemoved):
2973         Remove parent folder after last script tree element removed.
2974
2975 2016-05-12  Matt Baker  <mattbaker@apple.com>
2976
2977         Web Inspector: Can't filter Rendering Frames by duration
2978         https://bugs.webkit.org/show_bug.cgi?id=157654
2979
2980         Reviewed by Timothy Hatcher.
2981
2982         * UserInterface/Views/RenderingFrameTimelineView.js:
2983         (WebInspector.RenderingFrameTimelineView.prototype._scopeBarSelectionDidChange):
2984         Call filterDidChange on the grid, not the base class.
2985         TimelineView.filterDidChange exists to let TimelineViews perform
2986         additional work when the grid filter changes (see LayoutTimelineView).
2987         (WebInspector.RenderingFrameTimelineView):
2988
2989 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
2990
2991         Web Inspector: Deleting nodes in DOM Tree sometimes changes selection to parent instead of sibling
2992         https://bugs.webkit.org/show_bug.cgi?id=157649
2993
2994         Reviewed by Timothy Hatcher.
2995
2996         * UserInterface/Views/DOMTreeElement.js:
2997         (WebInspector.DOMTreeElement.prototype._updateChildren): Deleted.
2998         When pressing delete, we remove the node via DOM.removeNode()
2999         and remove the DOMTreeElement when we receive a successful response.
3000         However, the backend could send a DOM.childNodeRemoved event before
3001         the response from DOM.removeNode, and the frontend would have a race
3002         between DOMTreeUpdater's timeout and the removeNode callback.
3003
3004         In DOMTreeUpdater's path, DOMTreeElement updateChildren would notice
3005         a removed node and set the selection to the parent node.
3006
3007         In the DOM.removeNode path, TreeOutline would update the selection
3008         based on availability of a previousSibling/nextSibling/parent.
3009
3010         Remove the custom code in DOMTreeElement updateChildren, so that it
3011         can just do the normal TreeOutline behavior via removeChildAtIndex.
3012
3013 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
3014
3015         REGRESSION: Web Inspector: Fails to load sourceMappingURL with relative URL
3016         https://bugs.webkit.org/show_bug.cgi?id=157650
3017         <rdar://problem/26133763>
3018
3019         Reviewed by Timothy Hatcher.
3020
3021         * UserInterface/Controllers/SourceMapManager.js:
3022         Wrong order of arguments. The intent was to pass the incoming
3023         baseURL as the partialURL, because if it was not absolute by
3024         that point we could make it relative to the main resource.
3025         However we accidentally put the main resource as the partial
3026         portion, which would just always return the main resource url.
3027         Swap the order, so that if the incoming base is absolute
3028         (such as a resource.url) that will be used, but if the
3029         incoming base is relative (e.g. an incomplete sourceURL) we
3030         can make it absolute with the main resource.
3031
3032 2016-05-12  Matt Baker  <mattbaker@apple.com>
3033
3034         Web Inspector: Uncaught exception when removing selected Timeline instrument
3035         https://bugs.webkit.org/show_bug.cgi?id=157639
3036         <rdar://problem/26252938>
3037
3038         Reviewed by Timothy Hatcher.
3039
3040         * UserInterface/Views/TimelineOverview.js:
3041         (WebInspector.TimelineOverview.prototype._instrumentRemoved):
3042         Remove timeline tree element before modifying state. Removing the tree
3043         element triggers a SelectionDidChange event, which can have side effects.
3044
3045 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
3046
3047         Web Inspector: Timeline Reset button only resets the one active Script TimelineView
3048         https://bugs.webkit.org/show_bug.cgi?id=157638
3049
3050         Reviewed by Timothy Hatcher.
3051
3052         * UserInterface/Views/ScriptClusterTimelineView.js:
3053         (WebInspector.ScriptClusterTimelineView.prototype.reset):
3054         Reset should reset all the views.
3055
3056         (WebInspector.ScriptClusterTimelineView.prototype.get navigationSidebarTreeOutline): Deleted.
3057         * UserInterface/Views/NetworkGridContentView.js:
3058         (WebInspector.NetworkGridContentView.prototype.get navigationSidebarTreeOutline): Deleted.
3059         * UserInterface/Views/TimelineView.js:
3060         (WebInspector.TimelineView.prototype.get navigationSidebarTreeOutlineScopeBar): Deleted.
3061         Remove dead code. Nobody calls these getters.
3062
3063 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
3064
3065         Web Inspector: Layout timeline popovers are inconsistently shown
3066         https://bugs.webkit.org/show_bug.cgi?id=157640
3067         <rdar://problem/26253394>
3068
3069         Reviewed by Timothy Hatcher.
3070
3071         * UserInterface/Views/TimelineDataGrid.js:
3072         (WebInspector.TimelineDataGrid.prototype._showPopoverForSelectedNodeSoon):
3073         Fix the bug by clearing _showPopoverTimeout when we show the popover.
3074
3075         (WebInspector.TimelineDataGrid.prototype._hidePopover):
3076         Modernize the code to use arrow functions and avoid binds.
3077
3078         (WebInspector.TimelineDataGrid.prototype._updatePopoverForSelectedNode):
3079         Updating with presentNewContentWithFrame animates the popover to the correct
3080         position instead of jumping and ending up at the wrong location.
3081
3082 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
3083
3084         Web Inspector: Remove forced layouts caused by DOMTreeElement during Timeline recording
3085         https://bugs.webkit.org/show_bug.cgi?id=157641
3086
3087         Reviewed by Timothy Hatcher.
3088
3089         * UserInterface/Views/DOMTreeElement.js:
3090         (WebInspector.DOMTreeElement.prototype.updateSelection): Deleted.
3091         This triggers forced layout and I could never actually get it to trigger anyways.
3092         Its history is from the original import, so I don't know why it was added to begin with.
3093         Just remove it.
3094
3095 2016-05-12  Commit Queue  <commit-queue@webkit.org>
3096
3097         Unreviewed, rolling out r200718.
3098         https://bugs.webkit.org/show_bug.cgi?id=157637
3099
3100         Data grid column dividers are misaligned (Requested by NVI on
3101         #webkit).
3102
3103         Reverted changeset:
3104
3105         "Web Inspector: Contents of Duration column are covered by
3106         always on (legacy) scroll bars"
3107         https://bugs.webkit.org/show_bug.cgi?id=157590
3108         http://trac.webkit.org/changeset/200718
3109
3110 2016-05-12  Matt Baker  <mattbaker@apple.com>
3111
3112         Web Inspector: 11% of time in TimelineRecording spent updating DataGrid that is not visible
3113         https://bugs.webkit.org/show_bug.cgi?id=157612
3114         <rdar://problem/26239051>
3115
3116         Reviewed by Timothy Hatcher.
3117
3118         During recording, a timeline view is constantly having its cached time
3119         values updated. These updates should only trigger forced layouts if the
3120         view supports live data.
3121
3122         * UserInterface/Views/TimelineView.js:
3123         (WebInspector.TimelineView.prototype.set zeroTime):
3124         Drive-by fix, add call to _filterTimesDidChange.
3125         (WebInspector.TimelineView.prototype.set startTime):
3126         (WebInspector.TimelineView.prototype.set endTime):
3127         (WebInspector.TimelineView.prototype.set currentTime):
3128         Don't update layout directly.
3129         (WebInspector.TimelineView.prototype._timesDidChange):
3130         Force a layout if the view supports live data. When not recording,
3131         a layout is always performed.
3132         (WebInspector.TimelineView):
3133         (WebInspector.TimelineView.prototype._filterTimesDidChange.delayedWork): Deleted.
3134         Changed to an arrow function.
3135         (WebInspector.TimelineView.prototype._filterTimesDidChange): Deleted.
3136         Renamed _timesDidChange, since the method now does more than throttle
3137         a filterDidChange call.
3138
3139 2016-05-12  Fujii Hironori  <Hironori.Fujii@sony.com>
3140
3141         Web Inspector: Windows Perl fails to run copy-user-interface-resources.pl
3142         https://bugs.webkit.org/show_bug.cgi?id=157620
3143         <rdar://problem/26241548>
3144
3145         Reviewed by Timothy Hatcher.
3146
3147         There are two problems on Windows platform. 'cat' command is
3148         missing and can not execute shebang.
3149
3150         * Scripts/copy-user-interface-resources.pl: Invoke Perl scripts
3151         with explicitly specifying Perl command instead of relying on
3152         shebang.  Add a new subroutine 'appendFile' to concatenate files
3153         instread of 'cat' command.
3154
3155 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
3156
3157         Web Inspector: 3.8% of timeline recording spent in NavigationSidebarPanel _updateContentOverflowShadowVisibility for background tab
3158         https://bugs.webkit.org/show_bug.cgi?id=157616
3159
3160         Reviewed by Timothy Hatcher.
3161
3162         * UserInterface/Views/NavigationSidebarPanel.js:
3163         (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
3164         (WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
3165         Don't update or schedule and update if we aren't visible.
3166         When we are shown we will force an update.
3167
3168 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
3169
3170         Web Inspector: Reduce rAF churn in DefaultDashboardView on pages with lots of resources
3171         https://bugs.webkit.org/show_bug.cgi?id=157618
3172
3173         Reviewed by Timothy Hatcher.
3174
3175         * UserInterface/Views/DefaultDashboardView.js:
3176         (WebInspector.DefaultDashboardView):
3177         (WebInspector.DefaultDashboardView.prototype._updateDisplaySoon):
3178         (WebInspector.DefaultDashboardView.prototype._updateDisplay):
3179         Previously we were scheduling multiple rAFs that would all fire with
3180         the same data, each time a resource was added. Coalesce into one.
3181
3182 2016-05-12  Matt Baker  <mattbaker@apple.com>
3183
3184         Web Inspector: Improve snapshot selection in heap allocations overview graph
3185         https://bugs.webkit.org/show_bug.cgi?id=157588
3186         <rdar://problem/26231245>
3187
3188         Reviewed by Joseph Pecoraro.
3189
3190         Heap snapshot icon selection now uses the built-in record selection
3191         behavior provided by TimelineOverview/TimelineOverviewGraph. The marker
3192         representing the selected heap snapshot now has a "selected" style, and
3193         clicking an icon when the HeapAllocationsTimeline is not selected causes
3194         the timeline to become selected.
3195
3196         * UserInterface/Images/HeapSnapshotSelected.svg: Added.
3197         New art for selected snapshot icon.
3198
3199         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.css:
3200         (.timeline-overview-graph.heap-allocations > img.snapshot.selected):
3201         (.timeline-overview-graph.heap-allocations:not(.selected) > img.snapshot.selected):
3202         Selected icon styles for selected/unselected overview graph.
3203
3204         * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
3205         (WebInspector.HeapAllocationsTimelineOverviewGraph):
3206         Track selected image element.
3207
3208         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.layout):
3209         Associate image elements with their snapshot record, and reuse image
3210         elements between layouts. Image element click handler can just set the
3211         selectedRecord in the TimelineOverviewGraph base class.
3212
3213         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype.updateSelectedRecord):
3214         (WebInspector.HeapAllocationsTimelineOverviewGraph.prototype._updateSnapshotMarkers):
3215         Refresh snapshot icon styles when selected record changes.
3216
3217         * UserInterface/Views/HeapAllocationsTimelineView.js:
3218         (WebInspector.HeapAllocationsTimelineView.prototype.selectRecord):
3219         Show snapshot list if no record selected.
3220         (WebInspector.HeapAllocationsTimelineView.prototype.userSelectedRecordFromOverview): Deleted.
3221         No longer needed.
3222
3223         * UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
3224         (WebInspector.RenderingFrameTimelineOverviewGraph.prototype._updateFrameMarker):
3225         No need to call dispatchSelectedRecordChangedEvent manually anymore,
3226         method has been removed from base class.
3227
3228         * UserInterface/Views/TimelineOverviewGraph.js:
3229         (WebInspector.TimelineOverviewGraph.prototype._needsSelectedRecordLayout):
3230         (WebInspector.TimelineOverviewGraph):
3231         (WebInspector.TimelineOverviewGraph.prototype.dispatchSelectedRecordChangedEvent): Deleted.
3232         No longer needed. Event dispatched automatically by the rAF callback.
3233
3234         * UserInterface/Views/TimelineRecordingContentView.js:
3235         (WebInspector.TimelineRecordingContentView.prototype._recordSelected):
3236         Allow switching to another timeline, if the selected record does not
3237         belong to the current timeline.
3238
3239 2016-05-12  Joseph Pecoraro  <pecoraro@apple.com>
3240
3241         Web Inspector: 3.5% of time in toFixed in TimelineRecordBar updating element positions
3242         https://bugs.webkit.org/show_bug.cgi?id=157608
3243
3244         Reviewed by Timothy Hatcher.
3245
3246         Avoid using toFixed to do an approximation comparison of two floating point numbers.
3247         Instead keep in Numbers by just doing the approximation with Math.round(num * 100).
3248         Since toFixed was doing stringification it was very expensive.
3249
3250         * UserInterface/Views/TimelineRecordBar.js:
3251         (WebInspector.TimelineRecordBar.prototype._updateElementPosition):
3252         (WebInspector.TimelineRecordBar):
3253         * UserInterface/Views/TimelineRecordFrame.js:
3254         (WebInspector.TimelineRecordFrame.prototype._updateElementPosition):
3255         (WebInspector.TimelineRecordFrame):
3256         * UserInterface/Views/TimelineRuler.js:
3257         (WebInspector.TimelineRuler.prototype._updatePositionOfElement):
3258
3259 2016-05-11  Joseph Pecoraro  <pecoraro@apple.com>
3260
3261         Web Inspector: 4% of time in TimelineOverviewGraph adding/removing classList styles on TimelineRecordBar
3262         https://bugs.webkit.org/show_bug.cgi?id=157607
3263
3264         Reviewed by Brian Burg.
3265
3266         This gets us down to about 0.5% of time.
3267
3268         * UserInterface/Views/TimelineRecordBar.js:
3269         (WebInspector.TimelineRecordBar.prototype.set records):
3270         Only modify the classLists when the record changes.
3271
3272         (WebInspector.TimelineRecordBar.prototype.refresh):
3273         Set unfinished once for either the uses active or not uses active cases.
3274
3275 2016-05-11  Joseph Pecoraro  <pecoraro@apple.com>
3276
3277         Web Inspector: Unexpected unread notification icon next to Log after clearing via clear()
3278         https://bugs.webkit.org/show_bug.cgi?id=157598
3279
3280         Reviewed by Timothy Hatcher.
3281
3282         We always show ConsoleCommand and ConsoleCommandResult messages no matter
3283         what the filter is. So it doesn't make sense to mark the "log" filter
3284         as having an unread notification for a ConsoleCommandResult when we can
3285         see the result.
3286
3287         * UserInterface/Views/LogContentView.js:
3288         (WebInspector.LogContentView.prototype.didAppendConsoleMessageView):
3289         (WebInspector.LogContentView.prototype._markScopeBarItemUnread):
3290
3291 2016-05-11  Joseph Pecoraro  <pecoraro@apple.com>
3292
3293         Web Inspector: Console unread indicators should be cleared however the console clears
3294         https://bugs.webkit.org/show_bug.cgi?id=157594
3295
3296         Reviewed by Timothy Hatcher.
3297
3298         * UserInterface/Views/LogContentView.js:
3299         (WebInspector.LogContentView.prototype._logCleared):
3300         (WebInspector.LogContentView.prototype._clearLog):
3301         Move code that clears unread indicators from clearLog to logCleared
3302         to handle all possible clear cases.
3303
3304 2016-05-11  Nikita Vasilyev  <nvasilyev@apple.com>
3305
3306         Web Inspector: Contents of Duration column are covered by always on (legacy) scroll bars
3307         https://bugs.webkit.org/show_bug.cgi?id=157590
3308
3309         Reviewed by Timothy Hatcher.