| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
| 5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <script> | 8 <script> |
| 9 | 9 |
| 10 description("Verify that the priority parameter is a case-insensitive match to '
important' or the empty string."); | 10 description("Verify that the priority parameter is a case-insensitive match to '
important' or the empty string."); |
| 11 | 11 |
| 12 var testContainer = document.createElement("div"); | 12 var testContainer = document.createElement("div"); |
| 13 document.body.appendChild(testContainer); | 13 document.body.appendChild(testContainer); |
| 14 | 14 |
| 15 testContainer.innerHTML = '<div id="test">hello</div>'; | 15 testContainer.innerHTML = '<div id="test">hello</div>'; |
| 16 | 16 |
| 17 e = document.getElementById('test'); | 17 e = document.getElementById('test'); |
| 18 | 18 |
| 19 // Test "important" strictness | 19 // Test "important" strictness |
| 20 e.style.borderBottomStyle = ""; | 20 e.style.borderBottomStyle = ""; |
| 21 e.style.setProperty("border-bottom-style", "solid", "!important"); | 21 e.style.setProperty("border-bottom-style", "solid", "!important"); |
| 22 shouldBe("e.style.getPropertyValue('border-bottom-style')", "null"); | 22 shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", ""); |
| 23 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); | 23 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); |
| 24 | 24 |
| 25 e.style.borderBottomStyle = ""; | 25 e.style.borderBottomStyle = ""; |
| 26 e.style.setProperty("border-bottom-style", "solid", "very important"); | 26 e.style.setProperty("border-bottom-style", "solid", "very important"); |
| 27 shouldBe("e.style.getPropertyValue('border-bottom-style')", "null"); | 27 shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", ""); |
| 28 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); | 28 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); |
| 29 | 29 |
| 30 e.style.borderBottomStyle = ""; | 30 e.style.borderBottomStyle = ""; |
| 31 e.style.setProperty("border-bottom-style", "solid", "impORTANT"); | 31 e.style.setProperty("border-bottom-style", "solid", "impORTANT"); |
| 32 shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'"); | 32 shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'"); |
| 33 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "'important'"); | 33 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "'important'"); |
| 34 | 34 |
| 35 e.style.borderBottomStyle = ""; | 35 e.style.borderBottomStyle = ""; |
| 36 e.style.setProperty("border-bottom-style", "solid", "random"); | 36 e.style.setProperty("border-bottom-style", "solid", "random"); |
| 37 shouldBe("e.style.getPropertyValue('border-bottom-style')", "null"); | 37 shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", ""); |
| 38 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); | 38 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); |
| 39 | 39 |
| 40 e.style.borderBottomStyle = ""; | 40 e.style.borderBottomStyle = ""; |
| 41 e.style.setProperty("border-bottom-style", "solid", "undefined"); | 41 e.style.setProperty("border-bottom-style", "solid", "undefined"); |
| 42 shouldBe("e.style.getPropertyValue('border-bottom-style')", "null"); | 42 shouldBeEqualToString("e.style.getPropertyValue('border-bottom-style')", ""); |
| 43 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); | 43 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); |
| 44 | 44 |
| 45 e.style.borderBottomStyle = ""; | 45 e.style.borderBottomStyle = ""; |
| 46 e.style.setProperty("border-bottom-style", "solid", undefined); | 46 e.style.setProperty("border-bottom-style", "solid", undefined); |
| 47 shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'"); | 47 shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'"); |
| 48 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); | 48 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "''"); |
| 49 | 49 |
| 50 document.body.removeChild(testContainer); | 50 document.body.removeChild(testContainer); |
| 51 </script> | 51 </script> |
| 52 </body> | 52 </body> |
| 53 </html> | 53 </html> |
| OLD | NEW |