Changeset 238395 in webkit


Ignore:
Timestamp:
Nov 20, 2018 3:58:30 AM (5 years ago)
Author:
Manuel Rego Casasnovas
Message:

[css-grid] Consider scrollbars in populateGridPositionsForDirection()
https://bugs.webkit.org/show_bug.cgi?id=191656

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Imported tests from WPT.

  • web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001-expected.html: Added.
  • web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html: Added.
  • web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001-expected.html: Added.
  • web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html: Added.
  • web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001-expected.html: Added.
  • web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html: Added.
  • web-platform-tests/css/css-grid/grid-model/w3c-import.log:

Source/WebCore:

We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).

The patch modifies the method so it takes into account scrollbar size
in order to compute the position of the columns/rows depending on the direction and the writing mode.

Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html

imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::populateGridPositionsForDirection):

Location:
trunk
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r238377 r238395  
     12018-11-20  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Consider scrollbars in populateGridPositionsForDirection()
     4        https://bugs.webkit.org/show_bug.cgi?id=191656
     5
     6        Reviewed by Javier Fernandez.
     7
     8        Imported tests from WPT.
     9
     10        * web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001-expected.html: Added.
     11        * web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html: Added.
     12        * web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001-expected.html: Added.
     13        * web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html: Added.
     14        * web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001-expected.html: Added.
     15        * web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html: Added.
     16        * web-platform-tests/css/css-grid/grid-model/w3c-import.log:
     17
    1182018-11-19  Rob Buis  <rbuis@igalia.com>
    219
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/w3c-import.log

    r238242 r238395  
    2525/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-letter-002.html
    2626/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-line-001.html
     27/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001-expected.html
     28/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
     29/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001-expected.html
     30/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
     31/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001-expected.html
     32/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
    2733/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-display-grid-001-expected.xht
    2834/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-display-grid-001.html
  • trunk/Source/WebCore/ChangeLog

    r238393 r238395  
     12018-11-20  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Consider scrollbars in populateGridPositionsForDirection()
     4        https://bugs.webkit.org/show_bug.cgi?id=191656
     5
     6        Reviewed by Javier Fernandez.
     7
     8        We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
     9        that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
     10        but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
     11
     12        The patch modifies the method so it takes into account scrollbar size
     13        in order to compute the position of the columns/rows depending on the direction and the writing mode.
     14
     15        Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
     16               imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
     17               imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
     18
     19        * rendering/RenderGrid.cpp:
     20        (WebCore::RenderGrid::populateGridPositionsForDirection):
     21
    1222018-11-19  Ryosuke Niwa  <rniwa@webkit.org>
    223
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r238242 r238395  
    10041004    auto& positions = isRowAxis ? m_columnPositions : m_rowPositions;
    10051005    positions.resize(numberOfLines);
     1006
    10061007    auto borderAndPadding = isRowAxis ? borderAndPaddingLogicalLeft() : borderAndPaddingBefore();
     1008#if !PLATFORM(IOS_FAMILY)
     1009    // FIXME: Ideally scrollbarLogicalWidth() should return zero in iOS so we don't need this
     1010    // (see bug https://webkit.org/b/191857).
     1011    // If we are in horizontal writing mode and RTL direction the scrollbar is painted on the left,
     1012    // so we need to take into account when computing the position of the columns.
     1013    if (isRowAxis && style().isHorizontalWritingMode() && !style().isLeftToRightDirection())
     1014        borderAndPadding += scrollbarLogicalWidth();
     1015#endif
     1016
    10071017    positions[0] = borderAndPadding + offset.positionOffset;
    10081018    if (numberOfLines > 1) {
Note: See TracChangeset for help on using the changeset viewer.