| <head> | |
| <script> | |
| if (window.testRunner) | |
| testRunner.dumpAsText(); | |
| </script> | |
| <style> | |
| #input { | |
| color:purple; | |
| } | |
| #input:enabled { | |
| color:red; | |
| } | |
| #input:disabled { | |
| color:green; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="result"></div> | |
| <input id="input" type="hidden"></input> | |
| <script> | |
| var input = document.getElementById("input"); | |
| var result = document.getElementById("result"); | |
| if (document.defaultView.getComputedStyle(input, null).color == "rgb(255, 0, 0)") | |
| // :enabled | |
| result.innerHTML = "PASSED!"; | |
| else if (document.defaultView.getComputedStyle(input, null).color == "rgb(0, 255, 0)") | |
| // :disabled | |
| result.innerHTML = "PASSED!"; | |
| else | |
| result.innerHTML = "FAILED! Hidden input types should respond to :enabled and :disabled."; | |
| </script> | |
| </body> |