Title: [210382] branches/safari-603-branch/Source/WebInspectorUI
Revision
210382
Author
matthew_han...@apple.com
Date
2017-01-05 15:49:10 -0800 (Thu, 05 Jan 2017)

Log Message

Merge r210046. rdar://problem/27553228

Modified Paths

Diff

Modified: branches/safari-603-branch/Source/WebInspectorUI/ChangeLog (210381 => 210382)


--- branches/safari-603-branch/Source/WebInspectorUI/ChangeLog	2017-01-05 23:49:08 UTC (rev 210381)
+++ branches/safari-603-branch/Source/WebInspectorUI/ChangeLog	2017-01-05 23:49:10 UTC (rev 210382)
@@ -1,5 +1,30 @@
 2017-01-05  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r210046. rdar://problem/27553228
+
+    2016-12-20  Matt Baker  <mattba...@apple.com>
+
+            Web Inspector: Window resize causes TimelineOverview graph elements to be repositioned
+            https://bugs.webkit.org/show_bug.cgi?id=160207
+            <rdar://problem/27553228>
+
+            Reviewed by Brian Burg.
+
+            TimelineRuler does not always update its divider positions when the start
+            time changes while the end time remains the same. The check that determines
+            whether the first or last divider positions have changed before doing a
+            layout uses the ruler end time instead of calculating the last divider's
+            position, and would falsely determine no change was needed.
+
+            * UserInterface/Views/TimelineRuler.js:
+            (WebInspector.TimelineRuler.prototype.set startTime):
+            (WebInspector.TimelineRuler.prototype.set secondsPerPixel):
+            Clear cached divider data on zoom or scroll, forcing dividers to be recalculated.
+            (WebInspector.TimelineRuler.prototype.layout):
+            Calculate accurate divider count and last divider time.
+
+2017-01-05  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r210033. rdar://problem/29755339
 
     2016-12-20  Joseph Pecoraro  <pecor...@apple.com>

Modified: branches/safari-603-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js (210381 => 210382)


--- branches/safari-603-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js	2017-01-05 23:49:08 UTC (rev 210381)
+++ branches/safari-603-branch/Source/WebInspectorUI/UserInterface/Views/TimelineRuler.js	2017-01-05 23:49:10 UTC (rev 210382)
@@ -218,6 +218,8 @@
         if (!isNaN(this._duration))
             this._endTime = this._startTime + this._duration;
 
+        this._currentDividers = null;
+
         this.needsLayout();
     }
 
@@ -264,6 +266,7 @@
 
         this._secondsPerPixel = x;
         this._endTimePinned = false;
+        this._currentDividers = null;
         this._currentSliceTime = 0;
 
         this.needsLayout();
@@ -444,12 +447,12 @@
             sliceTime = this._currentSliceTime;
         }
 
+        // Calculate the divider count now based on the final slice time.
+        dividerCount = Math.floor(visibleWidth * this.secondsPerPixel / sliceTime);
+
         let firstDividerTime = (Math.ceil((this._startTime - this._zeroTime) / sliceTime) * sliceTime) + this._zeroTime;
-        let lastDividerTime = this._endTime;
+        let lastDividerTime = firstDividerTime + sliceTime * dividerCount;
 
-        // Calculate the divider count now based on the final slice time.
-        dividerCount = Math.ceil((lastDividerTime - firstDividerTime) / sliceTime);
-
         // Make an extra divider in case the last one is partially visible.
         if (!this._endTimePinned)
             ++dividerCount;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to