Skip to content
Permalink
Browse files
[css-grid] Add some test cases that were removed in r209562
https://bugs.webkit.org/show_bug.cgi?id=165750

Reviewed by Sergio Villar Senin.

Some valid test cases were removed in r209562, this patch adds them back.

* fast/css-grid-layout/grid-template-shorthand-get-set.html: The specified style is now preserved,
so we've to use a different value for it (as it doesn't merge the line names).
* fast/css-grid-layout/resources/grid-columns-rows-get-set.js: Flexible sizes must be non-negative,
but 0fr should be accepted (this is new as it was not working like that with the old parser).
A space between the dimension and the unit is wrong for flexible sizes.
* fast/css-grid-layout/resources/non-grid-columns-rows-get-set.js: Ditto.


Canonical link: https://commits.webkit.org/183376@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
mrego committed Dec 12, 2016
1 parent 5a23ca5 commit e0a38a7f14f770253a24a54928d1ca2d38521576
Showing 7 changed files with 44 additions and 0 deletions.
@@ -1,3 +1,19 @@
2016-12-12 Manuel Rego Casasnovas <rego@igalia.com>

[css-grid] Add some test cases that were removed in r209562
https://bugs.webkit.org/show_bug.cgi?id=165750

Reviewed by Sergio Villar Senin.

Some valid test cases were removed in r209562, this patch adds them back.

* fast/css-grid-layout/grid-template-shorthand-get-set.html: The specified style is now preserved,
so we've to use a different value for it (as it doesn't merge the line names).
* fast/css-grid-layout/resources/grid-columns-rows-get-set.js: Flexible sizes must be non-negative,
but 0fr should be accepted (this is new as it was not working like that with the old parser).
A space between the dimension and the unit is wrong for flexible sizes.
* fast/css-grid-layout/resources/non-grid-columns-rows-get-set.js: Ditto.

2016-12-12 Zalan Bujtas <zalan@apple.com>

The CSS 'columns' property when set on the <body> element makes short columns
@@ -124,6 +124,10 @@ PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is
PASS element.style.gridTemplateColumns is "3fr"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "600px"
PASS element.style.gridTemplateRows is "4fr"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "0px"
PASS element.style.gridTemplateColumns is "0fr"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "0px"
PASS element.style.gridTemplateRows is "0fr"

Test getting and setting grid-template-columns and grid-template-rows to calc() values through JS
PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "150px"
@@ -184,6 +188,8 @@ PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-column
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"

Test setting grid-template-columns and grid-template-rows back to 'none' through JS
PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "18px"
@@ -174,6 +174,12 @@ PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "[h
PASS element.style.gridTemplateRows is "[head] 15px [tail]"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "\"a\""
PASS element.style.gridTemplateAreas is "\"a\""
PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "100px"
PASS element.style.gridTemplateColumns is "100px"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "[foo1 bar1] 50px [foo2 bar2 foo3 bar3] 50px [foo4 bar4]"
PASS element.style.gridTemplateRows is "[foo1 bar1] 50px [foo2 bar2] [foo3 bar3] 50px [foo4 bar4]"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "\"a\" \"b\""
PASS element.style.gridTemplateAreas is "\"a\" \"b\""
PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "0px"
PASS element.style.gridTemplateColumns is "none"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "0px"
@@ -267,6 +267,7 @@
debug("Test getting and setting grid-template shorthand through JS");
testGridDefinitionsSetJSValues("66px / 18px", "18px", "66px", "none");
testGridDefinitionsSetJSValues("[head] 'a' 15px [tail] / 10px", "10px", "[head] 15px [tail]", "\"a\"");
testGridDefinitionsSetJSValues("[foo1 bar1] 'a' 50px [foo2 bar2] [foo3 bar3] 'b' 50px [foo4 bar4] / 100px", "100px", "[foo1 bar1] 50px [foo2 bar2 foo3 bar3] 50px [foo4 bar4]", "\"a\" \"b\"", "100px", "[foo1 bar1] 50px [foo2 bar2] [foo3 bar3] 50px [foo4 bar4]");
testGridDefinitionsSetJSValues("'a'", "0px", "0px", "\"a\"", "none", "auto");

debug("");
@@ -110,6 +110,10 @@ PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is
PASS element.style.gridTemplateColumns is "minmax(auto, 8vh)"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "minmax(80px, auto)"
PASS element.style.gridTemplateRows is "minmax(10vw, auto)"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "0px"
PASS element.style.gridTemplateColumns is "0fr"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "0px"
PASS element.style.gridTemplateRows is "0fr"

Test setting grid-template-columns and grid-template-rows to bad values through JS
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
@@ -132,6 +136,8 @@ PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-column
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"

Test setting grid-template-columns and grid-template-rows back to 'none' through JS
PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "18px"
@@ -64,6 +64,9 @@ testGridTemplatesSetJSValues("3600Fr", "154fR", "800px", "600px", "3600fr", "154
// A leading '+' is allowed.
testGridTemplatesSetJSValues("+3fr", "+4fr", "800px", "600px", "3fr", "4fr");

// 0fr is allowed.
testGridTemplatesSetJSValues(".0000fr", "0fr", "0px", "0px", "0fr", "0fr");

debug("");
debug("Test getting and setting grid-template-columns and grid-template-rows to calc() values through JS");
testGridTemplatesSetJSValues("calc(150px)", "calc(75px)", "150px", "75px");
@@ -93,6 +96,8 @@ testGridTemplatesSetBadJSValues("fit-content([a] 100px)", "fit-content(30px [b c

testGridTemplatesSetBadJSValues("-2fr", "3ffr");
testGridTemplatesSetBadJSValues("-2.05fr", "+-3fr");
// A dimension doesn't allow spaces between the number and the unit.
testGridTemplatesSetBadJSValues("1r", "13 fr");

testGridTemplatesSetBadJSValues("7.-fr", "-8,0fr");

@@ -56,6 +56,8 @@ testNonGridTemplatesSetJSValues("3.1459fr", "2.718fr");
// A leading '+' is allowed.
testNonGridTemplatesSetJSValues("+3fr", "+4fr", "3fr", "4fr", "3fr", "4fr");
testNonGridTemplatesSetJSValues("minmax(auto, 8vh)", "minmax(10vw, auto)", "minmax(auto, 48px)", "minmax(80px, auto)");
// 0fr is allowed.
testGridTemplatesSetJSValues(".0000fr", "0fr", "0px", "0px", "0fr", "0fr");

debug("");
debug("Test setting grid-template-columns and grid-template-rows to bad values through JS");
@@ -72,6 +74,8 @@ testGridTemplatesSetBadJSValues("minmax(1fr, 100px)", "minmax(2.5fr, 200px)");
testGridTemplatesSetBadJSValues("-2fr", "3ffr");
testGridTemplatesSetBadJSValues("-2.05fr", "+-3fr");
testGridTemplatesSetBadJSValues("7.-fr", "-8,0fr");
// A dimension doesn't allow spaces between the number and the unit.
testGridTemplatesSetBadJSValues("1r", "13 fr");
// Negative values are not allowed.
testGridTemplatesSetBadJSValues("-1px", "-6em");
testGridTemplatesSetBadJSValues("minmax(-1%, 32%)", "minmax(2vw, -6em)");

0 comments on commit e0a38a7

Please sign in to comment.