Changeset 194172 in webkit


Ignore:
Timestamp:
Dec 16, 2015 1:50:09 PM (8 years ago)
Author:
rniwa@webkit.org
Message:

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.

Location:
trunk/Websites/perf.webkit.org
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r194145 r194172  
     12015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        v3 dashboard doesn't stretch charts to fill the screen
     4        https://bugs.webkit.org/show_bug.cgi?id=152354
     5
     6        Reviewed by Chris Dumez.
     7
     8        The bug was caused by a workaround to avoid canvas stretching table cell too much.
     9
     10        Fix the problem instead by making the canvas absolutely positioned inside the "time-series-chart" element
     11        so that it does not contribute to the intrinsic/natural width of the cell.
     12
     13        * public/v3/components/time-series-chart.js:
     14        (TimeSeriesChart.prototype._ensureCanvas): Make the canvas absolutely positioned inside the shadow root.
     15        (TimeSeriesChart.prototype._updateCanvasSizeIfClientSizeChanged): Use the container element's size now that
     16        the canvas does not resize with it.
     17        * public/v3/pages/dashboard-page.js:
     18        (DashboardPage.cssTemplate): Updated the CSS so that the chart stretches all the way.
     19
    1202015-12-16  Ryosuke Niwa  <rniwa@webkit.org>
    221
  • trunk/Websites/perf.webkit.org/public/v3/components/time-series-chart.js

    r194130 r194172  
    3535            this._canvas = this._createCanvas();
    3636            this._canvas.style.display = 'block';
     37            this._canvas.style.position = 'absolute';
     38            this._canvas.style.left = '0px';
     39            this._canvas.style.top = '0px';
    3740            this._canvas.style.width = '100%';
    3841            this._canvas.style.height = '100%';
     
    535538        var canvas = this._ensureCanvas();
    536539
    537         var newWidth = canvas.clientWidth;
    538         var newHeight = canvas.clientHeight;
     540        var newWidth = this.element().clientWidth;
     541        var newHeight = this.element().clientHeight;
     542
    539543        if (!newWidth || !newHeight || (newWidth == this._width && newHeight == this._height))
    540544            return false;
  • trunk/Websites/perf.webkit.org/public/v3/pages/dashboard-page.js

    r194130 r194172  
    202202                border: 0;
    203203            }
    204             .dashboard-table td > * {
    205                 display: inline-block;
    206                 width: 20rem;
     204            .dashboard-table td time-series-chart {
     205                height: 10rem;
     206            }
     207            .dashboard-table td > chart-status-view {
     208                display: block;
     209                width: 100%;
    207210            }
    208211
Note: See TracChangeset for help on using the changeset viewer.