1 2015-12-10 Matt Baker <mattbaker@apple.com>
3 Web Inspector: debugger popover should have source location link when showing function source
4 https://bugs.webkit.org/show_bug.cgi?id=151866
6 Reviewed by Brian Burg.
8 Added source code location link to function popover header.
10 * UserInterface/Views/SourceCodeTextEditor.js:
11 (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
12 Create source code location link from response payload.
13 (WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction):
15 2015-12-10 Nikita Vasilyev <nvasilyev@apple.com>
17 Web Inspector: [Meta] Unify z-index values in Inspector's CSS
18 https://bugs.webkit.org/show_bug.cgi?id=151978
20 Introduce CSS variables for z-index due to recurring issues with incorrectly overlapping elements.
22 From now on, all z-index values >= 64 must be defined as variables.
23 Values below 64 must not.
25 Reviewed by Timothy Hatcher.
27 * UserInterface/Views/Variables.css:
29 Introduce z-index variables.
31 * UserInterface/Debug/UncaughtExceptionReporter.css:
33 * UserInterface/Views/BoxModelDetailsSectionRow.css:
34 (.details-section .row.box-model .editing):
35 * UserInterface/Views/CompletionSuggestionsView.css:
36 (.completion-suggestions):
37 * UserInterface/Views/DashboardContainerView.css:
38 (.dashboard-container .advance-arrow):
39 * UserInterface/Views/DataGrid.css:
40 (.data-grid .resizer):
41 * UserInterface/Views/DetailsSection.css:
42 (.details-section > .header):
43 (.details-section .details-section > .header):
44 * UserInterface/Views/FindBanner.css:
46 (.find-banner > button.segmented:active):
47 * UserInterface/Views/Main.css:
51 * UserInterface/Views/Popover.css:
53 * UserInterface/Views/Resizer.css:
55 (.glass-pane-for-drag):
56 * UserInterface/Views/TimelineOverview.css:
57 (.timeline-overview > .scroll-container):
58 * UserInterface/Views/VisualStyleSelectorSection.css:
59 (.details-section.visual-style-selector-section > .content > .selectors > .selector-list > .section-divider):
61 2015-12-09 Matt Baker <mattbaker@apple.com>
63 Web Inspector: when a marked-dirty subview is attached to a parent View, dirtyDescendantsCount gets out of sync
64 https://bugs.webkit.org/show_bug.cgi?id=151876
66 Reviewed by Brian Burg.
68 * UserInterface/Base/Main.js:
69 Use root view singleton instead of creating it explicitly.
71 * UserInterface/Views/View.js:
73 (WebInspector.View.rootView):
74 Singleton root view access. Lazily create and return a view backed
75 by the document's body element.
76 (WebInspector.View.prototype.isDescendantOf):
77 (WebInspector.View.prototype.insertSubviewBefore):
78 (WebInspector.View.prototype.removeSubview):
79 (WebInspector.View.prototype.didMoveToWindow):
80 Notify the view when it becomes, or is no longer, descended from the root view.
81 (WebInspector.View.prototype.didMoveToParent):
82 Notify the view when it's added to, or removed from, a parent view.
83 (WebInspector.View._scheduleLayoutForView):
84 (WebInspector.View._cancelScheduledLayoutForView):
85 (WebInspector.View.prototype.makeRootView): Deleted.
87 (WebInspector.View.prototype.didAttach): Deleted.
88 (WebInspector.View.prototype.didDetach): Deleted.
89 Replaced by didMoveToParent.
91 2015-12-09 Brian Burg <bburg@apple.com>
93 Web Inspector: control whether to collect and dump protocol messages using a WebInspector.Setting
94 https://bugs.webkit.org/show_bug.cgi?id=151635
96 Reviewed by Timothy Hatcher.
98 When closing and reopening the inspector, the setting for whether
99 to dump protocol messages should be persisted. Otherwise, enabling
100 dumping from the debug-only UI will miss the initial flood of
101 messages that are processed when the Inspector loads initial data.
103 To support a persistent setting, and build some infrastructure for
104 more advanced uses of collected protocol messages, this patch adds
105 a new object to trace protocol events. It gets callbacks for each
106 and implements the console-dumping functionality previously baked in
109 In follow-up patches, other protocol tracers will be added to save
110 protocol data to disk, marshall it to a higher inspection level,
111 or provide more fine-grained control over what is logged.
113 This change moves Setting.js into the Base/ directory,
114 since it is used by Views, Models, and now Protocol classes.
116 * UserInterface/Base/Setting.js: Renamed from Source/WebInspectorUI/UserInterface/Models/Setting.js.
117 (WebInspector.Setting):
118 (WebInspector.Setting.prototype.get name):
119 (WebInspector.Setting.prototype.get value):
120 (WebInspector.Setting.prototype.set value):
121 * UserInterface/Main.html:
122 * UserInterface/Protocol/InspectorBackend.js:
123 (InspectorBackendClass):
124 (InspectorBackendClass.prototype.set dumpInspectorProtocolMessages):
125 (InspectorBackendClass.prototype.get dumpInspectorProtocolMessages):
127 We still want to support the legacy way to enable dumping:
128 `InspectorBackend.dumpInspectorProtocolMessages = true`. This
129 is because some tests always use it, and it's easier to set this
130 flag in a custom Bootstrap.js file than to configure the Setting.
132 (InspectorBackendClass.prototype.set dumpInspectorTimeStats):
133 (InspectorBackendClass.prototype.get dumpInspectorTimeStats):
135 We still want to support the legacy way to enable dumping:
136 `InspectorBackend.dumpInspectorTimeStats = true`. This is
137 because MessageDispatcher checks this flag for its logging.
139 (InspectorBackendClass.prototype.set activeTracer):
140 (InspectorBackendClass.prototype.get activeTracer):
142 Set the active tracer, finalizing and removing any active tracer
143 if one exists. If removing a custom tracer (setting to null), then
144 re-sync activeTracer with the automatic tracing Setting.
146 (InspectorBackendClass.prototype.dispatch):
147 (InspectorBackendClass.prototype._startOrStopAutomaticTracing):
149 Sync the Setting with activeTracer. If an custom tracer is active,
150 don't replace it with the automatic logging tracer.
152 (InspectorBackendClass.prototype._sendCommandToBackendWithCallback):
153 (InspectorBackendClass.prototype._sendCommandToBackendExpectingPromise):
154 (InspectorBackendClass.prototype._sendMessageToBackend):
155 (InspectorBackendClass.prototype._dispatchResponse):
156 (InspectorBackendClass.prototype._dispatchEvent):
157 (InspectorBackendClass.prototype._flushPendingScripts):
158 * UserInterface/Protocol/LoggingProtocolTracer.js: Added.
159 (WebInspector.LoggingProtocolTracer):
160 (WebInspector.LoggingProtocolTracer.prototype.set dumpMessagesToConsole):
161 (WebInspector.LoggingProtocolTracer.prototype.get dumpMessagesToConsole):
162 (WebInspector.LoggingProtocolTracer.prototype.set dumpTimingDataToConsole):
163 (WebInspector.LoggingProtocolTracer.prototype.get dumpTimingDataToConsole):
164 (WebInspector.LoggingProtocolTracer.prototype.logFrontendException):
165 (WebInspector.LoggingProtocolTracer.prototype.logProtocolError):
166 (WebInspector.LoggingProtocolTracer.prototype.logFrontendRequest):
167 (WebInspector.LoggingProtocolTracer.prototype.logWillHandleResponse):
168 (WebInspector.LoggingProtocolTracer.prototype.logDidHandleResponse):
169 (WebInspector.LoggingProtocolTracer.prototype.logWillHandleEvent):
170 (WebInspector.LoggingProtocolTracer.prototype.logDidHandleEvent):
171 (WebInspector.LoggingProtocolTracer.prototype._processEntry):
172 * UserInterface/Protocol/ProtocolTracer.js: Added.
173 (WebInspector.ProtocolTracer.prototype.logStarted):
174 (WebInspector.ProtocolTracer.prototype.logFrontendException):
175 (WebInspector.ProtocolTracer.prototype.logProtocolError):
176 (WebInspector.ProtocolTracer.prototype.logFrontendRequest):
177 (WebInspector.ProtocolTracer.prototype.logWillHandleResponse):
178 (WebInspector.ProtocolTracer.prototype.logDidHandleResponse):
179 (WebInspector.ProtocolTracer.prototype.logWillHandleEvent):
180 (WebInspector.ProtocolTracer.prototype.logDidHandleEvent): (WebInspector.ProtocolTracer.prototype.logFinished):
181 (WebInspector.ProtocolTracer):
182 * UserInterface/Test.html:
184 2015-12-09 Brian Burg <bburg@apple.com>
186 Web Inspector: zoom with Ctrl +/- doesn't work correctly when inspector is docked
187 https://bugs.webkit.org/show_bug.cgi?id=152076
189 Reviewed by Timothy Hatcher.
191 When computing the new width or height of the inspector, take the zoom level into
192 account. window.inner{Width,Height} are in document pixels, but we need to specify
193 device pixels to InspectorFrontendHost.
195 * UserInterface/Base/Main.js:
197 2015-12-08 Joseph Pecoraro <pecoraro@apple.com>
199 Web Inspector: Workaround arrow function issue in TimelineOverviewGraph.js
200 https://bugs.webkit.org/show_bug.cgi?id=152031
202 Reviewed by Timothy Hatcher.
204 * UserInterface/Views/TimelineOverviewGraph.js:
205 (WebInspector.TimelineOverviewGraph.prototype._needsSelectedRecordLayout):
206 Workaround an existing arrow function issue by moving off of arrow functions here.
208 2015-12-08 Matt Baker <mattbaker@apple.com>
210 Web Inspector: Add a hidden property to TreeOutline
211 https://bugs.webkit.org/show_bug.cgi?id=152014
213 Reviewed by Timothy Hatcher.
215 * UserInterface/Views/NavigationSidebarPanel.js:
216 Removed static property for "hidden" CSS class. No longer used.
217 (WebInspector.NavigationSidebarPanel.prototype.set contentTreeOutline):
218 Fixed bug in order of visibleTreeOutlines add/remove.
219 (WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
221 * UserInterface/Views/TimelineSidebarPanel.js:
222 (WebInspector.TimelineSidebarPanel):
223 (WebInspector.TimelineSidebarPanel.prototype._changeViewMode):
225 * UserInterface/Views/TreeOutline.js:
226 (WebInspector.TreeOutline):
227 (WebInspector.TreeOutline.prototype.get hidden):
228 (WebInspector.TreeOutline.prototype.set hidden):
229 Added hidden property, set DOM element hidden attribute.
230 (WebInspector.TreeElement.prototype.set hidden):
231 Remove CSS class, set DOM element hidden attribute.
232 (WebInspector.TreeElement.prototype._attach):
233 (WebInspector.TreeElement.prototype.expand):
235 2015-12-08 Matt Baker <mattbaker@apple.com>
237 Web Inspector: Global Breakpoints should always be visible
238 https://bugs.webkit.org/show_bug.cgi?id=151066
240 Reviewed by Timothy Hatcher.
242 * UserInterface/Views/DebuggerSidebarPanel.js:
243 (WebInspector.DebuggerSidebarPanel):
244 Turn off filtering for Global Breakpoints elements.
246 * UserInterface/Views/NavigationSidebarPanel.js:
247 (WebInspector.NavigationSidebarPanel.prototype.suppressFilteringOnTreeElements):
248 Allow filtering to be turned off for specific tree elements.
249 (WebInspector.NavigationSidebarPanel.prototype.applyFiltersToTreeElement):
250 Make element visible if filtering suppressed.
251 (WebInspector.NavigationSidebarPanel.prototype._checkForEmptyFilterResults):
252 Visible elements with filtering disabled aren't considered when
253 showing/hiding the empty content placeholder.
255 2015-12-07 Brian Burg <bburg@apple.com>
257 Web Inspector: Uncaught Exception page should have better styles and handle more error cases
258 https://bugs.webkit.org/show_bug.cgi?id=151923
260 Reviewed by Timothy Hatcher.
262 Restructure the Uncaught Exception reporting page to act more like
263 a modal sheet. Distinguish between uncaught exceptions before and
264 after the frontend is initially loaded. If the frontend is loaded,
265 add a clickable link that dismisses the sheet and ignores the error.
266 If the inspector finished loading, then only show at most one
267 exception at a time, since subsequent interactions can cause spurious
268 errors when the sheet is active.
270 Split existing code into multiple functions so it's easier to follow.
271 Add miscellaneous guards against internal corruption and weird cases.
273 * UserInterface/Base/Main.js:
274 (WebInspector.contentLoaded): Store the flag on the global object
275 in case WebInspector becomes shadowed or otherwise unusable.
277 * UserInterface/Debug/UncaughtExceptionReporter.css: Renamed from Source/WebInspectorUI/UserInterface/Debug/CatchEarlyErrors.css.
278 (div.sheet-container):
279 (div.uncaught-exception-sheet):
280 (div.uncaught-exception-sheet a):
281 (div.uncaught-exception-sheet a:active):
282 (div.uncaught-exception-sheet h2):
283 (div.uncaught-exception-sheet h1 > img):
284 (div.uncaught-exception-sheet h2 > img):
285 (div.uncaught-exception-sheet dl):
286 (div.uncaught-exception-sheet dt):
287 (div.uncaught-exception-sheet dd):
288 (div.uncaught-exception-sheet ul):
289 (div.uncaught-exception-sheet li):
290 * UserInterface/Debug/UncaughtExceptionReporter.js: Renamed from CatchEarlyErrors.js.
291 (stopEventPropagation): Allow clicking whitelisted links on the sheet.
292 (blockEventHandlers):
293 (unblockEventHandlers):
294 (handleUncaughtException):
296 (createErrorSheet.insertWordBreakCharacters):
299 * UserInterface/Main.html:
300 * UserInterface/Protocol/MessageDispatcher.js:
301 (WebInspector.dispatchMessageFromBackend): Don't try to dispatch
302 messages from the backend when showing the error sheet. They will
303 probably fail, so suspend dispatching until the sheet is dismissed.
305 2015-12-06 Devin Rousso <dcrousso+webkit@gmail.com>
307 Web Inspector: Regression (r192936) - changing selectors in the visual styles sidebar is broken
308 https://bugs.webkit.org/show_bug.cgi?id=151924
310 Reviewed by Brian Burg.
312 * UserInterface/Views/VisualStyleSelectorSection.js:
313 (WebInspector.VisualStyleSelectorSection):
314 (WebInspector.VisualStyleSelectorSection.prototype._selectorChanged):
315 Now uses an event listener instead of an "onselect" function.
317 2015-12-06 Matt Baker <mattbaker@apple.com>
319 Web Inspector: Comparisons in setters should use the massaged value (" = x || 0/false/null/etc")
320 https://bugs.webkit.org/show_bug.cgi?id=151910
322 Reviewed by Timothy Hatcher.
324 Updated setters that use default values to convert falsy inputs to the default value
325 before compariing against the current value.
327 * UserInterface/Models/TimelineMarker.js:
328 (WebInspector.TimelineMarker.prototype.set time):
329 Assert new value is a number.
331 * UserInterface/Views/DataGrid.js:
332 (WebInspector.DataGridNode.prototype.set hidden):
333 (WebInspector.DataGridNode.prototype.set data):
334 Assert new value is of type object. Use shallowEqual compare before setting value.
336 * UserInterface/Views/GeneralTreeElement.js:
337 (WebInspector.GeneralTreeElement.prototype.set classNames):
338 Use shallowEqual compare before setting value.
339 (WebInspector.GeneralTreeElement.prototype.set mainTitle):
340 (WebInspector.GeneralTreeElement.prototype.set subtitle):
341 (WebInspector.GeneralTreeElement.prototype.set status):
342 (WebInspector.GeneralTreeElement.prototype.set tooltipHandledSeparately):
344 * UserInterface/Views/TimelineOverview.js:
345 (WebInspector.TimelineOverview.prototype.set startTime):
346 (WebInspector.TimelineOverview.prototype.set currentTime):
347 (WebInspector.TimelineOverview.prototype.set endTime):
348 (WebInspector.TimelineOverview.prototype.set scrollStartTime):
349 (WebInspector.TimelineOverview.prototype.set selectionStartTime):
350 Check current ruler selectionStartTime before setting value.
352 * UserInterface/Views/TimelineOverviewGraph.js:
353 (WebInspector.TimelineOverviewGraph.prototype.set zeroTime):
354 (WebInspector.TimelineOverviewGraph.prototype.set startTime):
355 (WebInspector.TimelineOverviewGraph.prototype.set endTime):
356 (WebInspector.TimelineOverviewGraph.prototype.set currentTime):
358 * UserInterface/Views/TimelineRuler.js:
359 (WebInspector.TimelineRuler):
360 (WebInspector.TimelineRuler.prototype.set allowsClippedLabels):
361 (WebInspector.TimelineRuler.prototype.set formatLabelCallback):
362 (WebInspector.TimelineRuler.prototype.set allowsTimeRangeSelection):
363 (WebInspector.TimelineRuler.prototype.set zeroTime):
364 (WebInspector.TimelineRuler.prototype.set startTime):
365 (WebInspector.TimelineRuler.prototype.set endTime):
366 (WebInspector.TimelineRuler.prototype.set secondsPerPixel):
367 (WebInspector.TimelineRuler.prototype.set selectionStartTime):
368 (WebInspector.TimelineRuler.prototype.set selectionEndTime):
369 (WebInspector.TimelineRuler.prototype.set duration): Deleted.
370 The ruler duration and "pinned" state are controlled by setting an end
371 time. Removed since it wasn't being used, and there shouldn't be two
372 ways to the exact same thing.
374 * UserInterface/Views/TimelineView.js:
375 (WebInspector.TimelineView.prototype.set zeroTime):
376 (WebInspector.TimelineView.prototype.set startTime):
377 (WebInspector.TimelineView.prototype.set endTime):
379 2015-12-04 Commit Queue <commit-queue@webkit.org>
381 Unreviewed, rolling out r193486.
382 https://bugs.webkit.org/show_bug.cgi?id=151904
384 Causes Infinite Recursion in Timeline Recording (Requested by
389 "Web Inspector: when a marked-dirty subview is attached to a
390 parent View, dirtyDescendantsCount gets out of sync"
391 https://bugs.webkit.org/show_bug.cgi?id=151876
392 http://trac.webkit.org/changeset/193486
394 2015-12-04 Joseph Pecoraro <pecoraro@apple.com>
396 Web Inspector: Uncaught Exception with Reload shortcut in JSContext Inspector
397 https://bugs.webkit.org/show_bug.cgi?id=151896
399 Reviewed by Timothy Hatcher.
401 * UserInterface/Base/Main.js:
402 (WebInspector.contentLoaded):
403 Do not implicitly prevent default on these keyboard shortcuts
404 so we can system beep if we do not do anything.
406 (WebInspector._reloadPage):
407 (WebInspector._reloadPageIgnoringCache):
408 Bail if there is no PageAgent without preventing default for
409 a beep system beep. Prevent default if we did something.
411 2015-12-04 Matt Baker <mattbaker@apple.com>
413 Web Inspector: when a marked-dirty subview is attached to a parent View, dirtyDescendantsCount gets out of sync
414 https://bugs.webkit.org/show_bug.cgi?id=151876
416 Reviewed by Brian Burg.
418 * UserInterface/Views/NewTabContentView.js:
419 (WebInspector.NewTabContentView.prototype._updateShownTabs):
420 Removed workaround added in https://bugs.webkit.org/show_bug.cgi?id=151594.
422 * UserInterface/Views/View.js:
423 (WebInspector.View._scheduleLayoutForView):
424 Always perform a synchronous layout when a view that isn't descended from the
425 root view schedules a layout.
427 2015-12-04 Brian Burg <bburg@apple.com>
429 Web Inspector: support runtime registration of tab type associations
430 https://bugs.webkit.org/show_bug.cgi?id=151594
432 Reviewed by Joseph Pecoraro.
434 We want to add special tabs that only exist in engineering builds
435 for debugging purposes. Though the relevant models and views can be
436 put in the Debug/ directory to exclude them from production builds,
437 there's no way to register tabs conditionally at runtime; tabs are
440 This patch makes it possible to register new tab types at runtime.
441 First, WebInspector keeps a map of known, registered tab classes.
442 Details that were hardcoded before---whether to show in New Tab,
443 whether a tab can be instantiated given the active domains, UI text,
444 etc.---are now static methods on the base TabContentView or overidden
445 in its subclasses. Lastly, a public method allows code in Bootstrap.js
446 to register tabs at runtime. Doing so sends a notification so the
447 NewTabContentView can show the newly available tab item.
449 * UserInterface/Base/Main.js:
450 (WebInspector.contentLoaded):
451 (WebInspector.isTabTypeAllowed):
452 (WebInspector.knownTabClasses): Added, used by NewTabContentView.
453 (WebInspector._createTabContentViewForType): Renamed from _tabContentViewForType.
454 (WebInspector._rememberOpenTabs):
455 (WebInspector._updateNewTabButtonState):
456 (WebInspector._tryToRestorePendingTabs): Added.
458 Whenever a new tab is registered, try to restore pending tabs, since
459 an extra tab won't be added initially when production tabs are added.
460 But, it could have been saved in the Setting for opened tabs.
462 (WebInspector.showNewTabTab):
463 (WebInspector.isNewTabWithTypeAllowed):
464 (WebInspector.createNewTabWithType):
465 (WebInspector._tabContentViewForType): Deleted.
466 * UserInterface/Base/Object.js:
467 * UserInterface/Views/ConsoleTabContentView.js:
468 (WebInspector.ConsoleTabContentView):
469 (WebInspector.ConsoleTabContentView.tabInfo): Added.
470 * UserInterface/Views/DebuggerTabContentView.js:
471 (WebInspector.DebuggerTabContentView):
472 (WebInspector.DebuggerTabContentView.tabInfo): Added.
473 * UserInterface/Views/ElementsTabContentView.js:
474 (WebInspector.ElementsTabContentView):
475 (WebInspector.ElementsTabContentView.tabInfo): Added.
476 (WebInspector.ElementsTabContentView.isTabAllowed): Added.
477 * UserInterface/Views/NetworkTabContentView.js:
478 (WebInspector.NetworkTabContentView):
479 (WebInspector.NetworkTabContentView.tabInfo): Added.
480 (WebInspector.NetworkTabContentView.isTabAllowed): Added.
481 * UserInterface/Views/NewTabContentView.js:
483 Keep a list of shown tab items, so we don't have to query the DOM
484 to update enabled/disabled state. Put tree construction inside a
485 layout() override and dirty the view whenever known tab types change.
487 (WebInspector.NewTabContentView):
488 (WebInspector.NewTabContentView.tabInfo): Added.
489 (WebInspector.NewTabContentView.isEphemeral): Added.
490 (WebInspector.NewTabContentView.shouldSaveTab): Added.
491 (WebInspector.NewTabContentView.prototype.layout): Added.
492 (WebInspector.NewTabContentView.prototype._updateShownTabs): Added.
493 (WebInspector.NewTabContentView.prototype._allowableTabTypes):
494 (WebInspector.NewTabContentView.prototype._updateTabItems):
495 (WebInspector.NewTabContentView.prototype.get tabItemElements): Deleted.
496 * UserInterface/Views/ResourcesTabContentView.js:
497 (WebInspector.ResourcesTabContentView):
498 (WebInspector.ResourcesTabContentView.tabInfo): Added.
499 * UserInterface/Views/SearchTabContentView.js:
500 (WebInspector.SearchTabContentView):
501 (WebInspector.SearchTabContentView.tabInfo): Added.
502 (WebInspector.SearchTabContentView.isEphemeral): Added.
503 * UserInterface/Views/SettingsTabContentView.js:
504 (WebInspector.SettingsTabContentView.isTabAllowed): Added.
505 (WebInspector.SettingsTabContentView.shouldSaveTab): Added.
506 * UserInterface/Views/StorageTabContentView.js:
507 (WebInspector.StorageTabContentView):
508 (WebInspector.StorageTabContentView.tabInfo): Added.
509 (WebInspector.StorageTabContentView.isTabAllowed): Added.
510 * UserInterface/Views/TabBrowser.js:
511 (WebInspector.TabBrowser.showTabForContentView):
513 Add a workaround for <https://webkit.org/b/151876>. This bug is
514 revealed by the changes to NewTabContentView in this patch.
516 * UserInterface/Views/TabContentView.js:
517 (WebInspector.TabContentView.isTabAllowed): Added.
518 (WebInspector.TabContentView.isEphemeral): Added.
519 (WebInspector.TabContentView.shouldSaveTab): Added.
520 * UserInterface/Views/TimelineTabContentView.js:
521 (WebInspector.TimelineTabContentView):
522 (WebInspector.TimelineTabContentView.tabInfo): Added.
523 (WebInspector.TimelineTabContentView.isTabAllowed): Added.
525 2015-12-04 Joseph Pecoraro <pecoraro@apple.com>
527 Web Inspector: Remove untested and unused Worker inspection
528 https://bugs.webkit.org/show_bug.cgi?id=151848
530 Reviewed by Brian Burg.
532 * UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
533 * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
534 * UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
535 * Versions/Inspector-iOS-7.0.json:
536 * Versions/Inspector-iOS-8.0.json:
537 * Versions/Inspector-iOS-9.0.json:
538 Since this was untested in older releases as well, remove
539 the protocol interfaces for legacy versions.
541 2015-12-04 Joseph Pecoraro <pecoraro@apple.com>
543 Web Inspector: Specifically Identify the Global Lexical Environment Scope
544 https://bugs.webkit.org/show_bug.cgi?id=151828
546 Reviewed by Brian Burg.
548 * Localizations/en.lproj/localizedStrings.js:
549 * UserInterface/Controllers/DebuggerManager.js:
550 (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload):
551 * UserInterface/Models/ScopeChainNode.js:
552 * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
553 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
554 Include a new scope type and give it a localized string.
556 2015-12-03 Anders Carlsson <andersca@apple.com>
558 Remove Objective-C GC support
559 https://bugs.webkit.org/show_bug.cgi?id=151819
560 rdar://problem/23746991
562 Reviewed by Dan Bernstein.
564 * Configurations/Base.xcconfig:
566 2015-12-03 Matt Baker <mattbaker@apple.com>
568 Uncaught Exception in Web Inspector: TypeError: null is not an object (evaluating 'dataGridNode.element.classList')
569 https://bugs.webkit.org/show_bug.cgi?id=151790
571 Reviewed by Timothy Hatcher.
573 * UserInterface/Views/DataGrid.js:
574 (WebInspector.DataGridNode):
575 (WebInspector.DataGridNode.prototype.get hidden):
576 (WebInspector.DataGridNode.prototype.set hidden):
577 Make hidden a property, so it can be set before the grid node's DOM element exists.
578 (WebInspector.DataGridNode.prototype.get selectable):
579 (WebInspector.DataGridNode.prototype.get element):
580 Add hidden style, if needed, when element is created.
582 * UserInterface/Views/TreeOutlineDataGridSynchronizer.js:
583 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementVisibilityDidChange):
584 (WebInspector.TreeOutlineDataGridSynchronizer):
585 Don't access the grid node's element directly, since it may not exist yet.
587 2015-12-02 Joseph Pecoraro <pecoraro@apple.com>
589 Web Inspector: Handle YieldExpressions in the ScriptSyntaxTree
590 https://bugs.webkit.org/show_bug.cgi?id=151730
592 Reviewed by Brian Burg.
594 * UserInterface/Models/NativeFunctionParameters.js:
595 Add the Generator API.
597 * UserInterface/Models/ScriptSyntaxTree.js:
598 (WebInspector.ScriptSyntaxTree.prototype._recurse):
599 (WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
600 Handle YieldExpressions.
602 2015-12-01 Matt Baker <mattbaker@apple.com>
604 Web Inspector: TreeOutline should just dispatch events via WebInspector.Object
605 https://bugs.webkit.org/show_bug.cgi?id=148067
607 Reviewed by Timothy Hatcher.
609 TreeOutline now dispatches most events via WebInspector.Object. The onselect and
610 ondeselect callbacks are replaced by a SelectionDidChange event, which includes
611 both the selected and deselected elements in its event data. The onexpand and oncollapse
612 callbacks are replaced by an ElementDisclosureDidChange event. This is consistent with the
613 behavior of onhidden, which had no corresponding onvisible callback.
615 Alas, TimelineView and TreeOutlineDataGridSynchronizer depended on the order in which
616 TreeOutline.onselect callbacks were chained together. The synchronizer added its
617 callback after the timeline view, which ensured that the tree and grid were in sync
618 before the view handled onselect and dispatched a SelectionPathComponentsDidChange.
619 The change notification causes the view's path components to be read, and timeline
620 views need the grid selection to be in a valid state to build path components.
622 This is addressed by having timeline views dispatch SelectionPathComponentsDidChange
623 events when the grid selection changes, instead of the tree selection. The change
624 required that the synchronizer no longer suppress notifications when selecting grid nodes.
626 * UserInterface/Views/DebuggerSidebarPanel.js:
627 (WebInspector.DebuggerSidebarPanel):
628 (WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
629 (WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
631 * UserInterface/Views/NavigationSidebarPanel.js:
632 (WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
633 (WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
635 * UserInterface/Views/NetworkGridContentView.js:
636 (WebInspector.NetworkGridContentView):
637 (WebInspector.NetworkGridContentView.prototype._treeSelectionDidChange):
639 * UserInterface/Views/ResourceSidebarPanel.js:
640 (WebInspector.ResourceSidebarPanel):
641 (WebInspector.ResourceSidebarPanel.prototype._treeSelectionDidChange):
642 (WebInspector.ResourceSidebarPanel.prototype._treeElementSelected): Deleted.
644 * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
645 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
646 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
647 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._treeElementAdded):
648 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._treeElementDisclosureDidChange):
649 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeExpandHandler): Deleted.
650 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeCollapseHandler): Deleted.
652 * UserInterface/Views/SearchSidebarPanel.js:
653 (WebInspector.SearchSidebarPanel):
654 (WebInspector.SearchSidebarPanel.prototype._treeSelectionDidChange):
655 (WebInspector.SearchSidebarPanel.prototype._treeElementSelected): Deleted.
657 * UserInterface/Views/StorageSidebarPanel.js:
658 (WebInspector.StorageSidebarPanel):
659 (WebInspector.StorageSidebarPanel._treeSelectionDidChange):
661 * UserInterface/Views/TimelineDataGrid.js:
662 (WebInspector.TimelineDataGrid.prototype._createPopoverContent):
663 (WebInspector.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
664 (WebInspector.TimelineDataGrid):
666 * UserInterface/Views/TimelineSidebarPanel.js:
667 (WebInspector.TimelineSidebarPanel):
668 (WebInspector.TimelineSidebarPanel.prototype._recordingsTreeSelectionDidChange):
669 (WebInspector.TimelineSidebarPanel.prototype._timelinesTreeSelectionDidChange):
670 (WebInspector.TimelineSidebarPanel.prototype._timelinesTreeElementSelected): Deleted.
672 * UserInterface/Views/TimelineView.js:
673 (WebInspector.TimelineView):
674 (WebInspector.TimelineView.prototype._treeSelectionDidChange):
675 (WebInspector.TimelineView.prototype.treeElementSelected):
676 Don't dispatch SelectionPathComponentsDidChange. Timeline views already do this
677 in response to grid selection events.
679 * UserInterface/Views/TreeOutline.js:
680 (WebInspector.TreeOutline.prototype.appendChild):
681 (WebInspector.TreeOutline.prototype.insertChild):
682 (WebInspector.TreeOutline.prototype.removeChildAtIndex):
683 (WebInspector.TreeOutline.prototype.removeChildren):
684 (WebInspector.TreeOutline.prototype.removeChildrenRecursive):
685 (WebInspector.TreeOutline.prototype._treeElementDidChange):
686 (WebInspector.TreeElement.prototype.set hidden):
687 (WebInspector.TreeElement.prototype.collapse):
688 (WebInspector.TreeElement.prototype.expand):
689 (WebInspector.TreeElement.prototype.select):
690 (WebInspector.TreeElement.prototype.deselect):
691 (WebInspector.TreeElement.prototype.get childrenListElement): Deleted.
694 * UserInterface/Views/TreeOutlineDataGridSynchronizer.js:
695 (WebInspector.TreeOutlineDataGridSynchronizer):
696 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeSelectionDidChange):
697 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementAdded):
698 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementRemoved):
699 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementDisclosureDidChange):
700 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementVisibilityDidChange):
701 (WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onadd): Deleted.
702 (WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onremove): Deleted.
703 (WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onexpand): Deleted.
704 (WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.oncollapse): Deleted.
705 (WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onhidden): Deleted.
706 (WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onselect): Deleted.
707 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementSelected): Deleted.
708 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementExpanded): Deleted.
709 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementCollapsed): Deleted.
710 (WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementHiddenChanged): Deleted.
712 * UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:
713 (WebInspector.VisualStyleCommaSeparatedKeywordEditor):
714 (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._treeSelectionDidChange):
715 (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._treeElementSelected): Deleted.
717 2015-12-01 Joseph Pecoraro <pecoraro@apple.com>
719 Web Inspector: Timestamp in Tooltip of Event Markers is incorrect
720 https://bugs.webkit.org/show_bug.cgi?id=151722
722 Reviewed by Timothy Hatcher.
724 * UserInterface/Views/TimelineRuler.js:
725 (WebInspector.TimelineRuler.prototype.addMarker):
726 Convert the marker's time, to be relative to the start of the recording.
728 2015-12-01 Joseph Pecoraro <pecoraro@apple.com>
730 Unreviewed common typo fix "occurance" => "occurrence".
732 * Scripts/combine-resources.pl:
735 2015-12-01 Joseph Pecoraro <pecoraro@apple.com>
737 Web Inspector: Spacebar to toggle Timeline recording doesn't work in Timeline tab after reloading the page
738 https://bugs.webkit.org/show_bug.cgi?id=151530
740 Reviewed by Timothy Hatcher.
742 If reloading the page caused the console to clear, that was triggering
743 the console prompt to be focused. When the console prompt is focused,
744 keyboard input like Spacebar, was just inputing characters instead of
745 triggering the keyboard shortcut that was expected.
747 This also means that console.clear() in the inspected page would cause
748 the inspector to focus the console. That is unexpected as well.
750 Focusing the console prompt whenever the console log is cleared
751 is not ideal. If we do want to focus the prompt the caller should
752 make that determination, not clear.
754 * UserInterface/Controllers/JavaScriptLogViewController.js:
755 (WebInspector.JavaScriptLogViewController.prototype.clear):
757 2015-12-01 Joseph Pecoraro <pecoraro@apple.com>
759 Web Inspector: Update Timeline UI based on the Instruments in the Active Recording
760 https://bugs.webkit.org/show_bug.cgi?id=151374
762 Reviewed by Brian Burg.
764 * UserInterface/Views/TimelineRecordingContentView.js:
765 (WebInspector.TimelineRecordingContentView.prototype._updateTimelineOverviewHeight):
766 Modernize as I was in this code while looking into this patch.
768 * UserInterface/Views/TimelineSidebarPanel.css:
769 (.sidebar > .panel.navigation.timeline > .title-bar.timeline-events): Deleted.
770 (.sidebar > .panel.navigation.timeline > .timelines-content): Deleted.
771 These defaults are no longer necessary, the UI overrides them anyways.
773 * UserInterface/Views/TimelineSidebarPanel.js:
774 (WebInspector.TimelineSidebarPanel):
775 Include both the basic and rendering frames toolbars. They will be
776 mutually exclusive based on if the FPSIntrument is available.
778 (WebInspector.TimelineSidebarPanel.prototype._recordingSelected):
779 (WebInspector.TimelineSidebarPanel.prototype._clearInstruments):
780 When loading a new Recording clear the UI.
782 (WebInspector.TimelineSidebarPanel.prototype._instrumentAdded):
783 (WebInspector.TimelineSidebarPanel.prototype._instrumentRemoved):
784 (WebInspector.TimelineSidebarPanel.prototype._addedFPSInstrument):
785 (WebInspector.TimelineSidebarPanel.prototype._removedFPSInstrument):
786 Handle toggling the toolbars when the FPS instrument is added/removed.
788 (WebInspector.TimelineSidebarPanel.prototype._timelineCountChanged):
789 (WebInspector.TimelineSidebarPanel.prototype._updateTimelineOverviewHeight):
790 (WebInspector.TimelineSidebarPanel.prototype._changeViewMode):
791 Properly update the sidebar's understanding of the TimelineOverview size.
793 2015-12-01 Joseph Pecoraro <pecoraro@apple.com>
795 Web Inspector: Initial support for variable timelines
796 https://bugs.webkit.org/show_bug.cgi?id=151372
798 Reviewed by Brian Burg.
800 * UserInterface/Controllers/TimelineManager.js:
801 (WebInspector.TimelineManager.defaultInstruments):
802 (WebInspector.TimelineManager.prototype._loadNewRecording):
803 Keep the status quo which is the same set of instruments for each recording.
805 (WebInspector.TimelineManager.prototype.startCapturing):
806 (WebInspector.TimelineManager.prototype.stopCapturing):
807 Push responsibility of capturing to the Recording, which has a specific set
808 of instruments that know what they need to turn on an off from the backend.
810 * UserInterface/Main.html:
811 * UserInterface/Models/Instrument.js: Added.
812 (WebInspector.Instrument):
813 (WebInspector.Instrument.startLegacyTimelineAgent):
814 (WebInspector.Instrument.stopLegacyTimelineAgent):
815 (WebInspector.Instrument.prototype.get timelineRecordType):
816 (WebInspector.Instrument.prototype.startInstrumentation):
817 (WebInspector.Instrument.prototype.stopInstrumentation):
818 New class representing something that can be turned on and off
819 from the backend and produces a set of Timeline record types.
820 Currently instruments are 1-to-1 to a Timeline type.
822 * UserInterface/Models/LayoutInstrument.js: Added.
823 (WebInspector.LayoutInstrument.prototype.get timelineRecordType):
824 (WebInspector.LayoutInstrument):
825 * UserInterface/Models/NetworkInstrument.js: Added.
826 (WebInspector.NetworkInstrument.prototype.get timelineRecordType):
827 (WebInspector.NetworkInstrument.prototype.startInstrumentation):
828 (WebInspector.NetworkInstrument.prototype.stopInstrumentation):
829 (WebInspector.NetworkInstrument):
830 * UserInterface/Models/ScriptInstrument.js: Added.
831 (WebInspector.ScriptInstrument.prototype.get timelineRecordType):
832 (WebInspector.ScriptInstrument):
833 The default set of instruments. Currently they all enable the TimelineAgent,
834 so they share code to enable/disable in the base class to avoid duplication.
836 * UserInterface/Models/FPSInstrument.js: Added.
837 (WebInspector.FPSInstrument):
838 (WebInspector.FPSInstrument.supported):
839 (WebInspector.FPSInstrument.prototype.get timelineRecordType):
840 Provide a "supported" static method and simplify other code that
841 checks whether or not RenderingFrames is available or not.
844 * UserInterface/Models/Timeline.js:
845 (WebInspector.Timeline.prototype.get displayName): Deleted.
846 (WebInspector.Timeline.prototype.get iconClassName): Deleted.
847 Move these to a View class, as this is primarily View logic.
849 * UserInterface/Models/TimelineRecording.js:
850 (WebInspector.TimelineRecording):
851 (WebInspector.TimelineRecording.prototype.get instruments):
852 (WebInspector.TimelineRecording.prototype.start):
853 (WebInspector.TimelineRecording.prototype.stop):
854 (WebInspector.TimelineRecording.prototype.timelineForInstrument):
855 (WebInspector.TimelineRecording.prototype.addInstrument):
856 (WebInspector.TimelineRecording.prototype.removeInstrument):
857 (WebInspector.TimelineRecording.prototype.addEventMarker):
858 (WebInspector.TimelineRecording.prototype.addTimeline): Deleted.
859 (WebInspector.TimelineRecording.prototype.removeTimeline): Deleted.
860 A recording now has a set of Instruments and its own start/stop
861 which starts/stops its set of Instruments! Treat Instruments as
862 the variable property of a Recording instead of Timelines.
864 * UserInterface/Views/TimelineOverview.js:
865 (WebInspector.TimelineOverview):
866 (WebInspector.TimelineOverview.prototype._instrumentAdded):
867 (WebInspector.TimelineOverview.prototype._instrumentRemoved):
868 (WebInspector.TimelineOverview.prototype._timelineAdded): Deleted.
869 (WebInspector.TimelineOverview.prototype._timelineRemoved): Deleted.
870 * UserInterface/Views/TimelineRecordingContentView.js:
871 (WebInspector.TimelineRecordingContentView):
872 (WebInspector.TimelineRecordingContentView.prototype._instrumentAdded):
873 (WebInspector.TimelineRecordingContentView.prototype._instrumentRemoved):
874 (WebInspector.TimelineRecordingContentView.prototype._timelineAdded): Deleted.
875 (WebInspector.TimelineRecordingContentView.prototype._timelineRemoved): Deleted.
876 * UserInterface/Views/TimelineSidebarPanel.js:
877 (WebInspector.TimelineSidebarPanel):
878 (WebInspector.TimelineSidebarPanel.displayNameForTimeline):
879 (WebInspector.TimelineSidebarPanel.iconClassNameForTimeline):
880 (WebInspector.TimelineSidebarPanel.prototype.updateFrameSelection):
881 (WebInspector.TimelineSidebarPanel.prototype.restoreStateFromCookie):
882 (WebInspector.TimelineSidebarPanel.prototype._recordingSelected):
883 (WebInspector.TimelineSidebarPanel.prototype._instrumentAdded):
884 (WebInspector.TimelineSidebarPanel.prototype._instrumentRemoved):
885 (WebInspector.TimelineSidebarPanel.prototype._changeViewMode):
886 (WebInspector.TimelineSidebarPanel.prototype._timelineAdded): Deleted.
887 (WebInspector.TimelineSidebarPanel.prototype._timelineRemoved): Deleted.
888 Update all TimelineAdded/TimelineRemoved clients to instead check
889 InstrumentAdded/InstrumentRemoved. Immediately convert from an Instrument
890 to a Timeline to keep the patch simple.
892 2015-12-01 Joseph Pecoraro <pecoraro@apple.com>
894 Web Inspector: Broken Inspector when resources are minified
895 https://bugs.webkit.org/show_bug.cgi?id=151711
897 Reviewed by Timothy Hatcher.
899 * Scripts/combine-resources.pl:
901 Provide a way to just strip resources matches a pattern.
903 * Scripts/copy-user-interface-resources.pl:
904 Strip "Debug/" resources before combining / minifying others.
906 * UserInterface/Views/View.js:
907 (WebInspector.View.prototype.makeRootView):
908 (WebInspector.View.prototype.didDetach):
909 Address warnings from the console.assert stripping phase
910 for console.assert statements lacking a trailing semicolon.
912 2015-11-30 Brian Burg <bburg@apple.com>
914 Web Inspector: show something useful when the inspector frontend fails to load
915 https://bugs.webkit.org/show_bug.cgi?id=151643
917 Reviewed by Timothy Hatcher.
919 When a parse error or other early error happens before the inspector
920 is fully loaded, we can't use the second-level inspector to tell what's
921 going on. It would be better to catch any early errors and list them.
923 This patch adds an error page that shows the early errors that happened
924 during loading. It provides a list of errors, a link to reload the
925 inspector, and a link to submit a pre-filled bug report about the error.
927 For now, this page only shows up in engineering builds because it's
928 located in the Debug/ directory. We can move it later when it works
929 better in all cases. Follow-up patches can address smaller issues,
930 such as the transparent title bar and broken text selection.
932 * UserInterface/Debug/CatchEarlyErrors.css: Added.
933 * UserInterface/Debug/CatchEarlyErrors.js: Added.
934 * UserInterface/Main.html:
935 * UserInterface/Main.js: Abort setting up the UI if something happened.
937 2015-11-30 Brian Burg <bburg@apple.com>
939 Web Inspector: delete-by-word and similar shortcuts should add text to the WebCore kill ring
940 https://bugs.webkit.org/show_bug.cgi?id=151312
942 Reviewed by Darin Adler.
944 Add support for other kill ring-eligible keybindinsg, such as
945 deleting by word, group, or line forwards and backwards.
947 * UserInterface/Controllers/CodeMirrorTextKillController.js:
948 (WebInspector.CodeMirrorTextKillController):
949 (WebInspector.CodeMirrorTextKillController.prototype._handleTextKillCommand): Renamed from _handleKillLine.
951 Parameterize the function so it can handle any keybinding and
952 command. Take a kill ring insertion mode argument, too.
954 (WebInspector.CodeMirrorTextKillController.prototype._handleTextChange):
956 Add some special casing for changes received from Delete Line
957 (Cmd-D) so the right text is added to the kill ring. Thread the
958 kill ring insertion mode to the frontend host call.
960 (WebInspector.CodeMirrorTextKillController.prototype._handleKillLine): Deleted.
962 2015-11-29 Brian Burg <bburg@apple.com>
964 Web Inspector: Add context menu item to Reload the Inspector
965 https://bugs.webkit.org/show_bug.cgi?id=141742
967 Reviewed by Timothy Hatcher.
969 Add a global context menu and global shortcut (Cmd-Opt-Shift-R) to
970 reload the Web Inspector frontend without closing the browser.
972 This should make it possible to more quickly fix typos, small nits,
973 etc. without having to relaunch. It might also make state
974 restoration bugs more visible in engineering builds, since there
975 is hardly any delay between seeing the old and reloaded frontends.
977 Note that this functionality reloads scripts from the configuration's
978 build directory, so you still need to "build" WebInspectorUI to ensure
979 that any changed files are properly minified and staged.
981 * UserInterface/Base/Main.js:
982 (WebInspector.unlocalizedString):
984 Added. Make it obvious when strings are intentionally not localized.
986 (WebInspector._contextMenuRequested):
988 If the "Show Debug UI" setting is available and true, add
989 a global "Reload Web Inspector" menu item to every context
990 menu. Otherwise, don't eagerly create a context menu.
991 * UserInterface/Debug/Bootstrap.js: Add Cmd-Opt-Shift-R shortcut.
993 2015-11-29 Brian Burg <bburg@apple.com>
995 Web Inspector: allow multiple UI components to add menu items upon getting a "contextmenu" event
996 https://bugs.webkit.org/show_bug.cgi?id=151629
998 Reviewed by Timothy Hatcher.
1000 The existing Context Menu system assumes that only one UI component
1001 will need to provide context menu items. But in some scenarios, there
1002 are multiple UI components that could provide relevant menu items. For
1003 example, right-clicking on an DOM element in the console should show
1004 menu items relevant to 1) the DOM element, 2) the console in general,
1005 and 3) global menu items. Existing code shows menu items provided by
1006 the first object that handles the event and calls ContextMenu.show().
1008 This patch changes behavior so that a context menu can be built up
1009 by multiple 'contextmenu' event handlers. A ContextMenu instance is
1010 hidden on the 'contextmenu' event object; client code calls a
1011 factory method that digs out this existing context menu or creates a
1012 new one as needed. To actually show the context menu through the
1013 InspectorFrontendHost methods, the top-level app controller adds a
1014 bubbling listener for 'contextmenu' and shows the event's context
1015 menu if one has been created.
1017 Along the way, do some cleanup. Do s/var/let/, arrowize some functions,
1018 use Array.{map,some}, and simplify some other code as a result.
1020 No new tests yet, since we can't trigger context menu easily from
1021 an inspector test. All affected context menus were manually verified.
1023 * UserInterface/Base/Main.js:
1024 (WebInspector.contentLoaded):
1025 * UserInterface/Controllers/BreakpointPopoverController.js:
1026 (WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems):
1027 (WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.editBreakpoint): Deleted.
1028 (WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.removeBreakpoint): Deleted.
1029 (WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.toggleBreakpoint): Deleted.
1030 (WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.toggleAutoContinue): Deleted.
1031 (WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.revealOriginalSourceCodeLocation): Deleted.
1032 * UserInterface/Views/BreakpointTreeElement.js:
1033 (WebInspector.BreakpointTreeElement.prototype.oncontextmenu):
1034 * UserInterface/Views/CSSStyleDeclarationSection.js:
1035 * UserInterface/Views/ContextMenu.js:
1036 (WebInspector.ContextMenuItem.prototype._buildDescriptor):
1037 (WebInspector.ContextMenuItem):
1038 (WebInspector.ContextSubMenuItem.prototype.appendItem):
1039 (WebInspector.ContextSubMenuItem.prototype.appendSubMenuItem):
1040 (WebInspector.ContextSubMenuItem.prototype.appendCheckboxItem):
1041 (WebInspector.ContextSubMenuItem.prototype._pushItem):
1042 (WebInspector.ContextSubMenuItem.prototype._buildDescriptor):
1043 (WebInspector.ContextSubMenuItem):
1044 (WebInspector.ContextMenu.createFromEvent):
1045 (WebInspector.ContextMenu.prototype.show):
1046 (WebInspector.ContextMenu.prototype.handleEvent):
1047 (WebInspector.ContextMenu.prototype._buildDescriptor):
1048 * UserInterface/Views/DOMTreeOutline.js:
1049 (WebInspector.DOMTreeOutline.prototype._contextMenuEventFired):
1050 (WebInspector.DOMTreeOutline.prototype._populateContextMenu.logElement):
1051 (WebInspector.DOMTreeOutline.prototype._populateContextMenu):
1052 * UserInterface/Views/DataGrid.js:
1053 (WebInspector.DataGrid.prototype._contextMenuInDataTable):
1054 * UserInterface/Views/DebuggerSidebarPanel.js:
1055 (WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineContextMenuTreeElement):
1056 (WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineContextMenuTreeElement.removeAllResourceBreakpoints): Deleted.
1057 (WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineContextMenuTreeElement.toggleAllResourceBreakpoints): Deleted.
1058 * UserInterface/Views/LogContentView.js:
1059 (WebInspector.LogContentView.prototype._handleContextMenuEvent):
1060 * UserInterface/Views/ObjectPreviewView.js:
1061 (WebInspector.ObjectPreviewView.prototype._contextMenuHandler):
1062 (WebInspector.ObjectPreviewView):
1063 * UserInterface/Views/ObjectTreeBaseTreeElement.js:
1064 (WebInspector.ObjectTreeBaseTreeElement.prototype._contextMenuHandler):
1065 (WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
1066 (WebInspector.ObjectTreeBaseTreeElement):
1067 * UserInterface/Views/SourceCodeTextEditor.js:
1068 (WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
1069 (WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.continueToLocation): Deleted.
1070 (WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.addBreakpoint): Deleted.
1071 (WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.revealInSidebar): Deleted.
1072 (WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.removeBreakpoints): Deleted.
1073 (WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.toggleBreakpoints): Deleted.
1074 * UserInterface/Views/TabBarItem.js:
1075 (WebInspector.TabBarItem.prototype._handleContextMenuEvent):
1076 (WebInspector.TabBarItem):
1077 (WebInspector.TabBarItem.prototype._handleContextMenuEvent.closeTab): Deleted.
1078 (WebInspector.TabBarItem.prototype._handleContextMenuEvent.closeOtherTabs): Deleted.
1079 * UserInterface/Views/TimelineSidebarPanel.js:
1080 (WebInspector.TimelineSidebarPanel.prototype._contextMenuNavigationBarOrStatusBar):
1081 (WebInspector.TimelineSidebarPanel.prototype._contextMenuNavigationBarOrStatusBar.toggleReplayInterface): Deleted.
1082 * UserInterface/Views/Toolbar.js:
1083 (WebInspector.Toolbar.prototype._handleContextMenuEvent):
1084 * UserInterface/Views/VisualStyleSelectorTreeItem.js:
1085 (WebInspector.VisualStyleSelectorTreeItem.prototype._handleContextMenuEvent):
1087 2015-11-28 Devin Rousso <dcrousso+webkit@gmail.com>
1089 Web Inspector: Styles sidebar placeholder is misaligned
1090 https://bugs.webkit.org/show_bug.cgi?id=151638
1092 Reviewed by Brian Burg.
1094 * UserInterface/Views/CSSStyleDeclarationTextEditor.css:
1095 (.css-style-text-editor > .CodeMirror .CodeMirror-placeholder):
1097 2015-11-28 Devin Rousso <dcrousso+webkit@gmail.com>
1099 Web Inspector: REGRESSION: "Duplicate Selector" context menu item doesn't work
1100 https://bugs.webkit.org/show_bug.cgi?id=151628
1102 Reviewed by Brian Burg.
1104 Merged the two "add rule" functions inside DOMNodeStyles to create a
1105 new rule with the given selector and use the generated best selector
1106 for that node otherwise. This also preserves all fallbacks across all
1107 functions for creating new CSS rules.
1109 * UserInterface/Models/DOMNodeStyles.js:
1110 (WebInspector.DOMNodeStyles.prototype.addEmptyRule): Deleted.
1111 (WebInspector.DOMNodeStyles.prototype.addRuleWithSelector): Deleted.
1112 (WebInspector.DOMNodeStyles.prototype.addRule):
1113 Creates a new CSS rule using either the provided selector or the best
1114 selector for the current node.
1116 * UserInterface/Views/CSSStyleDeclarationSection.js:
1117 (WebInspector.CSSStyleDeclarationSection.prototype._handleContextMenuEvent):
1118 * UserInterface/Views/RulesStyleDetailsPanel.js:
1119 (WebInspector.RulesStyleDetailsPanel.prototype.newRuleButtonClicked):
1120 * UserInterface/Views/VisualStyleSelectorSection.js:
1121 (WebInspector.VisualStyleSelectorSection.prototype._addNewRule):
1123 2015-11-24 Brian Burg <bburg@apple.com>
1125 Web Inspector: save Inspector's breakpoints to localStorage whenever they are modified
1126 https://bugs.webkit.org/show_bug.cgi?id=151581
1128 Reviewed by Timothy Hatcher.
1130 Serialize all breakpoints to the "breakpoints" Setting in local storage
1131 whenever any breakpoint model object is added, removed, or modified.
1133 Remove the old listener that attempted to save breakpoints on the
1134 pagehide event. It did not fire in important scenarios like exiting
1135 the browser via Cmd-Q or killing the process via Ctrl-C / SIGKILL.
1137 This is not expected to be a performance problem because most people
1138 do not keep thousands of breakpoints active, and breakpoints are not
1139 set very often. If it's a problem, we can mitigate it with coalescing.
1141 * UserInterface/Controllers/DebuggerManager.js:
1142 (WebInspector.DebuggerManager.prototype.addBreakpoint):
1143 (WebInspector.DebuggerManager.prototype.removeBreakpoint):
1144 (WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
1145 (WebInspector.DebuggerManager.prototype._saveBreakpoints):
1146 (WebInspector.DebuggerManager.prototype._inspectorClosing): Deleted.
1148 2015-11-24 Brian Burg <bburg@apple.com>
1150 Web Inspector: Cmd-1 to Cmd-9 shortcuts should select tabs by ordinal
1151 https://bugs.webkit.org/show_bug.cgi?id=151577
1153 Reviewed by Timothy Hatcher.
1155 The shortcuts only work if a tab at the specified ordinal exists.
1157 * UserInterface/Base/Main.js:
1158 (WebInspector.contentLoaded):
1160 2015-11-23 Brian Burg <bburg@apple.com>
1162 Web Inspector: Add a keyboard shortcut to restore the default zoom level
1163 https://bugs.webkit.org/show_bug.cgi?id=151237
1165 Reviewed by Timothy Hatcher.
1167 The Cmd-0 shortcut matches the keybindings of Safari and other browsers.
1169 * UserInterface/Base/Main.js:
1170 (WebInspector.contentLoaded):
1172 2015-11-23 Brian Burg <bburg@apple.com>
1174 Web Inspector: inspector settings should not be shared between different inspection levels
1175 https://bugs.webkit.org/show_bug.cgi?id=151151
1177 Reviewed by Timothy Hatcher.
1179 It's really annoying to have shared settings between Inspector^1 and Inspector^2, because
1180 they are not designed to respond to external changes to local storage keys. As a result,
1181 the two inspectors seemingly have different settings while both are open, but the settings
1182 clobber each other depending on which inspector is closed first. On the next inspector
1183 being opened, it has settings that reflect whichever inspector closed last.
1185 To fix this, alter the local storage key prefix to incude the inspection level when it is
1186 greater than 1 (i.e., inspecting the inspector). The storage prefix becomes
1187 "com.apple.WebInspector-${inspectionLevel}." in this case.
1188 This is backwards-compatible for normal Inspector, who keeps the same storage prefix.
1190 Alternate approaches that were considered and abandoned:
1192 - Use separate WKWebSiteDataStores for each inspection level. This API (as it currently is)
1193 does not support multiple on-disk storage locations. We don't want to add an entirely new
1194 Library directory for each inspector level, and sharing a single location doesn't fix the
1195 shared-settings bug. Changing storage location would lose all existing Inspector settings.
1197 - Sync settings between multiple open Inspectors. This would be catastrophic, as changing
1198 the active tab on one inspector would immediately propagate to the other open inspectors.
1200 * UserInterface/Models/Setting.js:
1201 (WebInspector.Setting):
1202 * UserInterface/Protocol/InspectorFrontendHostStub.js:
1203 (window.InspectorFrontendHost.WebInspector.InspectorFrontendHostStub.prototype.inspectionLevel):
1205 2015-11-23 Brian Burg <bburg@apple.com>
1207 Web Inspector: use Cmd-Option-L and Cmd-Option-R for toggling navigation and details sidebars
1208 https://bugs.webkit.org/show_bug.cgi?id=151572
1210 Reviewed by Timothy Hatcher.
1212 The previous shortcuts were Cmd-0 and Cmd-Option-0, but these didn't match Safari's
1213 sidebar shortcuts and conflict with Cmd-0 as the cross-browser way to reset page zoom.
1215 * UserInterface/Base/Main.js:
1216 (WebInspector.contentLoaded):
1218 2015-11-23 Brian Burg <bburg@apple.com>
1220 Web Inspector: when inspecting the inspector, add the inspection level to the title bar
1221 https://bugs.webkit.org/show_bug.cgi?id=151555
1223 Reviewed by Timothy Hatcher.
1225 Drive-by update to remove some localization strings that are no longer used.
1227 * Localizations/en.lproj/localizedStrings.js:
1229 2015-11-22 Matt Baker <mattbaker@apple.com>
1231 Web Inspector: Clean up FolderizedTreeElement folder settings
1232 https://bugs.webkit.org/show_bug.cgi?id=151539
1234 Reviewed by Brian Burg.
1236 The expanded state for each folder was stored as an external property on the folder
1237 tree element. Now FolderizedTreeElement keeps a map of folders to settings.
1239 * UserInterface/Views/FolderizedTreeElement.js:
1240 (WebInspector.FolderizedTreeElement):
1241 (WebInspector.FolderizedTreeElement.prototype.removeChildren):
1242 (WebInspector.FolderizedTreeElement.prototype._parentTreeElementForRepresentedObject):
1243 (WebInspector.FolderizedTreeElement.prototype._folderTreeElementExpandedStateChange):
1245 == Rolled over to ChangeLog-2015-11-21 ==