| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
| 3 <title>styleMap objects provide an 'update' function</title> | 3 <title>styleMap objects provide an 'update' function</title> |
| 4 <meta name="author" title="Shane Stephens"> | 4 <meta name="author" title="Shane Stephens"> |
| 5 <script src="/resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <body> | 7 <body> |
| 8 <div id='element'></div> | 8 <div id='element'></div> |
| 9 <div id="log"></div> | 9 <div id="log"></div> |
| 10 <script> | 10 <script> |
| 11 test(function() { | 11 test(function() { |
| 12 element.styleMap.set('width', new CSSSimpleLength(42, 'px')); | 12 element.styleMap.set('width', new CSSUnitValue(42, 'px')); |
| 13 element.styleMap.update('width', length => new CSSSimpleLength(length.valu
e + 20, length.type)) | 13 element.styleMap.update('width', length => new CSSSimpleLength(length.valu
e + 20, length.type)) |
| 14 assert_equals(element.styleMap.get('width').value, 62, 'update expected to
apply callback to old value in map'); | 14 assert_equals(element.styleMap.get('width').value, 62, 'update expected to
apply callback to old value in map'); |
| 15 }); | 15 }); |
| 16 </script> | 16 </script> |
| 17 | 17 |
| OLD | NEW |