Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (238219 => 238220)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-11-15 06:01:15 UTC (rev 238219)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-11-15 12:19:24 UTC (rev 238220)
@@ -1,3 +1,20 @@
+2018-11-15 Manuel Rego Casasnovas <r...@igalia.com>
+
+ [css-grid] Consider scrollbars in populateGridPositionsForDirection()
+ https://bugs.webkit.org/show_bug.cgi?id=191656
+
+ Reviewed by Javier Fernandez.
+
+ 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:
+
2018-11-14 Youenn Fablet <you...@apple.com>
Convert libwebrtc error types to DOM exceptions
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001-expected.html (0 => 238220)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001-expected.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001-expected.html 2018-11-15 12:19:24 UTC (rev 238220)
@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS container Layout Test Reference</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<style>
+ .container {
+ margin: 10px;
+ background: grey;
+ }
+
+ .scrollX {
+ overflow-x: scroll;
+ }
+
+ .scrollY {
+ overflow-y: scroll;
+ }
+
+ .fixedSize {
+ width: 200px;
+ height: 50px;
+ }
+
+ .container > div {
+ background: cyan;
+ width: 100%;
+ height: 100%;
+ }
+
+ .directionRTL {
+ direction: rtl;
+ }
+</style>
+
+<p>The test passes if it has the same output than the reference.</p>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: ltr;</h2>
+
+ <div class="container scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="container scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="container scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="container fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="container fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="container fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: rtl;</h2>
+
+ <div class="directionRTL container scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html (0 => 238220)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html 2018-11-15 12:19:24 UTC (rev 238220)
@@ -0,0 +1,92 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: Grid container with scrollbars</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<link rel="help" href=""
+<link rel="match" href=""
+<meta name="assert" content="This test verifes that scrollbars are properly painted on grid containers, and are shown in the expected position depending on the direction.">
+<link href="" rel="stylesheet">
+<style>
+ .grid {
+ margin: 10px;
+ }
+
+ .scrollX {
+ overflow-x: scroll;
+ }
+
+ .scrollY {
+ overflow-y: scroll;
+ }
+
+ .fixedSize {
+ width: 200px;
+ height: 50px;
+ }
+
+ .grid > div {
+ background: cyan;
+ }
+</style>
+
+<p>The test passes if it has the same output than the reference.</p>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: ltr;</h2>
+
+ <div class="grid scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="grid scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="grid scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="grid fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="grid fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="grid fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: rtl;</h2>
+
+ <div class="directionRTL grid scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001-expected.html (0 => 238220)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001-expected.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001-expected.html 2018-11-15 12:19:24 UTC (rev 238220)
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS container Layout Test Reference</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<style>
+ .container {
+ margin: 10px;
+ background: grey;
+ writing-mode: vertical-lr;
+ }
+
+ .scrollX {
+ overflow-x: scroll;
+ }
+
+ .scrollY {
+ overflow-y: scroll;
+ }
+
+ .fixedSize {
+ width: 200px;
+ height: 50px;
+ }
+
+ .container > div {
+ background: cyan;
+ width: 100%;
+ height: 100%;
+ }
+
+ .directionRTL {
+ direction: rtl;
+ }
+</style>
+
+<p>The test passes if it has the same output than the reference.</p>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: ltr;</h2>
+
+ <div class="container scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="container scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="container scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="container fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="container fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="container fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: rtl;</h2>
+
+ <div class="directionRTL container scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html (0 => 238220)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html 2018-11-15 12:19:24 UTC (rev 238220)
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: Grid container with scrollbars</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<link rel="help" href=""
+<link rel="match" href=""
+<meta name="assert" content="This test verifes that scrollbars are properly painted on grid containers, and are shown in the expected position depending on the direction.">
+<link href="" rel="stylesheet">
+<style>
+ .grid {
+ margin: 10px;
+ writing-mode: vertical-lr;
+ }
+
+ .scrollX {
+ overflow-x: scroll;
+ }
+
+ .scrollY {
+ overflow-y: scroll;
+ }
+
+ .fixedSize {
+ width: 200px;
+ height: 50px;
+ }
+
+ .grid > div {
+ background: cyan;
+ }
+</style>
+
+<p>The test passes if it has the same output than the reference.</p>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: ltr;</h2>
+
+ <div class="grid scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="grid scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="grid scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="grid fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="grid fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="grid fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: rtl;</h2>
+
+ <div class="directionRTL grid scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001-expected.html (0 => 238220)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001-expected.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001-expected.html 2018-11-15 12:19:24 UTC (rev 238220)
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS container Layout Test Reference</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<style>
+ .container {
+ margin: 10px;
+ background: grey;
+ writing-mode: vertical-rl;
+ }
+
+ .scrollX {
+ overflow-x: scroll;
+ }
+
+ .scrollY {
+ overflow-y: scroll;
+ }
+
+ .fixedSize {
+ width: 200px;
+ height: 50px;
+ }
+
+ .container > div {
+ background: cyan;
+ width: 100%;
+ height: 100%;
+ }
+
+ .directionRTL {
+ direction: rtl;
+ }
+</style>
+
+<p>The test passes if it has the same output than the reference.</p>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: ltr;</h2>
+
+ <div class="container scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="container scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="container scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="container fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="container fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="container fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: rtl;</h2>
+
+ <div class="directionRTL container scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL container fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html (0 => 238220)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html 2018-11-15 12:19:24 UTC (rev 238220)
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: Grid container with scrollbars</title>
+<link rel="author" title="Manuel Rego Casasnovas" href=""
+<link rel="help" href=""
+<link rel="match" href=""
+<meta name="assert" content="This test verifes that scrollbars are properly painted on grid containers, and are shown in the expected position depending on the direction.">
+<link href="" rel="stylesheet">
+<style>
+ .grid {
+ margin: 10px;
+ writing-mode: vertical-rl;
+ }
+
+ .scrollX {
+ overflow-x: scroll;
+ }
+
+ .scrollY {
+ overflow-y: scroll;
+ }
+
+ .fixedSize {
+ width: 200px;
+ height: 50px;
+ }
+
+ .grid > div {
+ background: cyan;
+ }
+</style>
+
+<p>The test passes if it has the same output than the reference.</p>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: ltr;</h2>
+
+ <div class="grid scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="grid scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="grid scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="grid fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="grid fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="grid fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
+
+<div style="float: left; width: 350px;">
+
+ <h2>direction: rtl;</h2>
+
+ <div class="directionRTL grid scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid scrollX scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid fixedSize scrollX">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid fixedSize scrollY">
+ <div>item</div>
+ </div>
+
+ <div class="directionRTL grid fixedSize scrollX scrollY">
+ <div>item</div>
+ </div>
+
+</div>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/w3c-import.log (238219 => 238220)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/w3c-import.log 2018-11-15 06:01:15 UTC (rev 238219)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/w3c-import.log 2018-11-15 12:19:24 UTC (rev 238220)
@@ -24,6 +24,12 @@
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-letter-002-expected.html
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-letter-002.html
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-line-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001-expected.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-display-grid-001-expected.xht
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-display-grid-001.html
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-display-inline-grid-001-expected.xht
Modified: trunk/Source/WebCore/ChangeLog (238219 => 238220)
--- trunk/Source/WebCore/ChangeLog 2018-11-15 06:01:15 UTC (rev 238219)
+++ trunk/Source/WebCore/ChangeLog 2018-11-15 12:19:24 UTC (rev 238220)
@@ -1,3 +1,24 @@
+2018-11-15 Manuel Rego Casasnovas <r...@igalia.com>
+
+ [css-grid] Consider scrollbars in populateGridPositionsForDirection()
+ https://bugs.webkit.org/show_bug.cgi?id=191656
+
+ Reviewed by Javier Fernandez.
+
+ 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):
+
2018-11-14 Keith Rollin <krol...@apple.com>
Move scripts for Derived and Unified Sources to external files
Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (238219 => 238220)
--- trunk/Source/WebCore/rendering/RenderGrid.cpp 2018-11-15 06:01:15 UTC (rev 238219)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp 2018-11-15 12:19:24 UTC (rev 238220)
@@ -1003,7 +1003,13 @@
const auto& offset = direction == ForColumns ? m_offsetBetweenColumns : m_offsetBetweenRows;
auto& positions = isRowAxis ? m_columnPositions : m_rowPositions;
positions.resize(numberOfLines);
+
auto borderAndPadding = isRowAxis ? borderAndPaddingLogicalLeft() : borderAndPaddingBefore();
+ // If we are in horizontal writing mode and RTL direction the scrollbar is painted on the left,
+ // so we need to take into account when computing the position of the columns.
+ if (isRowAxis && style().isHorizontalWritingMode() && !style().isLeftToRightDirection())
+ borderAndPadding += scrollbarLogicalWidth();
+
positions[0] = borderAndPadding + offset.positionOffset;
if (numberOfLines > 1) {
// If we have collapsed tracks we just ignore gaps here and add them later as we might not