Title: [188192] trunk/Source/WebInspectorUI
Revision
188192
Author
drou...@apple.com
Date
2015-08-08 19:06:07 -0700 (Sat, 08 Aug 2015)

Log Message

Web Inspector: Timeline ruler handle tooltip shows wrong value when handles overlap
https://bugs.webkit.org/show_bug.cgi?id=147652

Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype._updateSelection):
Now changes the title depending on whether the selection start/end is clamped.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (188191 => 188192)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-08-09 01:22:06 UTC (rev 188191)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-08-09 02:06:07 UTC (rev 188192)
@@ -1,5 +1,16 @@
 2015-08-08  Devin Rousso  <drou...@apple.com>
 
+        Web Inspector: Timeline ruler handle tooltip shows wrong value when handles overlap
+        https://bugs.webkit.org/show_bug.cgi?id=147652
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TimelineRuler.js:
+        (WebInspector.TimelineRuler.prototype._updateSelection):
+        Now changes the title depending on whether the selection start/end is clamped.
+
+2015-08-08  Devin Rousso  <drou...@apple.com>
+
         Web Inspector: Don't show "No Filter Results" when timeline is empty
         https://bugs.webkit.org/show_bug.cgi?id=147662
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js (188191 => 188192)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js	2015-08-09 01:22:06 UTC (rev 188191)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js	2015-08-09 02:06:07 UTC (rev 188192)
@@ -587,21 +587,27 @@
         if (!this._allowsTimeRangeSelection)
             return;
 
-        var newLeftPosition = Math.max(0, (this._selectionStartTime - this._startTime) / duration);
+        let startTimeClamped = this._selectionStartTime < this._startTime;
+        let endTimeClamped = this._selectionEndTime > this._endTime;
+
+        let formattedStartTimeText = this._formatDividerLabelText(this._selectionStartTime);
+        let formattedEndTimeText = this._formatDividerLabelText(this._selectionEndTime);
+
+        let newLeftPosition = Math.max(0, (this._selectionStartTime - this._startTime) / duration);
         this._updatePositionOfElement(this._leftShadedAreaElement, newLeftPosition, visibleWidth, "width");
         this._updatePositionOfElement(this._leftSelectionHandleElement, newLeftPosition, visibleWidth, "left");
         this._updatePositionOfElement(this._selectionDragElement, newLeftPosition, visibleWidth, "left");
 
-        this._leftSelectionHandleElement.classList.toggle("clamped", this._selectionStartTime < this._startTime);
-        this._leftSelectionHandleElement.title = this._selectionStartTime < this._startTime ? this._formatDividerLabelText(this._selectionStartTime) : "";
+        this._leftSelectionHandleElement.classList.toggle("clamped", startTimeClamped);
+        this._leftSelectionHandleElement.title = startTimeClamped  && this._selectionEndTime < this._startTime ? formattedEndTimeText : formattedStartTimeText;
 
-        var newRightPosition = 1 - Math.min((this._selectionEndTime - this._startTime) / duration, 1);
+        let newRightPosition = 1 - Math.min((this._selectionEndTime - this._startTime) / duration, 1);
         this._updatePositionOfElement(this._rightShadedAreaElement, newRightPosition, visibleWidth, "width");
         this._updatePositionOfElement(this._rightSelectionHandleElement, newRightPosition, visibleWidth, "right");
         this._updatePositionOfElement(this._selectionDragElement, newRightPosition, visibleWidth, "right");
 
-        this._rightSelectionHandleElement.classList.toggle("clamped", this._selectionEndTime > this._endTime);
-        this._rightSelectionHandleElement.title = this._selectionEndTime > this._endTime ? this._formatDividerLabelText(this._selectionEndTime) : "";
+        this._rightSelectionHandleElement.classList.toggle("clamped", endTimeClamped);
+        this._rightSelectionHandleElement.title = endTimeClamped && this._selectionStartTime > this._endTime ? formattedStartTimeText : formattedEndTimeText;
 
         if (!this._selectionDragElement.parentNode) {
             this._element.appendChild(this._selectionDragElement);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to