Web Inspector: Breakpoint Log action should support template literals
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2016-12-12  Matt Baker  <mattbaker@apple.com>
2
3         Web Inspector: Breakpoint Log action should support template literals
4         https://bugs.webkit.org/show_bug.cgi?id=165116
5         <rdar://problem/29464765>
6
7         Reviewed by Joseph Pecoraro.
8
9         * Localizations/en.lproj/localizedStrings.js:
10         New string "${expr} = expression" for breakpoint popover.
11
12         * UserInterface/Controllers/BreakpointLogMessageLexer.js: Added.
13         To support template literal placeholders in message text, it is necessary
14         to distinguish plain text parts of the message from placeholders, since
15         plain text must be escaped.
16
17         (WebInspector.BreakpointLogMessageLexer):
18         (WebInspector.BreakpointLogMessageLexer.prototype.tokenize):
19         (WebInspector.BreakpointLogMessageLexer.prototype.reset):
20         (WebInspector.BreakpointLogMessageLexer.prototype._finishPlainText):
21         (WebInspector.BreakpointLogMessageLexer.prototype._finishExpression):
22         (WebInspector.BreakpointLogMessageLexer.prototype._appendToken):
23         (WebInspector.BreakpointLogMessageLexer.prototype._consume):
24         (WebInspector.BreakpointLogMessageLexer.prototype._peek):
25         (WebInspector.BreakpointLogMessageLexer.prototype._expression):
26         (WebInspector.BreakpointLogMessageLexer.prototype._plainText):
27         (WebInspector.BreakpointLogMessageLexer.prototype._possiblePlaceholder):
28         (WebInspector.BreakpointLogMessageLexer.prototype._regExpOrStringLiteral):
29
30         * UserInterface/Controllers/DebuggerManager.js:
31         (WebInspector.DebuggerManager.prototype._debuggerBreakpointOptions):
32         Build breakpoint "options" object for DebuggerAgent. If a Log action
33         contains template literal placeholders it is changed to an Evaluate
34         action, which calls console.log with a template literal.
35
36         (WebInspector.DebuggerManager.prototype._setBreakpoint):
37         Use converted breakpoint options.
38
39         * UserInterface/Main.html:
40         * UserInterface/Test.html:
41         New file.
42
43         * UserInterface/Views/BreakpointActionView.css:
44         (.breakpoint-action-block-body > .description):
45         Styles for breakpoint Log action hint text.
46
47         * UserInterface/Views/BreakpointActionView.js:
48         (WebInspector.BreakpointActionView.prototype._updateBody):
49         Add Log action hint text element.
50
51 2016-12-11  Matt Baker  <mattbaker@apple.com>
52
53         Web Inspector: ThreadTreeElement should have a "Resume" status button when paused
54         https://bugs.webkit.org/show_bug.cgi?id=165581
55
56         Reviewed by Joseph Pecoraro.
57
58         * UserInterface/Images/Resume.svg:
59         Fill/stroke should be unspecified so that both can be styled in CSS.
60
61         * UserInterface/Views/DebuggerDashboardView.css:
62         (.dashboard.debugger .navigation-bar .item.debugger-dashboard-pause.activated):
63         * UserInterface/Views/DebuggerSidebarPanel.css:
64         (.sidebar > .panel.navigation.debugger > .navigation-bar .debugger-pause-resume):
65         (.sidebar > .panel.navigation.debugger > .navigation-bar .debugger-pause-resume.activated):
66         Recreate original style which relied on 'fill="none"' being specified in the SVG.
67
68         * UserInterface/Views/ThreadTreeElement.css:
69         (.tree-outline > .item.thread .icon):
70         (.tree-outline > .item.thread .status-button.resume):
71         (.tree-outline > .item.thread .status-button.resume:active):
72         (.tree-outline:matches(:focus, .force-focus) > .item.thread.selected .status-button.resume):
73         (.tree-outline > .item.thread.selected .status-button.resume,):
74         (.details-section.call-stack .thread .icon): Deleted.
75         Status button styles. Colors match those of the goto-arrow button.
76
77         * UserInterface/Views/ThreadTreeElement.js:
78         (WebInspector.ThreadTreeElement.prototype.refresh):
79         Update status icon.
80         (WebInspector.ThreadTreeElement.prototype.oncontextmenu):
81         (WebInspector.ThreadTreeElement.prototype._updateStatus):
82         Add/remove status button based on paused state.
83         Stop propagation of "mousedown" events on the status button, to
84         prevent button press from selecting the tree element.
85         (WebInspector.ThreadTreeElement):
86
87 2016-12-11  Joseph Pecoraro  <pecoraro@apple.com>
88
89         Web Inspector: Move MainTarget and WorkerTarget to their own files
90         https://bugs.webkit.org/show_bug.cgi?id=165701
91
92         Reviewed by Brian Burg.
93
94         * UserInterface/Controllers/DebuggerManager.js:
95         (WebInspector.DebuggerManager.prototype.scriptDidParse):
96         * UserInterface/Main.html:
97         * UserInterface/Protocol/MainTarget.js: Added.
98         (WebInspector.MainTarget):
99         (WebInspector.MainTarget.prototype.get displayName):
100         (WebInspector.MainTarget.prototype.get mainResource):
101         * UserInterface/Protocol/Target.js:
102         (WebInspector.Target):
103         (WebInspector.MainTarget): Deleted.
104         (WebInspector.MainTarget.prototype.get displayName): Deleted.
105         (WebInspector.MainTarget.prototype.get mainResource): Deleted.
106         (WebInspector.MainTarget.prototype.initialize): Deleted.
107         (WebInspector.WorkerTarget): Deleted.
108         (WebInspector.WorkerTarget.prototype.get displayName): Deleted.
109         (WebInspector.WorkerTarget.prototype.initialize): Deleted.
110         * UserInterface/Protocol/WorkerTarget.js: Added.
111         (WebInspector.WorkerTarget):
112         (WebInspector.WorkerTarget.prototype.get displayName):
113         * UserInterface/Test.html:
114
115 2016-12-09  Joseph Pecoraro  <pecoraro@apple.com>
116
117         Web Inspector: Frontend should not be resetting TypeProfiler state when switching between ContentViews
118         https://bugs.webkit.org/show_bug.cgi?id=165648
119
120         Reviewed by Brian Burg.
121
122         * UserInterface/Base/Main.js:
123         (WebInspector.loaded):
124         Update all backends when the state changes.
125
126         * UserInterface/Views/SourceCodeTextEditor.js:
127         (WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
128         (WebInspector.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
129         Moved this code to when the global Setting (which affects all editors) changes.
130
131 2016-12-09  Joseph Pecoraro  <pecoraro@apple.com>
132
133         Web Inspector: Some resources fetched via Fetch API do not have data
134         https://bugs.webkit.org/show_bug.cgi?id=165230
135         <rdar://problem/29449220>
136
137         Reviewed by Alex Christensen.
138
139         * Localizations/en.lproj/localizedStrings.js:
140         New "Fetch" and "Fetches" localized strings.
141
142         * UserInterface/Models/Resource.js:
143         (WebInspector.Resource.displayNameForType):
144         * UserInterface/Models/ResourceCollection.js:
145         (WebInspector.ResourceCollection.verifierForType):
146         * UserInterface/Views/CollectionContentView.js:
147         (WebInspector.CollectionContentView):
148         * UserInterface/Views/ResourceClusterContentView.js:
149         (WebInspector.ResourceClusterContentView.prototype.get responseContentView):
150         * UserInterface/Views/ResourceTreeElement.js:
151         (WebInspector.ResourceTreeElement.compareResourceTreeElements):
152         New ResourceType.Fetch. Behave like XHR in most places.
153
154 2016-12-08  Joseph Pecoraro  <pecoraro@apple.com>
155
156         Web Inspector: Unable to delete breakpoint from worker script
157         https://bugs.webkit.org/show_bug.cgi?id=165578
158
159         Reviewed by Matt Baker.
160
161         * UserInterface/Controllers/DebuggerManager.js:
162         (WebInspector.DebuggerManager.prototype._removeBreakpoint):
163         Match setting breakpoints. If this is a "URL breakpoint", affect
164         all targets. If this is a "Script breakpoint", affect just the
165         single target containing that Script.
166
167 2016-12-07  Devin Rousso  <dcrousso+webkit@gmail.com>
168
169         REGRESSION(r203912): Web Inspector: Navigation sidebar widths are not saved
170         https://bugs.webkit.org/show_bug.cgi?id=165496
171
172         Reviewed by Matt Baker.
173
174         * UserInterface/Views/TabBrowser.js:
175         (WebInspector.TabBrowser):
176         (WebInspector.TabBrowser.prototype._sidebarWidthDidChange):
177         (WebInspector.TabBrowser.prototype._showNavigationSidebarPanelForTabContentView):
178         (WebInspector.TabBrowser.prototype._sidebarWidthDidChange): Renamed from _detailsSidebarWidthDidChange.
179         Add event listener for when the navigation sidebar's width is changed.
180
181         * UserInterface/Views/TabContentView.js:
182         (WebInspector.TabContentView):
183         (WebInspector.TabContentView.prototype.get navigationSidebarPanel):
184         (WebInspector.TabContentView.prototype.get navigationSidebarCollapsedSetting):
185         (WebInspector.TabContentView.prototype.get navigationSidebarWidthSetting):
186         (WebInspector.TabContentView.prototype.get detailsSidebarPanels):
187         (WebInspector.TabContentView.prototype.get detailsSidebarCollapsedSetting):
188         (WebInspector.TabContentView.prototype.get detailsSidebarSelectedPanelSetting):
189         (WebInspector.TabContentView.prototype.get detailsSidebarWidthSetting):
190         Add WebInspector.Setting object for the navigation sidebar's width.
191
192 2016-12-07  Nikita Vasilyev  <nvasilyev@apple.com>
193
194         Web Inspector: Control Flow Profiler's event handlers aren't getting removed when ContentView closes
195         https://bugs.webkit.org/show_bug.cgi?id=165556
196
197         Reviewed by Joseph Pecoraro.
198
199         * UserInterface/Views/ScriptContentView.js:
200         (WebInspector.ScriptContentView.prototype.closed):
201         * UserInterface/Views/TextResourceContentView.js:
202         (WebInspector.TextResourceContentView.prototype.closed):
203
204 2016-12-07  Joseph Pecoraro  <pecoraro@apple.com>
205
206         Web Inspector: Add ability to distinguish if a Script was parsed as a module
207         https://bugs.webkit.org/show_bug.cgi?id=164900
208         <rdar://problem/29323817>
209
210         Reviewed by Timothy Hatcher.
211
212         * UserInterface/Models/Script.js:
213         (WebInspector.Script.prototype.get sourceType):
214         New property of Scripts. SourceType is either Program or Module.
215
216         * UserInterface/Controllers/DebuggerManager.js:
217         (WebInspector.DebuggerManager.prototype.scriptDidParse):
218         * UserInterface/Protocol/DebuggerObserver.js:
219         (WebInspector.DebuggerObserver.prototype.scriptParsed):
220         Convert incoming module boolean into SourceType when creating new Scripts.
221
222         * UserInterface/Models/ScriptSyntaxTree.js:
223         (WebInspector.ScriptSyntaxTree):
224         (WebInspector.ScriptSyntaxTree.prototype._recurse):
225         (WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
226         Update the generic AST for new module specific Esprima types.
227
228         * UserInterface/Views/SourceCodeTextEditor.js:
229         (WebInspector.SourceCodeTextEditor.prototype.textEditorScriptSourceType):
230         * UserInterface/Views/TextEditor.js:
231         (WebInspector.TextEditor.prototype._startWorkerPrettyPrint):
232         For pretty printing correctly state if this is a module or not for Esprima.
233
234 2016-12-07  Joseph Pecoraro  <pecoraro@apple.com>
235
236         Web Inspector: Update Esprima to support new features / syntax (**, async/await, trailing comma)
237         https://bugs.webkit.org/show_bug.cgi?id=164830
238         <rdar://problem/29293814>
239
240         Reviewed by Timothy Hatcher.
241
242         * UserInterface/External/Esprima/LICENSE:
243         * UserInterface/External/Esprima/esprima.js:
244         Updated to Esprima@7219731 (4.0.0-dev).
245
246         * UserInterface/Models/ScriptSyntaxTree.js:
247         (WebInspector.ScriptSyntaxTree.prototype._recurse):
248         (WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
249         * UserInterface/Workers/Formatter/ESTreeWalker.js:
250         (ESTreeWalker.prototype._walkChildren):
251         Add new nodes (AwaitExpression).
252         Add new states (async boolean property on Functions).
253         Remove stale properties (defaults is no longer needed, as parameters
254         with default values are now AssignmentPatterns).
255         Update MetaProperty where meta/property are now Identifiers not strings.
256
257         * UserInterface/Workers/Formatter/EsprimaFormatter.js:
258         (EsprimaFormatter.prototype._handleTokenAtNode):
259         Handle pretty printing of new nodes and identifiers.
260
261         * Controllers/FrameResourceManager.js
262         Address a console.assert warning for stripping assertions in Production.
263
264 2016-12-07  Joseph Pecoraro  <pecoraro@apple.com>
265
266         Web Inspector: Remove unused and mostly untested Page domain commands and events
267         https://bugs.webkit.org/show_bug.cgi?id=165507
268
269         Reviewed by Brian Burg.
270
271         * UserInterface/Protocol/PageObserver.js:
272         (WebInspector.PageObserver.prototype.javascriptDialogOpening):
273         (WebInspector.PageObserver.prototype.javascriptDialogClosed):
274         (WebInspector.PageObserver.prototype.scriptsEnabled):
275         Keep stub in case legacy backends dispatch the event to the frontend.
276
277         * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
278         * UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
279         * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
280         * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
281         * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
282         * Versions/Inspector-iOS-10.0.json:
283         * Versions/Inspector-iOS-7.0.json:
284         * Versions/Inspector-iOS-8.0.json:
285         * Versions/Inspector-iOS-9.0.json:
286         * Versions/Inspector-iOS-9.3.json:
287         Remove handleJavaScriptDialog command from legacy backends because it
288         doesn't appear as if the iOS backend handled it at all.
289
290 2016-12-06  Alexey Proskuryakov  <ap@apple.com>
291
292         Correct SDKROOT values in xcconfig files
293         https://bugs.webkit.org/show_bug.cgi?id=165487
294         rdar://problem/29539209
295
296         Reviewed by Dan Bernstein.
297
298         Fix suggested by Dan Bernstein.
299
300         * Configurations/DebugRelease.xcconfig:
301
302 2016-12-05  Matt Baker  <mattbaker@apple.com>
303
304         Web Inspector: Object.shallowEqual([{}], [{}]) should return true
305         https://bugs.webkit.org/show_bug.cgi?id=165397
306
307         Reviewed by Brian Burg.
308
309         * UserInterface/Base/Utilities.js:
310         (value):
311         Array.shallowEqual should compare array items using strict equivalence,
312         and on failure defer to Object.shallowEqual.
313
314 2016-12-05  Joseph Pecoraro  <pecoraro@apple.com>
315
316         Web Inspector: Remove legacy styles
317         https://bugs.webkit.org/show_bug.cgi?id=165389
318
319         Reviewed by Matt Baker.
320
321         Remove styles for platforms we don't build on anymore (Mavericks
322         and Mountain Lion). There are also no "unknown-mac" styles to
323         upgrade to a named platform.
324
325         * UserInterface/Base/Platform.js:
326         Add sierra and remove older unsupported platforms.
327
328         * UserInterface/Views/Main.css:
329         (body):
330         (body:not(.mavericks)): Deleted.
331         * UserInterface/Views/TabBar.css:
332         (body.mavericks .tab-bar > .item:not(.disabled).selected): Deleted.
333         * UserInterface/Views/Toolbar.css:
334         (body .toolbar):
335         (body.window-inactive .toolbar):
336         (body.mac-platform:not(.docked) .toolbar):
337         (body.mac-platform:not(.docked)):
338         (body:not(.mavericks) .toolbar,): Deleted.
339         (body.window-inactive:not(.mavericks) .toolbar): Deleted.
340         (body.mac-platform:not(.docked, .mavericks) .toolbar): Deleted.
341         (body.mac-platform:not(.docked, .mavericks)): Deleted.
342         Remove mavericks specific styles.
343
344 2016-12-02  Andy Estes  <aestes@apple.com>
345
346         [Cocoa] Adopt the PRODUCT_BUNDLE_IDENTIFIER build setting
347         https://bugs.webkit.org/show_bug.cgi?id=164492
348
349         Reviewed by Dan Bernstein.
350
351         * Configurations/WebInspectorUIFramework.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
352         com.apple.$(PRODUCT_NAME:rfc1034identifier).
353         * Info.plist: Changed CFBundleIdentifier's value from
354         com.apple.${PRODUCT_NAME:rfc1034identifier} to ${PRODUCT_BUNDLE_IDENTIFIER}.
355
356 2016-12-02  Nikita Vasilyev  <nvasilyev@apple.com>
357
358         REGRESSION (r192344): Web Inspector: Turning off Code Coverage or Type Profiler logs an error
359         https://bugs.webkit.org/show_bug.cgi?id=164804
360         <rdar://problem/29278028>
361
362         Reviewed by Matt Baker.
363
364         BasicBlockAnnotator and TypeTokenAnnotator were instanciated for a resource in an inactive Debugger tab.
365
366         * UserInterface/Views/NavigationSidebarPanel.js:
367         (WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
368         Don't show any content view if we are not in a selected tab.
369
370 2016-12-01  Matt Baker  <mattbaker@apple.com>
371
372         Web Inspector: Show async stack traces for workers
373         https://bugs.webkit.org/show_bug.cgi?id=165235
374         <rdar://problem/29450172>
375
376         Reviewed by Joseph Pecoraro.
377
378         * UserInterface/Views/CallFrameTreeElement.css:
379         (.tree-outline > .children > .item.call-frame.async-boundary):
380         (.tree-outline:not(.single-thread) > .children > .item.call-frame.async-boundary):
381         (.tree-outline .item.call-frame.async-boundary::before):
382         (.tree-outline.single-thread .item.call-frame.async-boundary::before):
383         (.tree-outline .item.call-frame.async-boundary): Deleted.
384         Style changes for single/multiple-thread call stacks.
385         Padding changes to account for Thread tree element.
386         Make selectors more specific where needed.
387
388         * UserInterface/Views/DebuggerSidebarPanel.css:
389         (.sidebar > .panel.navigation.debugger .tree-outline.single-thread > .item.thread):
390         (.sidebar > .panel.navigation.debugger .tree-outline.single-thread):
391         Style changes for single/multiple-thread call stacks.
392
393         * UserInterface/Views/DebuggerSidebarPanel.js:
394         (WebInspector.DebuggerSidebarPanel):
395         Use a single tree outline for showing a single thread or multiple threads.
396         For single-threaded, hide Thread tree element and un-indent children.
397
398         (WebInspector.DebuggerSidebarPanel.prototype._targetAdded):
399         (WebInspector.DebuggerSidebarPanel.prototype._targetRemoved):
400         (WebInspector.DebuggerSidebarPanel.prototype._updateCallStackTreeOutline):
401         Update tree style and whether Thread tree element is selectable.
402         (WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange):
403         Remove support for second tree outline.
404
405         (WebInspector.DebuggerSidebarPanel.prototype._updateSingleThreadCallStacks): Deleted.
406         (WebInspector.DebuggerSidebarPanel.prototype._selectActiveCallFrameTreeElement): Deleted.
407         (WebInspector.DebuggerSidebarPanel.prototype._showSingleThreadCallStacks): Deleted.
408         (WebInspector.DebuggerSidebarPanel.prototype._showMultipleThreadCallStacks): Deleted.
409         No longer needed after unifying tree outlines.
410
411         * UserInterface/Views/ThreadTreeElement.js:
412         (WebInspector.ThreadTreeElement.prototype.refresh):
413         Append call frames from the async stack trace.
414
415 2016-11-30  Joseph Pecoraro  <pecoraro@apple.com>
416
417         Web Inspector: Clicking on link in Web Inspector can cause UIProcess to crash
418         https://bugs.webkit.org/show_bug.cgi?id=165157
419         <rdar://problem/27896562>
420
421         Reviewed by Brian Burg.
422
423         By correctly disallowing slashes in the scheme Web Inspector resolves
424         the correct absolute URL and doesn't end up trying to navigate to an
425         incorrect file URL.
426
427         * UserInterface/Base/URLUtilities.js:
428         (parseURL):
429         Disallow "/" characters in the scheme portion. (/http://example.com)
430         Allow path to be optional before a fragment portion. (http://example.com#frag)
431
432 2016-11-29  Joseph Pecoraro  <pecoraro@apple.com>
433
434         Web Inspector: Improve name sorting in HeapSnapshot data grids
435         https://bugs.webkit.org/show_bug.cgi?id=165170
436         <rdar://problem/28784421>
437
438         Reviewed by Matt Baker.
439
440         When sorting the Name column, group named properties and unnamed
441         properties and sort them each individually:
442
443           - Sort named properties by their property name (property names will be unique if they exist)
444           - Sort unnamed properties by their class name (guaranteed)
445           - Sort any tied class names by their object id
446
447         This makes using the Object Graph with Name sort easier to follow.
448         In the ascending sort you see all the named properties first,
449         followed by the unnamed (internal) properties.
450
451         * UserInterface/Views/HeapSnapshotContentView.js:
452         (WebInspector.HeapSnapshotObjectGraphContentView):
453         Since this data grid column now sorts on more than just the "Class Name"
454         rename it to "Name".
455
456         * UserInterface/Views/HeapSnapshotDataGridTree.js:
457         (WebInspector.HeapSnapshotDataGridTree.buildSortComparator):
458         Make the sort of the `className` column more general to handle sorting
459         by property names, class names, and object identifiers.
460
461         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
462         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.get propertyName):
463         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
464         Provide a lazy `propertyName` accessor where we compute it once and stash
465         it on the DataGridNode to avoid extra work when resorting.
466
467         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populate.propertyName):
468         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populate):
469         In the initial populated sort, provide the necessary property name property
470         the sort comparator expects.
471
472 2016-11-29  Matt Baker  <mattbaker@apple.com>
473
474         Web Inspector: Breakpoints button enabled state is too subtle
475         https://bugs.webkit.org/show_bug.cgi?id=165153
476
477         Reviewed by Joseph Pecoraro.
478
479         * UserInterface/Images/Breakpoints.svg:
480         Change to path so stroke and fill can be styled.
481
482         * UserInterface/Views/DebuggerSidebarPanel.css:
483         (.sidebar > .panel.navigation.debugger > .navigation-bar .debugger-breakpoints):
484         (.sidebar > .panel.navigation.debugger > .navigation-bar .debugger-breakpoints.activated):
485         Fill and stroke styles for the active and inactive breakpoint button.
486
487 2016-11-28  Matt Baker  <mattbaker@apple.com>
488
489         Web Inspector: Debugger should have an option for showing asynchronous call stacks
490         https://bugs.webkit.org/show_bug.cgi?id=163230
491         <rdar://problem/28698683>
492
493         Reviewed by Joseph Pecoraro.
494
495         * Localizations/en.lproj/localizedStrings.js:
496         New string for generic async call stack boundary label: "(async)".
497
498         * UserInterface/Controllers/DebuggerManager.js:
499         Create async stack depth setting and set default depth.
500         (WebInspector.DebuggerManager.prototype.get asyncStackTraceDepth):
501         (WebInspector.DebuggerManager.prototype.set asyncStackTraceDepth):
502         Make async stack depth setting accessible to the frontend.
503         (WebInspector.DebuggerManager.prototype.initializeTarget):
504         Set async stack depth value on the target.
505         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
506         Plumbing for the async stack trace payload.
507
508         * UserInterface/Models/ConsoleMessage.js:
509         (WebInspector.ConsoleMessage):
510         Updated for new StackTrace.fromPayload use.
511
512         * UserInterface/Models/DebuggerData.js:
513         (WebInspector.DebuggerData):
514         (WebInspector.DebuggerData.prototype.get asyncStackTrace):
515         (WebInspector.DebuggerData.prototype.updateForPause):
516         (WebInspector.DebuggerData.prototype.updateForResume):
517         More plumbing.
518
519         * UserInterface/Models/StackTrace.js:
520         Update frontend model for use as new protocol object Console.StackTrace,
521         which was previously an alias for a simple array of Console.CallFrames.
522
523         (WebInspector.StackTrace):
524         (WebInspector.StackTrace.fromPayload):
525         (WebInspector.StackTrace.fromString):
526         (WebInspector.StackTrace.prototype.get topCallFrameIsBoundary):
527         (WebInspector.StackTrace.prototype.get parentStackTrace):
528
529         * UserInterface/Protocol/DebuggerObserver.js:
530         (WebInspector.DebuggerObserver.prototype.paused):
531         More plumbing.
532
533         * UserInterface/Views/CallFrameTreeElement.css:
534         (.tree-outline .item.call-frame.async-boundary):
535         Use default cursor since boundary element is not selectable.
536         (.tree-outline .item.call-frame.async-boundary .icon):
537         (.tree-outline .item.call-frame.async-boundary::before,):
538         (.tree-outline .item.call-frame.async-boundary::after):
539         (.tree-outline .item.call-frame.async-boundary::before):
540         Dimmed text and divider line styles for boundary element.
541
542         * UserInterface/Views/CallFrameTreeElement.js:
543         (WebInspector.CallFrameTreeElement):
544         Add a flag denoting whether the call frame is an async call trace
545         boundary, and set styles accordingly.
546
547         * UserInterface/Views/DebuggerSidebarPanel.js:
548         Set async stack trace depth, if supported.
549         (WebInspector.DebuggerSidebarPanel.prototype._updateSingleThreadCallStacks):
550         Add call frames for async stack traces to the call stack TreeOutline.
551         (WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
552         Ensure that async call frames cannot become the active call frame.
553
554         * UserInterface/Views/Variables.css:
555         (:root):
556         Add --text-color-gray-medium, for dimmed text in async boundary element.
557
558 2016-11-18  Matt Baker  <mattbaker@apple.com>
559
560         Web Inspector: TimelineDataGridNode assertions when refreshing page
561         https://bugs.webkit.org/show_bug.cgi?id=162642
562         <rdar://problem/28505898>
563
564         Reviewed by Timothy Hatcher.
565
566         This patch fixes a number of deficiencies in the Network tab that caused
567         TimelineDataGridNode graphs to refresh before the tab became visible.
568
569         * UserInterface/Views/ElementsTabContentView.js:
570         (WebInspector.ElementsTabContentView):
571         (WebInspector.ElementsTabContentView.prototype.shown):
572         Drive-by fix: defer showing the DOM content view until the tab is shown.
573
574         * UserInterface/Views/NetworkGridContentView.js:
575         (WebInspector.NetworkGridContentView):
576         Drive-by event listener cleanup.
577         (WebInspector.NetworkGridContentView.prototype.get startTime):
578         (WebInspector.NetworkGridContentView.prototype.get endTime):
579         Back endTime with a variable, instead of using the ruler value which
580         isn't valid before the tab is shown for the first time.
581
582         (WebInspector.NetworkGridContentView.prototype.shown):
583         Force the grid to update its layout, and that of the Timeline column ruler.
584         During layout the ruler's secondsPerPixel value is used, which isn't
585         valid until the ruler does an initial layout.
586
587         (WebInspector.NetworkGridContentView.prototype.reset):
588         Clear pending records. This was causing duplicates to appear when the
589         inspected page was refreshed multiple times prior to showing the Network
590         tab for the first time.
591
592         (WebInspector.NetworkGridContentView.prototype.layout):
593         Should more closely match behavior in NetworkTimelineView.prototype.layout.
594         Graph end time padding is added if no longer updating the current time.
595
596         (WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
597         Track endTime of the last record added, so that the graph end time can
598         be padded once the current time is no longer being updated.
599
600         (WebInspector.NetworkGridContentView.prototype._update):
601         (WebInspector.NetworkGridContentView.prototype._stopUpdatingCurrentTime):
602         Graph end time padding shouldn't be applied here, since this isn't called
603         if the inspected page finishes loading before the view is shown.
604
605         (WebInspector.NetworkGridContentView.prototype._clearNetworkItems): Deleted.
606         Replaced by an arrow function.
607
608         * UserInterface/Views/NetworkSidebarPanel.js:
609         (WebInspector.NetworkSidebarPanel.prototype._networkTimelineReset):
610         Don't show the content view if the tab is hidden.
611
612 2016-11-17  Devin Rousso  <dcrousso+webkit@gmail.com>
613
614         Web Inspector: Shift clicking on named color value only shows its hex form
615         https://bugs.webkit.org/show_bug.cgi?id=162758
616
617         Reviewed by Timothy Hatcher.
618
619         * UserInterface/Models/Color.js:
620         (WebInspector.Color.prototype.nextFormat):
621         Reworked the logic for the formatting order to be the following:
622          - Long HEX and Long HEXAlpha
623          - RGB and RGBA
624          - HSL and HSLA
625          - Keyword (if applicable)
626          - Short HEX (if applicable)
627          - Short HEXAlpha (if applicable)
628         It will only show formats with alpha values if the color value has an alpha that is not 1.
629         If the alpha is not 1, it will not show formats with non-alpha values.
630
631         The changes to this function have no effect on the context menu items of InlineSwatch
632         elements.  The purpose of each of those items is to allow the user to change the format to
633         a specified type, whereas WebInspector.Color.prototype.nextFormat is used to cycle through
634         all of the relevant formats.
635
636         (WebInspector.Color.prototype._toRGBString):
637         (WebInspector.Color.prototype._toRGBAString):
638         (WebInspector.Color.prototype._toHSLString):
639         (WebInspector.Color.prototype._toHSLAString):
640         Unrelated fix of extra decimals when converting from HEX to RGB and HSL.
641
642         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
643         (WebInspector.CSSStyleDeclarationTextEditor._inlineSwatchValueChanged):
644         Removed assertion for `_hasActiveInlineSwatchEditor` since the value may change from
645         switching the format of a color swatch (Shift-Click).
646
647 2016-11-16  Joseph Pecoraro  <pecoraro@apple.com>
648
649         Web Inspector: Background tabs are often updating non-stop because they think they are visible
650         https://bugs.webkit.org/show_bug.cgi?id=164841
651         <rdar://problem/29298658>
652
653         Reviewed by Matt Baker.
654
655         * UserInterface/Views/NetworkGridContentView.js:
656         (WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
657         * UserInterface/Views/TimelineRecordingContentView.js:
658         (WebInspector.TimelineRecordingContentView.prototype._update):
659         Don't constantly update when this tab is not in the foreground.
660
661 2016-11-15  Joseph Pecoraro  <pecoraro@apple.com>
662
663         Web Inspector: SourceCodeTextEditor should display execution lines for background threads
664         https://bugs.webkit.org/show_bug.cgi?id=164679
665         <rdar://problem/29233026>
666
667         Reviewed by Timothy Hatcher.
668
669         There may be multiple threads paused in the same content view. With
670         this change we should a thread indicator for each primary line a
671         thread is paused on. It uses the same inline line indicator that
672         inline errors/warnings (issues) use.
673
674         When there is a single thread (just the Page) we don't show thread
675         indicators. But as soon as there are multiple threads we start
676         managing and showing them. The line indicator contains the name of
677         the thread on the side.
678
679         Note that SourceCodeTextEditor maintains the thread indicators, but
680         it still always handles the ActiveCallFrame as it used to, pushing
681         values down into TextEditor. The ActiveCallFrame styles override
682         the thread line indicators (albeit with the same styles). The reason
683         these are still separate is that TextEditor has some special styles
684         regarding its gutter for the active execution line. Eventually we
685         may want to find a way to push this up into SourceCodeTextEditor.
686
687         * Localizations/en.lproj/localizedStrings.js:
688         New string "%d Threads" when multiple threads are on the same line.
689
690         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
691         (WebInspector.ScopeChainDetailsSidebarPanel):
692         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._activeCallFrameDidChange):
693         Update Watch Expressions when the active call frame changes.
694
695         * UserInterface/Views/SourceCodeTextEditor.css:
696         (.source-code.text-editor > .CodeMirror .line-indicator-widget):
697         (.source-code.text-editor > .CodeMirror .line-indicator-widget.inline):
698         (.source-code.text-editor > .CodeMirror .line-indicator-widget > .arrow):
699         (.source-code.text-editor > .CodeMirror .line-indicator-widget.inline > .arrow):
700         (.source-code.text-editor > .CodeMirror .line-indicator-widget > .icon):
701         (.source-code.text-editor > .CodeMirror .line-indicator-widget > .text):
702         (.source-code.text-editor > .CodeMirror .line-indicator-widget.inline > .text):
703         Share line indicator widget styles between issue widgets and thread widgets.
704
705         (.source-code.text-editor > .CodeMirror .thread-indicator):
706         (.source-code.text-editor > .CodeMirror .thread-widget):
707         (.source-code.text-editor > .CodeMirror .thread-widget.inline):
708         (.source-code.text-editor > .CodeMirror .thread-widget.inline > .arrow):
709         Colors for the thread-widget line-indicators.
710
711         * UserInterface/Views/SourceCodeTextEditor.js:
712         (WebInspector.SourceCodeTextEditor):
713         (WebInspector.SourceCodeTextEditor.prototype.close):
714         New event listeners handling for Target added / removed events.
715
716         (WebInspector.SourceCodeTextEditor.prototype._targetAdded):
717         (WebInspector.SourceCodeTextEditor.prototype._targetRemoved):
718         Update thread indicators as needed.
719
720         (WebInspector.SourceCodeTextEditor.prototype._looselyMatchesSourceCodeLocation):
721         More generic match based just on the URLs. Even if the exact script comes
722         from a different target, if they share the same URL that is fine.
723
724         (WebInspector.SourceCodeTextEditor.prototype._callFramesDidChange):
725         (WebInspector.SourceCodeTextEditor.prototype._addThreadIndicatorForTarget):
726         (WebInspector.SourceCodeTextEditor.prototype._removeThreadIndicatorForTarget):
727         (WebInspector.SourceCodeTextEditor.prototype._threadIndicatorWidgetForLine):
728         (WebInspector.SourceCodeTextEditor.prototype._updateThreadIndicatorWidget):
729         (WebInspector.SourceCodeTextEditor.prototype._handleThreadIndicatorWidgetClick):
730         Manage thread line indicator widgets. There are 3 maps we maintain.
731
732           1. line -> [threads]
733               List of threads paused on a line, needed for the UI text.
734           2. line -> widget
735               Gets the widget on a line so we can modify and eventually remove it.
736           3. target -> line
737               If a target is removed, we need to know what line it had an indicator on.
738
739         (WebInspector.SourceCodeTextEditor.prototype._isWidgetToggleable):
740         Generalize for all of our different line indicator widgets.
741
742         (WebInspector.SourceCodeTextEditor.prototype._contentDidPopulate):
743         (WebInspector.SourceCodeTextEditor.prototype.textEditorUpdatedFormatting):        
744         (WebInspector.SourceCodeTextEditor.prototype._reinsertAllThreadIndicators):
745         When first populated, or reformatted, clear and reinsert all widgets.
746
747         (WebInspector.SourceCodeTextEditor.prototype._reinsertAllIssues):
748         (WebInspector.SourceCodeTextEditor.prototype._logCleared):
749         (WebInspector.SourceCodeTextEditor.prototype._clearIssueWidgets): Renamed.
750         Rename _clearWidgets to _clearIssueWidgets.
751
752 2016-11-15  Joseph Pecoraro  <pecoraro@apple.com>
753
754         Web Inspector: Remove unused and untested Page.setTouchEmulationEnabled command
755         https://bugs.webkit.org/show_bug.cgi?id=164793
756
757         Reviewed by Timothy Hatcher.
758
759         * Localizations/en.lproj/localizedStrings.js:
760         Tooltips for new button.
761
762         * UserInterface/Base/Main.js:
763         (WebInspector.loaded):
764         New global setting.
765
766         * UserInterface/Views/DOMTreeContentView.js:
767         (WebInspector.DOMTreeContentView):
768         (WebInspector.DOMTreeContentView.prototype.get navigationItems):
769         (WebInspector.DOMTreeContentView.prototype._showPrintStylesSettingChanged):
770         (WebInspector.DOMTreeContentView.prototype._togglePrintStylesSetting):
771         New navigation bar button to toggle print styles.
772
773         * UserInterface/Controllers/CSSStyleManager.js:
774         (WebInspector.CSSStyleManager.prototype.mediaTypeChanged):
775         After toggling styles we will need to refresh styles, so provide
776         a meaningful way to trigger refreshing styles from the frontend.
777
778         * UserInterface/Images/Printer.svg: Added.
779         * UserInterface/Images/gtk/Printer.svg: Added.
780         New Printer icon for enabling / disabling print styles.
781
782         * UserInterface/Images/gtk/Crosshair.svg:
783         * UserInterface/Images/gtk/LayerBorders.svg:
784         * UserInterface/Images/gtk/NavigationItemCurleyBraces.svg:
785         * UserInterface/Images/gtk/NavigationItemTypes.svg:
786         * UserInterface/Images/gtk/PaintFlashing.svg:
787         * UserInterface/Images/gtk/ShadowDOM.svg:
788         * UserInterface/Images/gtk/ToggleLeftSidebar.svg:
789         * UserInterface/Images/gtk/ToggleRightSidebar.svg:
790         * UserInterface/Images/gtk/UpDownArrows.svg:
791         Fix a number of existing GTK images to have activated styles.
792
793 2016-11-15  Nikita Vasilyev  <nvasilyev@apple.com>
794
795         REGRESSION (r208248): Web Inspector: Pressing Left Arrow breaks autocomplete
796         https://bugs.webkit.org/show_bug.cgi?id=164391
797         <rdar://problem/29102408>
798
799         Reviewed by Matt Baker.
800
801         Unroll r208248.
802
803         * UserInterface/Controllers/CodeMirrorCompletionController.js:
804         (WebInspector.CodeMirrorCompletionController):
805         (WebInspector.CodeMirrorCompletionController.prototype.updateCompletions):
806         (WebInspector.CodeMirrorCompletionController.prototype.isCompletionChange):
807         (WebInspector.CodeMirrorCompletionController.prototype.hideCompletions):
808         (WebInspector.CodeMirrorCompletionController.prototype.close):
809         (WebInspector.CodeMirrorCompletionController.prototype.completionSuggestionsSelectedCompletion):
810         (WebInspector.CodeMirrorCompletionController.prototype._createCompletionHintMarker):
811         (WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint.update):
812         (WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint):
813         (WebInspector.CodeMirrorCompletionController.prototype._commitCompletionHint.update):
814         (WebInspector.CodeMirrorCompletionController.prototype._commitCompletionHint):
815         (WebInspector.CodeMirrorCompletionController.prototype._removeLastChangeFromHistory):
816         (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.clearMarker):
817         (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.update):
818         (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint):
819         (WebInspector.CodeMirrorCompletionController.prototype._completeAtCurrentPosition):
820         (WebInspector.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions):
821
822 2016-11-15  Joseph Pecoraro  <pecoraro@apple.com>
823
824         Web Inspector: Remove unused and untested Page.setTouchEmulationEnabled command
825         https://bugs.webkit.org/show_bug.cgi?id=164793
826
827         Reviewed by Matt Baker.
828
829         * UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js:
830         * UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
831         * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
832         * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
833         * UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js:
834         * Versions/Inspector-iOS-10.0.json:
835         * Versions/Inspector-iOS-7.0.json:
836         * Versions/Inspector-iOS-8.0.json:
837         * Versions/Inspector-iOS-9.0.json:
838         * Versions/Inspector-iOS-9.3.json:
839
840 2016-11-15  Joseph Pecoraro  <pecoraro@apple.com>
841
842         Web Inspector: URL Breakpoints that resolve in multiple workers should only appear in the UI once
843         https://bugs.webkit.org/show_bug.cgi?id=164334
844         <rdar://problem/29073523>
845
846         Reviewed by Matt Baker.
847
848         * UserInterface/Views/DebuggerSidebarPanel.js:
849         (WebInspector.DebuggerSidebarPanel.prototype._addBreakpoint):
850         Don't add a duplicate BreakpointTreeElements for the same Breakpoint.
851
852 2016-11-14  Joseph Pecoraro  <pecoraro@apple.com>
853
854         Web Inspector: Worker debugging should pause all targets and view call frames in all targets
855         https://bugs.webkit.org/show_bug.cgi?id=164305
856         <rdar://problem/29056192>
857
858         Reviewed by Timothy Hatcher.
859
860         This implements a policy where, when one Target ("Thread") pauses
861         the frontend triggers a pause in all other Targets. The intended
862         user experience is "all threads pause" whenever the frontend shows
863         the debugger paused UI.
864
865         DebuggerManager has a few straight forward changes:
866
867             - The paused state reflects if any target is paused.
868             - The Paused Event is fired when going from !paused -> paused.
869               This means when the first target pauses.
870             - The Resumed Event is fired when going from paused -> !paused.
871               This means only after all targets have resumed.
872             - The CallFrameDidChange Event now includes the Target that updated.
873
874         When a Target first pauses the frontend then immediately pauses all
875         other Targets. This puts them into a "pausing" state (we display as
876         Idle) and they will pause as soon as they start executing JavaScript.
877
878         When a Target steps the "paused" state isn't changing. So this is
879         just a CallFramesDidChange update.
880
881         When clicking Resume we resume all targets. This is will be the normal,
882         expected way users resume execution. Note that one of the threads may
883         then hit a breakpoint and re-pause all threads.
884
885         Sometimes when multiple threads are paused you may want to run an
886         individual thread to completion but keep other threads paused. There
887         is a context menu on the ThreadTreeElement to resume just that
888         single thread. It will continue and pause for its next run loop.
889
890         * Localizations/en.lproj/localizedStrings.js:
891         * UserInterface/Images/Thread.svg: Added.
892         * UserInterface/Images/gtk/Thread.svg: Added.
893         * UserInterface/Main.html:
894         New strings and files.
895
896         * UserInterface/Base/Main.js:
897         (WebInspector.loaded):
898         * UserInterface/Test/Test.js:
899         (WebInspector.loaded):
900         Place the TargetManager first since other managers may want to listen
901         for TargetAdded / TargetRemoved events.
902
903         * UserInterface/Controllers/DebuggerManager.js:
904         (WebInspector.DebuggerManager.prototype.get paused):
905         This is now a computed state.
906
907         (WebInspector.DebuggerManager.prototype.pause):
908         (WebInspector.DebuggerManager.prototype.resume):
909         Affect all targets.
910
911         (WebInspector.DebuggerManager.prototype.stepOver):
912         (WebInspector.DebuggerManager.prototype.stepInto):
913         (WebInspector.DebuggerManager.prototype.stepOut):
914         (WebInspector.DebuggerManager.prototype.reset):
915         Update to use the paused computed property.
916
917         (WebInspector.DebuggerManager.prototype.continueUntilNextRunLoop):
918         Issue the new Debugger.continueUntilNextRunLoop command
919         on a given target.
920
921         (WebInspector.DebuggerManager.prototype.initializeTarget):
922         When a new Target is created and we were already paused,
923         then start that Worker in a paused state.
924
925         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
926         Recover from bad cases where the backend informs the frontend about
927         internal JavaScript that it shouldn't know about. Legacy backend do
928         this but also there are corner cases we need to handle.
929         Dispatch events appropriately now that multiple targets may be paused.
930
931         (WebInspector.DebuggerManager.prototype._didResumeInternal):
932         Dispatch events appropriately now that multiple targets may be paused.
933
934         (WebInspector.DebuggerManager.prototype._targetRemoved):
935         Remove debugger data for targets that go away to avoid leaks.
936
937         * UserInterface/Models/DebuggerData.js:
938         (WebInspector.DebuggerData):
939         (WebInspector.DebuggerData.prototype.get paused):
940         (WebInspector.DebuggerData.prototype.get pausing):
941         Move some more per-Target state into DebuggerData.
942
943         (WebInspector.DebuggerData.prototype.pauseIfNeeded):
944         (WebInspector.DebuggerData.prototype.resumeIfNeeded):
945         (WebInspector.DebuggerData.prototype.continueUntilNextRunLoop):
946         These should only be called by DebuggerManager. They correctly
947         update the state of the DebuggerData for this Target, and also
948         issue the underlying command to the target.
949
950         (WebInspector.DebuggerData.prototype.updateForPause):
951         (WebInspector.DebuggerData.prototype.updateForResume):
952         Handle a special case where continueUntilNextRunLoop triggers
953         an invisible "pause" on the backend that we should mirror.
954
955         * UserInterface/Protocol/Target.js:
956         (WebInspector.MainTarget):
957         (WebInspector.MainTarget.prototype.get displayName):
958         (WebInspector.MainTarget.prototype.initialize):
959         Better display names.
960
961         * UserInterface/Views/DebuggerSidebarPanel.js:
962         (WebInspector.DebuggerSidebarPanel):
963         (WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause):
964         (WebInspector.DebuggerSidebarPanel.prototype._debuggerDidResume):
965         (WebInspector.DebuggerSidebarPanel.prototype._updateSingleThreadCallStacks):
966         (WebInspector.DebuggerSidebarPanel.prototype._selectActiveCallFrameTreeElement):
967         (WebInspector.DebuggerSidebarPanel.prototype._showSingleThreadCallStacks):
968         (WebInspector.DebuggerSidebarPanel.prototype._showMultipleThreadCallStacks):
969         (WebInspector.DebuggerSidebarPanel.prototype._findThreadTreeElementForTarget):
970         (WebInspector.DebuggerSidebarPanel.prototype._targetAdded):
971         (WebInspector.DebuggerSidebarPanel.prototype._targetRemoved):
972         (WebInspector.DebuggerSidebarPanel.prototype._debuggerCallFramesDidChange):
973         (WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange):
974         The DebuggerSidebar still has a single "Call Stacks" section, but maintains
975         two TreeOutlines and only shows one at a time. The Single Thread view shows
976         a flat list of the call frames for the Main Target when it is the only target.
977         The Multiple Threads view shows a list of Threads and their call frames.
978         We always keep both up to date, because we may need to swap between them
979         purely as Targets are added / removed. There is a bit of extra logic to
980         ensure we select elements properly based only on the visible tree outline.
981
982         * UserInterface/Views/LogContentView.js:
983         (WebInspector.LogContentView.prototype.didAppendConsoleMessageView):
984         When evaluating in a particular target, "runAfterPendingDispatches"
985         must wait for all other commands in that particular target to have
986         completed. So use the target specific version.
987
988         * UserInterface/Views/NavigationSidebarPanel.js:
989         (WebInspector.NavigationSidebarPanel.prototype._isTreeElementWithoutRepresentedObject):
990         Gracefully handle a few more TreeElements without a represented object.
991
992         * UserInterface/Views/IdleTreeElement.css: Added.
993         (.details-section.call-stack .idle .icon):
994         * UserInterface/Views/IdleTreeElement.js: Added.
995         (WebInspector.IdleTreeElement):
996         Very basic tree element to encapsulate an Idle call frame with an
997         empty represented object.
998
999         * UserInterface/Views/ThreadTreeElement.css: Added.
1000         (.details-section.call-stack .thread .icon):
1001         * UserInterface/Views/ThreadTreeElement.js: Added.
1002         (WebInspector.ThreadTreeElement):
1003         (WebInspector.ThreadTreeElement.prototype.get target):
1004         (WebInspector.ThreadTreeElement.prototype.refresh):
1005         (WebInspector.ThreadTreeElement.prototype.onattach):
1006         (WebInspector.ThreadTreeElement.prototype.oncontextmenu):
1007         ThreadTreeElement has no represented object, but makes it easy
1008         to refresh a list of CallFrameTreeElements for a given target.
1009
1010 2016-11-14  Timothy Hatcher  <timothy@apple.com>
1011
1012         Web Inspector: Disable Warning Filter in Debugger Tab By Default
1013         https://bugs.webkit.org/show_bug.cgi?id=164723
1014         rdar://problem/29251780
1015
1016         Reviewed by Joseph Pecoraro.
1017
1018         * UserInterface/Views/DebuggerSidebarPanel.js:
1019         (WebInspector.DebuggerSidebarPanel): Made "debugger-show-resources-with-issues-only" false by default.
1020
1021 2016-11-14  Nikita Vasilyev  <nvasilyev@apple.com>
1022
1023         Web Inspector: Settings tab should look more like a native macOS view
1024         https://bugs.webkit.org/show_bug.cgi?id=164708
1025         <rdar://problem/29241296>
1026
1027         Reviewed by Timothy Hatcher.
1028
1029         * UserInterface/Views/SettingsTabContentView.css:
1030         (.content-view.settings):
1031         (.content-view.settings > .header):
1032         (.content-view.settings > .setting-container):
1033         Match macOS Sierra default font size for settings view.
1034
1035         (.content-view.settings > .setting-container > .setting-name):
1036         (.content-view.settings > .setting-container > .setting-value-controller):
1037         (.content-view.settings > .setting-container > .setting-value-controller input):
1038         (.content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]):
1039         Make checkbox larger.
1040
1041         (.content-view.settings > .setting-container > .setting-value-controller select):
1042         (.content-view.settings > .setting-container > .setting-value-controller input[type="number"]):
1043         Decrease the width of the number fields to make them just wide enough to fit 2 digit numbers.
1044
1045 2016-11-12  Joseph Pecoraro  <pecoraro@apple.com>
1046
1047         Web Inspector: Type Profiler and Code Coverage Profiler should work in Workers
1048         https://bugs.webkit.org/show_bug.cgi?id=164682
1049
1050         Reviewed by Darin Adler.
1051
1052         * UserInterface/Controllers/BasicBlockAnnotator.js:
1053         * UserInterface/Models/ScriptSyntaxTree.js:
1054         (WebInspector.ScriptSyntaxTree.prototype.updateTypes):
1055         Use the target associated with the Script.
1056
1057         * UserInterface/Protocol/Target.js:
1058         (WebInspector.WorkerTarget.prototype.initialize):
1059         When initializing a Worker Target, match the existing state
1060         of the Page for these profilers.
1061
1062         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
1063         * UserInterface/Views/SourceCodeTextEditor.js:
1064         (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation):
1065         (WebInspector.SourceCodeTextEditor.prototype.willDismissPopover):
1066         Use the correct target for this Script / Resource.
1067
1068         (WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
1069         (WebInspector.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
1070         Enable / disable for all targets when toggling profilers.
1071
1072 2016-11-11  Anthony Ricaud  <rik@webkit.org>
1073
1074         Web Inspector: Whitespace in Editor should be less visible than regular content
1075         https://bugs.webkit.org/show_bug.cgi?id=164660
1076
1077         Reviewed by Matt Baker.
1078
1079         * UserInterface/Views/CodeMirrorOverrides.css:
1080         (.show-whitespace-characters .CodeMirror .cm-whitespace::before):
1081
1082 2016-11-11  Nikita Vasilyev  <nvasilyev@apple.com>
1083
1084         Web Inspector: Call RuntimeAgent.disableControlFlowProfiler when Code Coverage Profiler is turned off
1085         https://bugs.webkit.org/show_bug.cgi?id=163407
1086         <rdar://problem/28764230>
1087
1088         Reviewed by Timothy Hatcher.
1089
1090         Turning Type Profiler off by clicking [T] icon now disables its backend by calling RuntimeAgent.disableTypeProfiler().
1091
1092         * UserInterface/Views/SourceCodeTextEditor.js:
1093         (WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
1094
1095 2016-11-11  Nikita Vasilyev  <nvasilyev@apple.com>
1096
1097         Web Inspector: Settings tab: make the header smaller to fit more content
1098         https://bugs.webkit.org/show_bug.cgi?id=164613
1099         <rdar://problem/29206007>
1100
1101         Reviewed by Timothy Hatcher.
1102
1103         * UserInterface/Views/SettingsTabContentView.css:
1104         (.content-view.settings > .header):
1105         Use hv units for margin. 1vh = 1% of viewport height. When Web Inspector window is taller, the margin is larger.
1106
1107         (.content-view.settings > .setting-container):
1108         Convert padding to margin to make spacing between the header and the first section better.
1109
1110 2016-11-10  Nikita Vasilyev  <nvasilyev@apple.com>
1111
1112         Web Inspector: Call RuntimeAgent.disableControlFlowProfiler when Code Coverage Profiler is turned off
1113         https://bugs.webkit.org/show_bug.cgi?id=163407
1114         <rdar://problem/28764230>
1115
1116         Reviewed by Joseph Pecoraro.
1117
1118         Turning Code Coverage off by clicking [C] icon now disables its backend by calling RuntimeAgent.disableControlFlowProfiler().
1119
1120         * UserInterface/Views/SourceCodeTextEditor.js:
1121         (WebInspector.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
1122
1123 2016-11-10  Aaron Chu  <aaron_chu@apple.com>
1124
1125         Web Inspector: AXI: clarify button roles (e.g. toggle or popup button)
1126         https://bugs.webkit.org/show_bug.cgi?id=130726
1127         <rdar://problem/16420420>
1128
1129         Reviewed by Brian Burg.
1130
1131         Updated Inspector to show the button type using the new mapping information.
1132
1133         * Localizations/en.lproj/localizedStrings.js:
1134         * UserInterface/Models/DOMNode.js:
1135         (WebInspector.DOMNode.prototype.accessibilityProperties.accessibilityPropertiesCallback):
1136         (WebInspector.DOMNode.prototype.accessibilityProperties):
1137         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
1138         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
1139         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):
1140
1141 2016-11-09  Joseph Pecoraro  <pecoraro@apple.com>
1142
1143         Web Inspector: DebuggerManager.Event.Resumed introduces test flakiness
1144         https://bugs.webkit.org/show_bug.cgi?id=161951
1145         <rdar://problem/28295767>
1146
1147         Reviewed by Brian Burg.
1148
1149         * UserInterface/Controllers/DebuggerManager.js:
1150         (WebInspector.DebuggerManager.prototype.debuggerDidResume):
1151         Now, Debugger.resumed events really mean the debugger resumed,
1152         so act immediately instead of guessing. We must still guess
1153         in legacy backends.
1154
1155         * UserInterface/Test/Test.js:
1156         When the inspector frontend encounters an issue, log it.
1157
1158         * UserInterface/Views/DebuggerSidebarPanel.js:
1159         (WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause):
1160         (WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange):
1161         Always enable the step out button. I don't think it makes sense to disable
1162         it sometimes, and if there are issues with this we should solve the issues
1163         instead of hiding them.
1164
1165 2016-11-09  Joseph Pecoraro  <pecoraro@apple.com>
1166
1167         Web Inspector: Associate Worker Resources with the Worker and not the Page
1168         https://bugs.webkit.org/show_bug.cgi?id=164342
1169         <rdar://problem/29075775>
1170
1171         Reviewed by Timothy Hatcher.
1172
1173         A Target may have its own list of Resource. For example, Workers may
1174         request any resources via XHR/Fetch. So we associate a ResourceCollection
1175         with a Target, and ensure we show them in Web Inspector as you would expect.
1176         At this point, Target starts acting like Frame. Target has a resourceCollection
1177         and extraScriptsCollection just like Frame. Target has events for ResourceAdded
1178         just like Frame.
1179
1180         Even though Resource loads are happening in Workers, the Network data
1181         still comes from the Page's Network agent. The added "targetId" data
1182         with the Resource will let us associate a Resoure with a Target.
1183
1184         When opening inspector after a page has loaded, the frontend loads Resources
1185         via the Page.getResourceTree path. In this case, the frontend may be
1186         informed of Resources for a Target that it does not know about yet. In
1187         these cases, it sets them aside as Orphaned resources for a target. Later,
1188         when that Target is created, it will adopt its Orphaned resources.
1189
1190         Places that used to listen to just Frame.Event.ResourceWasAdded should now
1191         also listen for Target.Event.ResourceAdded to ensure it sees the resources
1192         associated with non-page targets.
1193
1194         * UserInterface/Protocol/Target.js:
1195         (WebInspector.Target):
1196         (WebInspector.Target.prototype.get identifier):
1197         (WebInspector.Target.prototype.get resourceCollection):
1198         (WebInspector.Target.prototype.get extraScriptCollection):
1199         (WebInspector.Target.prototype.addResource):
1200         (WebInspector.Target.prototype.adoptResource):
1201         (WebInspector.Target.prototype.addScript):
1202         Give Target resource collections.
1203
1204         (WebInspector.MainTarget):
1205         (WebInspector.MainTarget.prototype.get mainResource):
1206         Pass through to the FrameResourceManager for the MainTarget.
1207
1208         (WebInspector.WorkerTarget):
1209         (WebInspector.WorkerTarget.prototype.initialize):
1210         Adopt orphaned resources on creation.
1211
1212         * UserInterface/Models/Resource.js:
1213         (WebInspector.Resource):
1214         (WebInspector.Resource.prototype.get target):
1215         (WebInspector.Resource.prototype.get type):
1216         Resource now has a Target. During creation, if there is a targetId
1217         then we must produce a Target or null (orphaned).
1218
1219         (WebInspector.Resource.prototype.associateWithScript):
1220         When associating a Resource with a Script, we can use this opportunity
1221         to convert from an XML / Other type to Script.
1222
1223         * UserInterface/Models/Script.js:
1224         (WebInspector.Script.prototype._resolveResource):
1225         When associating Scripts with a resource we must associate resources
1226         from within the proper Target. If it is the Main target we still use
1227         the FrameResourceManager which keep searches across all Frames.
1228
1229         * UserInterface/Protocol/NetworkObserver.js:
1230         (WebInspector.NetworkObserver.prototype.requestWillBeSent):
1231         * UserInterface/Controllers/FrameResourceManager.js:
1232         (WebInspector.FrameResourceManager.prototype.initialize):
1233         (WebInspector.FrameResourceManager.prototype.frameDidNavigate):
1234         (WebInspector.FrameResourceManager.prototype.resourceRequestWillBeSent):
1235         (WebInspector.FrameResourceManager.prototype.resourceRequestWasServedFromMemoryCache):
1236         (WebInspector.FrameResourceManager.prototype.resourceRequestDidReceiveResponse):
1237         (WebInspector.FrameResourceManager.prototype.adoptOrphanedResourcesForTarget):
1238         (WebInspector.FrameResourceManager.prototype._addNewResourceToFrameOrTarget):
1239         (WebInspector.FrameResourceManager.prototype._addResourceToTarget):
1240         (WebInspector.FrameResourceManager.prototype._createResource):
1241         (WebInspector.FrameResourceManager.prototype._addFrameTreeFromFrameResourceTreePayload):
1242         (WebInspector.FrameResourceManager.prototype._addOrphanedResource):
1243         (WebInspector.FrameResourceManager.prototype._mainFrameDidChange):
1244         (WebInspector.FrameResourceManager.prototype._addNewResourceToFrame): Deleted.
1245         When creating Resources from Network events we may now have a targetId.
1246         Once created a Resource must be associated with a Frame, Target, or orphaned.
1247
1248         * UserInterface/Main.html:
1249         * UserInterface/Views/TargetTreeElement.js: Removed.
1250         * UserInterface/Views/WorkerTreeElement.js: Added.
1251         (WebInspector.WorkerTreeElement):
1252         (WebInspector.WorkerTreeElement.prototype.get target):
1253         (WebInspector.WorkerTreeElement.prototype.onexpand):
1254         (WebInspector.WorkerTreeElement.prototype.oncollapse):
1255         (WebInspector.WorkerTreeElement.prototype.onpopulate):
1256         (WebInspector.WorkerTreeElement.prototype.updateSourceMapResources):
1257         (WebInspector.WorkerTreeElement.prototype.onattach):
1258         (WebInspector.WorkerTreeElement.prototype.compareChildTreeElements):
1259         (WebInspector.WorkerTreeElement.prototype._handleContextMenuEvent):
1260         (WebInspector.WorkerTreeElement.prototype._scriptAdded):
1261         (WebInspector.WorkerTreeElement.prototype._resourceAdded):
1262         Convert TargetTreeElement to WorkerTreeElement as that is clearer.
1263         Behave like FrameTreeElement and populate resources on creation,
1264         handle SourceMapResource, etc.
1265
1266         * UserInterface/Views/FolderizedTreeElement.js:
1267         (WebInspector.FolderizedTreeElement.prototype.registerFolderizeSettings):
1268         (WebInspector.FolderizedTreeElement.prototype._compareTreeElementsByMainTitle):
1269         (WebInspector.FolderizedTreeElement.prototype._parentTreeElementForRepresentedObject):
1270         If the display name for a folder is `null` then there is no folder,
1271         and place such child tree elements at the top level. This will be
1272         the case for a Worker's Script's, which we choose not to folderize.
1273
1274         * UserInterface/Controllers/DebuggerManager.js:
1275         (WebInspector.DebuggerManager.prototype.scriptDidParse):
1276         * UserInterface/Controllers/TargetManager.js:
1277         (WebInspector.TargetManager.prototype.targetForIdentifier):
1278
1279         * UserInterface/Models/DefaultDashboard.js:
1280         (WebInspector.DefaultDashboard):
1281         * UserInterface/Controllers/TimelineManager.js:
1282         (WebInspector.TimelineManager):
1283         * UserInterface/Controllers/WorkerManager.js:
1284         (WebInspector.WorkerManager.prototype.workerCreated):
1285         * UserInterface/Views/OpenResourceDialog.js:
1286         (WebInspector.OpenResourceDialog.prototype.didDismissDialog):
1287         (WebInspector.OpenResourceDialog.prototype.didPresentDialog):
1288         (WebInspector.OpenResourceDialog.prototype._addScriptsForTarget): Deleted.
1289         (WebInspector.OpenResourceDialog.prototype._addResourcesForTarget): Added.
1290         Ensure those that listen for Frame.Event.ResourceWasAdded now also
1291         listen for Target.Event.ResourceAdded.
1292
1293         * UserInterface/Views/ContextMenuUtilities.js:
1294         (WebInspector.appendContextMenuItemsForSourceCode):
1295         (WebInspector.appendContextMenuItemsForResource): Deleted.
1296         * UserInterface/Views/ResourceTimelineDataGridNode.js:
1297         (WebInspector.ResourceTimelineDataGridNode.prototype.appendContextMenuItems):
1298         * UserInterface/Views/ResourceTreeElement.js:
1299         (WebInspector.ResourceTreeElement.prototype._updateTitles):
1300         (WebInspector.ResourceTreeElement.prototype._handleContextMenuEvent):
1301         Generalize ContextMenu helper to SourceCode so it can be used on a Script or Resource.
1302
1303         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
1304         (WebInspector.ResourceDetailsSidebarPanel.prototype.inspect):
1305         When looking at a WorkerTarget's mainResource (Script) show the
1306         Resource Details sidebar for its Resource.
1307
1308         * UserInterface/Views/ResourceSidebarPanel.js:
1309         (WebInspector.ResourceSidebarPanel):
1310         (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
1311         (WebInspector.ResourceSidebarPanel.prototype._scriptsCleared):
1312         (WebInspector.ResourceSidebarPanel.prototype._addTargetWithMainResource):
1313         (WebInspector.ResourceSidebarPanel.prototype._targetRemoved):
1314         (WebInspector.ResourceSidebarPanel.prototype._addScriptForNonMainTarget): Deleted.
1315         Simplify ResourceSidebarPanel to only handle adding WorkerTreeElements,
1316         which will do the rest of the work for their Resources/Scripts.
1317
1318         * UserInterface/Views/SourceCodeTreeElement.js:
1319         (WebInspector.SourceCodeTreeElement.prototype.descendantResourceTreeElementTypeDidChange):
1320         When we were changing the type of a resource, it would remove and re-insert.
1321         This would collapse the parent if it was the only child in removal, and not
1322         expand the parent when re-inserting. This ensures we re-expand.
1323
1324 2016-11-09  Nikita Vasilyev  <nvasilyev@apple.com>
1325
1326         Web Inspector: Settings tab sections overlap each other in docked Inspector window
1327         https://bugs.webkit.org/show_bug.cgi?id=164564
1328
1329         Reviewed by Joseph Pecoraro.
1330
1331         * UserInterface/Views/SettingsTabContentView.css:
1332         (.content-view.settings):
1333         Make settings sections non-shrinkable and make the content view vertically scrollable.
1334
1335         (.content-view.settings > .setting-container):
1336         Set vertical padding that looks good for non-shrinkable sections.
1337
1338 2016-11-09  Nikita Vasilyev  <nvasilyev@apple.com>
1339
1340         Web Inspector: Settings tab: Checkbox labels should be clickable
1341         https://bugs.webkit.org/show_bug.cgi?id=164470
1342         <rdar://problem/29133787>
1343
1344         Reviewed by Matt Baker.
1345
1346         * UserInterface/Views/SettingsTabContentView.js:
1347         (WebInspector.SettingsTabContentView.prototype.initialLayout):
1348         Add a label element to make checkboxes clickable.
1349
1350 2016-11-09  Devin Rousso  <dcrousso+webkit@gmail.com>
1351
1352         Web Inspector: Allow FolderTreeElement to display content when selected
1353         https://bugs.webkit.org/show_bug.cgi?id=164407
1354
1355         Reviewed by Timothy Hatcher.
1356
1357         * UserInterface/Main.html:
1358         Add CollectionContentView and TitleView.
1359
1360         * UserInterface/Base/Main.js:
1361         * UserInterface/Views/ContentView.js:
1362         (WebInspector.ContentView.createFromRepresentedObject):
1363         (WebInspector.ContentView.isViewable):
1364         Add support for Collection as the representedObject of a content view.
1365
1366         * UserInterface/Views/CollectionContentView.css: Added.
1367         (.content-view.collection):
1368         (.content-view.collection > .content-view):
1369         * UserInterface/Views/CollectionContentView.js: Added.
1370         (WebInspector.CollectionContentView):
1371         (WebInspector.CollectionContentView.prototype.initialLayout):
1372         (WebInspector.CollectionContentView.prototype._addContentViewForItem):
1373         (WebInspector.CollectionContentView.prototype._removeContentViewForItem):
1374         (WebInspector.CollectionContentView.prototype._handleItemAdded):
1375         (WebInspector.CollectionContentView.prototype._handleItemRemoved):
1376         (WebInspector.CollectionContentView.prototype._handleContentError):
1377         Takes in a Collection when constructed, and attempts to display a sub-ContentView for each
1378         item in the collection if the type of the collection is viewable en masse.  Currently, this
1379         is only supported for WebInspector.Resource.Type.Image collections.
1380
1381         * UserInterface/Views/ResourceContentView.js:
1382         (WebInspector.ResourceContentView.prototype._contentError):
1383         Dispatch an event whenever the content fails to load.
1384
1385         * UserInterface/Views/ResourceSidebarPanel.js:
1386         (WebInspector.ResourceSidebarPanel.prototype._treeSelectionDidChange):
1387         * UserInterface/Views/ResourcesTabContentView.js:
1388         (WebInspector.ResourcesTabContentView.prototype.canShowRepresentedObject):
1389         Allow FolderTreeElements to be selected.
1390
1391         * UserInterface/Views/TitleView.css: Added.
1392         (.title-view):
1393         * UserInterface/Views/TitleView.js: Added.
1394         (WebInspector.TitleView):
1395         Basic view that displays the given text in the center of the viewable area.
1396
1397 2016-11-03  Nikita Vasilyev  <nvasilyev@apple.com>
1398
1399         Web Inspector: Stack overflow when searching a timeline recording for JS function names
1400         https://bugs.webkit.org/show_bug.cgi?id=161784
1401         <rdar://problem/28219498>
1402
1403         Reviewed by Timothy Hatcher.
1404
1405         _populate method of ProfileNodeDataGridNode and ProfileDataGridNode traverses
1406         all children of a given node. makeVisible function of DataGrid#_applyFiltersToNode
1407         traverses all its parents to expand them. This creates an infinite recursion.
1408         Remove "populate" event before appending child nodes to prevent it.
1409
1410         * UserInterface/Views/ProfileDataGridNode.js:
1411         (WebInspector.ProfileDataGridNode.prototype._populate):
1412         (WebInspector.ProfileDataGridNode):
1413         * UserInterface/Views/ProfileNodeDataGridNode.js:
1414         (WebInspector.ProfileNodeDataGridNode.prototype._populate):
1415         (WebInspector.ProfileNodeDataGridNode):
1416
1417 2016-11-03  Devin Rousso  <dcrousso+webkit@gmail.com>
1418
1419         Web Inspector: Modify FolderTreeElement to have a Collection as a its represented object
1420         https://bugs.webkit.org/show_bug.cgi?id=164349
1421
1422         Reviewed by Matt Baker.
1423
1424         * UserInterface/Views/FolderTreeElement.js:
1425         (WebInspector.FolderTreeElement):
1426         Now accepts a representedObject parameter, which must be a WebInspector.Collection.
1427
1428         * UserInterface/Views/FolderizedTreeElement.js:
1429         (WebInspector.FolderizedTreeElement.prototype.registerFolderizeSettings):
1430         (WebInspector.FolderizedTreeElement.prototype.updateParentStatus):
1431         (WebInspector.FolderizedTreeElement.prototype._parentTreeElementForRepresentedObject):
1432         (WebInspector.FolderizedTreeElement.prototype._settingsForRepresentedObject):
1433         (WebInspector.FolderizedTreeElement.prototype._shouldGroupIntoFolders):
1434         (WebInspector.FolderizedTreeElement):
1435         Rework the logic for creating WebInspector.FolderTreeElement so that items for the
1436         representedObject parameter may be passed in via registerFolderizeSettings.
1437
1438         * UserInterface/Views/FrameTreeElement.js:
1439         (WebInspector.FrameTreeElement):
1440         (WebInspector.FrameTreeElement.): Deleted.
1441         (WebInspector.FrameTreeElement.makeChildCountCallback): Deleted.
1442         Rework logic for calling registerFolderizeSettings to support the representedObject
1443         parameter.  Also changed calls to WebInspector.Frame to support the
1444         WebInspector.Collection class.
1445
1446         * UserInterface/Views/ResourceSidebarPanel.js:
1447         (WebInspector.ResourceSidebarPanel.prototype.treeElementForRepresentedObject):
1448         (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
1449         (WebInspector.ResourceSidebarPanel.prototype._scriptsCleared):
1450         Create WebInspector.Collection instances of Script model objects for additional folders
1451         created by the Resources sidebar:
1452          - Anonymous Scripts
1453          - Extension Scripts
1454          - Extra Scripts
1455
1456 2016-11-02  Joseph Pecoraro  <pecoraro@apple.com>
1457
1458         Web Inspector: Include DebuggerAgent in Workers - see, pause, and step through scripts
1459         https://bugs.webkit.org/show_bug.cgi?id=164136
1460         <rdar://problem/29028462>
1461
1462         Reviewed by Brian Burg.
1463         
1464         By implementing DebuggerAgent, Workers will inform the frontend about
1465         Scripts that evaluate in the Worker's VM and the Worker VM can pause
1466         and send the pausing CallFrames to the frontend. This means that
1467         WebInspector.Script and WebInspector.CallFrame will need to be made
1468         target aware. This also means that each Target will have its own
1469         set of debugger data, such as the list of scripts and pause data
1470         like the pause reason / call frames. Previously all this data was
1471         managed by DebuggerManager.
1472
1473         With this change we split that data out of DebuggerManager to be
1474         per-target DebuggerData. DebuggerManager keeps `activeCallFrame`
1475         but the list of scripts and pause data have moved into `DebuggerData`
1476         which is per-target, accessed through DebuggerManager's new
1477         dataForTarget(target) method.
1478
1479         Finally we make a few changes to the UserInterface to make Workers
1480         and their scripts, appear grouped together. The Resources sidebar
1481         previously had a single top level item for the Main Frame, which
1482         has all its resources as its children (potentially grouped into
1483         folders). With this change, each Worker gets its own top level
1484         item as well, and the Worker's subresources (imported scripts)
1485         become its children.
1486
1487         We also now associate a single mainResource with Targets. In the
1488         case of Workers, we assume and assert that this is a Script. If
1489         this were to ever change we would need to adjust the assumptions.
1490
1491         * UserInterface/Main.html:
1492         * UserInterface/Test.html:
1493         New files.
1494
1495         * UserInterface/Base/Main.js:
1496         * UserInterface/Test/Test.js:
1497         Add WebInspector.assumingMainTarget to fill in all the places where
1498         we assume the main target right now, but would need to handle non-main
1499         targets as other agents are implemented in workers. For example profile
1500         data that assumes the main target right now could be worker targets
1501         when we implement ScriptProfiler / Heap agents.
1502
1503         * UserInterface/Protocol/Connection.js:
1504         (InspectorBackend.WorkerConnection):
1505         * UserInterface/Protocol/Target.js:
1506         (WebInspector.Target):
1507         (WebInspector.Target.prototype.get DebuggerAgent):
1508         (WebInspector.Target.prototype.get mainResource):
1509         (WebInspector.Target.prototype.set mainResource):
1510         (WebInspector.WorkerTarget.prototype.initialize):
1511         (WebInspector.WorkerTarget):
1512         Include DebuggerAgent in Targets.
1513         Include a mainResource for Worker Targets.
1514
1515         * UserInterface/Protocol/DebuggerObserver.js:
1516         (WebInspector.DebuggerObserver.prototype.scriptParsed):
1517         (WebInspector.DebuggerObserver.prototype.breakpointResolved):
1518         (WebInspector.DebuggerObserver.prototype.paused):
1519         (WebInspector.DebuggerObserver.prototype.resumed):
1520         Pass the target on to managers when necessary.
1521
1522         * UserInterface/Models/DebuggerData.js: Added.
1523         (WebInspector.DebuggerData):
1524         (WebInspector.DebuggerData.prototype.get target):
1525         (WebInspector.DebuggerData.prototype.get callFrames):
1526         (WebInspector.DebuggerData.prototype.get pauseReason):
1527         (WebInspector.DebuggerData.prototype.get pauseData):
1528         (WebInspector.DebuggerData.prototype.get scripts):
1529         (WebInspector.DebuggerData.prototype.scriptForIdentifier):
1530         (WebInspector.DebuggerData.prototype.scriptsForURL):
1531         (WebInspector.DebuggerData.prototype.reset):
1532         (WebInspector.DebuggerData.prototype.addScript):
1533         (WebInspector.DebuggerData.prototype.pause):
1534         (WebInspector.DebuggerData.prototype.unpause):
1535         Extract per-target data from DebuggerManager. This includes the list
1536         of scripts evaluated in a Target, and any pause data for this target
1537         such as the pause reason and call frames.
1538
1539         * UserInterface/Controllers/DebuggerManager.js:
1540         (WebInspector.DebuggerManager.prototype.dataForTarget):
1541         (WebInspector.DebuggerManager.prototype.get pauseReason): Deleted.
1542         (WebInspector.DebuggerManager.prototype.get pauseData): Deleted.
1543         (WebInspector.DebuggerManager.prototype.get callFrames): Deleted.
1544         (WebInspector.DebuggerManager.prototype.reset):
1545         New way to access per-target debugger data.
1546
1547         (WebInspector.DebuggerManager.prototype.initializeTarget):
1548         When a new Target is created, synchronize frontend state with the target.
1549         Things like the list of breakpoints and global breakpoint states.
1550
1551         (WebInspector.DebuggerManager.prototype.scriptForIdentifier):
1552         (WebInspector.DebuggerManager.prototype.scriptsForURL):
1553         Convenience accessors for scripts must now provide a Target.
1554
1555         (WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
1556         This is a convenience accessors for a list of all scripts across all targets
1557         so this handles getting the list across all targets.
1558
1559         (WebInspector.DebuggerManager.prototype.pause):
1560         (WebInspector.DebuggerManager.prototype.resume):
1561         (WebInspector.DebuggerManager.prototype.stepOver):
1562         (WebInspector.DebuggerManager.prototype.stepInto):
1563         (WebInspector.DebuggerManager.prototype.stepOut):
1564         (WebInspector.DebuggerManager.prototype.continueToLocation):
1565         Stepping commands affect the current target with the active call frame.
1566         Eventually we will change Pause and Resume behavior to affect all targets.
1567         
1568         (WebInspector.DebuggerManager.prototype.addBreakpoint):
1569         (WebInspector.DebuggerManager.prototype.breakpointResolved):
1570         (WebInspector.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
1571         (WebInspector.DebuggerManager.prototype._setBreakpoint):
1572         (WebInspector.DebuggerManager.prototype._removeBreakpoint):
1573         Breakpoints should be set on all targets, but we need a way
1574         to set them on a specific target, when initializing an
1575         individual target when we want to inform that single target
1576         of all of the breakpoints.
1577
1578         (WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
1579         (WebInspector.DebuggerManager.prototype._updateBreakOnExceptionsState):
1580         Changing global breakpoint state should inform all targets.
1581
1582         (WebInspector.DebuggerManager.prototype.scriptDidParse):
1583         Associate Scripts with a Target. Identify the main resource of a
1584         Worker Target and set it as soon as we can.
1585
1586         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
1587         (WebInspector.DebuggerManager.prototype.debuggerDidResume):
1588         (WebInspector.DebuggerManager.prototype._sourceCodeLocationFromPayload):
1589         (WebInspector.DebuggerManager.prototype._scopeChainFromPayload):
1590         (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload):
1591         (WebInspector.DebuggerManager.prototype._mainResourceDidChange):
1592         (WebInspector.DebuggerManager.prototype._didResumeInternal):
1593         Pausing and resuming now happens per-target, so associate
1594         created model objects (CallFrame, ScopeChain objects) and any
1595         other necessary data with the target.
1596
1597         * UserInterface/Models/Breakpoint.js:
1598         (WebInspector.Breakpoint):
1599         (WebInspector.Breakpoint.prototype.get target):
1600         (WebInspector.Breakpoint.prototype.get info):
1601         * UserInterface/Models/CallFrame.js:
1602         (WebInspector.CallFrame):
1603         (WebInspector.CallFrame.prototype.get target):
1604         (WebInspector.CallFrame.fromDebuggerPayload):
1605         (WebInspector.CallFrame.fromPayload):
1606         * UserInterface/Models/ConsoleMessage.js:
1607         (WebInspector.ConsoleMessage):
1608         * UserInterface/Models/Script.js:
1609         (WebInspector.Script):
1610         (WebInspector.Script.prototype.get target):
1611         (WebInspector.Script.prototype.isMainResource):
1612         (WebInspector.Script.prototype.requestContentFromBackend):
1613         (WebInspector.Script.prototype._resolveResource):
1614         * UserInterface/Models/StackTrace.js:
1615         (WebInspector.StackTrace.fromPayload):
1616         (WebInspector.StackTrace.fromString):
1617         * UserInterface/Models/ProbeManager.js:
1618         (WebInspector.ProbeManager.prototype.didSampleProbe):
1619         * UserInterface/Models/Probe.js:
1620         (WebInspector.ProbeSample):
1621         * UserInterface/Views/ConsoleMessageView.js:
1622         (WebInspector.ConsoleMessageView.prototype._appendLocationLink):
1623         (WebInspector.ConsoleMessageView.prototype._formatParameterAsString):
1624         Associate model objects with a specific target where necessary.
1625
1626         * UserInterface/Views/ObjectTreeBaseTreeElement.js:
1627         (WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
1628         * UserInterface/Controllers/RuntimeManager.js:
1629         (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
1630         * UserInterface/Protocol/RemoteObject.js:
1631         (WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
1632         Use target specific DebuggerAgent where necessary.
1633
1634         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
1635         * UserInterface/Controllers/TimelineManager.js:
1636         (WebInspector.TimelineManager.prototype._callFramesFromPayload):
1637         * UserInterface/Models/ScriptTimelineRecord.js:
1638         (WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload.profileNodeFromPayload):
1639         * UserInterface/Views/EventListenerSectionGroup.js:
1640         (WebInspector.EventListenerSectionGroup.prototype._functionTextOrLink):
1641         (WebInspector.EventListenerSectionGroup):
1642         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
1643         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.):
1644         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
1645         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populateWindowPreview):
1646         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
1647         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
1648         * UserInterface/Views/ProfileDataGridNode.js:
1649         (WebInspector.ProfileDataGridNode.prototype.iconClassName):
1650         (WebInspector.ProfileDataGridNode.prototype.filterableDataForColumn):
1651         (WebInspector.ProfileDataGridNode.prototype._displayContent):
1652         Use assumed main target and audit these when the Worker gets more Agents.
1653
1654         * UserInterface/Controllers/FrameResourceManager.js:
1655         (WebInspector.FrameResourceManager.prototype._initiatorSourceCodeLocationFromPayload):
1656         This will always be the main target because only the main target
1657         has access to the DOM.
1658
1659         * UserInterface/Views/SourceCodeTextEditor.js:
1660         (WebInspector.SourceCodeTextEditor.prototype.get target):
1661         (WebInspector.SourceCodeTextEditor.prototype.customPerformSearch):
1662         (WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
1663         (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
1664         (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
1665         (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
1666         (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction):
1667         Update target specific actions to use the proper target's agents.
1668
1669         * UserInterface/Views/TargetTreeElement.js: Added.
1670         (WebInspector.TargetTreeElement):
1671         (WebInspector.TargetTreeElement.prototype.get target):
1672         (WebInspector.TargetTreeElement.prototype.onexpand):
1673         (WebInspector.TargetTreeElement.prototype.oncollapse):
1674         Add a new tree element for a Target. We currently assume that the
1675         main resource for a Target will be a Script right now, as is the
1676         case for Web Workers. This simply remembers its expanded or
1677         collapsed state and has a better icon.
1678
1679         * UserInterface/Views/ResourceIcons.css:
1680         (body:matches(.mac-platform, .windows-platform) .script.worker-icon .icon):
1681         (body:matches(.mac-platform, .windows-platform) .large .script.worker-icon .icon):
1682         * UserInterface/Images/WorkerScript.png: Renamed from Source/WebInspectorUI/UserInterface/Images/WorkerDocument.png.
1683         * UserInterface/Images/WorkerScript@2x.png: Renamed from Source/WebInspectorUI/UserInterface/Images/WorkerDocument@2x.png.
1684         * UserInterface/Images/WorkerScriptLarge.png: Renamed from Source/WebInspectorUI/UserInterface/Images/WorkerDocumentLarge.png.
1685         * UserInterface/Images/WorkerScriptLarge@2x.png: Renamed from Source/WebInspectorUI/UserInterface/Images/WorkerDocumentLarge@2x.png.
1686         Improve icon for a Worker's main resource script.
1687
1688         * UserInterface/Views/ResourceSidebarPanel.js:
1689         (WebInspector.ResourceSidebarPanel):
1690         (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
1691         (WebInspector.ResourceSidebarPanel.prototype._scriptsCleared):
1692         (WebInspector.ResourceSidebarPanel.prototype._addScriptForNonMainTarget):
1693         (WebInspector.ResourceSidebarPanel.prototype._addTargetWithMainResource):
1694         (WebInspector.ResourceSidebarPanel.prototype._targetRemoved):
1695         * UserInterface/Views/SearchSidebarPanel.js:
1696         (WebInspector.SearchSidebarPanel.prototype.performSearch.searchScripts):
1697         (WebInspector.SearchSidebarPanel.prototype._searchTreeElementForScript):
1698         * UserInterface/Views/OpenResourceDialog.js:
1699         (WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline.createTreeElement):
1700         (WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline):
1701         (WebInspector.OpenResourceDialog.prototype.didDismissDialog):
1702         (WebInspector.OpenResourceDialog.prototype.didPresentDialog):
1703         (WebInspector.OpenResourceDialog.prototype._addResourcesForFrame):
1704         (WebInspector.OpenResourceDialog.prototype._addScriptsForTarget):
1705         (WebInspector.OpenResourceDialog.prototype._scriptAdded):
1706         (WebInspector.OpenResourceDialog):
1707         * UserInterface/Views/DebuggerSidebarPanel.js:
1708         (WebInspector.DebuggerSidebarPanel.prototype._addTreeElementForSourceCodeToTreeOutline):
1709         (WebInspector.DebuggerSidebarPanel.prototype._debuggerCallFramesDidChange):
1710         (WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange):
1711         (WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
1712         Include scripts from non-main targets in sidebars.
1713
1714 2016-11-01  Devin Rousso  <dcrousso+webkit@gmail.com>
1715
1716         Web Inspector: Creating a new pseudo-selector in the Styles sidebar doesn't work on first attempt
1717         https://bugs.webkit.org/show_bug.cgi?id=164092
1718
1719         Reviewed by Timothy Hatcher.
1720
1721         * UserInterface/Views/CSSStyleDeclarationSection.css:
1722         (.style-declaration-section:not(.invalid-selector).rule-disabled > .header > .icon):
1723         (.style-declaration-section.invalid-selector > .header > .icon):
1724         (.style-declaration-section.invalid-selector > .header > .selector,):
1725         (.style-declaration-section.rule-disabled > .header > .icon): Deleted.
1726
1727         * UserInterface/Views/CSSStyleDeclarationSection.js:
1728         (WebInspector.CSSStyleDeclarationSection):
1729         (WebInspector.CSSStyleDeclarationSection.prototype.refresh):
1730         (WebInspector.CSSStyleDeclarationSection.prototype._handleIconElementClicked):
1731         (WebInspector.CSSStyleDeclarationSection.prototype._updateSelectorIcon): Added.
1732         Re-add logic removed by https://webkit.org/b/159734 for handling invalid selectors.  Instead
1733         of just refreshing the section whenever the represented CSSRule changes selectors, we only
1734         need to refresh if the selector no longer applies to the current element.
1735
1736         (WebInspector.CSSStyleDeclarationSection.prototype._handleMouseMove): Added.
1737         Fix another issue discovered while adding the invalid selector warnings, where the title
1738         attribute of each individual selector was no longer visible.  To fix this, whenever the user
1739         moves their mouse over the selector input, the position is compared to each selector to find
1740         the first one that matches, whose title is then applied to the input element.
1741
1742 2016-11-01  Joseph Pecoraro  <pecoraro@apple.com>
1743
1744         Web Inspector: Improve debugger highlight in some exception cases
1745         https://bugs.webkit.org/show_bug.cgi?id=164300
1746
1747         Reviewed by Matt Baker.
1748
1749         * UserInterface/Views/SourceCodeTextEditor.js:
1750         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
1751         When walking up AST nodes and reach a throw statement, use that.
1752
1753 2016-11-01  Joseph Pecoraro  <pecoraro@apple.com>
1754
1755         Web Inspector: Cleanup stale code in NetworkSidebarPanel
1756         https://bugs.webkit.org/show_bug.cgi?id=164295
1757
1758         Reviewed by Matt Baker.
1759
1760         * UserInterface/Views/NetworkSidebarPanel.js:
1761         (WebInspector.NetworkSidebarPanel.prototype.closed): Deleted.
1762         This doesn't appear to be needed since NetworkSidebarPanel never
1763         registered any event listeners.
1764
1765 2016-11-01  Devin Rousso  <dcrousso+webkit@gmail.com>
1766
1767         REGRESSION (r191419): Web Inspector: Autocomplete is broken
1768         https://bugs.webkit.org/show_bug.cgi?id=150493
1769
1770         Reviewed by Timothy Hatcher.
1771
1772         Fixed CodeMirror.undo() logic rolled out by r191539 <https://webkit.org/b/150537>
1773
1774         Added calls to CodeMirror.changeGeneration(true) which tells the history stack to "close"
1775         the current event, preventing it from being consolidated with new changes.  If the user
1776         typed fast enough, non-completion changes (like adding ":" in CSS) would get merged with
1777         completion changes, causing calls to CodeMirror.undo() to undo those changes as well.  To
1778         prevent this, a boolean variable is set to true whenever a completion "activity" is in
1779         progress, defined by a sequence of completion related events.  When this "activity" first
1780         starts, call CodeMirror.changeGeneration(true) to freeze the current history.
1781
1782         See original bug for more information <https://webkit.org/b/147720>.
1783
1784         * UserInterface/Controllers/CodeMirrorCompletionController.js:
1785         (WebInspector.CodeMirrorCompletionController):
1786         (WebInspector.CodeMirrorCompletionController.prototype.updateCompletions):
1787         (WebInspector.CodeMirrorCompletionController.prototype.isCompletionChange):
1788         (WebInspector.CodeMirrorCompletionController.prototype.hideCompletions):
1789         (WebInspector.CodeMirrorCompletionController.prototype.close):
1790         (WebInspector.CodeMirrorCompletionController.prototype.completionSuggestionsSelectedCompletion):
1791         (WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint.update):
1792         (WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint):
1793         (WebInspector.CodeMirrorCompletionController.prototype._commitCompletionHint.update):
1794         (WebInspector.CodeMirrorCompletionController.prototype._commitCompletionHint):
1795         (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.update):
1796         (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint):
1797         (WebInspector.CodeMirrorCompletionController.prototype._completeAtCurrentPosition):
1798         (WebInspector.CodeMirrorCompletionController.prototype._handleBeforeChange):
1799         (WebInspector.CodeMirrorCompletionController.prototype._createCompletionHintMarker): Deleted.
1800         (WebInspector.CodeMirrorCompletionController.prototype._removeLastChangeFromHistory): Deleted.
1801         (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.clearMarker): Deleted.
1802
1803 2016-11-01  Devin Rousso  <dcrousso+webkit@gmail.com>
1804
1805         Web Inspector: Replace sublists inside DOM-related model objects with WI.Collection
1806         https://bugs.webkit.org/show_bug.cgi?id=164098
1807
1808         Reviewed by Timothy Hatcher.
1809
1810         * UserInterface/Models/DOMTree.js:
1811         * UserInterface/Models/Frame.js:
1812         Add support for WebInspector.Collection.
1813
1814         * UserInterface/Models/Script.js:
1815         (WebInspector.Script):
1816         * UserInterface/Views/DebuggerSidebarPanel.js:
1817         (WebInspector.DebuggerSidebarPanel.prototype._addResourcesRecursivelyForFrame):
1818         * UserInterface/Views/FrameTreeElement.js:
1819         (WebInspector.FrameTreeElement):
1820         (WebInspector.FrameTreeElement.prototype.onpopulate):
1821         * UserInterface/Views/OpenResourceDialog.js:
1822         (WebInspector.OpenResourceDialog.prototype._addResourcesForFrame):
1823         Use new functions defined by changing to WebInspector.Collection.
1824
1825 2016-11-01  Devin Rousso  <dcrousso+webkit@gmail.com>
1826
1827         Web Inspector: Fix double remove of ResourceCollection if type changes
1828         https://bugs.webkit.org/show_bug.cgi?id=164268
1829
1830         Reviewed by Joseph Pecoraro.
1831
1832         * UserInterface/Models/ResourceCollection.js:
1833         (WebInspector.ResourceCollection.prototype._resourceTypeDidChange):
1834         Change logic so that a non-typed collection will not try to remove a resource that has
1835         changed types from the sub-collection of its old type, since the sub-collection itself will
1836         handle the removal inside its own event listener for the type change.
1837
1838 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
1839
1840         Web Inspector: Add the support for custom elements
1841         https://bugs.webkit.org/show_bug.cgi?id=164266
1842         <rdar://problem/29038883>
1843
1844         Reviewed by Joseph Pecoraro.
1845
1846         Show the custom element state in DOM node's details pane:
1847          - "Element" for all builtin elements.
1848          - "Element (Custom)" for any upgraded custom elements.
1849          - "Element (Waiting to be upgraded)" for any element waiting to be upgraded.
1850          - "Element (Failed to upgrade)" for any custom element that failed during construction or an upgrade.
1851
1852         And add "Jump to Definition" to the context menu of an node to find the custom element's definition.
1853
1854         * Localizations/en.lproj/localizedStrings.js: Added localized strings.
1855         * UserInterface/Controllers/DOMTreeManager.js:
1856         (WebInspector.DOMTreeManager.prototype._customElementStateChanged): Added. Update the state and fire
1857         WebInspector.DOMTreeManager.Event.CustomElementStateChanged to update the node's details pane.
1858         * UserInterface/Models/DOMNode.js:
1859         (WebInspector.DOMNode): Set the custom element state or default to "builtin". Use null when the node
1860         is not an element.
1861         (WebInspector.DOMNode.prototype.isCustomElement): Added. Returns true if this is a successfully
1862         constructed or upgraded custom element.
1863         (WebInspector.DOMNode.prototype.customElementState): Added.
1864         (WebInspector.DOMNode.CustomElementState): Added.
1865         * UserInterface/Protocol/DOMObserver.js:
1866         (WebInspector.DOMObserver.prototype.customElementStateChanged): Added.
1867         * UserInterface/Protocol/RemoteObject.js:
1868         (WebInspector.RemoteObject.prototype.getProperty): Added. Retrieves the property of a given name from
1869         the remote backend.
1870         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
1871         (WebInspector.DOMNodeDetailsSidebarPanel): Call _customElementStateChanged when the custom element
1872         state changes by listening to WebInspector.DOMTreeManager.Event.CustomElementStateChanged.
1873         (WebInspector.DOMNodeDetailsSidebarPanel.prototype.layout):
1874         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshIdentity): Extracted from layout.
1875         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._customElementStateChanged): Added. 
1876         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._nodeTypeDisplayName): Include the custom element
1877         state when it's not a builtin element (_customElementState returns null in that case).
1878         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._customElementState): Get the localized string for
1879         each custom element state.
1880         * UserInterface/Views/DOMTreeElement.js:
1881         (WebInspector.DOMTreeElement.prototype._populateNodeContextMenu): Add "Jump to Definition" item in the
1882         context menu of an element when it's a successfully constructed or upgraded custom element.
1883
1884 2016-10-31  Joseph Pecoraro  <pecoraro@apple.com>
1885
1886         Web Inspector: Shadow DOM scoped styles are missing
1887         https://bugs.webkit.org/show_bug.cgi?id=164247
1888         <rdar://problem/29035061>
1889
1890         Reviewed by Antti Koivisto.
1891
1892         * UserInterface/Models/DOMNodeStyles.js:
1893         (WebInspector.DOMNodeStyles.prototype.refresh.fetchedInlineStyles):
1894         Fix incorrect WrapperPromise usage.
1895
1896 2016-10-31  Devin Rousso  <dcrousso+webkit@gmail.com>
1897
1898         Web Inspector: Arrows for Styles scope bar item are misaligned
1899         https://bugs.webkit.org/show_bug.cgi?id=164159
1900
1901         Reviewed by Timothy Hatcher.
1902
1903         * UserInterface/Views/ScopeRadioButtonNavigationItem.css:
1904         (.scope-radio-button-navigation-item > .scope-radio-button-item-select:focus):
1905         (.scope-radio-button-navigation-item > .arrows):
1906
1907 2016-10-31  Devin Rousso  <dcrousso+webkit@gmail.com>
1908
1909         Web Inspector: Entering ":n" in Open Resource Dialog, where n > number of lines, should jump to the last line
1910         https://bugs.webkit.org/show_bug.cgi?id=160840
1911
1912         Reviewed by Timothy Hatcher.
1913
1914         * UserInterface/Views/TextEditor.js:
1915         (WebInspector.TextEditor.prototype.revealPosition):
1916         Since it is possible for the given position to be outside the bounds of the CodeMirror
1917         instance, wait to get the line handler for the highlight animation until we have constrained
1918         the position value.
1919
1920 2016-10-28  Devin Rousso  <dcrousso+webkit@gmail.com>
1921
1922         Web Inspector: Preferences for Text Editor behavior
1923         https://bugs.webkit.org/show_bug.cgi?id=149120
1924
1925         Reviewed by Timothy Hatcher.
1926
1927         * Localizations/en.lproj/localizedStrings.js:
1928
1929         * UserInterface/Base/Main.js:
1930         (WebInspector.loaded):
1931         (WebInspector.contentLoaded):
1932         (WebInspector.contentLoaded.setTabSize):
1933         (WebInspector.contentLoaded.setInvalidCharacterClassName):
1934         (WebInspector.contentLoaded.setWhitespaceCharacterClassName):
1935         (WebInspector._tryToRestorePendingTabs):
1936         (WebInspector.indentString):
1937         (WebInspector._updateNewTabButtonState): Deleted.
1938         (WebInspector._newTabItemClicked): Deleted.
1939         Removed calls to the New Tab tab bar item on the Tab Bar instance.
1940         Added listener to the indentUnit setting to change the tab-size value on <body>.
1941         Created helper function to generate the indentString value from settings.
1942
1943         * UserInterface/Base/Test.js:
1944         (WebInspector.indentString):
1945         Assume indent string is "    " for tests.
1946
1947         * UserInterface/Base/Setting.js:
1948         Added global WebInspector.settings dictionary for holding settings with UI editors.
1949
1950         * UserInterface/Main.html:
1951         Added GeneralTabBarItem, PinnedTabBarItem, and SettingsTabContentView.
1952
1953         * UserInterface/Models/CSSStyleDeclaration.js:
1954         (WebInspector.CSSStyleDeclaration.prototype.generateCSSRuleString):
1955         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
1956         (WebInspector.CSSStyleDeclarationTextEditor.prototype._formattedContentFromEditor):
1957         (WebInspector.CSSStyleDeclarationTextEditor.prototype._resetContent.update):
1958         * UserInterface/Views/VisualStylePropertyEditor.js:
1959         (WebInspector.VisualStylePropertyEditor.generateFormattedTextForNewProperty):
1960         * UserInterface/Views/SourceCodeTextEditor.js:
1961         (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
1962         Now uses WebInspector.indentUnit for indentation values
1963
1964         * UserInterface/Views/CodeMirrorAdditions.js:
1965         Added "showWhitespaceCharacter" option to CodeMirror.  When enabled, it adds an overlay to
1966         the editor that will use pseudo-elements to display whitespace characters (unicode 00B7).
1967
1968         * UserInterface/Views/CodeMirrorOverrides.css:
1969         (.CodeMirror .cm-tab):
1970         (.show-whitespace-characters .CodeMirror .cm-tab::before):
1971         (.show-whitespace-characters .CodeMirror .cm-whitespace::before):
1972         (.show-whitespace-characters .CodeMirror .cm-whitespace-1::before):
1973         (.show-whitespace-characters .CodeMirror .cm-whitespace-2::before):
1974         (.show-whitespace-characters .CodeMirror .cm-whitespace-3::before):
1975         (.show-whitespace-characters .CodeMirror .cm-whitespace-4::before):
1976         (.show-whitespace-characters .CodeMirror .cm-whitespace-5::before):
1977         (.show-whitespace-characters .CodeMirror .cm-whitespace-6::before):
1978         (.show-whitespace-characters .CodeMirror .cm-whitespace-7::before):
1979         (.show-whitespace-characters .CodeMirror .cm-whitespace-8::before):
1980         (.show-whitespace-characters .CodeMirror .cm-whitespace-9::before):
1981         (.show-whitespace-characters .CodeMirror .cm-whitespace-10::before):
1982         (.show-whitespace-characters .CodeMirror .cm-whitespace-11::before):
1983         (.show-whitespace-characters .CodeMirror .cm-whitespace-12::before):
1984         (.show-whitespace-characters .CodeMirror .cm-whitespace-13::before):
1985         (.show-whitespace-characters .CodeMirror .cm-whitespace-14::before):
1986         (.show-whitespace-characters .CodeMirror .cm-whitespace-15::before):
1987         (.show-whitespace-characters .CodeMirror .cm-whitespace-16::before):
1988         (.show-invalid-characters .CodeMirror .cm-invalidchar):
1989         (.CodeMirror .cm-invalidchar): Deleted.
1990         Use unicode character 00B7 (middle dot) to display a space.  Also uses a grey border for
1991         visualizing tab characters.
1992
1993         * UserInterface/Views/ApplicationCacheFrameContentView.js:
1994         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
1995         * UserInterface/Views/ClusterContentView.js:
1996         * UserInterface/Views/DOMTreeContentView.js:
1997         * UserInterface/Views/DatabaseContentView.js:
1998         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
1999         * UserInterface/Views/NetworkGridContentView.js:
2000         * UserInterface/Views/ResourceContentView.js:
2001         * UserInterface/Views/ScriptContentView.js:
2002         * UserInterface/Views/TabContentView.js:
2003         * UserInterface/Views/TimelineRecordingContentView.js:
2004         Add calls to super.shown(), super.hidden(), and super.closed().
2005
2006         * UserInterface/Views/ConsoleTabContentView.js:
2007         * UserInterface/Views/DebuggerTabContentView.js:
2008         * UserInterface/Views/ElementsTabContentView.js:
2009         * UserInterface/Views/NetworkTabContentView.js:
2010         * UserInterface/Views/NewTabContentView.js:
2011         * UserInterface/Views/ResourcesTabContentView.js:
2012         * UserInterface/Views/SearchTabContentView.js:
2013         * UserInterface/Views/StorageTabContentView.js:
2014         * UserInterface/Views/TimelineTabContentView.js:
2015         Now uses WebInspector.GeneralTabBarItem.
2016
2017         * UserInterface/Views/GeneralTabBarItem.js: Added.
2018         (WebInspector.GeneralTabBarItem):
2019         (WebInspector.GeneralTabBarItem.prototype.set title):
2020         (WebInspector.GeneralTabBarItem.prototype._handleContextMenuEvent):
2021         Split from TabBarItem.js to make pinned tab bar items more distinct.
2022
2023         * UserInterface/Views/Main.css:
2024         (body):
2025         Removed tab-size.
2026
2027         * UserInterface/Views/PinnedTabBarItem.js: Added.
2028         (WebInspector.PinnedTabBarItem):
2029         Split from TabBarItem.js to make pinned tab bar items more distinct.
2030
2031         * UserInterface/Views/SettingsTabContentView.css: Added.
2032         (.content-view.settings):
2033         (.content-view.settings > .header):
2034         (.content-view.settings > .setting-container):
2035         (.content-view.settings > .setting-container > .setting-name):
2036         (.content-view.settings > .setting-container > .setting-value-controller):
2037         (.content-view.settings > .setting-container > .setting-value-controller input[type="number"]):
2038
2039         * UserInterface/Views/SettingsTabContentView.js:
2040         (WebInspector.SettingsTabContentView):
2041         (WebInspector.SettingsTabContentView.tabInfo):
2042         (WebInspector.SettingsTabContentView.isEphemeral):
2043         (WebInspector.SettingsTabContentView.shouldSaveTab):
2044         (WebInspector.SettingsTabContentView.prototype.initialLayout):
2045         (WebInspector.SettingsTabContentView.isTabAllowed): Deleted.
2046         (WebInspector.SettingsTabContentView.prototype.get type): Deleted.
2047         Added logic to display an appropriate editor for each item in WebInspector.settings.
2048
2049         * UserInterface/Views/SourceCodeTextEditor.js:
2050         (WebInspector.SourceCodeTextEditor.prototype.close):
2051         Add call to super.close().
2052
2053         * UserInterface/Views/TabBar.css:
2054         (.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover):
2055         (.tab-bar > .item:not(.pinned) > .flex-space:last-child):
2056         (.tab-bar > .item.pinned > .icon):
2057         (.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover > .icon):
2058         (.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover,): Deleted.
2059         (.tab-bar > .item > .flex-space:last-child): Deleted.
2060         (.tab-bar > .item.new-tab-button > .icon): Deleted.
2061         (.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover > .icon,): Deleted.
2062         Removed rules specifically targeting `.new-tab-button`.
2063
2064         * UserInterface/Views/TabBar.js:
2065         (WebInspector.TabBar):
2066         (WebInspector.TabBar.prototype.get newTabTabBarItem):
2067         (WebInspector.TabBar.prototype.updateNewTabTabBarItemState):
2068         (WebInspector.TabBar.prototype.insertTabBarItem):
2069         (WebInspector.TabBar.prototype.removeTabBarItem.animateTabs):
2070         (WebInspector.TabBar.prototype.removeTabBarItem):
2071         (WebInspector.TabBar.prototype.selectPreviousTab):
2072         (WebInspector.TabBar.prototype.selectNextTab):
2073         (WebInspector.TabBar.prototype.set selectedTabBarItem):
2074         (WebInspector.TabBar.prototype.hasNormalTab):
2075         (WebInspector.TabBar.prototype.layout):
2076         (WebInspector.TabBar.prototype._hasMoreThanOneNormalTab):
2077         (WebInspector.TabBar.prototype._handleMouseDown):
2078         (WebInspector.TabBar.prototype._handleMouseMoved):
2079         (WebInspector.TabBar.prototype._handleMouseLeave):
2080         (WebInspector.TabBar.prototype._handleNewTabClick):
2081         (WebInspector.TabBar.prototype._handleNewTabMouseEnter):
2082         (WebInspector.TabBar.prototype.get newTabItem): Deleted.
2083         (WebInspector.TabBar.prototype.set newTabItem): Deleted.
2084         Replaced the newTabItem setter by adding a saved pinned tab bar item (instead of relying
2085         upon a different object to give it the pinned tab bar item) that changes modes depending on
2086         whether a new tab is able to be created.
2087
2088         * UserInterface/Views/TabBarItem.js:
2089         (WebInspector.TabBarItem):
2090         (WebInspector.TabBarItem.prototype.get element):
2091         (WebInspector.TabBarItem.prototype.get representedObject):
2092         (WebInspector.TabBarItem.prototype.set representedObject):
2093         (WebInspector.TabBarItem.prototype.get parentTabBar):
2094         (WebInspector.TabBarItem.prototype.set parentTabBar):
2095         (WebInspector.TabBarItem.prototype.get image):
2096         (WebInspector.TabBarItem.prototype.set image):
2097         (WebInspector.TabBarItem.prototype.get title):
2098         (WebInspector.TabBarItem.prototype.set title):
2099         (WebInspector.TabBarItem.prototype.get pinned): Deleted.
2100         (WebInspector.TabBarItem.prototype._handleContextMenuEvent): Deleted.
2101         Split into GeneralTabBarItem and PinnedTabBarItem to simplify the logic of the DOM and allow
2102         for easier checking of whether a tab bar item is pinned or not.
2103
2104         * UserInterface/Views/TabBrowser.js:
2105         (WebInspector.TabBrowser):
2106         (WebInspector.TabBrowser.prototype.addTabForContentView):
2107         (WebInspector.TabBrowser.prototype.closeTabForContentView):
2108         (WebInspector.TabBrowser.prototype._tabBarItemSelected):
2109         (WebInspector.TabBrowser.prototype._tabBarItemRemoved):
2110         Replaced references to newTabItem with a set number (since each TabBar has a specific number
2111         of pinned tabs).
2112
2113         * UserInterface/Views/TextEditor.js:
2114         (WebInspector.TextEditor):
2115         (WebInspector.TextEditor.prototype.close):.
2116         Remove settings update event listeners to allow garbage collection.
2117
2118         (WebInspector.TextEditor.prototype._startWorkerPrettyPrint):
2119         (WebInspector.TextEditor.prototype._startCodeMirrorPrettyPrint):
2120         Now uses the settings values in WebInspector.setting for settings on the CodeMirror
2121         instance.  Also updates the CodeMirror instance if any setting changes.
2122
2123 2016-10-28  Joseph Pecoraro  <pecoraro@apple.com>
2124
2125         Web Inspector: Include parameter strings for native CustomElementRegistry methods in the console
2126         https://bugs.webkit.org/show_bug.cgi?id=164147
2127
2128         Reviewed by Brian Burg.
2129
2130         * UserInterface/Models/NativeFunctionParameters.js:
2131
2132 2016-10-28  Matt Baker  <mattbaker@apple.com>
2133
2134         Unreviewed, worker document images added
2135
2136         * UserInterface/Images/WorkerDocument.png: Added.
2137         * UserInterface/Images/WorkerDocument@2x.png: Added.
2138         * UserInterface/Images/WorkerDocumentLarge.png: Added.
2139         * UserInterface/Images/WorkerDocumentLarge@2x.png: Added.
2140
2141 2016-10-27  Devin Rousso  <dcrousso+webkit@gmail.com>
2142
2143         Web Inspector: Create general model object Collection class
2144         https://bugs.webkit.org/show_bug.cgi?id=163995
2145
2146         Reviewed by Joseph Pecoraro.
2147
2148         * UserInterface/Models/Collection.js: Added.
2149         (WebInspector.Collection):
2150         (WebInspector.Collection.prototype.get items):
2151         (WebInspector.Collection.prototype.get typeVerifier):
2152         (WebInspector.Collection.prototype.add):
2153         (WebInspector.Collection.prototype.remove):
2154         (WebInspector.Collection.prototype.clear):
2155         (WebInspector.Collection.prototype.toArray):
2156         (WebInspector.Collection.prototype.toJSON):
2157         (WebInspector.Collection.prototype.itemAdded):
2158         (WebInspector.Collection.prototype.itemRemoved):
2159         (WebInspector.Collection.prototype.itemsCleared):
2160         Class that holds multiple model objects.  It can be limited to a specific type by supplying
2161         a "typeVerifier", which is a function that accepts a single argument (the model object) and
2162         returns true/false depending on if that argument matches the "type" of the collection.
2163
2164         * UserInterface/Main.html:
2165         * UserInterface/Test.html:
2166         * UserInterface/Models/Frame.js:
2167         * UserInterface/Views/CookieStorageContentView.js:
2168         * UserInterface/Views/DebuggerSidebarPanel.js:
2169         * UserInterface/Views/FrameTreeElement.js:
2170         * UserInterface/Views/OpenResourceDialog.js:
2171         Add support for WebInspector.Collection.
2172         
2173         * UserInterface/Models/ResourceCollection.js:
2174         (WebInspector.ResourceCollection):
2175         (WebInspector.ResourceCollection.verifierForType):
2176         (WebInspector.ResourceCollection.prototype.resourceCollectionForType):
2177         (WebInspector.ResourceCollection.prototype.clear):
2178         (WebInspector.ResourceCollection.prototype.itemAdded):
2179         (WebInspector.ResourceCollection.prototype.itemRemoved):
2180         (WebInspector.ResourceCollection.prototype.itemsCleared):
2181         (WebInspector.ResourceCollection.prototype._associateWithResource):
2182         (WebInspector.ResourceCollection.prototype._disassociateWithResource):
2183         (WebInspector.ResourceCollection.prototype._resourceURLDidChange):
2184         (WebInspector.ResourceCollection.prototype._resourceTypeDidChange):
2185         (WebInspector.ResourceCollection.prototype.get resources): Deleted.
2186         (WebInspector.ResourceCollection.prototype.resourcesWithType): Deleted.
2187         (WebInspector.ResourceCollection.prototype.addResource): Deleted.
2188         (WebInspector.ResourceCollection.prototype.removeResource): Deleted.
2189         (WebInspector.ResourceCollection.prototype.removeAllResources): Deleted.
2190         Now a subclass of WebInspector.Collection.  Retrieving WebInspector.Resource objects by type
2191         and URL is still supported, but requesting by type now returns another instance of
2192         WebInspector.ResourceCollection that is configured to only accept the requested type.
2193
2194 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
2195
2196         Web Inspector: Include ConsoleAgent in Workers - real console.log support
2197         https://bugs.webkit.org/show_bug.cgi?id=163844
2198         <rdar://problem/28903328>
2199
2200         Reviewed by Brian Burg.
2201
2202         * UserInterface/Protocol/Target.js:
2203         (WebInspector.Target.prototype.get ConsoleAgent):
2204         (WebInspector.Target.prototype._initializeNonMainTarget):
2205         * UserInterface/Protocol/Connection.js:
2206         (InspectorBackend.WorkerConnection):
2207         Add ConsoleAgent.
2208
2209         * UserInterface/Controllers/LogManager.js:
2210         (WebInspector.LogManager.prototype.messageWasAdded):
2211         (WebInspector.LogManager.prototype.requestClearMessages):
2212         Handle ConsoleAgent calls with multiple targets.
2213
2214         * UserInterface/Protocol/ConsoleObserver.js:
2215         (WebInspector.ConsoleObserver.prototype.messageAdded):
2216         Dispatch with the target in case we create Model objects.
2217
2218         * UserInterface/Controllers/WorkerManager.js:
2219         (WebInspector.WorkerManager.prototype.workerCreated):
2220         The frontend must now call "initialized" on Workers after
2221         sending our setup messages (enable, set breakpoints, etc).
2222
2223         * UserInterface/Protocol/RemoteObject.js:
2224         (WebInspector.RemoteObject.prototype.get target):
2225         Expose an accessor for tests.
2226
2227         * UserInterface/Protocol/LoggingProtocolTracer.js:
2228         (WebInspector.LoggingProtocolTracer.prototype._processEntry):
2229         Actually output the Exception, useful when debugging failures in tests.
2230
2231 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
2232
2233         Web Inspector: Include RuntimeAgent in Workers - evaluate in Worker context
2234         https://bugs.webkit.org/show_bug.cgi?id=163835
2235         <rdar://problem/28901465>
2236
2237         Reviewed by Brian Burg.
2238
2239         This introduces the idea that the frontend may communication with multiple
2240         backend "Targets" which each have their own set of Agents.
2241
2242             - WebInspector.Target
2243               - has its own list of Agents
2244               - has a InspectorBackend.Connection to communicate with the backend
2245
2246             - WebInspector.mainTarget
2247               - always exists and represents the thing we are debugging (Page or JSContext)
2248
2249             - WebInspector.targets / WebInspector.targetManager
2250               - management of all Targets
2251               - create new Targets for Workers
2252
2253         This also slowly introduces the concept that Model objects may be tied to
2254         a specific Target:
2255
2256             - WebInspector.RemoteObject
2257               - in order to evaluate JS and interact with this object we must know the target (Page or Worker)
2258               - when fetching PropertyDescriptors and other RemoteObjects we must continue to pass on the target
2259
2260         Finally this makes the QuickConsole list Worker execution contexts in
2261         the context picker so that users can choose a Worker context and
2262         evaluate JavaScript in that context using the console.
2263
2264         * Localizations/en.lproj/localizedStrings.js:
2265         * UserInterface/Main.html:
2266         * UserInterface/Base/Main.js:
2267         (WebInspector.loaded):
2268         * UserInterface/Test.html:
2269         * UserInterface/Test/Test.js:
2270         (WebInspector.loaded):
2271         New files, strings, and managers.
2272         New global WebInspector.mainTarget.
2273         New convenience WebInspector.targets.
2274
2275         * UserInterface/Protocol/Target.js: Added.
2276         (WebInspector.Target):
2277         (WebInspector.Target.prototype.get RuntimeAgent):
2278         (WebInspector.Target.prototype.get name):
2279         (WebInspector.Target.prototype.get type):
2280         (WebInspector.Target.prototype.get connection):
2281         (WebInspector.Target.prototype.get executionContext):
2282         (WebInspector.Target.prototype.get displayName):
2283         (WebInspector.Target.prototype._intializeMainTarget):
2284         (WebInspector.Target.prototype._initializeNonMainTarget):
2285         Target has some basic properties.
2286
2287         * UserInterface/Controllers/TargetManager.js:
2288         (WebInspector.TargetManager):
2289         (WebInspector.TargetManager.prototype.get targets):
2290         (WebInspector.TargetManager.prototype.addTarget):
2291         (WebInspector.TargetManager.prototype.removeTarget):
2292         Holds the list of Targets and events when created / removed.
2293         Each target with a RuntimeAgent has an ExecutionContext.
2294
2295         * UserInterface/Controllers/WorkerManager.js:
2296         (WebInspector.WorkerManager):
2297         (WebInspector.WorkerManager.prototype.workerCreated):
2298         (WebInspector.WorkerManager.prototype.workerTerminated):
2299         (WebInspector.WorkerManager.prototype.dispatchMessageFromWorker):
2300         Create / remove / dispatch on a Worker Target.
2301
2302         * UserInterface/Protocol/InspectorBackend.js:
2303         (InspectorBackendClass):
2304         (InspectorBackendClass.prototype.registerCommand):
2305         (InspectorBackendClass.prototype.dispatch):
2306         (InspectorBackendClass.prototype.runAfterPendingDispatches):
2307         (InspectorBackendClass.prototype._agentForDomain):
2308         Keep the original implementations and just dispatch to the main connection.
2309
2310         (InspectorBackend.Agent):
2311         (InspectorBackend.Agent.prototype.get connection):
2312         (InspectorBackend.Agent.prototype.set connection):
2313         (InspectorBackend.Agent.prototype.get dispatcher):
2314         We will share Agent implementations but just give new "copies" a different
2315         connection and dispatcher.
2316
2317         (InspectorBackend.Command):
2318         (InspectorBackend.Command.create):
2319         (InspectorBackend.Command.prototype.invoke):
2320         (InspectorBackend.Command.prototype.supports):
2321         We continue to have a single Command instance on the Agent. However instead
2322         of using the hardcoded Agent on the Instance when evaluated as a function
2323         it uses the `this` object which should be an agent. This way:
2324
2325             target1.RuntimeAgent.evaluate
2326                 - `this` is target1 and we use the connection for that target
2327             target2.RuntimeAgent.evaluate
2328                 - `this` is target2 and we use the connection for that target
2329
2330         Unfortunately this breaks `RuntimeAgent.evaluate.invoke`. Currently this
2331         is solved by providing an extra parameter. In the case where we need to
2332         invoke on a particular agent we must provide the agent.
2333
2334             target.RuntimeAgent.evaluate.invoke({options}, target.RuntimeAgent)
2335
2336         This is unfortunate but only needed in a handful of places right now.
2337
2338         (InspectorBackendClass.prototype._sendCommandToBackendWithCallback): Deleted.
2339         (InspectorBackendClass.prototype._sendCommandToBackendExpectingPromise): Deleted.
2340         (InspectorBackendClass.prototype._sendMessageToBackend): Deleted.
2341         (InspectorBackendClass.prototype._dispatchResponse): Deleted.
2342         (InspectorBackendClass.prototype._dispatchResponseToCallback): Deleted.
2343         (InspectorBackendClass.prototype._dispatchResponseToPromise): Deleted.
2344         (InspectorBackendClass.prototype._dispatchEvent): Deleted.
2345         (InspectorBackendClass.prototype._flushPendingScripts): Deleted.
2346         (InspectorBackend.Agent.prototype.get currentDispatchState): Deleted.
2347         (InspectorBackend.Command.prototype.deliverFailure): Deleted.
2348         * UserInterface/Protocol/Connection.js: Added.
2349         (InspectorBackend.Connection):
2350         (InspectorBackend.Connection.prototype.get target):
2351         (InspectorBackend.Connection.prototype.set target):
2352         (InspectorBackend.Connection.prototype.dispatch):
2353         (InspectorBackend.Connection.prototype.runAfterPendingDispatches):
2354         (InspectorBackend.Connection.prototype.sendMessageToBackend):
2355         (InspectorBackend.Connection.prototype._dispatchResponse):
2356         (InspectorBackend.Connection.prototype._dispatchResponseToCallback):
2357         (InspectorBackend.Connection.prototype._dispatchResponseToPromise):
2358         (InspectorBackend.Connection.prototype._dispatchEvent):
2359         (InspectorBackend.Connection.prototype._sendCommandToBackendWithCallback):
2360         (InspectorBackend.Connection.prototype._sendCommandToBackendExpectingPromise):
2361         (InspectorBackend.Connection.prototype._sendMessageToBackend):
2362         (InspectorBackend.Connection.prototype._flushPendingScripts):
2363         This extracts the Connection details into its own class.
2364         Although we make it appear as though a Target has a list of
2365         Agents, we actually have the Connection hold the list of Agents.
2366         Instead of cloning the entire Agent we just create a new object
2367         extended from the original Agent instance. This allows us to keep
2368         the same interface but just change the connection / dispatcher
2369         properties within the Agent.
2370
2371         (InspectorBackend.MainConnection):
2372         (InspectorBackend.MainConnection.prototype.sendMessageToBackend):
2373         (InspectorBackend.WorkerConnection):
2374         (InspectorBackend.WorkerConnection.sendMessageToBackend):
2375         Two different kinds of connections. One for the Main connection
2376         and one for Workers. Currently the list of agents we expose
2377         on a Worker Target/Connection is hardcoded.
2378
2379         * UserInterface/Models/ExecutionContext.js:
2380         (WebInspector.ExecutionContext):
2381         (WebInspector.ExecutionContext.prototype.get target):
2382         We may now have ExecutionContexts that mean a Page, Frames, and Workers.
2383         To do this we include the (target, executionContextId) tuple in this object.
2384         With this we have everything we need to evaluate JavaScript.
2385
2386         * UserInterface/Controllers/RuntimeManager.js:
2387         (WebInspector.RuntimeManager):
2388         (WebInspector.RuntimeManager.prototype.get activeExecutionContext):
2389         (WebInspector.RuntimeManager.prototype.set activeExecutionContext):
2390         (WebInspector.RuntimeManager.prototype.get defaultExecutionContextIdentifier): Deleted.
2391         (WebInspector.RuntimeManager.prototype.set defaultExecutionContextIdentifier): Deleted.
2392         Update from contextId to a full ExecutionContext object.
2393
2394         (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow.evalCallback):
2395         (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
2396         (WebInspector.RuntimeManager.prototype.saveResult):
2397         (WebInspector.RuntimeManager.prototype.getPropertiesForRemoteObject):
2398         (WebInspector.RuntimeManager.prototype._frameExecutionContextsCleared):
2399         * UserInterface/Controllers/FrameResourceManager.js:
2400         (WebInspector.FrameResourceManager.prototype.executionContextCreated):
2401         * UserInterface/Controllers/JavaScriptLogViewController.js:
2402         (WebInspector.JavaScriptLogViewController.prototype.consolePromptShouldCommitText):
2403         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2404         Anywhere that wants to use the "activeExecutionContext" must use the
2405         specific RuntimeAgent tied to that ExecutionContext's Target.
2406
2407         * UserInterface/Models/PropertyDescriptor.js:
2408         (WebInspector.PropertyDescriptor.fromPayload):
2409         * UserInterface/Protocol/RemoteObject.js:
2410         (WebInspector.RemoteObject):
2411         (WebInspector.RemoteObject.createFakeRemoteObject):
2412         (WebInspector.RemoteObject.fromPrimitiveValue):
2413         (WebInspector.RemoteObject.fromPayload):
2414         (WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors):
2415         (WebInspector.RemoteObject.prototype.deprecatedGetDisplayableProperties):
2416         (WebInspector.RemoteObject.prototype.setPropertyValue):
2417         (WebInspector.RemoteObject.prototype.getCollectionEntries):
2418         (WebInspector.RemoteObject.prototype.releaseWeakCollectionEntries):
2419         (WebInspector.RemoteObject.prototype.callFunction):
2420         (WebInspector.RemoteObject.prototype.callFunctionJSON):
2421         (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptor.wrappedCallback):
2422         (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptor):
2423         (WebInspector.RemoteObject.prototype.release):
2424         (WebInspector.RemoteObject.prototype._getPropertyDescriptors):
2425         (WebInspector.RemoteObject.prototype._getPropertyDescriptorsResolver):
2426         (WebInspector.RemoteObject.prototype._deprecatedGetProperties):
2427         RemoteObject and related Model Objects now must be tied to a specific
2428         Target, because we need to know which Target it belongs to in order to
2429         interact with it further.
2430
2431         * UserInterface/Views/QuickConsole.js:
2432         (WebInspector.QuickConsole):
2433         (WebInspector.QuickConsole.prototype.get selectedExecutionContext):
2434         (WebInspector.QuickConsole.prototype.set selectedExecutionContext):
2435         (WebInspector.QuickConsole.prototype._executionContextPathComponentsToDisplay):
2436         (WebInspector.QuickConsole.prototype._rebuildExecutionContextPathComponents):
2437         (WebInspector.QuickConsole.prototype._framePageExecutionContextsChanged):
2438         (WebInspector.QuickConsole.prototype._frameExecutionContextsCleared):
2439         (WebInspector.QuickConsole.prototype._createExecutionContextPathComponent):
2440         (WebInspector.QuickConsole.prototype._createExecutionContextPathComponentFromFrame):
2441         (WebInspector.QuickConsole.prototype._compareExecutionContextPathComponents):
2442         (WebInspector.QuickConsole.prototype._insertOtherExecutionContextPathComponent):
2443         (WebInspector.QuickConsole.prototype._removeOtherExecutionContextPathComponent):
2444         (WebInspector.QuickConsole.prototype._insertExecutionContextPathComponentForFrame):
2445         (WebInspector.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
2446         (WebInspector.QuickConsole.prototype._targetAdded):
2447         (WebInspector.QuickConsole.prototype._targetRemoved):
2448         (WebInspector.QuickConsole.prototype._pathComponentSelected):
2449         (WebInspector.QuickConsole.prototype.get selectedExecutionContextIdentifier): Deleted.
2450         (WebInspector.QuickConsole.prototype.set selectedExecutionContextIdentifier): Deleted.
2451         (WebInspector.QuickConsole.prototype._defaultExecutionContextChanged): Deleted.
2452         Update the code from executionContextId to ExecutionContext objects.
2453         Update the picker with ExecutionContextPathComponent for Workers (new Targets).
2454         Generalize and cleanup the code to make it easier to follow.
2455
2456 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
2457
2458         Web Inspector: Introduce Page WorkerAgent and Worker InspectorController
2459         https://bugs.webkit.org/show_bug.cgi?id=163817
2460         <rdar://problem/28899063>
2461
2462         Reviewed by Brian Burg.
2463
2464         * UserInterface/Main.html:
2465         * UserInterface/Test.html:
2466         New files.
2467
2468         * UserInterface/Base/Main.js:
2469         (WebInspector.loaded):
2470         * UserInterface/Test/Test.js:
2471         (WebInspector.loaded):
2472         New Observers and Managers.
2473
2474         * UserInterface/Protocol/WorkerObserver.js: Added.
2475         (WebInspector.WorkerObserver.prototype.workerCreated):
2476         (WebInspector.WorkerObserver.prototype.workerTerminated):
2477         (WebInspector.WorkerObserver.prototype.dispatchMessageFromWorker):
2478         (WebInspector.WorkerObserver):
2479         * UserInterface/Controllers/WorkerManager.js: Added.
2480         (WebInspector.WorkerManager):
2481         (WebInspector.WorkerManager.prototype.workerCreated):
2482         (WebInspector.WorkerManager.prototype.workerTerminated):
2483         (WebInspector.WorkerManager.prototype.dispatchMessageFromWorker):
2484         To be implemented with the first Worker agent implementation
2485         when there is actually something we can do with the Worker.
2486
2487 2016-10-25  Joseph Pecoraro  <pecoraro@apple.com>
2488
2489         Web Inspector: Cmd-+ doesn't "zoom in" to increase text size in the Web Inspector
2490         https://bugs.webkit.org/show_bug.cgi?id=163961
2491         <rdar://problem/28895308>
2492
2493         Reviewed by Brian Burg.
2494
2495         * UserInterface/Base/Main.js:
2496         (WebInspector.contentLoaded):
2497         Add a duplicate set of keyboard shortcuts for the Shift variants.
2498
2499 2016-10-25  Joseph Pecoraro  <pecoraro@apple.com>
2500
2501         Web Inspector: Remove dead code in FrameTreeElement
2502         https://bugs.webkit.org/show_bug.cgi?id=163914
2503
2504         Reviewed by Brian Burg.
2505
2506         * UserInterface/Views/FrameTreeElement.js:
2507
2508 2016-10-24  Devin Rousso  <dcrousso+webkit@gmail.com>
2509
2510         Web Inspector: Scope chain shouldn't show empty Closure sections
2511         https://bugs.webkit.org/show_bug.cgi?id=152348
2512
2513         Reviewed by Joseph Pecoraro.
2514
2515         * UserInterface/Controllers/DebuggerManager.js:
2516         (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload):
2517         * UserInterface/Models/ScopeChainNode.js:
2518         (WebInspector.ScopeChainNode):
2519         (WebInspector.ScopeChainNode.prototype.get empty):
2520         Added support for new empty property.
2521
2522         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
2523         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
2524         Only create and display a DetailsSection if the scope is not empty (via empty).
2525
2526 2016-10-24  Devin Rousso  <dcrousso+webkit@gmail.com>
2527
2528         Web Inspector: Improve Quick Open sorting algorithm
2529         https://bugs.webkit.org/show_bug.cgi?id=163705
2530
2531         Reviewed by Joseph Pecoraro.
2532
2533         * UserInterface/Models/ResourceQueryResult.js:
2534         (WebInspector.ResourceQueryResult.prototype._calculateRank.getMultiplier):
2535         (WebInspector.ResourceQueryResult.prototype._calculateRank):
2536         Added logic to multiply the ranking increment/decrement based on whether the current match
2537         is part of a sequence, whether that sequence began with a special character, and the length
2538         of the current sequence.
2539
2540 2016-10-19  Dean Jackson  <dino@apple.com>
2541
2542         Support CSS Shapes Level 1 without a prefix
2543         https://bugs.webkit.org/show_bug.cgi?id=163709
2544         <rdar://problem/28859369>
2545
2546         Reviewed by Myles Maxfield.
2547
2548         Replace -webkit-shape-outside with shape-outside.
2549
2550         * UserInterface/Models/CSSKeywordCompletions.js:
2551
2552 2016-10-19  Aaron Chu  <aaron_chu@apple.com>
2553
2554         Web Inspector: AXI: expose computed tree node and heading level
2555         https://bugs.webkit.org/show_bug.cgi?id=130825
2556         <rdar://problem/16442349>
2557
2558         Reviewed by Joseph Pecoraro.
2559
2560         Updating the Web Accessibility Inspector to display Heading Level and Hierarchical Level.
2561
2562         * Localizations/en.lproj/localizedStrings.js:
2563         * UserInterface/Models/DOMNode.js:
2564         (WebInspector.DOMNode.prototype.accessibilityProperties.accessibilityPropertiesCallback):
2565         (WebInspector.DOMNode.prototype.accessibilityProperties):
2566         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
2567         (WebInspector.DOMNodeDetailsSidebarPanel):
2568         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
2569         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):
2570
2571 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
2572
2573         Web Inspector: Styles Sidebar highlights "translate" but not "translateX"
2574         https://bugs.webkit.org/show_bug.cgi?id=163613
2575         <rdar://problem/28829610>
2576
2577         Reviewed by Timothy Hatcher.
2578
2579         * UserInterface/Models/CSSCompletions.js:
2580         (WebInspector.CSSCompletions.requestCSSCompletions):
2581         The hash table objects we pass to CodeMirror expects keys to be lowercased.
2582
2583 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
2584
2585         Web Inspector: CSS Autocompletion sometimes adds extra unexpected characters
2586         https://bugs.webkit.org/show_bug.cgi?id=163612
2587         <rdar://problem/28829557>
2588
2589         Reviewed by Timothy Hatcher.
2590
2591         * UserInterface/Controllers/CodeMirrorCompletionController.js:
2592         (WebInspector.CodeMirrorCompletionController.prototype._generateCSSCompletions):
2593         Better handle completions in cases where we are in the middle of a property
2594         to avoid orphaned characters, or at the end of a function name to avoid creating
2595         duplicate parenthesis.
2596
2597 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
2598
2599         REGRESSION(r201171): Web Inspector: Timeline Recording playhead should always start immediately, not wait until first event
2600         https://bugs.webkit.org/show_bug.cgi?id=163583
2601         <rdar://problem/28815882>
2602
2603         Reviewed by Timothy Hatcher.
2604
2605         * UserInterface/Views/TimelineRecordingContentView.js:
2606         (WebInspector.TimelineRecordingContentView.prototype._startUpdatingCurrentTime):
2607         Revert logic change introduced by r201171 with no explanation.
2608         Whenever we get a start time we should use it, regardless of
2609         of what the current time is, precisely because the backend is
2610         informing us of the start time to use.
2611
2612 2016-10-17  Joseph Pecoraro  <pecoraro@apple.com>
2613
2614         Web Inspector: Add toggles for debugger pauses at console.assert failures
2615         https://bugs.webkit.org/show_bug.cgi?id=139542
2616         <rdar://problem/19281600>
2617
2618         Reviewed by Timothy Hatcher.
2619
2620         * UserInterface/Controllers/DebuggerManager.js:
2621         (WebInspector.DebuggerManager.prototype.get assertionsBreakpoint):
2622         (WebInspector.DebuggerManager.prototype.isBreakpointRemovable):
2623         (WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
2624         New breakpoint and toggling behavior.
2625
2626         * Localizations/en.lproj/localizedStrings.js:
2627         * UserInterface/Views/DebuggerSidebarPanel.js:
2628         (WebInspector.DebuggerSidebarPanel):
2629         (WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
2630         (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements.isSpecialBreakpoint):
2631         (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):
2632         New breakpoint tree element behavior.
2633
2634         (WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
2635         (WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
2636         Sidebar restoration if it was selected.
2637
2638         * UserInterface/Images/Assertion.svg: Added.
2639         * UserInterface/Images/gtk/Assertion.svg: Added.
2640         * UserInterface/Views/BreakpointTreeElement.css:
2641         (.breakpoint-assertion-icon .icon):
2642         New sidebar icon for the global breakpoint.
2643
2644 2016-10-15  Joseph Pecoraro  <pecoraro@apple.com>
2645
2646         Web Inspector: Cleanup parts of DebuggerManager
2647         https://bugs.webkit.org/show_bug.cgi?id=163400
2648
2649         Reviewed by Timothy Hatcher.
2650
2651         * UserInterface/Controllers/DebuggerManager.js:
2652         (WebInspector.DebuggerManager.restoreBreakpointsSoon):
2653
2654         (WebInspector.DebuggerManager.prototype.get paused):
2655         (WebInspector.DebuggerManager.prototype.get pauseReason):
2656         (WebInspector.DebuggerManager.prototype.get pauseData):
2657         (WebInspector.DebuggerManager.prototype.get callFrames):
2658         (WebInspector.DebuggerManager.prototype.get activeCallFrame):
2659         (WebInspector.DebuggerManager.prototype.set activeCallFrame):
2660         Put simple accessors at the top.
2661
2662         (WebInspector.DebuggerManager.prototype.get allExceptionsBreakpoint):
2663         (WebInspector.DebuggerManager.prototype.get allUncaughtExceptionsBreakpoint):
2664         (WebInspector.DebuggerManager.prototype.get breakpoints):
2665         (WebInspector.DebuggerManager.prototype.breakpointForIdentifier):
2666         (WebInspector.DebuggerManager.prototype.breakpointsForSourceCode):
2667         (WebInspector.DebuggerManager.prototype.isBreakpointRemovable):
2668         (WebInspector.DebuggerManager.prototype.isBreakpointEditable):
2669         (WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily):
2670         Group public breakpoint state and access methods.
2671
2672         (WebInspector.DebuggerManager.prototype.scriptForIdentifier):
2673         (WebInspector.DebuggerManager.prototype.scriptsForURL):
2674         (WebInspector.DebuggerManager.prototype.get searchableScripts):
2675         (WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
2676         Group public script access methods.
2677
2678         (WebInspector.DebuggerManager.prototype.pause):
2679         (WebInspector.DebuggerManager.prototype.resume):
2680         (WebInspector.DebuggerManager.prototype.stepOver):
2681         (WebInspector.DebuggerManager.prototype.stepInto):
2682         (WebInspector.DebuggerManager.prototype.stepOut):
2683         (WebInspector.DebuggerManager.prototype.continueToLocation):
2684         (WebInspector.DebuggerManager.prototype.addBreakpoint):
2685         (WebInspector.DebuggerManager.prototype.removeBreakpoint):
2686         Group and modernize public methods that perform actions.
2687
2688         (WebInspector.DebuggerManager.prototype.nextBreakpointActionIdentifier):
2689         Misc. methods.
2690
2691         (WebInspector.DebuggerManager.prototype.breakpointResolved):
2692         (WebInspector.DebuggerManager.prototype.reset):
2693         (WebInspector.DebuggerManager.prototype.playBreakpointActionSound):
2694         (WebInspector.DebuggerManager.prototype.scriptDidParse):
2695         (WebInspector.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
2696         (WebInspector.DebuggerManager.prototype._setBreakpoint):
2697         (WebInspector.DebuggerManager.prototype._breakpointEditablePropertyDidChange):
2698         (WebInspector.DebuggerManager.prototype._updateBreakOnExceptionsState):
2699         (WebInspector.DebuggerManager.prototype._associateBreakpointsWithSourceCode):
2700         Minor cleanup in protected and private methods.
2701
2702         * UserInterface/Models/BreakpointAction.js:
2703         (WebInspector.BreakpointAction):
2704         Getting the next identifier is an action so it should be a function call.
2705
2706         * UserInterface/Views/SourceCodeTextEditor.js:
2707         (WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointAdded):
2708         Remove unused parameter.
2709
2710 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
2711
2712         Web Inspector: Dragging to delete a Breakpoint should never trigger a ContentView change
2713         https://bugs.webkit.org/show_bug.cgi?id=163403
2714         <rdar://problem/28762930>
2715
2716         Reviewed by Timothy Hatcher.
2717
2718         * UserInterface/Views/BreakpointTreeElement.js:
2719         (WebInspector.BreakpointTreeElement.prototype.ondelete):
2720         Signal when a breakpoint tree element will be going away because it was
2721         deleted via the keyboard operation within the TreeOutline. This is a dirty
2722         way to do the signal but we remove BreakpointTreeElements asynchronously
2723         when the Breakpoint actually gets removed from the backend.
2724
2725         * UserInterface/Views/DebuggerSidebarPanel.js:
2726         (WebInspector.DebuggerSidebarPanel.prototype._removeDebuggerTreeElement):
2727         Deselect a BreakpointTreeElement if it was deleted in a way other then
2728         the delete keyboard shortcut. This ensures another TreeElement selection
2729         doesn't force ContentView changes.
2730
2731 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
2732
2733         Web Inspector: Improve debugger highlight when inside of getter/setter calls
2734         https://bugs.webkit.org/show_bug.cgi?id=163428
2735         <rdar://problem/28769061>
2736
2737         Reviewed by Timothy Hatcher.
2738
2739         * UserInterface/Views/SourceCodeTextEditor.js:
2740         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
2741         When in the middle of a member expression at a '.' or '[' get the best member
2742         expression range.
2743
2744         * UserInterface/Views/TextEditor.js:
2745         (WebInspector.TextEditor.prototype._updateExecutionRangeHighlight):
2746         Include the character at the current position. This is useful since AST Nodes
2747         don't give us token info but we would like to know if we are at particular tokens.
2748
2749 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
2750
2751         Web Inspector: Unused Breakpoint getter/setter for "id" - should be "identifier"
2752         https://bugs.webkit.org/show_bug.cgi?id=163395
2753
2754         Reviewed by Timothy Hatcher.
2755
2756         * UserInterface/Models/Breakpoint.js:
2757         (WebInspector.Breakpoint.prototype.get identifier): Renamed.
2758         (WebInspector.Breakpoint.prototype.set identifier): Renamed.
2759         The only user is DebuggerManager which sets and gets. Previously
2760         it was unexpectedly setting a direct property on the Breakpoint
2761         instead of using these methods to set the member variable.
2762
2763 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
2764
2765         Web Inspector: Remove uses of delete in SourceCodeTextEditor
2766         https://bugs.webkit.org/show_bug.cgi?id=163379
2767
2768         Reviewed by Timothy Hatcher.
2769
2770         Remove uses of delete and better group member variables.
2771         One of the deletes was deleting an incorrect property.
2772
2773         * UserInterface/Views/SourceCodeTextEditor.js:
2774         (WebInspector.SourceCodeTextEditor):
2775         (WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointAdded):
2776         (WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointRemoved):
2777         (WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointMoved):
2778         (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedMarkedExpression):
2779         (WebInspector.SourceCodeTextEditor.prototype._dismissEditingController):
2780         (WebInspector.SourceCodeTextEditor.prototype.editingControllerDidFinishEditing):
2781
2782 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
2783
2784         Uncaught Exception: TypeError: this.positionToOffset is not a function - seen hovering expressions with Type Profiler enabled
2785         https://bugs.webkit.org/show_bug.cgi?id=163405
2786         <rdar://problem/28763953>
2787
2788         Reviewed by Matt Baker.
2789
2790         * UserInterface/Views/SourceCodeTextEditor.js:
2791         Use correct method name, the old one must have gone away.
2792
2793 2016-10-12  Joseph Pecoraro  <pecoraro@apple.com>
2794
2795         Web Inspector: Improve support for logging Proxy objects in console
2796         https://bugs.webkit.org/show_bug.cgi?id=163323
2797         <rdar://problem/28432553>
2798
2799         Reviewed by Timothy Hatcher.
2800
2801         * UserInterface/Views/ConsoleMessageView.js:
2802         (WebInspector.ConsoleMessageView.prototype._formatParameter):
2803         Treat a Proxy like any other object.
2804
2805 2016-10-12  Joseph Pecoraro  <pecoraro@apple.com>
2806
2807         Emit DebugHooks uniformly with pause locations instead of having separate pause locations and op_debug emits
2808         https://bugs.webkit.org/show_bug.cgi?id=162809
2809
2810         Reviewed by Geoffrey Garen.
2811
2812         * UserInterface/Views/SourceCodeTextEditor.js:
2813         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
2814         When pausing on the variable assignment inside for..of and for..in don't just
2815         highlight "var foo" but include the right hand side "var foo in ..." or
2816         "var foo of ...".
2817
2818 2016-10-12  Joseph Pecoraro  <pecoraro@apple.com>
2819
2820         Web Inspector: Whole program sometimes highlighted instead of just first statement
2821         https://bugs.webkit.org/show_bug.cgi?id=163300
2822         <rdar://problem/28723162>
2823
2824         Reviewed by Timothy Hatcher.
2825
2826         * UserInterface/Views/SourceCodeTextEditor.js:
2827         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
2828         Avoid highlighting the entire program by skipping a Program type Node.
2829
2830         * UserInterface/Views/TextEditor.js:
2831         (WebInspector.TextEditor.prototype.setExecutionLineAndColumn):
2832         Avoid unnecessary work before content has loaded.
2833
2834         (WebInspector.TextEditor.prototype.currentPositionToOriginalOffset):
2835         Avoid unnecessary indirection to get the CodeMirror editor.
2836
2837 2016-10-11  Joseph Pecoraro  <pecoraro@apple.com>
2838
2839         Web Inspector: Remove line highlight on primary execution line while stepping because it is distracting
2840         https://bugs.webkit.org/show_bug.cgi?id=163294
2841         <rdar://problem/28721176>
2842
2843         Reviewed by Timothy Hatcher.
2844
2845         * UserInterface/Views/TextEditor.js:
2846         (WebInspector.TextEditor.prototype._updateExecutionLine):
2847         When setting the primary execution line, remove default line highlights.
2848
2849 2016-10-10  Matt Baker  <mattbaker@apple.com>
2850
2851         Web Inspector: Revealed line not highlighted in TextEditor while debugger paused
2852         https://bugs.webkit.org/show_bug.cgi?id=163197
2853
2854         Reviewed by Timothy Hatcher.
2855
2856         * UserInterface/Views/TextEditor.js:
2857         (WebInspector.TextEditor.prototype.revealPosition.revealAndHighlightLine):
2858         Avoid highlighting the execution line while debugging, but allow
2859         other lines to be highlighted.
2860
2861 2016-10-06  Devin Rousso  <dcrousso+webkit@gmail.com>
2862
2863         Inspector exception in `parseTextForRule()` when pasting into CSS rule selector
2864         https://bugs.webkit.org/show_bug.cgi?id=162792
2865
2866         Reviewed by Matt Baker.
2867
2868         * UserInterface/Views/CSSStyleDeclarationSection.js:
2869         (WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste.parseTextForRule):
2870         Changed regular expression for matching CSS rules to allow newlines in pasted text.
2871
2872 2016-10-02  Devin Rousso  <dcrousso+webkit@gmail.com>
2873
2874         Web Inspector: Clicking twice on the color swatch square should hide the color picker
2875         https://bugs.webkit.org/show_bug.cgi?id=162759
2876
2877         Reviewed by Matt Baker.
2878
2879         * UserInterface/Views/InlineSwatch.js:
2880         (WebInspector.InlineSwatch):
2881         (WebInspector.InlineSwatch.prototype.didDismissPopover):
2882         (WebInspector.InlineSwatch.prototype._swatchElementClicked):
2883         Remove the "click" event listener when a popover is presented to prevent improper
2884         interaction.  Add the event listener back when the popover is dismissed.
2885
2886 2016-10-02  Matt Baker  <mattbaker@apple.com>
2887
2888         Web Inspector: Exception thrown when hovering network waterfall graphs during reload
2889         https://bugs.webkit.org/show_bug.cgi?id=162850
2890         <rdar://problem/28579653>
2891
2892         Reviewed by Brian Burg.
2893
2894         * UserInterface/Views/ResourceTimelineDataGridNode.js:
2895         (WebInspector.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar):
2896         Check that the node's data grid reference is valid before use.
2897         (WebInspector.ResourceTimelineDataGridNode):
2898
2899 2016-10-01  Joseph Pecoraro  <pecoraro@apple.com>
2900
2901         Web Inspector: Selection does not show up over execution highlight ranges
2902         https://bugs.webkit.org/show_bug.cgi?id=162844
2903         <rdar://problem/28579121>
2904
2905         Reviewed by Matt Baker.
2906
2907         * Scripts/update-codemirror-resources.rb:
2908         * UserInterface/External/CodeMirror/mark-selection.js: Added.
2909         * UserInterface/Main.html:
2910         New add-on that makes selection a text marker so it can be styled
2911         at the same level as other text markers.
2912
2913         * UserInterface/Views/TextEditor.css:
2914         (.text-editor > .CodeMirror .execution-range-highlight:not(.CodeMirror-selectedtext)):
2915         Don't use execution-range-highlight styles if the text is selected.
2916
2917         * UserInterface/Views/TextEditor.js:
2918         (WebInspector.TextEditor):
2919         Enable the text selection as text markers addon.
2920
2921 2016-09-30  Joseph Pecoraro  <pecoraro@apple.com>
2922
2923         Web Inspector: Make debugger stepping highlights work in inline <script>s
2924         https://bugs.webkit.org/show_bug.cgi?id=162753
2925         <rdar://problem/28551332>
2926
2927         Reviewed by Brian Burg.
2928
2929         * UserInterface/Models/TextRange.js:
2930         (WebInspector.TextRange.prototype.contains):
2931         Check if a given line/column falls within this range.
2932
2933         * UserInterface/Views/SourceCodeTextEditor.js:
2934         (WebInspector.SourceCodeTextEditor.prototype._getAssociatedScript):
2935         If we are in a Document resource find the associated script at a given position.
2936
2937         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
2938         When comparing offsets to SyntaxTree offsets, the SyntaxTree's offset of 0 is the
2939         first character of the Script, which differs from the current SourceCode's offset.
2940         Adjust the offset by the Script's startOffset.
2941
2942         * UserInterface/Views/TextEditor.js:
2943         (WebInspector.TextEditor.prototype.currentPositionToOriginalPosition):
2944         (WebInspector.TextEditor.prototype._updateExecutionRangeHighlight):
2945         Pass both the original offset and original position to the delegate.
2946
2947 2016-09-30  Joseph Pecoraro  <pecoraro@apple.com>
2948
2949         Web Inspector: Stepping through `a(); b(); c();` it is unclear where we are and what is about to execute
2950         https://bugs.webkit.org/show_bug.cgi?id=161658
2951         <rdar://problem/28181254>
2952
2953         Reviewed by Geoffrey Garen.
2954
2955         * UserInterface/Models/Script.js:
2956         (WebInspector.Script.prototype.requestScriptSyntaxTree):
2957         Fix first calls to requestScriptSyntaxTree. They were getting an uncaught
2958         exception because the content argument was missing.
2959
2960         * UserInterface/Models/ScriptSyntaxTree.js:
2961         (WebInspector.ScriptSyntaxTree.prototype.containersOfOffset):
2962         Find all AST nodes that contain a particular offset.
2963
2964         * UserInterface/Views/SourceCodeTextEditor.js:
2965         (WebInspector.SourceCodeTextEditor):
2966         (WebInspector.SourceCodeTextEditor.prototype.close):
2967         (WebInspector.SourceCodeTextEditor.prototype._activeCallFrameDidChange):
2968         (WebInspector.SourceCodeTextEditor.prototype._activeCallFrameSourceCodeLocationChanged):
2969         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
2970         Provide a good highlight range for a given offset. This is normally the start
2971         of a statement/expression, inside a statement/expression, or the closing brace
2972         of a function (leaving a function). Provide good ranges for each of these.
2973
2974         * UserInterface/Views/TextEditor.js:
2975         (WebInspector.TextEditor):
2976         (WebInspector.TextEditor.set string.update):
2977         (WebInspector.TextEditor.prototype.set string):
2978         (WebInspector.TextEditor.prototype.setExecutionLineAndColumn):
2979         (WebInspector.TextEditor.prototype.revealPosition.revealAndHighlightLine):
2980         (WebInspector.TextEditor.prototype.revealPosition):
2981         (WebInspector.TextEditor.prototype.currentPositionToOriginalOffset):
2982         (WebInspector.TextEditor.prototype._updateAfterFormatting):
2983         (WebInspector.TextEditor.prototype.set executionLineNumber): Deleted.
2984         (WebInspector.TextEditor.prototype.set executionColumnNumber): Deleted.
2985         (WebInspector.TextEditor.prototype._updateExecutionLine.update): Deleted.
2986         Always set the execution line and column together, to simplify how we update highlights.
2987
2988         (WebInspector.TextEditor.prototype._clearMultilineExecutionLineHighlights):
2989         (WebInspector.TextEditor.prototype._updateExecutionLine):
2990         When updating the main highlight clear any multi-line highlights.
2991
2992         (WebInspector.TextEditor.prototype._updateExecutionRangeHighlight):
2993         Ask the delegate for a specific highlight range. If provided use that range,
2994         otherwise just highlight the end of the line. Once we know the range, if it
2995         is multiple lines, give the extra lines the full line highlight as well.
2996         Also make adjustments, such as not highlighting trailing whitespace.
2997
2998         * UserInterface/Views/TextEditor.css:
2999         (.text-editor > .CodeMirror .execution-line.primary .CodeMirror-linenumber::after):
3000         (.text-editor > .CodeMirror .execution-line):
3001         (.text-editor > .CodeMirror .execution-line .CodeMirror-matchingbracket):
3002         (.text-editor > .CodeMirror .execution-range-highlight):
3003         Styles for execution lines and execution range highlights.
3004
3005 2016-09-29  Aaron Chu  <aaron_chu@apple.com>
3006
3007         Web Inspector: AXI: linkified refs to #document and #text are not usually navigable nodes; consider delinkifying them
3008         https://bugs.webkit.org/show_bug.cgi?id=130600
3009         <rdar://problem/16391333>
3010
3011         Reviewed by Brian Burg.
3012
3013         Removing link style for non-navigable nodes by first
3014         checking nodeType of the node.
3015
3016         * UserInterface/Base/DOMUtilities.js:
3017         (WebInspector.linkifyNodeReference):
3018
3019 2016-09-27  Matt Baker  <mattbaker@apple.com>
3020
3021         Web Inspector: Refreshing while in Timelines-tab causes negative timestamps in Network-tab
3022         https://bugs.webkit.org/show_bug.cgi?id=160051
3023         <rdar://problem/27480122>
3024
3025         Reviewed by Brian Burg.
3026
3027         * UserInterface/Views/NetworkGridContentView.js:
3028         (WebInspector.NetworkGridContentView.prototype.get startTime):
3029         (WebInspector.NetworkGridContentView.prototype.get zeroTime):
3030         Use the cached start time for graph data source properties instead of
3031         relying on the ruler, which requires a layout in order to be updated
3032         for the first time.
3033
3034 2016-09-27  Matt Baker  <mattbaker@apple.com>
3035
3036         Web Inspector: Unfocusing / Focusing inspector window should not change ContentView
3037         https://bugs.webkit.org/show_bug.cgi?id=162572
3038         <rdar://problem/28479562>
3039
3040         Reviewed by Brian Burg.
3041
3042         Improve NavigationSidebarPanel logic for coordinating selection between trees.
3043         When tree selection changes, the most recent selection should be restored
3044         the next time the tree is focused.
3045
3046         The sidebar should also handle focusing a tree for the first time, in
3047         which no previous selection exists, and focusing a tree that has had its
3048         previous selection filtered out (hidden).
3049
3050         * UserInterface/Views/NavigationSidebarPanel.js:
3051         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineDidFocus):
3052         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
3053         Restoring the last deselected element, instead of the last selected element
3054         only works when the selection is moving from one tree to another. When
3055         the elements belong to the same tree the newly selected element won't
3056         be saved until the next selection change. If the window loses and regains
3057         the focus before then, the tree will restore the previous selection,
3058         effectively reverting the last selection change.
3059
3060 2016-09-27  Tomas Popela  <tpopela@redhat.com>
3061
3062         [GTK] Mac defaults are used for key shortcuts on Linux
3063         https://bugs.webkit.org/show_bug.cgi?id=162564
3064
3065         Don't set Mac's default keymap as a fallthrough for CodeMirror when we
3066         are not on Mac.
3067
3068         Reviewed by Carlos Garcia Campos.
3069
3070         * UserInterface/Test.html: Include Platform.js for the
3071         WebInspector.Platform definition.
3072         * UserInterface/Views/CodeMirrorAdditions.js:
3073
3074 2016-09-26  Matt Baker  <mattbaker@apple.com>
3075
3076         Web Inspector: Box Model values not updated when DOM node styles change
3077         https://bugs.webkit.org/show_bug.cgi?id=162525
3078
3079         Reviewed by Brian Burg.
3080
3081         The Box Model section should refresh itself when the selected node's
3082         computed style changes. This is necessary since the Styles sidebar
3083         doesn't always refresh its sections on node changes.
3084
3085         * UserInterface/Views/BoxModelDetailsSectionRow.js:
3086         (WebInspector.BoxModelDetailsSectionRow.prototype.set nodeStyles):
3087         Refresh metrics whenever the computed style changes.
3088
3089         (WebInspector.BoxModelDetailsSectionRow.prototype._getBox):
3090         (WebInspector.BoxModelDetailsSectionRow.prototype._getComponentSuffix):
3091         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createValueElement):
3092         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement):
3093         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement):
3094         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics):
3095         Drive-by cleanup to make this large function easier to read.
3096         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createElement): Deleted.
3097         Renamed createValueElement.
3098         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaWidthElement): Deleted.
3099         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaHeightElement): Deleted.
3100         Combined these into a single function taking a property name (width or height).
3101
3102 == Rolled over to ChangeLog-2016-09-26 ==