зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1586226 [wpt PR 19507] - CSS: Additional grid-template-rows/columns computed value tests, a=testonly
Automatic update from web-platform-tests CSS: Additional grid-template-rows/columns computed value tests WPT for grid-template-rows and grid-template-columns when element is not empty. Note: Some tests crashed Blink before crbug.com/988516 was fixed. The last grid-template-rows test fails in Blink and WebKit: crbug.com/1011329 Bug: 988516, 1011329 Change-Id: If738869b81ae9fae7214042481f9650bf856b1ff Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1840131 Commit-Queue: Eric Willigers <ericwilligers@chromium.org> Reviewed-by: Oriol Brufau <obrufau@igalia.com> Cr-Commit-Position: refs/heads/master@{#707636} -- wpt-commits: e0875f70f4f33a92d8a935e8d0e09a67a45761e8 wpt-pr: 19507
This commit is contained in:
Родитель
ae501d94d8
Коммит
5036b72e78
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Grid Layout Test: getComputedStyle().gridTemplateColumns</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#propdef-grid-template-columns">
|
||||
<meta name="assert" content="grid-template-columns computed value is the keyword none or a computed track list.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
display: grid;
|
||||
font-size: 40px;
|
||||
min-width: 200px;
|
||||
width: 300px;
|
||||
max-width: 400px;
|
||||
min-height: 500px;
|
||||
height: 600px;
|
||||
max-height: 700px;
|
||||
}
|
||||
#child {
|
||||
min-width: 20px;
|
||||
width: 30px;
|
||||
max-width: 40px;
|
||||
min-height: 50px;
|
||||
height: 60px;
|
||||
max-height: 70px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="target">
|
||||
<div id="child"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
test_computed_value("grid-template-columns", 'none', '300px'); // "none" without #child
|
||||
|
||||
// track-size <fixed-breadth> = <length-percentage> | <flex> | min-content | max-content | auto
|
||||
test_computed_value("grid-template-columns", '20%', '60px'); // 20% * width
|
||||
test_computed_value("grid-template-columns", 'calc(-0.5em + 10px)', '0px');
|
||||
test_computed_value("grid-template-columns", 'calc(0.5em + 10px)', '30px');
|
||||
test_computed_value("grid-template-columns", 'calc(30% + 40px)', '130px'); // 30% * width + 40px
|
||||
test_computed_value("grid-template-columns", '5fr', '300px'); // width
|
||||
test_computed_value("grid-template-columns", 'min-content', '30px');
|
||||
test_computed_value("grid-template-columns", 'max-content', '30px');
|
||||
test_computed_value("grid-template-columns", 'auto', '300px'); // width
|
||||
|
||||
// track-size minmax( <inflexible-breadth> , <track-breadth> )
|
||||
test_computed_value("grid-template-columns", 'minmax(10px, auto)', '300px'); // width
|
||||
test_computed_value("grid-template-columns", 'minmax(20%, max-content)', '60px'); // 20% * width
|
||||
test_computed_value("grid-template-columns", 'minmax(min-content, calc(-0.5em + 10px))', '30px');
|
||||
test_computed_value("grid-template-columns", 'minmax(auto, 0)', '30px');
|
||||
|
||||
// track-size fit-content( <length-percentage> )
|
||||
test_computed_value("grid-template-columns", 'fit-content(70px)', '30px');
|
||||
test_computed_value("grid-template-columns", 'fit-content(20%)', '30px');
|
||||
test_computed_value("grid-template-columns", 'fit-content(calc(-0.5em + 10px))', '30px');
|
||||
|
||||
// <track-repeat> = repeat( [ <positive-integer> ] , [ <line-names>? <track-size> ]+ <line-names>? )
|
||||
test_computed_value("grid-template-columns", 'repeat(1, 10px)', '10px');
|
||||
test_computed_value("grid-template-columns", 'repeat(1, [one two] 20%)', '[one two] 60px');
|
||||
test_computed_value("grid-template-columns", 'repeat(2, minmax(10px, auto))', '160px 140px');
|
||||
|
||||
test_computed_value("grid-template-columns", 'repeat(2, fit-content(20%) [three four] 30px 40px [five six])',
|
||||
'30px [three four] 30px 40px [five six] 0px [three four] 30px 40px [five six]');
|
||||
|
||||
// <track-list> = [ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>?
|
||||
test_computed_value("grid-template-columns", 'min-content repeat(5, minmax(10px, auto))',
|
||||
'30px 54px 54px 54px 54px 54px');
|
||||
test_computed_value("grid-template-columns", '[] 150px [] 1fr []', '150px 150px');
|
||||
|
||||
// <auto-repeat> = repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? )
|
||||
test_computed_value("grid-template-columns", 'repeat(auto-fill, 200px)', '200px');
|
||||
test_computed_value("grid-template-columns", 'repeat(auto-fit, [one] 20%)',
|
||||
'[one] 60px [one] 0px [one] 0px [one] 0px [one] 0px');
|
||||
test_computed_value("grid-template-columns", 'repeat(auto-fill, minmax(100px, 5fr) [two])',
|
||||
'100px [two] 100px [two] 100px [two]');
|
||||
test_computed_value("grid-template-columns", 'repeat(auto-fit, [three] minmax(max-content, 6em) [four])',
|
||||
'[three] 240px [four]');
|
||||
|
||||
// <auto-track-list> =
|
||||
// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
|
||||
// <auto-repeat>
|
||||
// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
|
||||
|
||||
test_computed_value("grid-template-columns", '[one] repeat(2, minmax(50px, auto)) [two] 30px [three] repeat(auto-fill, 10px) 40px [four five] repeat(2, minmax(200px, auto)) [six]',
|
||||
'[one] 50px 50px [two] 30px [three] 10px 40px [four five] 200px 200px [six]');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Grid Layout Test: getComputedStyle().gridTemplateRows</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#propdef-grid-template-rows">
|
||||
<meta name="assert" content="grid-template-rows computed value is the keyword none or a computed track list.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
display: grid;
|
||||
font-size: 40px;
|
||||
min-width: 200px;
|
||||
width: 300px;
|
||||
max-width: 400px;
|
||||
min-height: 500px;
|
||||
height: 600px;
|
||||
max-height: 700px;
|
||||
}
|
||||
#child {
|
||||
min-width: 20px;
|
||||
width: 30px;
|
||||
max-width: 40px;
|
||||
min-height: 50px;
|
||||
height: 60px;
|
||||
max-height: 70px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="target">
|
||||
<div id="child"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
test_computed_value("grid-template-rows", 'none', '600px'); // "none" without #child
|
||||
|
||||
// track-size <fixed-breadth> = <length-percentage> | <flex> | min-content | max-content | auto
|
||||
test_computed_value("grid-template-rows", '20%', '120px'); // 20% * height
|
||||
test_computed_value("grid-template-rows", 'calc(-0.5em + 10px)', '0px');
|
||||
test_computed_value("grid-template-rows", 'calc(0.5em + 10px)', '30px');
|
||||
test_computed_value("grid-template-rows", 'calc(30% + 40px)', '220px'); // 30% * height + 40px
|
||||
test_computed_value("grid-template-rows", '5fr', '600px'); // height
|
||||
test_computed_value("grid-template-rows", 'min-content', '60px');
|
||||
test_computed_value("grid-template-rows", 'max-content', '60px');
|
||||
test_computed_value("grid-template-rows", 'auto', '600px'); // height
|
||||
|
||||
// track-size minmax( <inflexible-breadth> , <track-breadth> )
|
||||
test_computed_value("grid-template-rows", 'minmax(10px, auto)', '600px'); // height
|
||||
test_computed_value("grid-template-rows", 'minmax(20%, max-content)', '120px'); // 20% * height
|
||||
test_computed_value("grid-template-rows", 'minmax(min-content, calc(-0.5em + 10px))', '60px');
|
||||
test_computed_value("grid-template-rows", 'minmax(auto, 0)', '60px');
|
||||
|
||||
// track-size fit-content( <length-percentage> )
|
||||
test_computed_value("grid-template-rows", 'fit-content(70px)', '60px');
|
||||
test_computed_value("grid-template-rows", 'fit-content(20%)', '60px');
|
||||
test_computed_value("grid-template-rows", 'fit-content(calc(-0.5em + 10px))', '60px');
|
||||
|
||||
// <track-repeat> = repeat( [ <positive-integer> ] , [ <line-names>? <track-size> ]+ <line-names>? )
|
||||
test_computed_value("grid-template-rows", 'repeat(1, 10px)', '10px');
|
||||
test_computed_value("grid-template-rows", 'repeat(1, [one two] 20%)', '[one two] 120px');
|
||||
test_computed_value("grid-template-rows", 'repeat(2, minmax(10px, auto))', '325px 275px');
|
||||
|
||||
test_computed_value("grid-template-rows", 'repeat(2, fit-content(20%) [three four] 30px 40px [five six])',
|
||||
'60px [three four] 30px 40px [five six] 0px [three four] 30px 40px [five six]');
|
||||
|
||||
// <track-list> = [ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>?
|
||||
test_computed_value("grid-template-rows", 'min-content repeat(5, minmax(10px, auto))',
|
||||
'60px 108px 108px 108px 108px 108px');
|
||||
test_computed_value("grid-template-rows", '[] 150px [] 1fr []', '150px 450px');
|
||||
|
||||
// <auto-repeat> = repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? )
|
||||
test_computed_value("grid-template-rows", 'repeat(auto-fill, 200px)', '200px 200px 200px');
|
||||
test_computed_value("grid-template-rows", 'repeat(auto-fit, [one] 20%)',
|
||||
'[one] 120px [one] 0px [one] 0px [one] 0px [one] 0px');
|
||||
test_computed_value("grid-template-rows", 'repeat(auto-fill, minmax(100px, 5fr) [two])',
|
||||
'100px [two] 100px [two] 100px [two] 100px [two] 100px [two] 100px [two]');
|
||||
test_computed_value("grid-template-rows", 'repeat(auto-fit, [three] minmax(max-content, 6em) [four])',
|
||||
'[three] 240px [four three] 0px [four]');
|
||||
|
||||
// <auto-track-list> =
|
||||
// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
|
||||
// <auto-repeat>
|
||||
// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
|
||||
|
||||
test_computed_value("grid-template-rows", '[one] repeat(2, minmax(50px, auto)) [two] 30px [three] repeat(auto-fill, 10px) 40px [four five] repeat(2, minmax(200px, auto)) [six]',
|
||||
'[one] 50px 50px [two] 30px [three] 10px 10px 10px 40px [four five] 200px 200px [six]');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче