Commit 600fda0a authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

[css-logical] WPTs for inset parsing

inset is one to four values, each auto or a length-percentage.
https://drafts.csswg.org/css-logical/#propdef-inset

Change-Id: I3f1599e200fec16a709cc6404246a28c404805b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1747488Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686337}
parent 9c435ab3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedStyle().inset</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-inset">
<meta name="assert" content="Computed value is as specified, with lengths made absolute.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
#target {
font-size: 40px;
}
</style>
</head>
<body>
<div id="target"></div>
<script>
test_computed_value("inset", "auto");
test_computed_value("inset", "-10px");
test_computed_value("inset", "calc(10px - 0.5em) -20%", "-10px -20%");
test_computed_value("inset", "auto auto", "auto");
test_computed_value("inset", "10px calc(10px - 0.5em) -30px", "10px -10px -30px");
test_computed_value("inset", "auto auto auto", "auto");
test_computed_value("inset", "10px 20px auto -30px");
test_computed_value("inset", "auto auto auto auto", "auto");
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing inset with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-inset">
<meta name="assert" content="inset supports only the grammar '<'top'>{1,4}'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("inset", "none");
test_invalid_value("inset", "20%, calc(10px - 0.5em)");
test_invalid_value("inset", "10px auto 20px auto 30px");
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing inset with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-inset">
<meta name="assert" content="inset supports the full grammar '<'top'>{1,4}'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("inset", "auto");
test_valid_value("inset", "-10px");
test_valid_value("inset", "calc(-0.5em + 10px) -20%");
test_valid_value("inset", "auto auto", "auto");
test_valid_value("inset", "10px calc(-0.5em + 10px) -30px");
test_valid_value("inset", "auto auto auto", "auto");
test_valid_value("inset", "10px calc(-0.5em + 10px) auto -30px");
test_valid_value("inset", "auto auto auto auto", "auto");
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment