Changeset 200962 in webkit


Ignore:
Timestamp:
May 16, 2016, 1:19:24 PM (9 years ago)
Author:
Nikita Vasilyev
Message:

Web Inspector: Contents of Duration column are covered by always on (legacy) scroll bars
https://bugs.webkit.org/show_bug.cgi?id=157590

Reviewed by Timothy Hatcher.

Set the right padding of the DataGrid header to match the scrollbar width.

  • UserInterface/Views/DataGrid.css:

(.data-grid .data-container):
(.data-grid.inline .data-container):
Don't show scrollbars for inline data grids.

(.data-grid > .header-wrapper):
(.data-grid.no-header > .header-wrapper > table.header):
(.data-grid.no-header > table.header): Deleted.
(.data-grid th): Deleted.

  • UserInterface/Views/DataGrid.js:

(WebInspector.DataGrid):
We can't add padding-rigth to a table. Wrap the table in div.header-wrapper.

(WebInspector.DataGrid.prototype._updateScrollbarPadding):
(WebInspector.DataGrid.prototype.layout):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r200955 r200962  
     12016-05-16  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Web Inspector: Contents of Duration column are covered by always on (legacy) scroll bars
     4        https://bugs.webkit.org/show_bug.cgi?id=157590
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Set the right padding of the DataGrid header to match the scrollbar width.
     9
     10        * UserInterface/Views/DataGrid.css:
     11        (.data-grid .data-container):
     12        (.data-grid.inline .data-container):
     13        Don't show scrollbars for inline data grids.
     14
     15        (.data-grid > .header-wrapper):
     16        (.data-grid.no-header > .header-wrapper > table.header):
     17        (.data-grid.no-header > table.header): Deleted.
     18        (.data-grid th): Deleted.
     19        * UserInterface/Views/DataGrid.js:
     20        (WebInspector.DataGrid):
     21        We can't add padding-rigth to a table. Wrap the table in div.header-wrapper.
     22
     23        (WebInspector.DataGrid.prototype._updateScrollbarPadding):
     24        (WebInspector.DataGrid.prototype.layout):
     25
    1262016-05-16  Nikita Vasilyev  <nvasilyev@apple.com>
    227
  • trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.css

    r200918 r200962  
    5151    right: 0;
    5252    overflow-x: hidden;
    53     overflow-y: overlay;
     53    overflow-y: scroll;
    5454}
    5555
    5656.data-grid.inline .data-container {
    5757    position: static;
     58    overflow-y: auto;
    5859}
    5960
     
    6263}
    6364
    64 .data-grid.no-header > table.header {
     65.data-grid > .header-wrapper {
     66    border-bottom: 0.5px solid var(--border-color);
     67}
     68
     69.data-grid.no-header > .header-wrapper > table.header {
    6570    display: none;
    6671}
     
    7580
    7681    background-color: white;
    77 
    78     border-bottom: 0.5px solid var(--border-color);
    7982
    8083    font-weight: normal;
  • trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js

    r200949 r200962  
    5353        this.resizers = [];
    5454        this._columnWidthsInitialized = false;
     55        this._scrollbarWidth = 0;
    5556
    5657        this._cachedScrollTop = NaN;
     
    6869        this.element.copyHandler = this;
    6970
     71        this._headerWrapperElement = document.createElement("div");
     72        this._headerWrapperElement.classList.add("header-wrapper");
     73
    7074        this._headerTableElement = document.createElement("table");
    7175        this._headerTableElement.className = "header";
     76        this._headerWrapperElement.appendChild(this._headerTableElement);
     77
    7278        this._headerTableColumnGroupElement = this._headerTableElement.createChild("colgroup");
    7379        this._headerTableBodyElement = this._headerTableElement.createChild("tbody");
     
    110116        this._fillerRowElement = this.dataTableBodyElement.createChild("tr", "filler");
    111117
    112         this.element.appendChild(this._headerTableElement);
     118        this.element.appendChild(this._headerWrapperElement);
    113119        this.element.appendChild(this._scrollContainerElement);
    114120
     
    120126                this.insertColumn(columnIdentifier, columnsData[columnIdentifier]);
    121127        }
     128
     129        this._updateScrollbarPadding();
     130    }
     131
     132    _updateScrollbarPadding()
     133    {
     134        if (this._inline)
     135            return;
     136
     137        let scrollbarWidth = this._scrollContainerElement.offsetWidth - this._scrollContainerElement.scrollWidth;
     138        if (this._scrollbarWidth === scrollbarWidth)
     139            return;
     140
     141        this._headerWrapperElement.style.paddingRight = scrollbarWidth + "px";
     142        this._scrollbarWidth = scrollbarWidth;
    122143    }
    123144
     
    807828            this._positionResizerElements();
    808829            this._positionHeaderViews();
     830            this._updateScrollbarPadding();
    809831
    810832            this._cachedScrollTop = NaN;
Note: See TracChangeset for help on using the changeset viewer.