6d3308628fdf4b88d6ed2c0f4b1a09fb26eeca55
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2016-11-15  Joseph Pecoraro  <pecoraro@apple.com>
2
3         Web Inspector: URL Breakpoints that resolve in multiple workers should only appear in the UI once
4         https://bugs.webkit.org/show_bug.cgi?id=164334
5         <rdar://problem/29073523>
6
7         Reviewed by Matt Baker.
8
9         * UserInterface/Views/DebuggerSidebarPanel.js:
10         (WebInspector.DebuggerSidebarPanel.prototype._addBreakpoint):
11         Don't add a duplicate BreakpointTreeElements for the same Breakpoint.
12
13 2016-11-14  Joseph Pecoraro  <pecoraro@apple.com>
14
15         Web Inspector: Worker debugging should pause all targets and view call frames in all targets
16         https://bugs.webkit.org/show_bug.cgi?id=164305
17         <rdar://problem/29056192>
18
19         Reviewed by Timothy Hatcher.
20
21         This implements a policy where, when one Target ("Thread") pauses
22         the frontend triggers a pause in all other Targets. The intended
23         user experience is "all threads pause" whenever the frontend shows
24         the debugger paused UI.
25
26         DebuggerManager has a few straight forward changes:
27
28             - The paused state reflects if any target is paused.
29             - The Paused Event is fired when going from !paused -> paused.
30               This means when the first target pauses.
31             - The Resumed Event is fired when going from paused -> !paused.
32               This means only after all targets have resumed.
33             - The CallFrameDidChange Event now includes the Target that updated.
34
35         When a Target first pauses the frontend then immediately pauses all
36         other Targets. This puts them into a "pausing" state (we display as
37         Idle) and they will pause as soon as they start executing JavaScript.
38
39         When a Target steps the "paused" state isn't changing. So this is
40         just a CallFramesDidChange update.
41
42         When clicking Resume we resume all targets. This is will be the normal,
43         expected way users resume execution. Note that one of the threads may
44         then hit a breakpoint and re-pause all threads.
45
46         Sometimes when multiple threads are paused you may want to run an
47         individual thread to completion but keep other threads paused. There
48         is a context menu on the ThreadTreeElement to resume just that
49         single thread. It will continue and pause for its next run loop.
50
51         * Localizations/en.lproj/localizedStrings.js:
52         * UserInterface/Images/Thread.svg: Added.
53         * UserInterface/Images/gtk/Thread.svg: Added.
54         * UserInterface/Main.html:
55         New strings and files.
56
57         * UserInterface/Base/Main.js:
58         (WebInspector.loaded):
59         * UserInterface/Test/Test.js:
60         (WebInspector.loaded):
61         Place the TargetManager first since other managers may want to listen
62         for TargetAdded / TargetRemoved events.
63
64         * UserInterface/Controllers/DebuggerManager.js:
65         (WebInspector.DebuggerManager.prototype.get paused):
66         This is now a computed state.
67
68         (WebInspector.DebuggerManager.prototype.pause):
69         (WebInspector.DebuggerManager.prototype.resume):
70         Affect all targets.
71
72         (WebInspector.DebuggerManager.prototype.stepOver):
73         (WebInspector.DebuggerManager.prototype.stepInto):
74         (WebInspector.DebuggerManager.prototype.stepOut):
75         (WebInspector.DebuggerManager.prototype.reset):
76         Update to use the paused computed property.
77
78         (WebInspector.DebuggerManager.prototype.continueUntilNextRunLoop):
79         Issue the new Debugger.continueUntilNextRunLoop command
80         on a given target.
81
82         (WebInspector.DebuggerManager.prototype.initializeTarget):
83         When a new Target is created and we were already paused,
84         then start that Worker in a paused state.
85
86         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
87         Recover from bad cases where the backend informs the frontend about
88         internal JavaScript that it shouldn't know about. Legacy backend do
89         this but also there are corner cases we need to handle.
90         Dispatch events appropriately now that multiple targets may be paused.
91
92         (WebInspector.DebuggerManager.prototype._didResumeInternal):
93         Dispatch events appropriately now that multiple targets may be paused.
94
95         (WebInspector.DebuggerManager.prototype._targetRemoved):
96         Remove debugger data for targets that go away to avoid leaks.
97
98         * UserInterface/Models/DebuggerData.js:
99         (WebInspector.DebuggerData):
100         (WebInspector.DebuggerData.prototype.get paused):
101         (WebInspector.DebuggerData.prototype.get pausing):
102         Move some more per-Target state into DebuggerData.
103
104         (WebInspector.DebuggerData.prototype.pauseIfNeeded):
105         (WebInspector.DebuggerData.prototype.resumeIfNeeded):
106         (WebInspector.DebuggerData.prototype.continueUntilNextRunLoop):
107         These should only be called by DebuggerManager. They correctly
108         update the state of the DebuggerData for this Target, and also
109         issue the underlying command to the target.
110
111         (WebInspector.DebuggerData.prototype.updateForPause):
112         (WebInspector.DebuggerData.prototype.updateForResume):
113         Handle a special case where continueUntilNextRunLoop triggers
114         an invisible "pause" on the backend that we should mirror.
115
116         * UserInterface/Protocol/Target.js:
117         (WebInspector.MainTarget):
118         (WebInspector.MainTarget.prototype.get displayName):
119         (WebInspector.MainTarget.prototype.initialize):
120         Better display names.
121
122         * UserInterface/Views/DebuggerSidebarPanel.js:
123         (WebInspector.DebuggerSidebarPanel):
124         (WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause):
125         (WebInspector.DebuggerSidebarPanel.prototype._debuggerDidResume):
126         (WebInspector.DebuggerSidebarPanel.prototype._updateSingleThreadCallStacks):
127         (WebInspector.DebuggerSidebarPanel.prototype._selectActiveCallFrameTreeElement):
128         (WebInspector.DebuggerSidebarPanel.prototype._showSingleThreadCallStacks):
129         (WebInspector.DebuggerSidebarPanel.prototype._showMultipleThreadCallStacks):
130         (WebInspector.DebuggerSidebarPanel.prototype._findThreadTreeElementForTarget):
131         (WebInspector.DebuggerSidebarPanel.prototype._targetAdded):
132         (WebInspector.DebuggerSidebarPanel.prototype._targetRemoved):
133         (WebInspector.DebuggerSidebarPanel.prototype._debuggerCallFramesDidChange):
134         (WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange):
135         The DebuggerSidebar still has a single "Call Stacks" section, but maintains
136         two TreeOutlines and only shows one at a time. The Single Thread view shows
137         a flat list of the call frames for the Main Target when it is the only target.
138         The Multiple Threads view shows a list of Threads and their call frames.
139         We always keep both up to date, because we may need to swap between them
140         purely as Targets are added / removed. There is a bit of extra logic to
141         ensure we select elements properly based only on the visible tree outline.
142
143         * UserInterface/Views/LogContentView.js:
144         (WebInspector.LogContentView.prototype.didAppendConsoleMessageView):
145         When evaluating in a particular target, "runAfterPendingDispatches"
146         must wait for all other commands in that particular target to have
147         completed. So use the target specific version.
148
149         * UserInterface/Views/NavigationSidebarPanel.js:
150         (WebInspector.NavigationSidebarPanel.prototype._isTreeElementWithoutRepresentedObject):
151         Gracefully handle a few more TreeElements without a represented object.
152
153         * UserInterface/Views/IdleTreeElement.css: Added.
154         (.details-section.call-stack .idle .icon):
155         * UserInterface/Views/IdleTreeElement.js: Added.
156         (WebInspector.IdleTreeElement):
157         Very basic tree element to encapsulate an Idle call frame with an
158         empty represented object.
159
160         * UserInterface/Views/ThreadTreeElement.css: Added.
161         (.details-section.call-stack .thread .icon):
162         * UserInterface/Views/ThreadTreeElement.js: Added.
163         (WebInspector.ThreadTreeElement):
164         (WebInspector.ThreadTreeElement.prototype.get target):
165         (WebInspector.ThreadTreeElement.prototype.refresh):
166         (WebInspector.ThreadTreeElement.prototype.onattach):
167         (WebInspector.ThreadTreeElement.prototype.oncontextmenu):
168         ThreadTreeElement has no represented object, but makes it easy
169         to refresh a list of CallFrameTreeElements for a given target.
170
171 2016-11-14  Timothy Hatcher  <timothy@apple.com>
172
173         Web Inspector: Disable Warning Filter in Debugger Tab By Default
174         https://bugs.webkit.org/show_bug.cgi?id=164723
175         rdar://problem/29251780
176
177         Reviewed by Joseph Pecoraro.
178
179         * UserInterface/Views/DebuggerSidebarPanel.js:
180         (WebInspector.DebuggerSidebarPanel): Made "debugger-show-resources-with-issues-only" false by default.
181
182 2016-11-14  Nikita Vasilyev  <nvasilyev@apple.com>
183
184         Web Inspector: Settings tab should look more like a native macOS view
185         https://bugs.webkit.org/show_bug.cgi?id=164708
186         <rdar://problem/29241296>
187
188         Reviewed by Timothy Hatcher.
189
190         * UserInterface/Views/SettingsTabContentView.css:
191         (.content-view.settings):
192         (.content-view.settings > .header):
193         (.content-view.settings > .setting-container):
194         Match macOS Sierra default font size for settings view.
195
196         (.content-view.settings > .setting-container > .setting-name):
197         (.content-view.settings > .setting-container > .setting-value-controller):
198         (.content-view.settings > .setting-container > .setting-value-controller input):
199         (.content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]):
200         Make checkbox larger.
201
202         (.content-view.settings > .setting-container > .setting-value-controller select):
203         (.content-view.settings > .setting-container > .setting-value-controller input[type="number"]):
204         Decrease the width of the number fields to make them just wide enough to fit 2 digit numbers.
205
206 2016-11-12  Joseph Pecoraro  <pecoraro@apple.com>
207
208         Web Inspector: Type Profiler and Code Coverage Profiler should work in Workers
209         https://bugs.webkit.org/show_bug.cgi?id=164682
210
211         Reviewed by Darin Adler.
212
213         * UserInterface/Controllers/BasicBlockAnnotator.js:
214         * UserInterface/Models/ScriptSyntaxTree.js:
215         (WebInspector.ScriptSyntaxTree.prototype.updateTypes):
216         Use the target associated with the Script.
217
218         * UserInterface/Protocol/Target.js:
219         (WebInspector.WorkerTarget.prototype.initialize):
220         When initializing a Worker Target, match the existing state
221         of the Page for these profilers.
222
223         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
224         * UserInterface/Views/SourceCodeTextEditor.js:
225         (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptTypeInformation):
226         (WebInspector.SourceCodeTextEditor.prototype.willDismissPopover):
227         Use the correct target for this Script / Resource.
228
229         (WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
230         (WebInspector.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
231         Enable / disable for all targets when toggling profilers.
232
233 2016-11-11  Anthony Ricaud  <rik@webkit.org>
234
235         Web Inspector: Whitespace in Editor should be less visible than regular content
236         https://bugs.webkit.org/show_bug.cgi?id=164660
237
238         Reviewed by Matt Baker.
239
240         * UserInterface/Views/CodeMirrorOverrides.css:
241         (.show-whitespace-characters .CodeMirror .cm-whitespace::before):
242
243 2016-11-11  Nikita Vasilyev  <nvasilyev@apple.com>
244
245         Web Inspector: Call RuntimeAgent.disableControlFlowProfiler when Code Coverage Profiler is turned off
246         https://bugs.webkit.org/show_bug.cgi?id=163407
247         <rdar://problem/28764230>
248
249         Reviewed by Timothy Hatcher.
250
251         Turning Type Profiler off by clicking [T] icon now disables its backend by calling RuntimeAgent.disableTypeProfiler().
252
253         * UserInterface/Views/SourceCodeTextEditor.js:
254         (WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
255
256 2016-11-11  Nikita Vasilyev  <nvasilyev@apple.com>
257
258         Web Inspector: Settings tab: make the header smaller to fit more content
259         https://bugs.webkit.org/show_bug.cgi?id=164613
260         <rdar://problem/29206007>
261
262         Reviewed by Timothy Hatcher.
263
264         * UserInterface/Views/SettingsTabContentView.css:
265         (.content-view.settings > .header):
266         Use hv units for margin. 1vh = 1% of viewport height. When Web Inspector window is taller, the margin is larger.
267
268         (.content-view.settings > .setting-container):
269         Convert padding to margin to make spacing between the header and the first section better.
270
271 2016-11-10  Nikita Vasilyev  <nvasilyev@apple.com>
272
273         Web Inspector: Call RuntimeAgent.disableControlFlowProfiler when Code Coverage Profiler is turned off
274         https://bugs.webkit.org/show_bug.cgi?id=163407
275         <rdar://problem/28764230>
276
277         Reviewed by Joseph Pecoraro.
278
279         Turning Code Coverage off by clicking [C] icon now disables its backend by calling RuntimeAgent.disableControlFlowProfiler().
280
281         * UserInterface/Views/SourceCodeTextEditor.js:
282         (WebInspector.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
283
284 2016-11-10  Aaron Chu  <aaron_chu@apple.com>
285
286         Web Inspector: AXI: clarify button roles (e.g. toggle or popup button)
287         https://bugs.webkit.org/show_bug.cgi?id=130726
288         <rdar://problem/16420420>
289
290         Reviewed by Brian Burg.
291
292         Updated Inspector to show the button type using the new mapping information.
293
294         * Localizations/en.lproj/localizedStrings.js:
295         * UserInterface/Models/DOMNode.js:
296         (WebInspector.DOMNode.prototype.accessibilityProperties.accessibilityPropertiesCallback):
297         (WebInspector.DOMNode.prototype.accessibilityProperties):
298         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
299         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
300         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):
301
302 2016-11-09  Joseph Pecoraro  <pecoraro@apple.com>
303
304         Web Inspector: DebuggerManager.Event.Resumed introduces test flakiness
305         https://bugs.webkit.org/show_bug.cgi?id=161951
306         <rdar://problem/28295767>
307
308         Reviewed by Brian Burg.
309
310         * UserInterface/Controllers/DebuggerManager.js:
311         (WebInspector.DebuggerManager.prototype.debuggerDidResume):
312         Now, Debugger.resumed events really mean the debugger resumed,
313         so act immediately instead of guessing. We must still guess
314         in legacy backends.
315
316         * UserInterface/Test/Test.js:
317         When the inspector frontend encounters an issue, log it.
318
319         * UserInterface/Views/DebuggerSidebarPanel.js:
320         (WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause):
321         (WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange):
322         Always enable the step out button. I don't think it makes sense to disable
323         it sometimes, and if there are issues with this we should solve the issues
324         instead of hiding them.
325
326 2016-11-09  Joseph Pecoraro  <pecoraro@apple.com>
327
328         Web Inspector: Associate Worker Resources with the Worker and not the Page
329         https://bugs.webkit.org/show_bug.cgi?id=164342
330         <rdar://problem/29075775>
331
332         Reviewed by Timothy Hatcher.
333
334         A Target may have its own list of Resource. For example, Workers may
335         request any resources via XHR/Fetch. So we associate a ResourceCollection
336         with a Target, and ensure we show them in Web Inspector as you would expect.
337         At this point, Target starts acting like Frame. Target has a resourceCollection
338         and extraScriptsCollection just like Frame. Target has events for ResourceAdded
339         just like Frame.
340
341         Even though Resource loads are happening in Workers, the Network data
342         still comes from the Page's Network agent. The added "targetId" data
343         with the Resource will let us associate a Resoure with a Target.
344
345         When opening inspector after a page has loaded, the frontend loads Resources
346         via the Page.getResourceTree path. In this case, the frontend may be
347         informed of Resources for a Target that it does not know about yet. In
348         these cases, it sets them aside as Orphaned resources for a target. Later,
349         when that Target is created, it will adopt its Orphaned resources.
350
351         Places that used to listen to just Frame.Event.ResourceWasAdded should now
352         also listen for Target.Event.ResourceAdded to ensure it sees the resources
353         associated with non-page targets.
354
355         * UserInterface/Protocol/Target.js:
356         (WebInspector.Target):
357         (WebInspector.Target.prototype.get identifier):
358         (WebInspector.Target.prototype.get resourceCollection):
359         (WebInspector.Target.prototype.get extraScriptCollection):
360         (WebInspector.Target.prototype.addResource):
361         (WebInspector.Target.prototype.adoptResource):
362         (WebInspector.Target.prototype.addScript):
363         Give Target resource collections.
364
365         (WebInspector.MainTarget):
366         (WebInspector.MainTarget.prototype.get mainResource):
367         Pass through to the FrameResourceManager for the MainTarget.
368
369         (WebInspector.WorkerTarget):
370         (WebInspector.WorkerTarget.prototype.initialize):
371         Adopt orphaned resources on creation.
372
373         * UserInterface/Models/Resource.js:
374         (WebInspector.Resource):
375         (WebInspector.Resource.prototype.get target):
376         (WebInspector.Resource.prototype.get type):
377         Resource now has a Target. During creation, if there is a targetId
378         then we must produce a Target or null (orphaned).
379
380         (WebInspector.Resource.prototype.associateWithScript):
381         When associating a Resource with a Script, we can use this opportunity
382         to convert from an XML / Other type to Script.
383
384         * UserInterface/Models/Script.js:
385         (WebInspector.Script.prototype._resolveResource):
386         When associating Scripts with a resource we must associate resources
387         from within the proper Target. If it is the Main target we still use
388         the FrameResourceManager which keep searches across all Frames.
389
390         * UserInterface/Protocol/NetworkObserver.js:
391         (WebInspector.NetworkObserver.prototype.requestWillBeSent):
392         * UserInterface/Controllers/FrameResourceManager.js:
393         (WebInspector.FrameResourceManager.prototype.initialize):
394         (WebInspector.FrameResourceManager.prototype.frameDidNavigate):
395         (WebInspector.FrameResourceManager.prototype.resourceRequestWillBeSent):
396         (WebInspector.FrameResourceManager.prototype.resourceRequestWasServedFromMemoryCache):
397         (WebInspector.FrameResourceManager.prototype.resourceRequestDidReceiveResponse):
398         (WebInspector.FrameResourceManager.prototype.adoptOrphanedResourcesForTarget):
399         (WebInspector.FrameResourceManager.prototype._addNewResourceToFrameOrTarget):
400         (WebInspector.FrameResourceManager.prototype._addResourceToTarget):
401         (WebInspector.FrameResourceManager.prototype._createResource):
402         (WebInspector.FrameResourceManager.prototype._addFrameTreeFromFrameResourceTreePayload):
403         (WebInspector.FrameResourceManager.prototype._addOrphanedResource):
404         (WebInspector.FrameResourceManager.prototype._mainFrameDidChange):
405         (WebInspector.FrameResourceManager.prototype._addNewResourceToFrame): Deleted.
406         When creating Resources from Network events we may now have a targetId.
407         Once created a Resource must be associated with a Frame, Target, or orphaned.
408
409         * UserInterface/Main.html:
410         * UserInterface/Views/TargetTreeElement.js: Removed.
411         * UserInterface/Views/WorkerTreeElement.js: Added.
412         (WebInspector.WorkerTreeElement):
413         (WebInspector.WorkerTreeElement.prototype.get target):
414         (WebInspector.WorkerTreeElement.prototype.onexpand):
415         (WebInspector.WorkerTreeElement.prototype.oncollapse):
416         (WebInspector.WorkerTreeElement.prototype.onpopulate):
417         (WebInspector.WorkerTreeElement.prototype.updateSourceMapResources):
418         (WebInspector.WorkerTreeElement.prototype.onattach):
419         (WebInspector.WorkerTreeElement.prototype.compareChildTreeElements):
420         (WebInspector.WorkerTreeElement.prototype._handleContextMenuEvent):
421         (WebInspector.WorkerTreeElement.prototype._scriptAdded):
422         (WebInspector.WorkerTreeElement.prototype._resourceAdded):
423         Convert TargetTreeElement to WorkerTreeElement as that is clearer.
424         Behave like FrameTreeElement and populate resources on creation,
425         handle SourceMapResource, etc.
426
427         * UserInterface/Views/FolderizedTreeElement.js:
428         (WebInspector.FolderizedTreeElement.prototype.registerFolderizeSettings):
429         (WebInspector.FolderizedTreeElement.prototype._compareTreeElementsByMainTitle):
430         (WebInspector.FolderizedTreeElement.prototype._parentTreeElementForRepresentedObject):
431         If the display name for a folder is `null` then there is no folder,
432         and place such child tree elements at the top level. This will be
433         the case for a Worker's Script's, which we choose not to folderize.
434
435         * UserInterface/Controllers/DebuggerManager.js:
436         (WebInspector.DebuggerManager.prototype.scriptDidParse):
437         * UserInterface/Controllers/TargetManager.js:
438         (WebInspector.TargetManager.prototype.targetForIdentifier):
439
440         * UserInterface/Models/DefaultDashboard.js:
441         (WebInspector.DefaultDashboard):
442         * UserInterface/Controllers/TimelineManager.js:
443         (WebInspector.TimelineManager):
444         * UserInterface/Controllers/WorkerManager.js:
445         (WebInspector.WorkerManager.prototype.workerCreated):
446         * UserInterface/Views/OpenResourceDialog.js:
447         (WebInspector.OpenResourceDialog.prototype.didDismissDialog):
448         (WebInspector.OpenResourceDialog.prototype.didPresentDialog):
449         (WebInspector.OpenResourceDialog.prototype._addScriptsForTarget): Deleted.
450         (WebInspector.OpenResourceDialog.prototype._addResourcesForTarget): Added.
451         Ensure those that listen for Frame.Event.ResourceWasAdded now also
452         listen for Target.Event.ResourceAdded.
453
454         * UserInterface/Views/ContextMenuUtilities.js:
455         (WebInspector.appendContextMenuItemsForSourceCode):
456         (WebInspector.appendContextMenuItemsForResource): Deleted.
457         * UserInterface/Views/ResourceTimelineDataGridNode.js:
458         (WebInspector.ResourceTimelineDataGridNode.prototype.appendContextMenuItems):
459         * UserInterface/Views/ResourceTreeElement.js:
460         (WebInspector.ResourceTreeElement.prototype._updateTitles):
461         (WebInspector.ResourceTreeElement.prototype._handleContextMenuEvent):
462         Generalize ContextMenu helper to SourceCode so it can be used on a Script or Resource.
463
464         * UserInterface/Views/ResourceDetailsSidebarPanel.js:
465         (WebInspector.ResourceDetailsSidebarPanel.prototype.inspect):
466         When looking at a WorkerTarget's mainResource (Script) show the
467         Resource Details sidebar for its Resource.
468
469         * UserInterface/Views/ResourceSidebarPanel.js:
470         (WebInspector.ResourceSidebarPanel):
471         (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
472         (WebInspector.ResourceSidebarPanel.prototype._scriptsCleared):
473         (WebInspector.ResourceSidebarPanel.prototype._addTargetWithMainResource):
474         (WebInspector.ResourceSidebarPanel.prototype._targetRemoved):
475         (WebInspector.ResourceSidebarPanel.prototype._addScriptForNonMainTarget): Deleted.
476         Simplify ResourceSidebarPanel to only handle adding WorkerTreeElements,
477         which will do the rest of the work for their Resources/Scripts.
478
479         * UserInterface/Views/SourceCodeTreeElement.js:
480         (WebInspector.SourceCodeTreeElement.prototype.descendantResourceTreeElementTypeDidChange):
481         When we were changing the type of a resource, it would remove and re-insert.
482         This would collapse the parent if it was the only child in removal, and not
483         expand the parent when re-inserting. This ensures we re-expand.
484
485 2016-11-09  Nikita Vasilyev  <nvasilyev@apple.com>
486
487         Web Inspector: Settings tab sections overlap each other in docked Inspector window
488         https://bugs.webkit.org/show_bug.cgi?id=164564
489
490         Reviewed by Joseph Pecoraro.
491
492         * UserInterface/Views/SettingsTabContentView.css:
493         (.content-view.settings):
494         Make settings sections non-shrinkable and make the content view vertically scrollable.
495
496         (.content-view.settings > .setting-container):
497         Set vertical padding that looks good for non-shrinkable sections.
498
499 2016-11-09  Nikita Vasilyev  <nvasilyev@apple.com>
500
501         Web Inspector: Settings tab: Checkbox labels should be clickable
502         https://bugs.webkit.org/show_bug.cgi?id=164470
503         <rdar://problem/29133787>
504
505         Reviewed by Matt Baker.
506
507         * UserInterface/Views/SettingsTabContentView.js:
508         (WebInspector.SettingsTabContentView.prototype.initialLayout):
509         Add a label element to make checkboxes clickable.
510
511 2016-11-09  Devin Rousso  <dcrousso+webkit@gmail.com>
512
513         Web Inspector: Allow FolderTreeElement to display content when selected
514         https://bugs.webkit.org/show_bug.cgi?id=164407
515
516         Reviewed by Timothy Hatcher.
517
518         * UserInterface/Main.html:
519         Add CollectionContentView and TitleView.
520
521         * UserInterface/Base/Main.js:
522         * UserInterface/Views/ContentView.js:
523         (WebInspector.ContentView.createFromRepresentedObject):
524         (WebInspector.ContentView.isViewable):
525         Add support for Collection as the representedObject of a content view.
526
527         * UserInterface/Views/CollectionContentView.css: Added.
528         (.content-view.collection):
529         (.content-view.collection > .content-view):
530         * UserInterface/Views/CollectionContentView.js: Added.
531         (WebInspector.CollectionContentView):
532         (WebInspector.CollectionContentView.prototype.initialLayout):
533         (WebInspector.CollectionContentView.prototype._addContentViewForItem):
534         (WebInspector.CollectionContentView.prototype._removeContentViewForItem):
535         (WebInspector.CollectionContentView.prototype._handleItemAdded):
536         (WebInspector.CollectionContentView.prototype._handleItemRemoved):
537         (WebInspector.CollectionContentView.prototype._handleContentError):
538         Takes in a Collection when constructed, and attempts to display a sub-ContentView for each
539         item in the collection if the type of the collection is viewable en masse.  Currently, this
540         is only supported for WebInspector.Resource.Type.Image collections.
541
542         * UserInterface/Views/ResourceContentView.js:
543         (WebInspector.ResourceContentView.prototype._contentError):
544         Dispatch an event whenever the content fails to load.
545
546         * UserInterface/Views/ResourceSidebarPanel.js:
547         (WebInspector.ResourceSidebarPanel.prototype._treeSelectionDidChange):
548         * UserInterface/Views/ResourcesTabContentView.js:
549         (WebInspector.ResourcesTabContentView.prototype.canShowRepresentedObject):
550         Allow FolderTreeElements to be selected.
551
552         * UserInterface/Views/TitleView.css: Added.
553         (.title-view):
554         * UserInterface/Views/TitleView.js: Added.
555         (WebInspector.TitleView):
556         Basic view that displays the given text in the center of the viewable area.
557
558 2016-11-03  Nikita Vasilyev  <nvasilyev@apple.com>
559
560         Web Inspector: Stack overflow when searching a timeline recording for JS function names
561         https://bugs.webkit.org/show_bug.cgi?id=161784
562         <rdar://problem/28219498>
563
564         Reviewed by Timothy Hatcher.
565
566         _populate method of ProfileNodeDataGridNode and ProfileDataGridNode traverses
567         all children of a given node. makeVisible function of DataGrid#_applyFiltersToNode
568         traverses all its parents to expand them. This creates an infinite recursion.
569         Remove "populate" event before appending child nodes to prevent it.
570
571         * UserInterface/Views/ProfileDataGridNode.js:
572         (WebInspector.ProfileDataGridNode.prototype._populate):
573         (WebInspector.ProfileDataGridNode):
574         * UserInterface/Views/ProfileNodeDataGridNode.js:
575         (WebInspector.ProfileNodeDataGridNode.prototype._populate):
576         (WebInspector.ProfileNodeDataGridNode):
577
578 2016-11-03  Devin Rousso  <dcrousso+webkit@gmail.com>
579
580         Web Inspector: Modify FolderTreeElement to have a Collection as a its represented object
581         https://bugs.webkit.org/show_bug.cgi?id=164349
582
583         Reviewed by Matt Baker.
584
585         * UserInterface/Views/FolderTreeElement.js:
586         (WebInspector.FolderTreeElement):
587         Now accepts a representedObject parameter, which must be a WebInspector.Collection.
588
589         * UserInterface/Views/FolderizedTreeElement.js:
590         (WebInspector.FolderizedTreeElement.prototype.registerFolderizeSettings):
591         (WebInspector.FolderizedTreeElement.prototype.updateParentStatus):
592         (WebInspector.FolderizedTreeElement.prototype._parentTreeElementForRepresentedObject):
593         (WebInspector.FolderizedTreeElement.prototype._settingsForRepresentedObject):
594         (WebInspector.FolderizedTreeElement.prototype._shouldGroupIntoFolders):
595         (WebInspector.FolderizedTreeElement):
596         Rework the logic for creating WebInspector.FolderTreeElement so that items for the
597         representedObject parameter may be passed in via registerFolderizeSettings.
598
599         * UserInterface/Views/FrameTreeElement.js:
600         (WebInspector.FrameTreeElement):
601         (WebInspector.FrameTreeElement.): Deleted.
602         (WebInspector.FrameTreeElement.makeChildCountCallback): Deleted.
603         Rework logic for calling registerFolderizeSettings to support the representedObject
604         parameter.  Also changed calls to WebInspector.Frame to support the
605         WebInspector.Collection class.
606
607         * UserInterface/Views/ResourceSidebarPanel.js:
608         (WebInspector.ResourceSidebarPanel.prototype.treeElementForRepresentedObject):
609         (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
610         (WebInspector.ResourceSidebarPanel.prototype._scriptsCleared):
611         Create WebInspector.Collection instances of Script model objects for additional folders
612         created by the Resources sidebar:
613          - Anonymous Scripts
614          - Extension Scripts
615          - Extra Scripts
616
617 2016-11-02  Joseph Pecoraro  <pecoraro@apple.com>
618
619         Web Inspector: Include DebuggerAgent in Workers - see, pause, and step through scripts
620         https://bugs.webkit.org/show_bug.cgi?id=164136
621         <rdar://problem/29028462>
622
623         Reviewed by Brian Burg.
624         
625         By implementing DebuggerAgent, Workers will inform the frontend about
626         Scripts that evaluate in the Worker's VM and the Worker VM can pause
627         and send the pausing CallFrames to the frontend. This means that
628         WebInspector.Script and WebInspector.CallFrame will need to be made
629         target aware. This also means that each Target will have its own
630         set of debugger data, such as the list of scripts and pause data
631         like the pause reason / call frames. Previously all this data was
632         managed by DebuggerManager.
633
634         With this change we split that data out of DebuggerManager to be
635         per-target DebuggerData. DebuggerManager keeps `activeCallFrame`
636         but the list of scripts and pause data have moved into `DebuggerData`
637         which is per-target, accessed through DebuggerManager's new
638         dataForTarget(target) method.
639
640         Finally we make a few changes to the UserInterface to make Workers
641         and their scripts, appear grouped together. The Resources sidebar
642         previously had a single top level item for the Main Frame, which
643         has all its resources as its children (potentially grouped into
644         folders). With this change, each Worker gets its own top level
645         item as well, and the Worker's subresources (imported scripts)
646         become its children.
647
648         We also now associate a single mainResource with Targets. In the
649         case of Workers, we assume and assert that this is a Script. If
650         this were to ever change we would need to adjust the assumptions.
651
652         * UserInterface/Main.html:
653         * UserInterface/Test.html:
654         New files.
655
656         * UserInterface/Base/Main.js:
657         * UserInterface/Test/Test.js:
658         Add WebInspector.assumingMainTarget to fill in all the places where
659         we assume the main target right now, but would need to handle non-main
660         targets as other agents are implemented in workers. For example profile
661         data that assumes the main target right now could be worker targets
662         when we implement ScriptProfiler / Heap agents.
663
664         * UserInterface/Protocol/Connection.js:
665         (InspectorBackend.WorkerConnection):
666         * UserInterface/Protocol/Target.js:
667         (WebInspector.Target):
668         (WebInspector.Target.prototype.get DebuggerAgent):
669         (WebInspector.Target.prototype.get mainResource):
670         (WebInspector.Target.prototype.set mainResource):
671         (WebInspector.WorkerTarget.prototype.initialize):
672         (WebInspector.WorkerTarget):
673         Include DebuggerAgent in Targets.
674         Include a mainResource for Worker Targets.
675
676         * UserInterface/Protocol/DebuggerObserver.js:
677         (WebInspector.DebuggerObserver.prototype.scriptParsed):
678         (WebInspector.DebuggerObserver.prototype.breakpointResolved):
679         (WebInspector.DebuggerObserver.prototype.paused):
680         (WebInspector.DebuggerObserver.prototype.resumed):
681         Pass the target on to managers when necessary.
682
683         * UserInterface/Models/DebuggerData.js: Added.
684         (WebInspector.DebuggerData):
685         (WebInspector.DebuggerData.prototype.get target):
686         (WebInspector.DebuggerData.prototype.get callFrames):
687         (WebInspector.DebuggerData.prototype.get pauseReason):
688         (WebInspector.DebuggerData.prototype.get pauseData):
689         (WebInspector.DebuggerData.prototype.get scripts):
690         (WebInspector.DebuggerData.prototype.scriptForIdentifier):
691         (WebInspector.DebuggerData.prototype.scriptsForURL):
692         (WebInspector.DebuggerData.prototype.reset):
693         (WebInspector.DebuggerData.prototype.addScript):
694         (WebInspector.DebuggerData.prototype.pause):
695         (WebInspector.DebuggerData.prototype.unpause):
696         Extract per-target data from DebuggerManager. This includes the list
697         of scripts evaluated in a Target, and any pause data for this target
698         such as the pause reason and call frames.
699
700         * UserInterface/Controllers/DebuggerManager.js:
701         (WebInspector.DebuggerManager.prototype.dataForTarget):
702         (WebInspector.DebuggerManager.prototype.get pauseReason): Deleted.
703         (WebInspector.DebuggerManager.prototype.get pauseData): Deleted.
704         (WebInspector.DebuggerManager.prototype.get callFrames): Deleted.
705         (WebInspector.DebuggerManager.prototype.reset):
706         New way to access per-target debugger data.
707
708         (WebInspector.DebuggerManager.prototype.initializeTarget):
709         When a new Target is created, synchronize frontend state with the target.
710         Things like the list of breakpoints and global breakpoint states.
711
712         (WebInspector.DebuggerManager.prototype.scriptForIdentifier):
713         (WebInspector.DebuggerManager.prototype.scriptsForURL):
714         Convenience accessors for scripts must now provide a Target.
715
716         (WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
717         This is a convenience accessors for a list of all scripts across all targets
718         so this handles getting the list across all targets.
719
720         (WebInspector.DebuggerManager.prototype.pause):
721         (WebInspector.DebuggerManager.prototype.resume):
722         (WebInspector.DebuggerManager.prototype.stepOver):
723         (WebInspector.DebuggerManager.prototype.stepInto):
724         (WebInspector.DebuggerManager.prototype.stepOut):
725         (WebInspector.DebuggerManager.prototype.continueToLocation):
726         Stepping commands affect the current target with the active call frame.
727         Eventually we will change Pause and Resume behavior to affect all targets.
728         
729         (WebInspector.DebuggerManager.prototype.addBreakpoint):
730         (WebInspector.DebuggerManager.prototype.breakpointResolved):
731         (WebInspector.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
732         (WebInspector.DebuggerManager.prototype._setBreakpoint):
733         (WebInspector.DebuggerManager.prototype._removeBreakpoint):
734         Breakpoints should be set on all targets, but we need a way
735         to set them on a specific target, when initializing an
736         individual target when we want to inform that single target
737         of all of the breakpoints.
738
739         (WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
740         (WebInspector.DebuggerManager.prototype._updateBreakOnExceptionsState):
741         Changing global breakpoint state should inform all targets.
742
743         (WebInspector.DebuggerManager.prototype.scriptDidParse):
744         Associate Scripts with a Target. Identify the main resource of a
745         Worker Target and set it as soon as we can.
746
747         (WebInspector.DebuggerManager.prototype.debuggerDidPause):
748         (WebInspector.DebuggerManager.prototype.debuggerDidResume):
749         (WebInspector.DebuggerManager.prototype._sourceCodeLocationFromPayload):
750         (WebInspector.DebuggerManager.prototype._scopeChainFromPayload):
751         (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload):
752         (WebInspector.DebuggerManager.prototype._mainResourceDidChange):
753         (WebInspector.DebuggerManager.prototype._didResumeInternal):
754         Pausing and resuming now happens per-target, so associate
755         created model objects (CallFrame, ScopeChain objects) and any
756         other necessary data with the target.
757
758         * UserInterface/Models/Breakpoint.js:
759         (WebInspector.Breakpoint):
760         (WebInspector.Breakpoint.prototype.get target):
761         (WebInspector.Breakpoint.prototype.get info):
762         * UserInterface/Models/CallFrame.js:
763         (WebInspector.CallFrame):
764         (WebInspector.CallFrame.prototype.get target):
765         (WebInspector.CallFrame.fromDebuggerPayload):
766         (WebInspector.CallFrame.fromPayload):
767         * UserInterface/Models/ConsoleMessage.js:
768         (WebInspector.ConsoleMessage):
769         * UserInterface/Models/Script.js:
770         (WebInspector.Script):
771         (WebInspector.Script.prototype.get target):
772         (WebInspector.Script.prototype.isMainResource):
773         (WebInspector.Script.prototype.requestContentFromBackend):
774         (WebInspector.Script.prototype._resolveResource):
775         * UserInterface/Models/StackTrace.js:
776         (WebInspector.StackTrace.fromPayload):
777         (WebInspector.StackTrace.fromString):
778         * UserInterface/Models/ProbeManager.js:
779         (WebInspector.ProbeManager.prototype.didSampleProbe):
780         * UserInterface/Models/Probe.js:
781         (WebInspector.ProbeSample):
782         * UserInterface/Views/ConsoleMessageView.js:
783         (WebInspector.ConsoleMessageView.prototype._appendLocationLink):
784         (WebInspector.ConsoleMessageView.prototype._formatParameterAsString):
785         Associate model objects with a specific target where necessary.
786
787         * UserInterface/Views/ObjectTreeBaseTreeElement.js:
788         (WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
789         * UserInterface/Controllers/RuntimeManager.js:
790         (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
791         * UserInterface/Protocol/RemoteObject.js:
792         (WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
793         Use target specific DebuggerAgent where necessary.
794
795         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
796         * UserInterface/Controllers/TimelineManager.js:
797         (WebInspector.TimelineManager.prototype._callFramesFromPayload):
798         * UserInterface/Models/ScriptTimelineRecord.js:
799         (WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload.profileNodeFromPayload):
800         * UserInterface/Views/EventListenerSectionGroup.js:
801         (WebInspector.EventListenerSectionGroup.prototype._functionTextOrLink):
802         (WebInspector.EventListenerSectionGroup):
803         * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
804         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.node.shortestGCRootPath.):
805         (WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
806         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populateWindowPreview):
807         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
808         (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
809         * UserInterface/Views/ProfileDataGridNode.js:
810         (WebInspector.ProfileDataGridNode.prototype.iconClassName):
811         (WebInspector.ProfileDataGridNode.prototype.filterableDataForColumn):
812         (WebInspector.ProfileDataGridNode.prototype._displayContent):
813         Use assumed main target and audit these when the Worker gets more Agents.
814
815         * UserInterface/Controllers/FrameResourceManager.js:
816         (WebInspector.FrameResourceManager.prototype._initiatorSourceCodeLocationFromPayload):
817         This will always be the main target because only the main target
818         has access to the DOM.
819
820         * UserInterface/Views/SourceCodeTextEditor.js:
821         (WebInspector.SourceCodeTextEditor.prototype.get target):
822         (WebInspector.SourceCodeTextEditor.prototype.customPerformSearch):
823         (WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
824         (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
825         (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
826         (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
827         (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction):
828         Update target specific actions to use the proper target's agents.
829
830         * UserInterface/Views/TargetTreeElement.js: Added.
831         (WebInspector.TargetTreeElement):
832         (WebInspector.TargetTreeElement.prototype.get target):
833         (WebInspector.TargetTreeElement.prototype.onexpand):
834         (WebInspector.TargetTreeElement.prototype.oncollapse):
835         Add a new tree element for a Target. We currently assume that the
836         main resource for a Target will be a Script right now, as is the
837         case for Web Workers. This simply remembers its expanded or
838         collapsed state and has a better icon.
839
840         * UserInterface/Views/ResourceIcons.css:
841         (body:matches(.mac-platform, .windows-platform) .script.worker-icon .icon):
842         (body:matches(.mac-platform, .windows-platform) .large .script.worker-icon .icon):
843         * UserInterface/Images/WorkerScript.png: Renamed from Source/WebInspectorUI/UserInterface/Images/WorkerDocument.png.
844         * UserInterface/Images/WorkerScript@2x.png: Renamed from Source/WebInspectorUI/UserInterface/Images/WorkerDocument@2x.png.
845         * UserInterface/Images/WorkerScriptLarge.png: Renamed from Source/WebInspectorUI/UserInterface/Images/WorkerDocumentLarge.png.
846         * UserInterface/Images/WorkerScriptLarge@2x.png: Renamed from Source/WebInspectorUI/UserInterface/Images/WorkerDocumentLarge@2x.png.
847         Improve icon for a Worker's main resource script.
848
849         * UserInterface/Views/ResourceSidebarPanel.js:
850         (WebInspector.ResourceSidebarPanel):
851         (WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
852         (WebInspector.ResourceSidebarPanel.prototype._scriptsCleared):
853         (WebInspector.ResourceSidebarPanel.prototype._addScriptForNonMainTarget):
854         (WebInspector.ResourceSidebarPanel.prototype._addTargetWithMainResource):
855         (WebInspector.ResourceSidebarPanel.prototype._targetRemoved):
856         * UserInterface/Views/SearchSidebarPanel.js:
857         (WebInspector.SearchSidebarPanel.prototype.performSearch.searchScripts):
858         (WebInspector.SearchSidebarPanel.prototype._searchTreeElementForScript):
859         * UserInterface/Views/OpenResourceDialog.js:
860         (WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline.createTreeElement):
861         (WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline):
862         (WebInspector.OpenResourceDialog.prototype.didDismissDialog):
863         (WebInspector.OpenResourceDialog.prototype.didPresentDialog):
864         (WebInspector.OpenResourceDialog.prototype._addResourcesForFrame):
865         (WebInspector.OpenResourceDialog.prototype._addScriptsForTarget):
866         (WebInspector.OpenResourceDialog.prototype._scriptAdded):
867         (WebInspector.OpenResourceDialog):
868         * UserInterface/Views/DebuggerSidebarPanel.js:
869         (WebInspector.DebuggerSidebarPanel.prototype._addTreeElementForSourceCodeToTreeOutline):
870         (WebInspector.DebuggerSidebarPanel.prototype._debuggerCallFramesDidChange):
871         (WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange):
872         (WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
873         Include scripts from non-main targets in sidebars.
874
875 2016-11-01  Devin Rousso  <dcrousso+webkit@gmail.com>
876
877         Web Inspector: Creating a new pseudo-selector in the Styles sidebar doesn't work on first attempt
878         https://bugs.webkit.org/show_bug.cgi?id=164092
879
880         Reviewed by Timothy Hatcher.
881
882         * UserInterface/Views/CSSStyleDeclarationSection.css:
883         (.style-declaration-section:not(.invalid-selector).rule-disabled > .header > .icon):
884         (.style-declaration-section.invalid-selector > .header > .icon):
885         (.style-declaration-section.invalid-selector > .header > .selector,):
886         (.style-declaration-section.rule-disabled > .header > .icon): Deleted.
887
888         * UserInterface/Views/CSSStyleDeclarationSection.js:
889         (WebInspector.CSSStyleDeclarationSection):
890         (WebInspector.CSSStyleDeclarationSection.prototype.refresh):
891         (WebInspector.CSSStyleDeclarationSection.prototype._handleIconElementClicked):
892         (WebInspector.CSSStyleDeclarationSection.prototype._updateSelectorIcon): Added.
893         Re-add logic removed by https://webkit.org/b/159734 for handling invalid selectors.  Instead
894         of just refreshing the section whenever the represented CSSRule changes selectors, we only
895         need to refresh if the selector no longer applies to the current element.
896
897         (WebInspector.CSSStyleDeclarationSection.prototype._handleMouseMove): Added.
898         Fix another issue discovered while adding the invalid selector warnings, where the title
899         attribute of each individual selector was no longer visible.  To fix this, whenever the user
900         moves their mouse over the selector input, the position is compared to each selector to find
901         the first one that matches, whose title is then applied to the input element.
902
903 2016-11-01  Joseph Pecoraro  <pecoraro@apple.com>
904
905         Web Inspector: Improve debugger highlight in some exception cases
906         https://bugs.webkit.org/show_bug.cgi?id=164300
907
908         Reviewed by Matt Baker.
909
910         * UserInterface/Views/SourceCodeTextEditor.js:
911         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
912         When walking up AST nodes and reach a throw statement, use that.
913
914 2016-11-01  Joseph Pecoraro  <pecoraro@apple.com>
915
916         Web Inspector: Cleanup stale code in NetworkSidebarPanel
917         https://bugs.webkit.org/show_bug.cgi?id=164295
918
919         Reviewed by Matt Baker.
920
921         * UserInterface/Views/NetworkSidebarPanel.js:
922         (WebInspector.NetworkSidebarPanel.prototype.closed): Deleted.
923         This doesn't appear to be needed since NetworkSidebarPanel never
924         registered any event listeners.
925
926 2016-11-01  Devin Rousso  <dcrousso+webkit@gmail.com>
927
928         REGRESSION (r191419): Web Inspector: Autocomplete is broken
929         https://bugs.webkit.org/show_bug.cgi?id=150493
930
931         Reviewed by Timothy Hatcher.
932
933         Fixed CodeMirror.undo() logic rolled out by r191539 <https://webkit.org/b/150537>
934
935         Added calls to CodeMirror.changeGeneration(true) which tells the history stack to "close"
936         the current event, preventing it from being consolidated with new changes.  If the user
937         typed fast enough, non-completion changes (like adding ":" in CSS) would get merged with
938         completion changes, causing calls to CodeMirror.undo() to undo those changes as well.  To
939         prevent this, a boolean variable is set to true whenever a completion "activity" is in
940         progress, defined by a sequence of completion related events.  When this "activity" first
941         starts, call CodeMirror.changeGeneration(true) to freeze the current history.
942
943         See original bug for more information <https://webkit.org/b/147720>.
944
945         * UserInterface/Controllers/CodeMirrorCompletionController.js:
946         (WebInspector.CodeMirrorCompletionController):
947         (WebInspector.CodeMirrorCompletionController.prototype.updateCompletions):
948         (WebInspector.CodeMirrorCompletionController.prototype.isCompletionChange):
949         (WebInspector.CodeMirrorCompletionController.prototype.hideCompletions):
950         (WebInspector.CodeMirrorCompletionController.prototype.close):
951         (WebInspector.CodeMirrorCompletionController.prototype.completionSuggestionsSelectedCompletion):
952         (WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint.update):
953         (WebInspector.CodeMirrorCompletionController.prototype._applyCompletionHint):
954         (WebInspector.CodeMirrorCompletionController.prototype._commitCompletionHint.update):
955         (WebInspector.CodeMirrorCompletionController.prototype._commitCompletionHint):
956         (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.update):
957         (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint):
958         (WebInspector.CodeMirrorCompletionController.prototype._completeAtCurrentPosition):
959         (WebInspector.CodeMirrorCompletionController.prototype._handleBeforeChange):
960         (WebInspector.CodeMirrorCompletionController.prototype._createCompletionHintMarker): Deleted.
961         (WebInspector.CodeMirrorCompletionController.prototype._removeLastChangeFromHistory): Deleted.
962         (WebInspector.CodeMirrorCompletionController.prototype._removeCompletionHint.clearMarker): Deleted.
963
964 2016-11-01  Devin Rousso  <dcrousso+webkit@gmail.com>
965
966         Web Inspector: Replace sublists inside DOM-related model objects with WI.Collection
967         https://bugs.webkit.org/show_bug.cgi?id=164098
968
969         Reviewed by Timothy Hatcher.
970
971         * UserInterface/Models/DOMTree.js:
972         * UserInterface/Models/Frame.js:
973         Add support for WebInspector.Collection.
974
975         * UserInterface/Models/Script.js:
976         (WebInspector.Script):
977         * UserInterface/Views/DebuggerSidebarPanel.js:
978         (WebInspector.DebuggerSidebarPanel.prototype._addResourcesRecursivelyForFrame):
979         * UserInterface/Views/FrameTreeElement.js:
980         (WebInspector.FrameTreeElement):
981         (WebInspector.FrameTreeElement.prototype.onpopulate):
982         * UserInterface/Views/OpenResourceDialog.js:
983         (WebInspector.OpenResourceDialog.prototype._addResourcesForFrame):
984         Use new functions defined by changing to WebInspector.Collection.
985
986 2016-11-01  Devin Rousso  <dcrousso+webkit@gmail.com>
987
988         Web Inspector: Fix double remove of ResourceCollection if type changes
989         https://bugs.webkit.org/show_bug.cgi?id=164268
990
991         Reviewed by Joseph Pecoraro.
992
993         * UserInterface/Models/ResourceCollection.js:
994         (WebInspector.ResourceCollection.prototype._resourceTypeDidChange):
995         Change logic so that a non-typed collection will not try to remove a resource that has
996         changed types from the sub-collection of its old type, since the sub-collection itself will
997         handle the removal inside its own event listener for the type change.
998
999 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
1000
1001         Web Inspector: Add the support for custom elements
1002         https://bugs.webkit.org/show_bug.cgi?id=164266
1003         <rdar://problem/29038883>
1004
1005         Reviewed by Joseph Pecoraro.
1006
1007         Show the custom element state in DOM node's details pane:
1008          - "Element" for all builtin elements.
1009          - "Element (Custom)" for any upgraded custom elements.
1010          - "Element (Waiting to be upgraded)" for any element waiting to be upgraded.
1011          - "Element (Failed to upgrade)" for any custom element that failed during construction or an upgrade.
1012
1013         And add "Jump to Definition" to the context menu of an node to find the custom element's definition.
1014
1015         * Localizations/en.lproj/localizedStrings.js: Added localized strings.
1016         * UserInterface/Controllers/DOMTreeManager.js:
1017         (WebInspector.DOMTreeManager.prototype._customElementStateChanged): Added. Update the state and fire
1018         WebInspector.DOMTreeManager.Event.CustomElementStateChanged to update the node's details pane.
1019         * UserInterface/Models/DOMNode.js:
1020         (WebInspector.DOMNode): Set the custom element state or default to "builtin". Use null when the node
1021         is not an element.
1022         (WebInspector.DOMNode.prototype.isCustomElement): Added. Returns true if this is a successfully
1023         constructed or upgraded custom element.
1024         (WebInspector.DOMNode.prototype.customElementState): Added.
1025         (WebInspector.DOMNode.CustomElementState): Added.
1026         * UserInterface/Protocol/DOMObserver.js:
1027         (WebInspector.DOMObserver.prototype.customElementStateChanged): Added.
1028         * UserInterface/Protocol/RemoteObject.js:
1029         (WebInspector.RemoteObject.prototype.getProperty): Added. Retrieves the property of a given name from
1030         the remote backend.
1031         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
1032         (WebInspector.DOMNodeDetailsSidebarPanel): Call _customElementStateChanged when the custom element
1033         state changes by listening to WebInspector.DOMTreeManager.Event.CustomElementStateChanged.
1034         (WebInspector.DOMNodeDetailsSidebarPanel.prototype.layout):
1035         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshIdentity): Extracted from layout.
1036         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._customElementStateChanged): Added. 
1037         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._nodeTypeDisplayName): Include the custom element
1038         state when it's not a builtin element (_customElementState returns null in that case).
1039         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._customElementState): Get the localized string for
1040         each custom element state.
1041         * UserInterface/Views/DOMTreeElement.js:
1042         (WebInspector.DOMTreeElement.prototype._populateNodeContextMenu): Add "Jump to Definition" item in the
1043         context menu of an element when it's a successfully constructed or upgraded custom element.
1044
1045 2016-10-31  Joseph Pecoraro  <pecoraro@apple.com>
1046
1047         Web Inspector: Shadow DOM scoped styles are missing
1048         https://bugs.webkit.org/show_bug.cgi?id=164247
1049         <rdar://problem/29035061>
1050
1051         Reviewed by Antti Koivisto.
1052
1053         * UserInterface/Models/DOMNodeStyles.js:
1054         (WebInspector.DOMNodeStyles.prototype.refresh.fetchedInlineStyles):
1055         Fix incorrect WrapperPromise usage.
1056
1057 2016-10-31  Devin Rousso  <dcrousso+webkit@gmail.com>
1058
1059         Web Inspector: Arrows for Styles scope bar item are misaligned
1060         https://bugs.webkit.org/show_bug.cgi?id=164159
1061
1062         Reviewed by Timothy Hatcher.
1063
1064         * UserInterface/Views/ScopeRadioButtonNavigationItem.css:
1065         (.scope-radio-button-navigation-item > .scope-radio-button-item-select:focus):
1066         (.scope-radio-button-navigation-item > .arrows):
1067
1068 2016-10-31  Devin Rousso  <dcrousso+webkit@gmail.com>
1069
1070         Web Inspector: Entering ":n" in Open Resource Dialog, where n > number of lines, should jump to the last line
1071         https://bugs.webkit.org/show_bug.cgi?id=160840
1072
1073         Reviewed by Timothy Hatcher.
1074
1075         * UserInterface/Views/TextEditor.js:
1076         (WebInspector.TextEditor.prototype.revealPosition):
1077         Since it is possible for the given position to be outside the bounds of the CodeMirror
1078         instance, wait to get the line handler for the highlight animation until we have constrained
1079         the position value.
1080
1081 2016-10-28  Devin Rousso  <dcrousso+webkit@gmail.com>
1082
1083         Web Inspector: Preferences for Text Editor behavior
1084         https://bugs.webkit.org/show_bug.cgi?id=149120
1085
1086         Reviewed by Timothy Hatcher.
1087
1088         * Localizations/en.lproj/localizedStrings.js:
1089
1090         * UserInterface/Base/Main.js:
1091         (WebInspector.loaded):
1092         (WebInspector.contentLoaded):
1093         (WebInspector.contentLoaded.setTabSize):
1094         (WebInspector.contentLoaded.setInvalidCharacterClassName):
1095         (WebInspector.contentLoaded.setWhitespaceCharacterClassName):
1096         (WebInspector._tryToRestorePendingTabs):
1097         (WebInspector.indentString):
1098         (WebInspector._updateNewTabButtonState): Deleted.
1099         (WebInspector._newTabItemClicked): Deleted.
1100         Removed calls to the New Tab tab bar item on the Tab Bar instance.
1101         Added listener to the indentUnit setting to change the tab-size value on <body>.
1102         Created helper function to generate the indentString value from settings.
1103
1104         * UserInterface/Base/Test.js:
1105         (WebInspector.indentString):
1106         Assume indent string is "    " for tests.
1107
1108         * UserInterface/Base/Setting.js:
1109         Added global WebInspector.settings dictionary for holding settings with UI editors.
1110
1111         * UserInterface/Main.html:
1112         Added GeneralTabBarItem, PinnedTabBarItem, and SettingsTabContentView.
1113
1114         * UserInterface/Models/CSSStyleDeclaration.js:
1115         (WebInspector.CSSStyleDeclaration.prototype.generateCSSRuleString):
1116         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
1117         (WebInspector.CSSStyleDeclarationTextEditor.prototype._formattedContentFromEditor):
1118         (WebInspector.CSSStyleDeclarationTextEditor.prototype._resetContent.update):
1119         * UserInterface/Views/VisualStylePropertyEditor.js:
1120         (WebInspector.VisualStylePropertyEditor.generateFormattedTextForNewProperty):
1121         * UserInterface/Views/SourceCodeTextEditor.js:
1122         (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
1123         Now uses WebInspector.indentUnit for indentation values
1124
1125         * UserInterface/Views/CodeMirrorAdditions.js:
1126         Added "showWhitespaceCharacter" option to CodeMirror.  When enabled, it adds an overlay to
1127         the editor that will use pseudo-elements to display whitespace characters (unicode 00B7).
1128
1129         * UserInterface/Views/CodeMirrorOverrides.css:
1130         (.CodeMirror .cm-tab):
1131         (.show-whitespace-characters .CodeMirror .cm-tab::before):
1132         (.show-whitespace-characters .CodeMirror .cm-whitespace::before):
1133         (.show-whitespace-characters .CodeMirror .cm-whitespace-1::before):
1134         (.show-whitespace-characters .CodeMirror .cm-whitespace-2::before):
1135         (.show-whitespace-characters .CodeMirror .cm-whitespace-3::before):
1136         (.show-whitespace-characters .CodeMirror .cm-whitespace-4::before):
1137         (.show-whitespace-characters .CodeMirror .cm-whitespace-5::before):
1138         (.show-whitespace-characters .CodeMirror .cm-whitespace-6::before):
1139         (.show-whitespace-characters .CodeMirror .cm-whitespace-7::before):
1140         (.show-whitespace-characters .CodeMirror .cm-whitespace-8::before):
1141         (.show-whitespace-characters .CodeMirror .cm-whitespace-9::before):
1142         (.show-whitespace-characters .CodeMirror .cm-whitespace-10::before):
1143         (.show-whitespace-characters .CodeMirror .cm-whitespace-11::before):
1144         (.show-whitespace-characters .CodeMirror .cm-whitespace-12::before):
1145         (.show-whitespace-characters .CodeMirror .cm-whitespace-13::before):
1146         (.show-whitespace-characters .CodeMirror .cm-whitespace-14::before):
1147         (.show-whitespace-characters .CodeMirror .cm-whitespace-15::before):
1148         (.show-whitespace-characters .CodeMirror .cm-whitespace-16::before):
1149         (.show-invalid-characters .CodeMirror .cm-invalidchar):
1150         (.CodeMirror .cm-invalidchar): Deleted.
1151         Use unicode character 00B7 (middle dot) to display a space.  Also uses a grey border for
1152         visualizing tab characters.
1153
1154         * UserInterface/Views/ApplicationCacheFrameContentView.js:
1155         * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
1156         * UserInterface/Views/ClusterContentView.js:
1157         * UserInterface/Views/DOMTreeContentView.js:
1158         * UserInterface/Views/DatabaseContentView.js:
1159         * UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
1160         * UserInterface/Views/NetworkGridContentView.js:
1161         * UserInterface/Views/ResourceContentView.js:
1162         * UserInterface/Views/ScriptContentView.js:
1163         * UserInterface/Views/TabContentView.js:
1164         * UserInterface/Views/TimelineRecordingContentView.js:
1165         Add calls to super.shown(), super.hidden(), and super.closed().
1166
1167         * UserInterface/Views/ConsoleTabContentView.js:
1168         * UserInterface/Views/DebuggerTabContentView.js:
1169         * UserInterface/Views/ElementsTabContentView.js:
1170         * UserInterface/Views/NetworkTabContentView.js:
1171         * UserInterface/Views/NewTabContentView.js:
1172         * UserInterface/Views/ResourcesTabContentView.js:
1173         * UserInterface/Views/SearchTabContentView.js:
1174         * UserInterface/Views/StorageTabContentView.js:
1175         * UserInterface/Views/TimelineTabContentView.js:
1176         Now uses WebInspector.GeneralTabBarItem.
1177
1178         * UserInterface/Views/GeneralTabBarItem.js: Added.
1179         (WebInspector.GeneralTabBarItem):
1180         (WebInspector.GeneralTabBarItem.prototype.set title):
1181         (WebInspector.GeneralTabBarItem.prototype._handleContextMenuEvent):
1182         Split from TabBarItem.js to make pinned tab bar items more distinct.
1183
1184         * UserInterface/Views/Main.css:
1185         (body):
1186         Removed tab-size.
1187
1188         * UserInterface/Views/PinnedTabBarItem.js: Added.
1189         (WebInspector.PinnedTabBarItem):
1190         Split from TabBarItem.js to make pinned tab bar items more distinct.
1191
1192         * UserInterface/Views/SettingsTabContentView.css: Added.
1193         (.content-view.settings):
1194         (.content-view.settings > .header):
1195         (.content-view.settings > .setting-container):
1196         (.content-view.settings > .setting-container > .setting-name):
1197         (.content-view.settings > .setting-container > .setting-value-controller):
1198         (.content-view.settings > .setting-container > .setting-value-controller input[type="number"]):
1199
1200         * UserInterface/Views/SettingsTabContentView.js:
1201         (WebInspector.SettingsTabContentView):
1202         (WebInspector.SettingsTabContentView.tabInfo):
1203         (WebInspector.SettingsTabContentView.isEphemeral):
1204         (WebInspector.SettingsTabContentView.shouldSaveTab):
1205         (WebInspector.SettingsTabContentView.prototype.initialLayout):
1206         (WebInspector.SettingsTabContentView.isTabAllowed): Deleted.
1207         (WebInspector.SettingsTabContentView.prototype.get type): Deleted.
1208         Added logic to display an appropriate editor for each item in WebInspector.settings.
1209
1210         * UserInterface/Views/SourceCodeTextEditor.js:
1211         (WebInspector.SourceCodeTextEditor.prototype.close):
1212         Add call to super.close().
1213
1214         * UserInterface/Views/TabBar.css:
1215         (.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover):
1216         (.tab-bar > .item:not(.pinned) > .flex-space:last-child):
1217         (.tab-bar > .item.pinned > .icon):
1218         (.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover > .icon):
1219         (.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover,): Deleted.
1220         (.tab-bar > .item > .flex-space:last-child): Deleted.
1221         (.tab-bar > .item.new-tab-button > .icon): Deleted.
1222         (.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover > .icon,): Deleted.
1223         Removed rules specifically targeting `.new-tab-button`.
1224
1225         * UserInterface/Views/TabBar.js:
1226         (WebInspector.TabBar):
1227         (WebInspector.TabBar.prototype.get newTabTabBarItem):
1228         (WebInspector.TabBar.prototype.updateNewTabTabBarItemState):
1229         (WebInspector.TabBar.prototype.insertTabBarItem):
1230         (WebInspector.TabBar.prototype.removeTabBarItem.animateTabs):
1231         (WebInspector.TabBar.prototype.removeTabBarItem):
1232         (WebInspector.TabBar.prototype.selectPreviousTab):
1233         (WebInspector.TabBar.prototype.selectNextTab):
1234         (WebInspector.TabBar.prototype.set selectedTabBarItem):
1235         (WebInspector.TabBar.prototype.hasNormalTab):
1236         (WebInspector.TabBar.prototype.layout):
1237         (WebInspector.TabBar.prototype._hasMoreThanOneNormalTab):
1238         (WebInspector.TabBar.prototype._handleMouseDown):
1239         (WebInspector.TabBar.prototype._handleMouseMoved):
1240         (WebInspector.TabBar.prototype._handleMouseLeave):
1241         (WebInspector.TabBar.prototype._handleNewTabClick):
1242         (WebInspector.TabBar.prototype._handleNewTabMouseEnter):
1243         (WebInspector.TabBar.prototype.get newTabItem): Deleted.
1244         (WebInspector.TabBar.prototype.set newTabItem): Deleted.
1245         Replaced the newTabItem setter by adding a saved pinned tab bar item (instead of relying
1246         upon a different object to give it the pinned tab bar item) that changes modes depending on
1247         whether a new tab is able to be created.
1248
1249         * UserInterface/Views/TabBarItem.js:
1250         (WebInspector.TabBarItem):
1251         (WebInspector.TabBarItem.prototype.get element):
1252         (WebInspector.TabBarItem.prototype.get representedObject):
1253         (WebInspector.TabBarItem.prototype.set representedObject):
1254         (WebInspector.TabBarItem.prototype.get parentTabBar):
1255         (WebInspector.TabBarItem.prototype.set parentTabBar):
1256         (WebInspector.TabBarItem.prototype.get image):
1257         (WebInspector.TabBarItem.prototype.set image):
1258         (WebInspector.TabBarItem.prototype.get title):
1259         (WebInspector.TabBarItem.prototype.set title):
1260         (WebInspector.TabBarItem.prototype.get pinned): Deleted.
1261         (WebInspector.TabBarItem.prototype._handleContextMenuEvent): Deleted.
1262         Split into GeneralTabBarItem and PinnedTabBarItem to simplify the logic of the DOM and allow
1263         for easier checking of whether a tab bar item is pinned or not.
1264
1265         * UserInterface/Views/TabBrowser.js:
1266         (WebInspector.TabBrowser):
1267         (WebInspector.TabBrowser.prototype.addTabForContentView):
1268         (WebInspector.TabBrowser.prototype.closeTabForContentView):
1269         (WebInspector.TabBrowser.prototype._tabBarItemSelected):
1270         (WebInspector.TabBrowser.prototype._tabBarItemRemoved):
1271         Replaced references to newTabItem with a set number (since each TabBar has a specific number
1272         of pinned tabs).
1273
1274         * UserInterface/Views/TextEditor.js:
1275         (WebInspector.TextEditor):
1276         (WebInspector.TextEditor.prototype.close):.
1277         Remove settings update event listeners to allow garbage collection.
1278
1279         (WebInspector.TextEditor.prototype._startWorkerPrettyPrint):
1280         (WebInspector.TextEditor.prototype._startCodeMirrorPrettyPrint):
1281         Now uses the settings values in WebInspector.setting for settings on the CodeMirror
1282         instance.  Also updates the CodeMirror instance if any setting changes.
1283
1284 2016-10-28  Joseph Pecoraro  <pecoraro@apple.com>
1285
1286         Web Inspector: Include parameter strings for native CustomElementRegistry methods in the console
1287         https://bugs.webkit.org/show_bug.cgi?id=164147
1288
1289         Reviewed by Brian Burg.
1290
1291         * UserInterface/Models/NativeFunctionParameters.js:
1292
1293 2016-10-28  Matt Baker  <mattbaker@apple.com>
1294
1295         Unreviewed, worker document images added
1296
1297         * UserInterface/Images/WorkerDocument.png: Added.
1298         * UserInterface/Images/WorkerDocument@2x.png: Added.
1299         * UserInterface/Images/WorkerDocumentLarge.png: Added.
1300         * UserInterface/Images/WorkerDocumentLarge@2x.png: Added.
1301
1302 2016-10-27  Devin Rousso  <dcrousso+webkit@gmail.com>
1303
1304         Web Inspector: Create general model object Collection class
1305         https://bugs.webkit.org/show_bug.cgi?id=163995
1306
1307         Reviewed by Joseph Pecoraro.
1308
1309         * UserInterface/Models/Collection.js: Added.
1310         (WebInspector.Collection):
1311         (WebInspector.Collection.prototype.get items):
1312         (WebInspector.Collection.prototype.get typeVerifier):
1313         (WebInspector.Collection.prototype.add):
1314         (WebInspector.Collection.prototype.remove):
1315         (WebInspector.Collection.prototype.clear):
1316         (WebInspector.Collection.prototype.toArray):
1317         (WebInspector.Collection.prototype.toJSON):
1318         (WebInspector.Collection.prototype.itemAdded):
1319         (WebInspector.Collection.prototype.itemRemoved):
1320         (WebInspector.Collection.prototype.itemsCleared):
1321         Class that holds multiple model objects.  It can be limited to a specific type by supplying
1322         a "typeVerifier", which is a function that accepts a single argument (the model object) and
1323         returns true/false depending on if that argument matches the "type" of the collection.
1324
1325         * UserInterface/Main.html:
1326         * UserInterface/Test.html:
1327         * UserInterface/Models/Frame.js:
1328         * UserInterface/Views/CookieStorageContentView.js:
1329         * UserInterface/Views/DebuggerSidebarPanel.js:
1330         * UserInterface/Views/FrameTreeElement.js:
1331         * UserInterface/Views/OpenResourceDialog.js:
1332         Add support for WebInspector.Collection.
1333         
1334         * UserInterface/Models/ResourceCollection.js:
1335         (WebInspector.ResourceCollection):
1336         (WebInspector.ResourceCollection.verifierForType):
1337         (WebInspector.ResourceCollection.prototype.resourceCollectionForType):
1338         (WebInspector.ResourceCollection.prototype.clear):
1339         (WebInspector.ResourceCollection.prototype.itemAdded):
1340         (WebInspector.ResourceCollection.prototype.itemRemoved):
1341         (WebInspector.ResourceCollection.prototype.itemsCleared):
1342         (WebInspector.ResourceCollection.prototype._associateWithResource):
1343         (WebInspector.ResourceCollection.prototype._disassociateWithResource):
1344         (WebInspector.ResourceCollection.prototype._resourceURLDidChange):
1345         (WebInspector.ResourceCollection.prototype._resourceTypeDidChange):
1346         (WebInspector.ResourceCollection.prototype.get resources): Deleted.
1347         (WebInspector.ResourceCollection.prototype.resourcesWithType): Deleted.
1348         (WebInspector.ResourceCollection.prototype.addResource): Deleted.
1349         (WebInspector.ResourceCollection.prototype.removeResource): Deleted.
1350         (WebInspector.ResourceCollection.prototype.removeAllResources): Deleted.
1351         Now a subclass of WebInspector.Collection.  Retrieving WebInspector.Resource objects by type
1352         and URL is still supported, but requesting by type now returns another instance of
1353         WebInspector.ResourceCollection that is configured to only accept the requested type.
1354
1355 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1356
1357         Web Inspector: Include ConsoleAgent in Workers - real console.log support
1358         https://bugs.webkit.org/show_bug.cgi?id=163844
1359         <rdar://problem/28903328>
1360
1361         Reviewed by Brian Burg.
1362
1363         * UserInterface/Protocol/Target.js:
1364         (WebInspector.Target.prototype.get ConsoleAgent):
1365         (WebInspector.Target.prototype._initializeNonMainTarget):
1366         * UserInterface/Protocol/Connection.js:
1367         (InspectorBackend.WorkerConnection):
1368         Add ConsoleAgent.
1369
1370         * UserInterface/Controllers/LogManager.js:
1371         (WebInspector.LogManager.prototype.messageWasAdded):
1372         (WebInspector.LogManager.prototype.requestClearMessages):
1373         Handle ConsoleAgent calls with multiple targets.
1374
1375         * UserInterface/Protocol/ConsoleObserver.js:
1376         (WebInspector.ConsoleObserver.prototype.messageAdded):
1377         Dispatch with the target in case we create Model objects.
1378
1379         * UserInterface/Controllers/WorkerManager.js:
1380         (WebInspector.WorkerManager.prototype.workerCreated):
1381         The frontend must now call "initialized" on Workers after
1382         sending our setup messages (enable, set breakpoints, etc).
1383
1384         * UserInterface/Protocol/RemoteObject.js:
1385         (WebInspector.RemoteObject.prototype.get target):
1386         Expose an accessor for tests.
1387
1388         * UserInterface/Protocol/LoggingProtocolTracer.js:
1389         (WebInspector.LoggingProtocolTracer.prototype._processEntry):
1390         Actually output the Exception, useful when debugging failures in tests.
1391
1392 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1393
1394         Web Inspector: Include RuntimeAgent in Workers - evaluate in Worker context
1395         https://bugs.webkit.org/show_bug.cgi?id=163835
1396         <rdar://problem/28901465>
1397
1398         Reviewed by Brian Burg.
1399
1400         This introduces the idea that the frontend may communication with multiple
1401         backend "Targets" which each have their own set of Agents.
1402
1403             - WebInspector.Target
1404               - has its own list of Agents
1405               - has a InspectorBackend.Connection to communicate with the backend
1406
1407             - WebInspector.mainTarget
1408               - always exists and represents the thing we are debugging (Page or JSContext)
1409
1410             - WebInspector.targets / WebInspector.targetManager
1411               - management of all Targets
1412               - create new Targets for Workers
1413
1414         This also slowly introduces the concept that Model objects may be tied to
1415         a specific Target:
1416
1417             - WebInspector.RemoteObject
1418               - in order to evaluate JS and interact with this object we must know the target (Page or Worker)
1419               - when fetching PropertyDescriptors and other RemoteObjects we must continue to pass on the target
1420
1421         Finally this makes the QuickConsole list Worker execution contexts in
1422         the context picker so that users can choose a Worker context and
1423         evaluate JavaScript in that context using the console.
1424
1425         * Localizations/en.lproj/localizedStrings.js:
1426         * UserInterface/Main.html:
1427         * UserInterface/Base/Main.js:
1428         (WebInspector.loaded):
1429         * UserInterface/Test.html:
1430         * UserInterface/Test/Test.js:
1431         (WebInspector.loaded):
1432         New files, strings, and managers.
1433         New global WebInspector.mainTarget.
1434         New convenience WebInspector.targets.
1435
1436         * UserInterface/Protocol/Target.js: Added.
1437         (WebInspector.Target):
1438         (WebInspector.Target.prototype.get RuntimeAgent):
1439         (WebInspector.Target.prototype.get name):
1440         (WebInspector.Target.prototype.get type):
1441         (WebInspector.Target.prototype.get connection):
1442         (WebInspector.Target.prototype.get executionContext):
1443         (WebInspector.Target.prototype.get displayName):
1444         (WebInspector.Target.prototype._intializeMainTarget):
1445         (WebInspector.Target.prototype._initializeNonMainTarget):
1446         Target has some basic properties.
1447
1448         * UserInterface/Controllers/TargetManager.js:
1449         (WebInspector.TargetManager):
1450         (WebInspector.TargetManager.prototype.get targets):
1451         (WebInspector.TargetManager.prototype.addTarget):
1452         (WebInspector.TargetManager.prototype.removeTarget):
1453         Holds the list of Targets and events when created / removed.
1454         Each target with a RuntimeAgent has an ExecutionContext.
1455
1456         * UserInterface/Controllers/WorkerManager.js:
1457         (WebInspector.WorkerManager):
1458         (WebInspector.WorkerManager.prototype.workerCreated):
1459         (WebInspector.WorkerManager.prototype.workerTerminated):
1460         (WebInspector.WorkerManager.prototype.dispatchMessageFromWorker):
1461         Create / remove / dispatch on a Worker Target.
1462
1463         * UserInterface/Protocol/InspectorBackend.js:
1464         (InspectorBackendClass):
1465         (InspectorBackendClass.prototype.registerCommand):
1466         (InspectorBackendClass.prototype.dispatch):
1467         (InspectorBackendClass.prototype.runAfterPendingDispatches):
1468         (InspectorBackendClass.prototype._agentForDomain):
1469         Keep the original implementations and just dispatch to the main connection.
1470
1471         (InspectorBackend.Agent):
1472         (InspectorBackend.Agent.prototype.get connection):
1473         (InspectorBackend.Agent.prototype.set connection):
1474         (InspectorBackend.Agent.prototype.get dispatcher):
1475         We will share Agent implementations but just give new "copies" a different
1476         connection and dispatcher.
1477
1478         (InspectorBackend.Command):
1479         (InspectorBackend.Command.create):
1480         (InspectorBackend.Command.prototype.invoke):
1481         (InspectorBackend.Command.prototype.supports):
1482         We continue to have a single Command instance on the Agent. However instead
1483         of using the hardcoded Agent on the Instance when evaluated as a function
1484         it uses the `this` object which should be an agent. This way:
1485
1486             target1.RuntimeAgent.evaluate
1487                 - `this` is target1 and we use the connection for that target
1488             target2.RuntimeAgent.evaluate
1489                 - `this` is target2 and we use the connection for that target
1490
1491         Unfortunately this breaks `RuntimeAgent.evaluate.invoke`. Currently this
1492         is solved by providing an extra parameter. In the case where we need to
1493         invoke on a particular agent we must provide the agent.
1494
1495             target.RuntimeAgent.evaluate.invoke({options}, target.RuntimeAgent)
1496
1497         This is unfortunate but only needed in a handful of places right now.
1498
1499         (InspectorBackendClass.prototype._sendCommandToBackendWithCallback): Deleted.
1500         (InspectorBackendClass.prototype._sendCommandToBackendExpectingPromise): Deleted.
1501         (InspectorBackendClass.prototype._sendMessageToBackend): Deleted.
1502         (InspectorBackendClass.prototype._dispatchResponse): Deleted.
1503         (InspectorBackendClass.prototype._dispatchResponseToCallback): Deleted.
1504         (InspectorBackendClass.prototype._dispatchResponseToPromise): Deleted.
1505         (InspectorBackendClass.prototype._dispatchEvent): Deleted.
1506         (InspectorBackendClass.prototype._flushPendingScripts): Deleted.
1507         (InspectorBackend.Agent.prototype.get currentDispatchState): Deleted.
1508         (InspectorBackend.Command.prototype.deliverFailure): Deleted.
1509         * UserInterface/Protocol/Connection.js: Added.
1510         (InspectorBackend.Connection):
1511         (InspectorBackend.Connection.prototype.get target):
1512         (InspectorBackend.Connection.prototype.set target):
1513         (InspectorBackend.Connection.prototype.dispatch):
1514         (InspectorBackend.Connection.prototype.runAfterPendingDispatches):
1515         (InspectorBackend.Connection.prototype.sendMessageToBackend):
1516         (InspectorBackend.Connection.prototype._dispatchResponse):
1517         (InspectorBackend.Connection.prototype._dispatchResponseToCallback):
1518         (InspectorBackend.Connection.prototype._dispatchResponseToPromise):
1519         (InspectorBackend.Connection.prototype._dispatchEvent):
1520         (InspectorBackend.Connection.prototype._sendCommandToBackendWithCallback):
1521         (InspectorBackend.Connection.prototype._sendCommandToBackendExpectingPromise):
1522         (InspectorBackend.Connection.prototype._sendMessageToBackend):
1523         (InspectorBackend.Connection.prototype._flushPendingScripts):
1524         This extracts the Connection details into its own class.
1525         Although we make it appear as though a Target has a list of
1526         Agents, we actually have the Connection hold the list of Agents.
1527         Instead of cloning the entire Agent we just create a new object
1528         extended from the original Agent instance. This allows us to keep
1529         the same interface but just change the connection / dispatcher
1530         properties within the Agent.
1531
1532         (InspectorBackend.MainConnection):
1533         (InspectorBackend.MainConnection.prototype.sendMessageToBackend):
1534         (InspectorBackend.WorkerConnection):
1535         (InspectorBackend.WorkerConnection.sendMessageToBackend):
1536         Two different kinds of connections. One for the Main connection
1537         and one for Workers. Currently the list of agents we expose
1538         on a Worker Target/Connection is hardcoded.
1539
1540         * UserInterface/Models/ExecutionContext.js:
1541         (WebInspector.ExecutionContext):
1542         (WebInspector.ExecutionContext.prototype.get target):
1543         We may now have ExecutionContexts that mean a Page, Frames, and Workers.
1544         To do this we include the (target, executionContextId) tuple in this object.
1545         With this we have everything we need to evaluate JavaScript.
1546
1547         * UserInterface/Controllers/RuntimeManager.js:
1548         (WebInspector.RuntimeManager):
1549         (WebInspector.RuntimeManager.prototype.get activeExecutionContext):
1550         (WebInspector.RuntimeManager.prototype.set activeExecutionContext):
1551         (WebInspector.RuntimeManager.prototype.get defaultExecutionContextIdentifier): Deleted.
1552         (WebInspector.RuntimeManager.prototype.set defaultExecutionContextIdentifier): Deleted.
1553         Update from contextId to a full ExecutionContext object.
1554
1555         (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow.evalCallback):
1556         (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
1557         (WebInspector.RuntimeManager.prototype.saveResult):
1558         (WebInspector.RuntimeManager.prototype.getPropertiesForRemoteObject):
1559         (WebInspector.RuntimeManager.prototype._frameExecutionContextsCleared):
1560         * UserInterface/Controllers/FrameResourceManager.js:
1561         (WebInspector.FrameResourceManager.prototype.executionContextCreated):
1562         * UserInterface/Controllers/JavaScriptLogViewController.js:
1563         (WebInspector.JavaScriptLogViewController.prototype.consolePromptShouldCommitText):
1564         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
1565         Anywhere that wants to use the "activeExecutionContext" must use the
1566         specific RuntimeAgent tied to that ExecutionContext's Target.
1567
1568         * UserInterface/Models/PropertyDescriptor.js:
1569         (WebInspector.PropertyDescriptor.fromPayload):
1570         * UserInterface/Protocol/RemoteObject.js:
1571         (WebInspector.RemoteObject):
1572         (WebInspector.RemoteObject.createFakeRemoteObject):
1573         (WebInspector.RemoteObject.fromPrimitiveValue):
1574         (WebInspector.RemoteObject.fromPayload):
1575         (WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors):
1576         (WebInspector.RemoteObject.prototype.deprecatedGetDisplayableProperties):
1577         (WebInspector.RemoteObject.prototype.setPropertyValue):
1578         (WebInspector.RemoteObject.prototype.getCollectionEntries):
1579         (WebInspector.RemoteObject.prototype.releaseWeakCollectionEntries):
1580         (WebInspector.RemoteObject.prototype.callFunction):
1581         (WebInspector.RemoteObject.prototype.callFunctionJSON):
1582         (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptor.wrappedCallback):
1583         (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptor):
1584         (WebInspector.RemoteObject.prototype.release):
1585         (WebInspector.RemoteObject.prototype._getPropertyDescriptors):
1586         (WebInspector.RemoteObject.prototype._getPropertyDescriptorsResolver):
1587         (WebInspector.RemoteObject.prototype._deprecatedGetProperties):
1588         RemoteObject and related Model Objects now must be tied to a specific
1589         Target, because we need to know which Target it belongs to in order to
1590         interact with it further.
1591
1592         * UserInterface/Views/QuickConsole.js:
1593         (WebInspector.QuickConsole):
1594         (WebInspector.QuickConsole.prototype.get selectedExecutionContext):
1595         (WebInspector.QuickConsole.prototype.set selectedExecutionContext):
1596         (WebInspector.QuickConsole.prototype._executionContextPathComponentsToDisplay):
1597         (WebInspector.QuickConsole.prototype._rebuildExecutionContextPathComponents):
1598         (WebInspector.QuickConsole.prototype._framePageExecutionContextsChanged):
1599         (WebInspector.QuickConsole.prototype._frameExecutionContextsCleared):
1600         (WebInspector.QuickConsole.prototype._createExecutionContextPathComponent):
1601         (WebInspector.QuickConsole.prototype._createExecutionContextPathComponentFromFrame):
1602         (WebInspector.QuickConsole.prototype._compareExecutionContextPathComponents):
1603         (WebInspector.QuickConsole.prototype._insertOtherExecutionContextPathComponent):
1604         (WebInspector.QuickConsole.prototype._removeOtherExecutionContextPathComponent):
1605         (WebInspector.QuickConsole.prototype._insertExecutionContextPathComponentForFrame):
1606         (WebInspector.QuickConsole.prototype._removeExecutionContextPathComponentForFrame):
1607         (WebInspector.QuickConsole.prototype._targetAdded):
1608         (WebInspector.QuickConsole.prototype._targetRemoved):
1609         (WebInspector.QuickConsole.prototype._pathComponentSelected):
1610         (WebInspector.QuickConsole.prototype.get selectedExecutionContextIdentifier): Deleted.
1611         (WebInspector.QuickConsole.prototype.set selectedExecutionContextIdentifier): Deleted.
1612         (WebInspector.QuickConsole.prototype._defaultExecutionContextChanged): Deleted.
1613         Update the code from executionContextId to ExecutionContext objects.
1614         Update the picker with ExecutionContextPathComponent for Workers (new Targets).
1615         Generalize and cleanup the code to make it easier to follow.
1616
1617 2016-10-27  Joseph Pecoraro  <pecoraro@apple.com>
1618
1619         Web Inspector: Introduce Page WorkerAgent and Worker InspectorController
1620         https://bugs.webkit.org/show_bug.cgi?id=163817
1621         <rdar://problem/28899063>
1622
1623         Reviewed by Brian Burg.
1624
1625         * UserInterface/Main.html:
1626         * UserInterface/Test.html:
1627         New files.
1628
1629         * UserInterface/Base/Main.js:
1630         (WebInspector.loaded):
1631         * UserInterface/Test/Test.js:
1632         (WebInspector.loaded):
1633         New Observers and Managers.
1634
1635         * UserInterface/Protocol/WorkerObserver.js: Added.
1636         (WebInspector.WorkerObserver.prototype.workerCreated):
1637         (WebInspector.WorkerObserver.prototype.workerTerminated):
1638         (WebInspector.WorkerObserver.prototype.dispatchMessageFromWorker):
1639         (WebInspector.WorkerObserver):
1640         * UserInterface/Controllers/WorkerManager.js: Added.
1641         (WebInspector.WorkerManager):
1642         (WebInspector.WorkerManager.prototype.workerCreated):
1643         (WebInspector.WorkerManager.prototype.workerTerminated):
1644         (WebInspector.WorkerManager.prototype.dispatchMessageFromWorker):
1645         To be implemented with the first Worker agent implementation
1646         when there is actually something we can do with the Worker.
1647
1648 2016-10-25  Joseph Pecoraro  <pecoraro@apple.com>
1649
1650         Web Inspector: Cmd-+ doesn't "zoom in" to increase text size in the Web Inspector
1651         https://bugs.webkit.org/show_bug.cgi?id=163961
1652         <rdar://problem/28895308>
1653
1654         Reviewed by Brian Burg.
1655
1656         * UserInterface/Base/Main.js:
1657         (WebInspector.contentLoaded):
1658         Add a duplicate set of keyboard shortcuts for the Shift variants.
1659
1660 2016-10-25  Joseph Pecoraro  <pecoraro@apple.com>
1661
1662         Web Inspector: Remove dead code in FrameTreeElement
1663         https://bugs.webkit.org/show_bug.cgi?id=163914
1664
1665         Reviewed by Brian Burg.
1666
1667         * UserInterface/Views/FrameTreeElement.js:
1668
1669 2016-10-24  Devin Rousso  <dcrousso+webkit@gmail.com>
1670
1671         Web Inspector: Scope chain shouldn't show empty Closure sections
1672         https://bugs.webkit.org/show_bug.cgi?id=152348
1673
1674         Reviewed by Joseph Pecoraro.
1675
1676         * UserInterface/Controllers/DebuggerManager.js:
1677         (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload):
1678         * UserInterface/Models/ScopeChainNode.js:
1679         (WebInspector.ScopeChainNode):
1680         (WebInspector.ScopeChainNode.prototype.get empty):
1681         Added support for new empty property.
1682
1683         * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
1684         (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
1685         Only create and display a DetailsSection if the scope is not empty (via empty).
1686
1687 2016-10-24  Devin Rousso  <dcrousso+webkit@gmail.com>
1688
1689         Web Inspector: Improve Quick Open sorting algorithm
1690         https://bugs.webkit.org/show_bug.cgi?id=163705
1691
1692         Reviewed by Joseph Pecoraro.
1693
1694         * UserInterface/Models/ResourceQueryResult.js:
1695         (WebInspector.ResourceQueryResult.prototype._calculateRank.getMultiplier):
1696         (WebInspector.ResourceQueryResult.prototype._calculateRank):
1697         Added logic to multiply the ranking increment/decrement based on whether the current match
1698         is part of a sequence, whether that sequence began with a special character, and the length
1699         of the current sequence.
1700
1701 2016-10-19  Dean Jackson  <dino@apple.com>
1702
1703         Support CSS Shapes Level 1 without a prefix
1704         https://bugs.webkit.org/show_bug.cgi?id=163709
1705         <rdar://problem/28859369>
1706
1707         Reviewed by Myles Maxfield.
1708
1709         Replace -webkit-shape-outside with shape-outside.
1710
1711         * UserInterface/Models/CSSKeywordCompletions.js:
1712
1713 2016-10-19  Aaron Chu  <aaron_chu@apple.com>
1714
1715         Web Inspector: AXI: expose computed tree node and heading level
1716         https://bugs.webkit.org/show_bug.cgi?id=130825
1717         <rdar://problem/16442349>
1718
1719         Reviewed by Joseph Pecoraro.
1720
1721         Updating the Web Accessibility Inspector to display Heading Level and Hierarchical Level.
1722
1723         * Localizations/en.lproj/localizedStrings.js:
1724         * UserInterface/Models/DOMNode.js:
1725         (WebInspector.DOMNode.prototype.accessibilityProperties.accessibilityPropertiesCallback):
1726         (WebInspector.DOMNode.prototype.accessibilityProperties):
1727         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
1728         (WebInspector.DOMNodeDetailsSidebarPanel):
1729         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
1730         (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):
1731
1732 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
1733
1734         Web Inspector: Styles Sidebar highlights "translate" but not "translateX"
1735         https://bugs.webkit.org/show_bug.cgi?id=163613
1736         <rdar://problem/28829610>
1737
1738         Reviewed by Timothy Hatcher.
1739
1740         * UserInterface/Models/CSSCompletions.js:
1741         (WebInspector.CSSCompletions.requestCSSCompletions):
1742         The hash table objects we pass to CodeMirror expects keys to be lowercased.
1743
1744 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
1745
1746         Web Inspector: CSS Autocompletion sometimes adds extra unexpected characters
1747         https://bugs.webkit.org/show_bug.cgi?id=163612
1748         <rdar://problem/28829557>
1749
1750         Reviewed by Timothy Hatcher.
1751
1752         * UserInterface/Controllers/CodeMirrorCompletionController.js:
1753         (WebInspector.CodeMirrorCompletionController.prototype._generateCSSCompletions):
1754         Better handle completions in cases where we are in the middle of a property
1755         to avoid orphaned characters, or at the end of a function name to avoid creating
1756         duplicate parenthesis.
1757
1758 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
1759
1760         REGRESSION(r201171): Web Inspector: Timeline Recording playhead should always start immediately, not wait until first event
1761         https://bugs.webkit.org/show_bug.cgi?id=163583
1762         <rdar://problem/28815882>
1763
1764         Reviewed by Timothy Hatcher.
1765
1766         * UserInterface/Views/TimelineRecordingContentView.js:
1767         (WebInspector.TimelineRecordingContentView.prototype._startUpdatingCurrentTime):
1768         Revert logic change introduced by r201171 with no explanation.
1769         Whenever we get a start time we should use it, regardless of
1770         of what the current time is, precisely because the backend is
1771         informing us of the start time to use.
1772
1773 2016-10-17  Joseph Pecoraro  <pecoraro@apple.com>
1774
1775         Web Inspector: Add toggles for debugger pauses at console.assert failures
1776         https://bugs.webkit.org/show_bug.cgi?id=139542
1777         <rdar://problem/19281600>
1778
1779         Reviewed by Timothy Hatcher.
1780
1781         * UserInterface/Controllers/DebuggerManager.js:
1782         (WebInspector.DebuggerManager.prototype.get assertionsBreakpoint):
1783         (WebInspector.DebuggerManager.prototype.isBreakpointRemovable):
1784         (WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
1785         New breakpoint and toggling behavior.
1786
1787         * Localizations/en.lproj/localizedStrings.js:
1788         * UserInterface/Views/DebuggerSidebarPanel.js:
1789         (WebInspector.DebuggerSidebarPanel):
1790         (WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
1791         (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements.isSpecialBreakpoint):
1792         (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):
1793         New breakpoint tree element behavior.
1794
1795         (WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
1796         (WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
1797         Sidebar restoration if it was selected.
1798
1799         * UserInterface/Images/Assertion.svg: Added.
1800         * UserInterface/Images/gtk/Assertion.svg: Added.
1801         * UserInterface/Views/BreakpointTreeElement.css:
1802         (.breakpoint-assertion-icon .icon):
1803         New sidebar icon for the global breakpoint.
1804
1805 2016-10-15  Joseph Pecoraro  <pecoraro@apple.com>
1806
1807         Web Inspector: Cleanup parts of DebuggerManager
1808         https://bugs.webkit.org/show_bug.cgi?id=163400
1809
1810         Reviewed by Timothy Hatcher.
1811
1812         * UserInterface/Controllers/DebuggerManager.js:
1813         (WebInspector.DebuggerManager.restoreBreakpointsSoon):
1814
1815         (WebInspector.DebuggerManager.prototype.get paused):
1816         (WebInspector.DebuggerManager.prototype.get pauseReason):
1817         (WebInspector.DebuggerManager.prototype.get pauseData):
1818         (WebInspector.DebuggerManager.prototype.get callFrames):
1819         (WebInspector.DebuggerManager.prototype.get activeCallFrame):
1820         (WebInspector.DebuggerManager.prototype.set activeCallFrame):
1821         Put simple accessors at the top.
1822
1823         (WebInspector.DebuggerManager.prototype.get allExceptionsBreakpoint):
1824         (WebInspector.DebuggerManager.prototype.get allUncaughtExceptionsBreakpoint):
1825         (WebInspector.DebuggerManager.prototype.get breakpoints):
1826         (WebInspector.DebuggerManager.prototype.breakpointForIdentifier):
1827         (WebInspector.DebuggerManager.prototype.breakpointsForSourceCode):
1828         (WebInspector.DebuggerManager.prototype.isBreakpointRemovable):
1829         (WebInspector.DebuggerManager.prototype.isBreakpointEditable):
1830         (WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily):
1831         Group public breakpoint state and access methods.
1832
1833         (WebInspector.DebuggerManager.prototype.scriptForIdentifier):
1834         (WebInspector.DebuggerManager.prototype.scriptsForURL):
1835         (WebInspector.DebuggerManager.prototype.get searchableScripts):
1836         (WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
1837         Group public script access methods.
1838
1839         (WebInspector.DebuggerManager.prototype.pause):
1840         (WebInspector.DebuggerManager.prototype.resume):
1841         (WebInspector.DebuggerManager.prototype.stepOver):
1842         (WebInspector.DebuggerManager.prototype.stepInto):
1843         (WebInspector.DebuggerManager.prototype.stepOut):
1844         (WebInspector.DebuggerManager.prototype.continueToLocation):
1845         (WebInspector.DebuggerManager.prototype.addBreakpoint):
1846         (WebInspector.DebuggerManager.prototype.removeBreakpoint):
1847         Group and modernize public methods that perform actions.
1848
1849         (WebInspector.DebuggerManager.prototype.nextBreakpointActionIdentifier):
1850         Misc. methods.
1851
1852         (WebInspector.DebuggerManager.prototype.breakpointResolved):
1853         (WebInspector.DebuggerManager.prototype.reset):
1854         (WebInspector.DebuggerManager.prototype.playBreakpointActionSound):
1855         (WebInspector.DebuggerManager.prototype.scriptDidParse):
1856         (WebInspector.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
1857         (WebInspector.DebuggerManager.prototype._setBreakpoint):
1858         (WebInspector.DebuggerManager.prototype._breakpointEditablePropertyDidChange):
1859         (WebInspector.DebuggerManager.prototype._updateBreakOnExceptionsState):
1860         (WebInspector.DebuggerManager.prototype._associateBreakpointsWithSourceCode):
1861         Minor cleanup in protected and private methods.
1862
1863         * UserInterface/Models/BreakpointAction.js:
1864         (WebInspector.BreakpointAction):
1865         Getting the next identifier is an action so it should be a function call.
1866
1867         * UserInterface/Views/SourceCodeTextEditor.js:
1868         (WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointAdded):
1869         Remove unused parameter.
1870
1871 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
1872
1873         Web Inspector: Dragging to delete a Breakpoint should never trigger a ContentView change
1874         https://bugs.webkit.org/show_bug.cgi?id=163403
1875         <rdar://problem/28762930>
1876
1877         Reviewed by Timothy Hatcher.
1878
1879         * UserInterface/Views/BreakpointTreeElement.js:
1880         (WebInspector.BreakpointTreeElement.prototype.ondelete):
1881         Signal when a breakpoint tree element will be going away because it was
1882         deleted via the keyboard operation within the TreeOutline. This is a dirty
1883         way to do the signal but we remove BreakpointTreeElements asynchronously
1884         when the Breakpoint actually gets removed from the backend.
1885
1886         * UserInterface/Views/DebuggerSidebarPanel.js:
1887         (WebInspector.DebuggerSidebarPanel.prototype._removeDebuggerTreeElement):
1888         Deselect a BreakpointTreeElement if it was deleted in a way other then
1889         the delete keyboard shortcut. This ensures another TreeElement selection
1890         doesn't force ContentView changes.
1891
1892 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
1893
1894         Web Inspector: Improve debugger highlight when inside of getter/setter calls
1895         https://bugs.webkit.org/show_bug.cgi?id=163428
1896         <rdar://problem/28769061>
1897
1898         Reviewed by Timothy Hatcher.
1899
1900         * UserInterface/Views/SourceCodeTextEditor.js:
1901         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
1902         When in the middle of a member expression at a '.' or '[' get the best member
1903         expression range.
1904
1905         * UserInterface/Views/TextEditor.js:
1906         (WebInspector.TextEditor.prototype._updateExecutionRangeHighlight):
1907         Include the character at the current position. This is useful since AST Nodes
1908         don't give us token info but we would like to know if we are at particular tokens.
1909
1910 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
1911
1912         Web Inspector: Unused Breakpoint getter/setter for "id" - should be "identifier"
1913         https://bugs.webkit.org/show_bug.cgi?id=163395
1914
1915         Reviewed by Timothy Hatcher.
1916
1917         * UserInterface/Models/Breakpoint.js:
1918         (WebInspector.Breakpoint.prototype.get identifier): Renamed.
1919         (WebInspector.Breakpoint.prototype.set identifier): Renamed.
1920         The only user is DebuggerManager which sets and gets. Previously
1921         it was unexpectedly setting a direct property on the Breakpoint
1922         instead of using these methods to set the member variable.
1923
1924 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
1925
1926         Web Inspector: Remove uses of delete in SourceCodeTextEditor
1927         https://bugs.webkit.org/show_bug.cgi?id=163379
1928
1929         Reviewed by Timothy Hatcher.
1930
1931         Remove uses of delete and better group member variables.
1932         One of the deletes was deleting an incorrect property.
1933
1934         * UserInterface/Views/SourceCodeTextEditor.js:
1935         (WebInspector.SourceCodeTextEditor):
1936         (WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointAdded):
1937         (WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointRemoved):
1938         (WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointMoved):
1939         (WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedMarkedExpression):
1940         (WebInspector.SourceCodeTextEditor.prototype._dismissEditingController):
1941         (WebInspector.SourceCodeTextEditor.prototype.editingControllerDidFinishEditing):
1942
1943 2016-10-14  Joseph Pecoraro  <pecoraro@apple.com>
1944
1945         Uncaught Exception: TypeError: this.positionToOffset is not a function - seen hovering expressions with Type Profiler enabled
1946         https://bugs.webkit.org/show_bug.cgi?id=163405
1947         <rdar://problem/28763953>
1948
1949         Reviewed by Matt Baker.
1950
1951         * UserInterface/Views/SourceCodeTextEditor.js:
1952         Use correct method name, the old one must have gone away.
1953
1954 2016-10-12  Joseph Pecoraro  <pecoraro@apple.com>
1955
1956         Web Inspector: Improve support for logging Proxy objects in console
1957         https://bugs.webkit.org/show_bug.cgi?id=163323
1958         <rdar://problem/28432553>
1959
1960         Reviewed by Timothy Hatcher.
1961
1962         * UserInterface/Views/ConsoleMessageView.js:
1963         (WebInspector.ConsoleMessageView.prototype._formatParameter):
1964         Treat a Proxy like any other object.
1965
1966 2016-10-12  Joseph Pecoraro  <pecoraro@apple.com>
1967
1968         Emit DebugHooks uniformly with pause locations instead of having separate pause locations and op_debug emits
1969         https://bugs.webkit.org/show_bug.cgi?id=162809
1970
1971         Reviewed by Geoffrey Garen.
1972
1973         * UserInterface/Views/SourceCodeTextEditor.js:
1974         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
1975         When pausing on the variable assignment inside for..of and for..in don't just
1976         highlight "var foo" but include the right hand side "var foo in ..." or
1977         "var foo of ...".
1978
1979 2016-10-12  Joseph Pecoraro  <pecoraro@apple.com>
1980
1981         Web Inspector: Whole program sometimes highlighted instead of just first statement
1982         https://bugs.webkit.org/show_bug.cgi?id=163300
1983         <rdar://problem/28723162>
1984
1985         Reviewed by Timothy Hatcher.
1986
1987         * UserInterface/Views/SourceCodeTextEditor.js:
1988         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
1989         Avoid highlighting the entire program by skipping a Program type Node.
1990
1991         * UserInterface/Views/TextEditor.js:
1992         (WebInspector.TextEditor.prototype.setExecutionLineAndColumn):
1993         Avoid unnecessary work before content has loaded.
1994
1995         (WebInspector.TextEditor.prototype.currentPositionToOriginalOffset):
1996         Avoid unnecessary indirection to get the CodeMirror editor.
1997
1998 2016-10-11  Joseph Pecoraro  <pecoraro@apple.com>
1999
2000         Web Inspector: Remove line highlight on primary execution line while stepping because it is distracting
2001         https://bugs.webkit.org/show_bug.cgi?id=163294
2002         <rdar://problem/28721176>
2003
2004         Reviewed by Timothy Hatcher.
2005
2006         * UserInterface/Views/TextEditor.js:
2007         (WebInspector.TextEditor.prototype._updateExecutionLine):
2008         When setting the primary execution line, remove default line highlights.
2009
2010 2016-10-10  Matt Baker  <mattbaker@apple.com>
2011
2012         Web Inspector: Revealed line not highlighted in TextEditor while debugger paused
2013         https://bugs.webkit.org/show_bug.cgi?id=163197
2014
2015         Reviewed by Timothy Hatcher.
2016
2017         * UserInterface/Views/TextEditor.js:
2018         (WebInspector.TextEditor.prototype.revealPosition.revealAndHighlightLine):
2019         Avoid highlighting the execution line while debugging, but allow
2020         other lines to be highlighted.
2021
2022 2016-10-06  Devin Rousso  <dcrousso+webkit@gmail.com>
2023
2024         Inspector exception in `parseTextForRule()` when pasting into CSS rule selector
2025         https://bugs.webkit.org/show_bug.cgi?id=162792
2026
2027         Reviewed by Matt Baker.
2028
2029         * UserInterface/Views/CSSStyleDeclarationSection.js:
2030         (WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste.parseTextForRule):
2031         Changed regular expression for matching CSS rules to allow newlines in pasted text.
2032
2033 2016-10-02  Devin Rousso  <dcrousso+webkit@gmail.com>
2034
2035         Web Inspector: Clicking twice on the color swatch square should hide the color picker
2036         https://bugs.webkit.org/show_bug.cgi?id=162759
2037
2038         Reviewed by Matt Baker.
2039
2040         * UserInterface/Views/InlineSwatch.js:
2041         (WebInspector.InlineSwatch):
2042         (WebInspector.InlineSwatch.prototype.didDismissPopover):
2043         (WebInspector.InlineSwatch.prototype._swatchElementClicked):
2044         Remove the "click" event listener when a popover is presented to prevent improper
2045         interaction.  Add the event listener back when the popover is dismissed.
2046
2047 2016-10-02  Matt Baker  <mattbaker@apple.com>
2048
2049         Web Inspector: Exception thrown when hovering network waterfall graphs during reload
2050         https://bugs.webkit.org/show_bug.cgi?id=162850
2051         <rdar://problem/28579653>
2052
2053         Reviewed by Brian Burg.
2054
2055         * UserInterface/Views/ResourceTimelineDataGridNode.js:
2056         (WebInspector.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar):
2057         Check that the node's data grid reference is valid before use.
2058         (WebInspector.ResourceTimelineDataGridNode):
2059
2060 2016-10-01  Joseph Pecoraro  <pecoraro@apple.com>
2061
2062         Web Inspector: Selection does not show up over execution highlight ranges
2063         https://bugs.webkit.org/show_bug.cgi?id=162844
2064         <rdar://problem/28579121>
2065
2066         Reviewed by Matt Baker.
2067
2068         * Scripts/update-codemirror-resources.rb:
2069         * UserInterface/External/CodeMirror/mark-selection.js: Added.
2070         * UserInterface/Main.html:
2071         New add-on that makes selection a text marker so it can be styled
2072         at the same level as other text markers.
2073
2074         * UserInterface/Views/TextEditor.css:
2075         (.text-editor > .CodeMirror .execution-range-highlight:not(.CodeMirror-selectedtext)):
2076         Don't use execution-range-highlight styles if the text is selected.
2077
2078         * UserInterface/Views/TextEditor.js:
2079         (WebInspector.TextEditor):
2080         Enable the text selection as text markers addon.
2081
2082 2016-09-30  Joseph Pecoraro  <pecoraro@apple.com>
2083
2084         Web Inspector: Make debugger stepping highlights work in inline <script>s
2085         https://bugs.webkit.org/show_bug.cgi?id=162753
2086         <rdar://problem/28551332>
2087
2088         Reviewed by Brian Burg.
2089
2090         * UserInterface/Models/TextRange.js:
2091         (WebInspector.TextRange.prototype.contains):
2092         Check if a given line/column falls within this range.
2093
2094         * UserInterface/Views/SourceCodeTextEditor.js:
2095         (WebInspector.SourceCodeTextEditor.prototype._getAssociatedScript):
2096         If we are in a Document resource find the associated script at a given position.
2097
2098         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
2099         When comparing offsets to SyntaxTree offsets, the SyntaxTree's offset of 0 is the
2100         first character of the Script, which differs from the current SourceCode's offset.
2101         Adjust the offset by the Script's startOffset.
2102
2103         * UserInterface/Views/TextEditor.js:
2104         (WebInspector.TextEditor.prototype.currentPositionToOriginalPosition):
2105         (WebInspector.TextEditor.prototype._updateExecutionRangeHighlight):
2106         Pass both the original offset and original position to the delegate.
2107
2108 2016-09-30  Joseph Pecoraro  <pecoraro@apple.com>
2109
2110         Web Inspector: Stepping through `a(); b(); c();` it is unclear where we are and what is about to execute
2111         https://bugs.webkit.org/show_bug.cgi?id=161658
2112         <rdar://problem/28181254>
2113
2114         Reviewed by Geoffrey Garen.
2115
2116         * UserInterface/Models/Script.js:
2117         (WebInspector.Script.prototype.requestScriptSyntaxTree):
2118         Fix first calls to requestScriptSyntaxTree. They were getting an uncaught
2119         exception because the content argument was missing.
2120
2121         * UserInterface/Models/ScriptSyntaxTree.js:
2122         (WebInspector.ScriptSyntaxTree.prototype.containersOfOffset):
2123         Find all AST nodes that contain a particular offset.
2124
2125         * UserInterface/Views/SourceCodeTextEditor.js:
2126         (WebInspector.SourceCodeTextEditor):
2127         (WebInspector.SourceCodeTextEditor.prototype.close):
2128         (WebInspector.SourceCodeTextEditor.prototype._activeCallFrameDidChange):
2129         (WebInspector.SourceCodeTextEditor.prototype._activeCallFrameSourceCodeLocationChanged):
2130         (WebInspector.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
2131         Provide a good highlight range for a given offset. This is normally the start
2132         of a statement/expression, inside a statement/expression, or the closing brace
2133         of a function (leaving a function). Provide good ranges for each of these.
2134
2135         * UserInterface/Views/TextEditor.js:
2136         (WebInspector.TextEditor):
2137         (WebInspector.TextEditor.set string.update):
2138         (WebInspector.TextEditor.prototype.set string):
2139         (WebInspector.TextEditor.prototype.setExecutionLineAndColumn):
2140         (WebInspector.TextEditor.prototype.revealPosition.revealAndHighlightLine):
2141         (WebInspector.TextEditor.prototype.revealPosition):
2142         (WebInspector.TextEditor.prototype.currentPositionToOriginalOffset):
2143         (WebInspector.TextEditor.prototype._updateAfterFormatting):
2144         (WebInspector.TextEditor.prototype.set executionLineNumber): Deleted.
2145         (WebInspector.TextEditor.prototype.set executionColumnNumber): Deleted.
2146         (WebInspector.TextEditor.prototype._updateExecutionLine.update): Deleted.
2147         Always set the execution line and column together, to simplify how we update highlights.
2148
2149         (WebInspector.TextEditor.prototype._clearMultilineExecutionLineHighlights):
2150         (WebInspector.TextEditor.prototype._updateExecutionLine):
2151         When updating the main highlight clear any multi-line highlights.
2152
2153         (WebInspector.TextEditor.prototype._updateExecutionRangeHighlight):
2154         Ask the delegate for a specific highlight range. If provided use that range,
2155         otherwise just highlight the end of the line. Once we know the range, if it
2156         is multiple lines, give the extra lines the full line highlight as well.
2157         Also make adjustments, such as not highlighting trailing whitespace.
2158
2159         * UserInterface/Views/TextEditor.css:
2160         (.text-editor > .CodeMirror .execution-line.primary .CodeMirror-linenumber::after):
2161         (.text-editor > .CodeMirror .execution-line):
2162         (.text-editor > .CodeMirror .execution-line .CodeMirror-matchingbracket):
2163         (.text-editor > .CodeMirror .execution-range-highlight):
2164         Styles for execution lines and execution range highlights.
2165
2166 2016-09-29  Aaron Chu  <aaron_chu@apple.com>
2167
2168         Web Inspector: AXI: linkified refs to #document and #text are not usually navigable nodes; consider delinkifying them
2169         https://bugs.webkit.org/show_bug.cgi?id=130600
2170         <rdar://problem/16391333>
2171
2172         Reviewed by Brian Burg.
2173
2174         Removing link style for non-navigable nodes by first
2175         checking nodeType of the node.
2176
2177         * UserInterface/Base/DOMUtilities.js:
2178         (WebInspector.linkifyNodeReference):
2179
2180 2016-09-27  Matt Baker  <mattbaker@apple.com>
2181
2182         Web Inspector: Refreshing while in Timelines-tab causes negative timestamps in Network-tab
2183         https://bugs.webkit.org/show_bug.cgi?id=160051
2184         <rdar://problem/27480122>
2185
2186         Reviewed by Brian Burg.
2187
2188         * UserInterface/Views/NetworkGridContentView.js:
2189         (WebInspector.NetworkGridContentView.prototype.get startTime):
2190         (WebInspector.NetworkGridContentView.prototype.get zeroTime):
2191         Use the cached start time for graph data source properties instead of
2192         relying on the ruler, which requires a layout in order to be updated
2193         for the first time.
2194
2195 2016-09-27  Matt Baker  <mattbaker@apple.com>
2196
2197         Web Inspector: Unfocusing / Focusing inspector window should not change ContentView
2198         https://bugs.webkit.org/show_bug.cgi?id=162572
2199         <rdar://problem/28479562>
2200
2201         Reviewed by Brian Burg.
2202
2203         Improve NavigationSidebarPanel logic for coordinating selection between trees.
2204         When tree selection changes, the most recent selection should be restored
2205         the next time the tree is focused.
2206
2207         The sidebar should also handle focusing a tree for the first time, in
2208         which no previous selection exists, and focusing a tree that has had its
2209         previous selection filtered out (hidden).
2210
2211         * UserInterface/Views/NavigationSidebarPanel.js:
2212         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineDidFocus):
2213         (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
2214         Restoring the last deselected element, instead of the last selected element
2215         only works when the selection is moving from one tree to another. When
2216         the elements belong to the same tree the newly selected element won't
2217         be saved until the next selection change. If the window loses and regains
2218         the focus before then, the tree will restore the previous selection,
2219         effectively reverting the last selection change.
2220
2221 2016-09-27  Tomas Popela  <tpopela@redhat.com>
2222
2223         [GTK] Mac defaults are used for key shortcuts on Linux
2224         https://bugs.webkit.org/show_bug.cgi?id=162564
2225
2226         Don't set Mac's default keymap as a fallthrough for CodeMirror when we
2227         are not on Mac.
2228
2229         Reviewed by Carlos Garcia Campos.
2230
2231         * UserInterface/Test.html: Include Platform.js for the
2232         WebInspector.Platform definition.
2233         * UserInterface/Views/CodeMirrorAdditions.js:
2234
2235 2016-09-26  Matt Baker  <mattbaker@apple.com>
2236
2237         Web Inspector: Box Model values not updated when DOM node styles change
2238         https://bugs.webkit.org/show_bug.cgi?id=162525
2239
2240         Reviewed by Brian Burg.
2241
2242         The Box Model section should refresh itself when the selected node's
2243         computed style changes. This is necessary since the Styles sidebar
2244         doesn't always refresh its sections on node changes.
2245
2246         * UserInterface/Views/BoxModelDetailsSectionRow.js:
2247         (WebInspector.BoxModelDetailsSectionRow.prototype.set nodeStyles):
2248         Refresh metrics whenever the computed style changes.
2249
2250         (WebInspector.BoxModelDetailsSectionRow.prototype._getBox):
2251         (WebInspector.BoxModelDetailsSectionRow.prototype._getComponentSuffix):
2252         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createValueElement):
2253         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement):
2254         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement):
2255         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics):
2256         Drive-by cleanup to make this large function easier to read.
2257         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createElement): Deleted.
2258         Renamed createValueElement.
2259         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaWidthElement): Deleted.
2260         (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaHeightElement): Deleted.
2261         Combined these into a single function taking a property name (width or height).
2262
2263 == Rolled over to ChangeLog-2016-09-26 ==