| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 |
| 3 <style> |
| 4 div { |
| 5 background-color: var(color); |
| 6 border-style: var(border); |
| 7 text-decoration: var(decoration); |
| 8 } |
| 9 </style> |
| 10 |
| 11 <div style="var-color: green; var-border: solid"> |
| 12 This div should be green with a solid border and no strikethrough. |
| 13 <div id="innerA" style="var-color: darkred; var-border: dashed"> |
| 14 This div should be green with a solid border and no strikethrough. |
| 15 <div id="innerB" style="var-decoration: line-through">This div should be
green with a solid border and no strikethrough.</div> |
| 16 </div> |
| 17 </div> |
| 18 <pre id="output"></pre> |
| 19 |
| 20 <script> |
| 21 var innerA = document.querySelector("#innerA"); |
| 22 var innerB = document.querySelector("#innerB"); |
| 23 var output = document.querySelector("#output"); |
| 24 |
| 25 innerA.style.var.delete("color"); |
| 26 innerA.style.var.set("border", ""); |
| 27 innerB.style.var.clear(); |
| 28 |
| 29 output.innerText += "Test access after removal:\n"; |
| 30 output.innerText += " delete border: " + (innerA.style.var.get("border") ? "f
ail" : "pass") + "\n"; |
| 31 output.innerText += " set empty color: " + (innerA.style.var.get("color") ? "
fail" : "pass") + "\n"; |
| 32 output.innerText += " clear decoration: " + (innerB.style.var.get("decoration
") ? "fail" : "pass") + "\n"; |
| 33 output.innerText += "Variable counts after removal: " + innerA.style.var.size +
" " + innerB.style.var.size; |
| 34 </script> |
| OLD | NEW |