v3 dashboard doesn't stretch charts to fill the screen
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2015 21:50:09 +0000 (21:50 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2015 21:50:09 +0000 (21:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152354

Reviewed by Chris Dumez.

The bug was caused by a workaround to avoid canvas stretching table cell too much.

Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
so that it does not contribute to the intrinsic/natural width of the cell.

* public/v3/components/time-series-chart.js:
(TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
(TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
the canvas does not resize with it.
* public/v3/pages/dashboard-page.js:
(DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194172 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/v3/components/time-series-chart.js
Websites/perf.webkit.org/public/v3/pages/dashboard-page.js

index b6feef3..7f22612 100644 (file)
@@ -1,5 +1,24 @@
 2015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
 
+        v3 dashboard doesn't stretch charts to fill the screen
+        https://bugs.webkit.org/show_bug.cgi?id=152354
+
+        Reviewed by Chris Dumez.
+
+        The bug was caused by a workaround to avoid canvas stretching table cell too much.
+
+        Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
+        so that it does not contribute to the intrinsic/natural width of the cell.
+
+        * public/v3/components/time-series-chart.js:
+        (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
+        (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
+        the canvas does not resize with it.
+        * public/v3/pages/dashboard-page.js:
+        (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
+
+2015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
+
         The chart status on v3 UI sometimes show wrong revision ranges
         https://bugs.webkit.org/show_bug.cgi?id=152331
 
index 6308db3..dad2544 100644 (file)
@@ -34,6 +34,9 @@ class TimeSeriesChart extends ComponentBase {
         if (!this._canvas) {
             this._canvas = this._createCanvas();
             this._canvas.style.display = 'block';
+            this._canvas.style.position = 'absolute';
+            this._canvas.style.left = '0px';
+            this._canvas.style.top = '0px';
             this._canvas.style.width = '100%';
             this._canvas.style.height = '100%';
             this.content().appendChild(this._canvas);
@@ -534,8 +537,9 @@ class TimeSeriesChart extends ComponentBase {
     {
         var canvas = this._ensureCanvas();
 
-        var newWidth = canvas.clientWidth;
-        var newHeight = canvas.clientHeight;
+        var newWidth = this.element().clientWidth;
+        var newHeight = this.element().clientHeight;
+
         if (!newWidth || !newHeight || (newWidth == this._width && newHeight == this._height))
             return false;
 
index 3994228..a7e84d8 100644 (file)
@@ -201,9 +201,12 @@ class DashboardPage extends PageWithCharts {
                 height: 100%;
                 border: 0;
             }
-            .dashboard-table td > * {
-                display: inline-block;
-                width: 20rem;
+            .dashboard-table td time-series-chart {
+                height: 10rem;
+            }
+            .dashboard-table td > chart-status-view {
+                display: block;
+                width: 100%;
             }
 
             .dashboard-table td *:first-child {