Bug 1567661 [wpt PR 17952] - CSS: WPTs for computed value results derived from percentages, a=testonly

Automatic update from web-platform-tests
CSS: WPTs for computed value results derived from percentages

WPTs for getComputedStyle results for the following properties:
- margin
- inline-size, block-size
- perspective-origin
- transform-origin
https://drafts.csswg.org/css-box-3/#propdef-margin
https://drafts.csswg.org/css-logical-1/#dimension-properties
https://drafts.csswg.org/css-transforms-2/#perspective-origin-property
https://drafts.csswg.org/css-transforms-2/#transform-origin-property

Change-Id: I7318446a148323649ff4f555855495b69e6c3992
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1708695
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679846}

--

wpt-commits: f30c9161157e2162ae09687eeea86e5e71a8b075
wpt-pr: 17952


--HG--
rename : testing/web-platform/tests/css/css-transforms/parsing/perspective-origin-parsing-invalid.html => testing/web-platform/tests/css/css-transforms/parsing/perspective-origin-invalid.html
rename : testing/web-platform/tests/css/css-transforms/parsing/perspective-origin-parsing-valid.html => testing/web-platform/tests/css/css-transforms/parsing/perspective-origin-valid.html
This commit is contained in:
Eric Willigers 2019-07-30 17:46:06 +00:00 коммит произвёл moz-wptsync-bot
Родитель 976acc7a7b
Коммит 931c09b286
8 изменённых файлов: 224 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS basic box model: getComputedStyle().margin</title>
<link rel="help" href="https://drafts.csswg.org/css-box-3/#propdef-margin">
<meta name="assert" content="margin computed value has absolute lengths.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#parent {
width: 200px;
}
#target {
width: 0px;
font-size: 40px;
}
</style>
</head>
<body>
<div id="parent">
<div id="target"></div>
</div>
<script>
test_computed_value("margin", "10px");
test_computed_value("margin", "10px 20px 30px 40px");
test_computed_value("margin", "calc(0.5em + 10px)", "30px");
test_computed_value("margin", "30%", "60px");
test_computed_value("margin-top", "10px");
test_computed_value("margin-right", "20px");
test_computed_value("margin-bottom", "30px");
test_computed_value("margin-left", "40px");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedStyle().blockSize</title>
<link rel="help" href="https://drafts.csswg.org/css-logical-1/#dimension-properties">
<meta name="assert" content="block-size computed value is an absolute length.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#parent {
height: 300px;
}
#target {
width: 0px;
height: 0px;
font-size: 40px;
}
#child {
height: 80px;
}
</style>
</head>
<body>
<div id="parent">
<div id="target">
<div id="child">
</div>
</div>
</div>
<script>
test_computed_value("block-size", "auto", "80px"); // child height
test_computed_value("block-size", "10px");
test_computed_value("block-size", "20%", "60px");
test_computed_value("block-size", "calc(0.5em + 10px)", "30px");
test_computed_value("block-size", "calc(-0.5em + 10px)", "0px");
test_computed_value("block-size", "min-content", "80px"); // child height
test_computed_value("block-size", "max-content", "80px");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedStyle().inlineSize</title>
<link rel="help" href="https://drafts.csswg.org/css-logical-1/#dimension-properties">
<meta name="assert" content="inline-size computed value is an absolute length.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#parent {
width: 200px;
}
#target {
width: 0px;
height: 0px;
font-size: 40px;
}
#child {
width: 60px;
}
</style>
</head>
<body>
<div id="parent">
<div id="target">
<div id="child">
</div>
</div>
</div>
<script>
test_computed_value("inline-size", "auto", "200px"); // parent width
test_computed_value("inline-size", "10px");
test_computed_value("inline-size", "20%", "40px");
test_computed_value("inline-size", "calc(0.5em + 10px)", "30px");
test_computed_value("inline-size", "calc(-0.5em + 10px)", "0px");
test_computed_value("inline-size", "min-content", "60px"); // child width
test_computed_value("inline-size", "max-content", "60px");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Transform Module Level 2: getComputedStyle().perspectiveOrigin</title>
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property">
<meta name="assert" content="perspective-origin computed value is a pair of absolute lengths">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#target {
width: 200px;
height: 300px;
font-size: 40px;
}
</style>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("perspective-origin", "10%", "20px 150px");
test_computed_value("perspective-origin", "10% center", "20px 150px");
test_computed_value("perspective-origin", "20% 30px", "40px 30px");
test_computed_value("perspective-origin", "30px center", "30px 150px");
test_computed_value("perspective-origin", "40px top", "40px 0px");
test_computed_value("perspective-origin", "bottom 10% right 20%", "160px 270px");
test_computed_value("perspective-origin", "bottom right", "200px 300px");
test_computed_value("perspective-origin", "center", "100px 150px");
test_computed_value("perspective-origin", "center 50px", "100px 50px");
test_computed_value("perspective-origin", "center bottom", "100px 300px");
test_computed_value("perspective-origin", "center center", "100px 150px");
test_computed_value("perspective-origin", "center left", "0px 150px");
test_computed_value("perspective-origin", "left", "0px 150px");
test_computed_value("perspective-origin", "left 10px", "0px 10px");
test_computed_value("perspective-origin", "left bottom", "0px 300px");
test_computed_value("perspective-origin", "left center", "0px 150px");
test_computed_value("perspective-origin", "right 40%", "200px 120px");
test_computed_value("perspective-origin", "right 30% top -60px", "140px -60px");
test_computed_value("perspective-origin", "top", "100px 0px");
test_computed_value("perspective-origin", "right 20px bottom 30px", "180px 270px");
test_computed_value("perspective-origin", "right calc(10px - 0.5em) top calc(10px - 0.5em)", "210px -10px");
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Transform Module Level 2: getComputedStyle().transformOrigin</title>
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#transform-origin-property">
<meta name="assert" content="transform-origin computed value is two or three absolute lengths">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#target {
width: 200px;
height: 300px;
font-size: 40px;
}
</style>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("transform-origin", "10%", "20px 150px");
test_computed_value("transform-origin", "10% center", "20px 150px");
test_computed_value("transform-origin", "20% 30px", "40px 30px");
test_computed_value("transform-origin", "30px center", "30px 150px");
test_computed_value("transform-origin", "40px top", "40px 0px");
test_computed_value("transform-origin", "bottom right", "200px 300px");
test_computed_value("transform-origin", "center", "100px 150px");
test_computed_value("transform-origin", "center 50px", "100px 50px");
test_computed_value("transform-origin", "center bottom", "100px 300px");
test_computed_value("transform-origin", "center center", "100px 150px");
test_computed_value("transform-origin", "center left", "0px 150px");
test_computed_value("transform-origin", "left", "0px 150px");
test_computed_value("transform-origin", "left 10px", "0px 10px");
test_computed_value("transform-origin", "left bottom", "0px 300px");
test_computed_value("transform-origin", "left center", "0px 150px");
test_computed_value("transform-origin", "right 40%", "200px 120px");
test_computed_value("transform-origin", "top", "100px 0px");
test_computed_value("transform-origin", "-1px bottom 5px", "-1px 300px 5px");
test_computed_value("transform-origin", "left center 6px", "0px 150px 6px");
test_computed_value("transform-origin", "center top", "100px 0px");
test_computed_value("transform-origin", "right bottom 7px", "200px 300px 7px");
test_computed_value("transform-origin", "-1px -2px -3px");
test_computed_value("transform-origin", "calc(-100% + 10px - 0.5em) calc(10px - 0.5em) calc(10px - 0.5em)", "-210px -10px -10px");
</script>
</body>
</html>

Просмотреть файл

@ -19,6 +19,10 @@ test_invalid_value("transform-origin", "1px left");
test_invalid_value("transform-origin", "top 1px"); // Blink fails. test_invalid_value("transform-origin", "top 1px"); // Blink fails.
test_invalid_value("transform-origin", "right left"); test_invalid_value("transform-origin", "right left");
test_invalid_value("transform-origin", "top bottom"); test_invalid_value("transform-origin", "top bottom");
test_invalid_value("transform-origin", "bottom 10% right 20%");
test_invalid_value("transform-origin", "right 30% top -60px");
test_invalid_value("transform-origin", "right 20px bottom 30px");
</script> </script>
</body> </body>
</html> </html>