Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-typed-om] Add support for grid properties.
This patch adds support for some grid properties. We add a new <flex> CSS value object, which meant rebaselining all the tests. We're failing some tests because the 'grid', 'grid-template' and 'grid-gap' shorthands don't serialize to anything [1], so Typed OM can't create an unsupported style value from it. Not sure if this is a bug... [1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp?type=cs&l=406 Bug: 820299 Change-Id: I8ff871fffed2977ca20a623bd283d7cbdc247870
- Loading branch information
1 parent
55846d5
commit 901fbf8
Showing
10 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
css/css-typed-om/the-stylepropertymap/properties/grid-area.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'grid-area' property</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<script src="resources/testsuite.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
runUnsupportedPropertyTests('grid-area', [ | ||
'a', 'a / a', 'auto', 'auto / auto', '2 / 1 / 2', | ||
'span 3', '2 span / a span' | ||
]); | ||
|
||
</script> |
33 changes: 33 additions & 0 deletions
33
css/css-typed-om/the-stylepropertymap/properties/grid-auto-columns-rows.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'grid-auto-columns' and 'grid-auto-rows' properties</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<script src="resources/testsuite.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
// grid-auto-columns/rows are list-valued. | ||
// Run list-valued tests here too. | ||
for (const suffix of ['columns', 'rows']) { | ||
runPropertyTests(`grid-auto-${suffix}`, [ | ||
{ syntax: 'min-content' }, | ||
{ syntax: 'max-content' }, | ||
{ syntax: 'auto' }, | ||
{ syntax: '<length>' }, | ||
{ syntax: '<percentage>' }, | ||
{ syntax: '<flex>' }, | ||
]); | ||
|
||
runUnsupportedPropertyTests(`grid-auto-${suffix}`, [ | ||
'minmax(100px, auto)', 'fit-content(400px)' | ||
]); | ||
} | ||
|
||
</script> |
25 changes: 25 additions & 0 deletions
25
css/css-typed-om/the-stylepropertymap/properties/grid-auto-flow.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'grid-auto-flow' property</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<script src="resources/testsuite.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
runPropertyTests('grid-auto-flow', [ | ||
{ syntax: 'row' }, | ||
{ syntax: 'column' }, | ||
]); | ||
|
||
runUnsupportedPropertyTests('grid-auto-flow', [ | ||
'row dense', 'column dense', | ||
]); | ||
|
||
</script> |
20 changes: 20 additions & 0 deletions
20
css/css-typed-om/the-stylepropertymap/properties/grid-gap.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'grid-gap' property</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<script src="resources/testsuite.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
runUnsupportedPropertyTests('grid-gap', [ | ||
'20px', '16%', '20px 10px', '15% 100%', '21px 82%' | ||
]); | ||
|
||
</script> |
28 changes: 28 additions & 0 deletions
28
css/css-typed-om/the-stylepropertymap/properties/grid-start-end.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'grid-{row/column}-{start/end}' properties</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<script src="resources/testsuite.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
for (const orientation of ['row', 'column']) { | ||
for (const suffix of ['start', 'end']) { | ||
runPropertyTests(`grid-${orientation}-${suffix}`, [ | ||
{ syntax: 'auto' }, | ||
]); | ||
|
||
runUnsupportedPropertyTests(`grid-${orientation}-${suffix}`, [ | ||
'3', 'span 2', '5 somegridarea span' | ||
]); | ||
} | ||
} | ||
|
||
</script> |
24 changes: 24 additions & 0 deletions
24
css/css-typed-om/the-stylepropertymap/properties/grid-template-areas.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'grid-template-areas' property</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<script src="resources/testsuite.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
runPropertyTests('grid-template-areas', [ | ||
{ syntax: 'none' }, | ||
]); | ||
|
||
runUnsupportedPropertyTests('grid-template-areas', [ | ||
'"a a a"', '"a a a" "b b b"', | ||
]); | ||
|
||
</script> |
27 changes: 27 additions & 0 deletions
27
css/css-typed-om/the-stylepropertymap/properties/grid-template-columns-rows.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'grid-template-columns' and 'grid-template-rows' properties</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<script src="resources/testsuite.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
for (const suffix of ['columns', 'rows']) { | ||
runPropertyTests(`grid-template-${suffix}`, [ | ||
{ syntax: 'none' }, | ||
]); | ||
|
||
runUnsupportedPropertyTests(`grid-template-${suffix}`, [ | ||
'[linename1] 100px [linename2 linename3]', | ||
'200px repeat(auto-fill, 100px) 300px' | ||
]); | ||
} | ||
|
||
</script> |
22 changes: 22 additions & 0 deletions
22
css/css-typed-om/the-stylepropertymap/properties/grid-template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'grid-template' property</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<script src="resources/testsuite.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
runUnsupportedPropertyTests('grid-template', [ | ||
'none', '100px 1fr / 50px 1fr', '[linename] 100px / [columnname1] 30% [columname2] 70%', | ||
'fit-content(100px) / fit-content(40%)', '"a a a" "b b b"', | ||
'[header-top] "a a a" [header-bottom] [main-top] "b b b" 1fr [main-bottom] / auto 1fr auto' | ||
]); | ||
|
||
</script> |
21 changes: 21 additions & 0 deletions
21
css/css-typed-om/the-stylepropertymap/properties/grid.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>'grid' property</title> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set"> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../../resources/testhelper.js"></script> | ||
<script src="resources/testsuite.js"></script> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
runUnsupportedPropertyTests('grid', [ | ||
'auto-flow / 1fr 1fr 1fr', 'auto-flow dense / 40px 40px 1fr', | ||
'repeat(3, 80px) / auto-flow' | ||
]); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters