[css-grid] Consider scrollbars in populateGridPositionsForDirection()
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Nov 2018 11:58:30 +0000 (11:58 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Nov 2018 11:58:30 +0000 (11:58 +0000)
commitd41b23495ead976203bb3d92f7a7951a9de96df5
treebd9293d70ecda52cccf86b595a2913a1bff9be8d
parent9e002577565249dcb5b93812d05746e9f664696f
[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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001-expected.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp