12017-10-26 Devin Rousso <webkit@devinrousso.com>
2
3 Web Inspector: Canvas Tab: canvases overview should support navigation via keyboard
4 https://bugs.webkit.org/show_bug.cgi?id=178800
5 <rdar://problem/35175856>
6
7 Reviewed by NOBODY (OOPS!).
8
9 Create a KeyboardShorcut for each of the following:
10 - Up: selects the previous canvas in the selected column
11 - Down: selects the next canvas in the selected column
12 - Right: selects the next canvas in the selected row
13 - Left: selects the previous canvas in the selected row
14 - Space: toggle recording of the selected canvas
15 - Shift+Space: toggle single-frame recording of the selected canvas
16
17 The calculation for selected row/colum is based on the `offsetWidth` of the parent element
18 and the selected item's content view element. Since this view uses a flexbox, all of the
19 items are expected to have the same dimensions, meaning that this value is uniform. The
20 intended functionality is that of a spreadsheet, where pressing pressing left/right will
21 never change the selected row and up/down will never change the selected column.
22
23 * UserInterface/Views/CanvasOverviewContentView.js:
24 (WI.CanvasOverviewContentView):
25 (WI.CanvasOverviewContentView.prototype.contentViewAdded):
26 (WI.CanvasOverviewContentView.prototype.contentViewRemoved):
27 (WI.CanvasOverviewContentView.prototype.attached):
28 (WI.CanvasOverviewContentView.prototype.detached):
29 (WI.CanvasOverviewContentView.prototype._changeSelectedItemVertically):
30 (WI.CanvasOverviewContentView.prototype._changeSelectedItemHorizontally):
31 (WI.CanvasOverviewContentView.prototype._updateNavigationItems):
32 (WI.CanvasOverviewContentView.prototype._handleUp):
33 (WI.CanvasOverviewContentView.prototype._handleRight):
34 (WI.CanvasOverviewContentView.prototype._handleDown):
35 (WI.CanvasOverviewContentView.prototype._handleLeft):
36 (WI.CanvasOverviewContentView.prototype._handleSpace):
37 (WI.CanvasOverviewContentView.prototype._supplementalRepresentedObjectsDidChange):
38 Drive-by: call `_updateNavigationItems` whenever an item is added/removed so that if there
39 are no items the navigation items cannot be clicked.
40