Web Inspector: TimelineRuler should have a "select all" mode
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Feb 2016 17:41:42 +0000 (17:41 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Feb 2016 17:41:42 +0000 (17:41 +0000)
commit723ed054772327a0a1e4c18d8085a6d2d65f4e6b
tree2191f5ef93c89df7fb2d0955ef47155cfe2ba28e
parent869ec1ac9695fd03a26aa9d272da47492c148409
Web Inspector: TimelineRuler should have a "select all" mode
https://bugs.webkit.org/show_bug.cgi?id=154561
<rdar://problem/24779872>

Reviewed by Timothy Hatcher.

TimelineRuler is initialized with a selected range of [0, Number.MAX_VALUE),
indicating the entire timeline is selected. This patch makes it possible to
return the ruler to this state, after being overwritten by a custom selection.
When no custom selection exists, the selection handles are hidden.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler.selection-hidden > :matches(.selection-drag, .selection-handle, .shaded-area)):
Style for hiding selection controls as needed.

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler):
Represent unbounded selection interval as [0, Number.MAX_VALUE).

(WebInspector.TimelineRuler.prototype.set allowsTimeRangeSelection):
Register double-click event listener.

(WebInspector.TimelineRuler.prototype.set zeroTime):
(WebInspector.TimelineRuler.prototype.get entireRangeSelected):
(WebInspector.TimelineRuler.prototype.selectEntireRange):
Let clients check and set the selection of the entire range without needing
to use the internal sentinel values 0 and Number.MAX_VALUE.

(WebInspector.TimelineRuler.prototype._updateSelection):
Update ruler styles and dispatch selection change event when entire
range is selected.

(WebInspector.TimelineRuler.prototype._handleDoubleClick):
If a user-defined selection exists, select the entire range.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/TimelineRuler.css
Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js