blob: cd6bec30df2c47347f64199ab9860aecb716c5c8 [file] [log] [blame]
<!doctype html>
<meta charset="utf-8">
<title>'font-weight' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
function assert_is_font_weight(weight, result) {
assert_style_value_equals(result, new CSSUnitValue(weight, 'number'));
}
runPropertyTests('font-weight', [
{
syntax: 'normal',
computed: (_, result) => assert_is_font_weight(400, result)
},
{
syntax: 'bold',
computed: (_, result) => assert_is_font_weight(700, result)
},
{
syntax: 'bolder',
computed: (_, result) => assert_is_unit('number', result)
},
{
syntax: 'lighter',
computed: (_, result) => assert_is_unit('number', result)
},
{
syntax: '<number>',
specified: (input, result) => {
if (input instanceof CSSUnitValue &&
(input.value < 0 || input.value > 1000))
assert_style_value_equals(result, new CSSMathSum(input));
else
assert_style_value_equals(result, input);
}
},
]);
</script>