Revision 190c3feba3a42cbc4c32facd7994c190589d889e authored by Liam R. E. Quin on 26 March 2018, 01:04:45 UTC, committed by Liam R. E. Quin on 26 March 2018, 01:04:45 UTC
1 parent 2b4cdad
offset-supports-calc.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Motion Path Module Level 1: calc values</title>
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
<link rel="help" href="https://drafts.fxtf.org/motion-1/">
<link rel="help" href="https://drafts.csswg.org/css-values-3/#calc-notation">
<meta name="assert" content="calc values are supported in offset properties.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#target {
font-size: 20px;
}
</style>
</head>
<body>
<div id="target"></div>
<script>
'use strict';
test(function(){
target.style = 'offset-position: calc(30px + 20%) calc(-200px + 8em + 100%);';
assert_equals(getComputedStyle(target).offsetPosition, 'calc(30px + 20%) calc(-40px + 100%)');
}, 'offset-position supports calc');
test(function(){
target.style = 'offset-path: ray(calc(1turn - 100grad) closest-side);';
assert_equals(getComputedStyle(target).offsetPath, 'ray(270deg closest-side)');
}, 'offset-path supports calc');
test(function(){
target.style = 'offset-distance: calc(-100px + 50%);';
assert_equals(getComputedStyle(target).offsetDistance, 'calc(-100px + 50%)');
}, 'offset-distance supports calc');
test(function(){
target.style = 'offset-rotate: auto calc(1turn - 100grad);';
assert_equals(getComputedStyle(target).offsetRotate, 'auto 270deg');
}, 'offset-rotate supports calc');
test(function(){
target.style = 'offset-anchor: calc(30px + 20%) calc(-200px + 8em + 100%);';
assert_equals(getComputedStyle(target).offsetAnchor, 'calc(30px + 20%) calc(-40px + 100%)');
}, 'offset-anchor supports calc');
</script>
</body>
</html>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...