Title: [171812] branches/safari-600.1-branch/Source/WebInspectorUI

Diff

Modified: branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog (171811 => 171812)


--- branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog	2014-07-30 20:36:45 UTC (rev 171811)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog	2014-07-30 20:40:22 UTC (rev 171812)
@@ -1,5 +1,29 @@
 2014-07-30  Lucas Forschler  <[email protected]>
 
+        Merge r171786
+
+    2014-07-29  Joseph Pecoraro  <[email protected]>
+
+            Web Inspector: Reduce forced layouts in TimelineOverview
+            https://bugs.webkit.org/show_bug.cgi?id=135405
+
+            Reviewed by Timothy Hatcher.
+
+            Remove another forced layout. The scroll container won't
+            change size unless the ContentView itself resized. Make the
+            distinction between a layout update due to a resize and
+            normal events (scale changes, etc) and only calculate
+            element sizes then.
+
+            * UserInterface/Views/TimelineContentView.js:
+            (WebInspector.TimelineContentView.prototype.updateLayout):
+            * UserInterface/Views/TimelineOverview.js:
+            (WebInspector.TimelineOverview):
+            (WebInspector.TimelineOverview.prototype.get visibleDuration):
+            (WebInspector.TimelineOverview.prototype.updateLayoutForResize):
+
+2014-07-30  Lucas Forschler  <[email protected]>
+
         Merge r171783
 
     2014-07-29  Joseph Pecoraro  <[email protected]>

Modified: branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js (171811 => 171812)


--- branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js	2014-07-30 20:36:45 UTC (rev 171811)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js	2014-07-30 20:40:22 UTC (rev 171812)
@@ -156,7 +156,7 @@
 
     updateLayout: function()
     {
-        this._timelineOverview.updateLayout();
+        this._timelineOverview.updateLayoutForResize();
 
         if (!this._currentTimelineView)
             return;

Modified: branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (171811 => 171812)


--- branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2014-07-30 20:36:45 UTC (rev 171811)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2014-07-30 20:40:22 UTC (rev 171812)
@@ -69,6 +69,7 @@
     this._endTime = 0;
     this._secondsPerPixel = this._secondsPerPixelSetting.value;
     this._scrollStartTime = 0;
+    this._cachedScrollContainerWidth = NaN;
 
     this.selectionStartTime = this._selectionStartTimeSetting.value;
     this.selectionDuration = this._selectionDurationSetting.value;
@@ -177,7 +178,12 @@
 
     get visibleDuration()
     {
-        return this._scrollContainer.offsetWidth * this._secondsPerPixel;
+        if (isNaN(this._cachedScrollContainerWidth)) {
+            this._cachedScrollContainerWidth = this._scrollContainer.offsetWidth;
+            console.assert(this._cachedScrollContainerWidth > 0);
+        }
+
+        return this._cachedScrollContainerWidth * this._secondsPerPixel;
     },
 
     get selectionStartTime()
@@ -215,6 +221,12 @@
         this.scrollStartTime = marker.time - (this.visibleDuration / 2);
     },
 
+    updateLayoutForResize: function()
+    {
+        this._cachedScrollContainerWidth = NaN;
+        this.updateLayout();
+    },
+
     updateLayout: function()
     {
         if (this._scheduledLayoutUpdateIdentifier) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to