| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 | 4 |
| 5 <style> | 5 <style> |
| 6 #color { | 6 #color { |
| 7 --color-value: blue; | 7 --color-value: blue; |
| 8 --accordionColor:#0000ee; | 8 --accordionColor:#0000ee; |
| 9 --foo:#1\.; | 9 --foo:#1\.; |
| 10 background-color: var(--color-value); | 10 background-color: var(--color-value); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 assert_equals(getComputedStyle(color).getPropertyValue('--accordionColor'), '#
0000ee'); | 47 assert_equals(getComputedStyle(color).getPropertyValue('--accordionColor'), '#
0000ee'); |
| 48 assert_equals(getComputedStyle(color).getPropertyValue('--foo'), '#1\\.'); | 48 assert_equals(getComputedStyle(color).getPropertyValue('--foo'), '#1\\.'); |
| 49 }, 'property value, accordionColor, foo'); | 49 }, 'property value, accordionColor, foo'); |
| 50 | 50 |
| 51 test(function() { | 51 test(function() { |
| 52 assert_equals(getComputedStyle(float_pixel).borderWidth, '0px'); | 52 assert_equals(getComputedStyle(float_pixel).borderWidth, '0px'); |
| 53 }, 'border-width property, border-style = none'); | 53 }, 'border-width property, border-style = none'); |
| 54 | 54 |
| 55 float_pixel.style.borderStyle = "solid"; | 55 float_pixel.style.borderStyle = "solid"; |
| 56 test(function() { | 56 test(function() { |
| 57 assert_equals(getComputedStyle(float_pixel).borderWidth, '10px'); | 57 assert_equals(getComputedStyle(float_pixel).borderWidth, '10.5px'); |
| 58 }, 'border-width property, border-style = solid, floating point pixel value'); | 58 }, 'border-width property, border-style = solid, floating point pixel value'); |
| 59 | 59 |
| 60 test(function() { | 60 test(function() { |
| 61 assert_equals(getComputedStyle(em).fontSize, '24px'); | 61 assert_equals(getComputedStyle(em).fontSize, '24px'); |
| 62 }, 'font-size property, em value'); | 62 }, 'font-size property, em value'); |
| 63 | 63 |
| 64 test(function() { | 64 test(function() { |
| 65 assert_equals( | 65 assert_equals( |
| 66 getComputedStyle(percentage).width, parseInt(getComputedStyle(document.body)
.width) * 0.75 + 'px'); | 66 getComputedStyle(percentage).width, parseInt(getComputedStyle(document.body)
.width) * 0.75 + 'px'); |
| 67 }, 'width property, percentage value'); | 67 }, 'width property, percentage value'); |
| 68 | 68 |
| 69 test(function() { | 69 test(function() { |
| 70 assert_equals(getComputedStyle(dynamic).getPropertyValue("--custom-value"), ""
); | 70 assert_equals(getComputedStyle(dynamic).getPropertyValue("--custom-value"), ""
); |
| 71 dynamic.className = "dynamic"; | 71 dynamic.className = "dynamic"; |
| 72 assert_equals(getComputedStyle(dynamic).getPropertyValue("--custom-value"), "p
ass"); | 72 assert_equals(getComputedStyle(dynamic).getPropertyValue("--custom-value"), "p
ass"); |
| 73 }, 'custom property, forced style recalc'); | 73 }, 'custom property, forced style recalc'); |
| 74 </script> | 74 </script> |
| OLD | NEW |