Commit 6e342f0d authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

CSS: Parsing tests for inset-block and inset-inline

https://drafts.csswg.org/css-logical-1/#propdef-inset-block

Change-Id: I32ba1428ab52ce8003add1fb5b0b4d4d17cfea88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615402Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661310}
parent 58a45b84
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: getComputedValue().insetBlock / insetInline</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-inset-block">
<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-block-start", "auto");
test_computed_value("inset-block-end", "-10px");
test_computed_value("inset-inline-start", "-20%");
test_computed_value("inset-inline-end", "calc(10px - 0.5em)", "-10px");
test_computed_value("inset-block", "auto");
test_computed_value("inset-block", "-10px");
test_computed_value("inset-block", "calc(10px - 0.5em) -20%", "-10px -20%");
test_computed_value("inset-block", "auto auto", "auto");
test_computed_value("inset-inline", "-20%");
test_computed_value("inset-inline", "calc(10px - 0.5em)", "-10px");
test_computed_value("inset-inline", "-10px auto");
test_computed_value("inset-inline", "auto calc(10px + 0.5em)", "auto 30px");
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing inset-block and inset-inline with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-inset-block">
<meta name="assert" content="inset-block, inset-inline support only the grammar '<'top'>{1,2}'.">
<meta name="assert" content="inset-block, inset-inline longhands support only the grammar '<'top'>'.">
<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-block-start", "none");
test_invalid_value("inset-block-end", "10");
test_invalid_value("inset-inline-start", "20% calc(10px - 0.5em)");
test_invalid_value("inset-inline-end", "10px, auto");
test_invalid_value("inset-block", "none");
test_invalid_value("inset-block", "20%, calc(10px - 0.5em)");
test_invalid_value("inset-inline", "10px auto 20px");
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Logical Properties and Values: parsing inset-block and inset-inline with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-logical/#propdef-inset-block">
<meta name="assert" content="inset-block, inset-inline support the full grammar '<'top'>{1,2}'.">
<meta name="assert" content="inset-block, inset-inline longhands support the full grammar '<'top'>'.">
<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-block-start", "auto");
test_valid_value("inset-block-end", "-10px");
test_valid_value("inset-inline-start", "-20%");
test_valid_value("inset-inline-end", "calc(10px - 0.5em)");
test_valid_value("inset-block", "auto");
test_valid_value("inset-block", "-10px");
test_valid_value("inset-block", "calc(10px - 0.5em) -20%");
test_valid_value("inset-block", "auto auto", "auto");
test_valid_value("inset-inline", "-20%");
test_valid_value("inset-inline", "calc(10px - 0.5em)");
test_valid_value("inset-inline", "-10px auto");
test_valid_value("inset-inline", "auto calc(10px + 0.5em)");
</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