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