blob: 2e2796c3b7cc93d724b58f6d3b704e81b3e9cd19 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ CSSTypedOMEnabled=true ] -->
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<meta name="author" title="Justin Michaud" href="mailto:justin_michaud@webkit.org">
<meta name="assert" content="Test element.attributeStyleMap basics">
<link rel="help" content="https://drafts.css-houdini.org/css-typed-om-1/">
<div id="el" style = "width: 150px; height: 10em; --my-prop: hello;"></div>
<script>
test(function() {
assert_true(!!el.attributeStyleMap);
assert_true(el.attributeStyleMap instanceof StylePropertyMap);
}, 'test that element.attributeStyleMap exists');
test(function() {
assert_true(el.attributeStyleMap.get('width') instanceof CSSUnitValue);
assert_equals(el.attributeStyleMap.get('width').value, 150);
assert_equals(el.attributeStyleMap.get('width').unit, 'px');
}, 'test that element.attributeStyleMap has a valid width value');
</script>