OLD | NEW |
(Empty) | |
| 1 var validWriteExpectations = ['ink', |
| 2 'objects', |
| 3 'objects ink']; |
| 4 |
| 5 var writeInvalidExpectations = ['none objects', // Combinations with none invali
d |
| 6 'none', // none currently not supported |
| 7 'abc def', |
| 8 '', |
| 9 'objects objects', |
| 10 'ink ink', |
| 11 'edges'] // not supported yet |
| 12 |
| 13 setup({ explicit_done: true }); |
| 14 |
| 15 function styleAndComputedStyleReadback() { |
| 16 |
| 17 var testContainer = document.createElement("div"); |
| 18 document.body.appendChild(testContainer); |
| 19 |
| 20 for (validValue of validWriteExpectations) { |
| 21 testContainer.style.textDecorationSkip = validValue; |
| 22 test(function() { |
| 23 assert_equals(testContainer.style.textDecorationSkip, validValue); |
| 24 assert_equals(getComputedStyle(testContainer).textDecorationSkip, va
lidValue); |
| 25 }, 'text-decoration-skip value ' + validValue + ' should be equal when r
eading it back from style and getComputedstyle.'); |
| 26 } |
| 27 |
| 28 document.body.removeChild(testContainer); |
| 29 } |
| 30 |
| 31 function testInheritance() { |
| 32 var testContainer = document.createElement('div'); |
| 33 var testContainerChild = document.createElement('div'); |
| 34 testContainer.appendChild(testContainerChild); |
| 35 document.body.appendChild(testContainer); |
| 36 |
| 37 for (validValue of validWriteExpectations) { |
| 38 testContainer.style.textDecorationSkip = validValue; |
| 39 test(function() { |
| 40 assert_equals(testContainerChild.style.textDecorationSkip, ''); |
| 41 assert_equals(getComputedStyle(testContainerChild).textDecorationSki
p, validValue); |
| 42 }, 'text-decoration-skip value ' + validValue + ' should be inherited to
computed style of child.'); |
| 43 } |
| 44 document.body.removeChild(testContainer); |
| 45 } |
| 46 |
| 47 function validWriteTests() { |
| 48 for (validValue of validWriteExpectations) { |
| 49 test(function() { |
| 50 assert_true(CSS.supports('text-decoration-skip', validValue)); |
| 51 }, 'Value ' + validValue + ' valid for property text-decoration-skip'); |
| 52 } |
| 53 } |
| 54 |
| 55 function invalidWriteTests() { |
| 56 for (invalidValue of writeInvalidExpectations) { |
| 57 test(function() { |
| 58 assert_false(CSS.supports('text-decoration-skip', invalidValue)); |
| 59 }, 'Value ' + invalidValue + ' invalid for property text-decoration-skip
'); |
| 60 } |
| 61 } |
| 62 |
| 63 window.addEventListener('load', function() { |
| 64 validWriteTests(); |
| 65 invalidWriteTests(); |
| 66 styleAndComputedStyleReadback(); |
| 67 testInheritance(); |
| 68 done(); |
| 69 }); |
OLD | NEW |