summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-typed-om/width-by-max-px-em.html
blob: 2aac59b70744e24fccd91bfc92d1177d6bb5c3a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<link rel="help" href="https://www.w3.org/TR/css-typed-om-1/#stylevalue-subclasses">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<meta name="assert" content="'width' can be set with a CSSMathMax object.">
<style>
#target { font-size: 10px; background-color: green; height: 100px; }
</style>
<p>Test passes if there is a filled green square.</p>
<div id=target></div>
<script>
const width = new CSSMathMax(CSS.em(10), CSS.px(90));
const target = document.querySelector('#target');
target.attributeStyleMap.set('width', width);
</script>