Revision control

1
<!DOCTYPE html><!-- webkit-test-runner [ CSSTypedOMEnabled=true ] -->
2
<script src="../resources/testharness.js"></script>
3
<script src="../resources/testharnessreport.js"></script>
4
<meta name="author" title="Justin Michaud" href="mailto:justin_michaud@webkit.org">
5
<meta name="assert" content="Test element.attributeStyleMap basics">
6
<link rel="help" content="https://drafts.css-houdini.org/css-typed-om-1/">
7
8
<div id="el" style = "width: 150px; height: 10em; --my-prop: hello;"></div>
9
10
<script>
11
test(function() {
12
assert_true(!!el.attributeStyleMap);
13
assert_true(el.attributeStyleMap instanceof StylePropertyMap);
14
}, 'test that element.attributeStyleMap exists');
15
16
test(function() {
17
assert_true(el.attributeStyleMap.get('width') instanceof CSSUnitValue);
18
assert_equals(el.attributeStyleMap.get('width').value, 150);
19
assert_equals(el.attributeStyleMap.get('width').unit, 'px');
20
}, 'test that element.attributeStyleMap has a valid width value');
21
22
</script>