| <html> |
| <head> |
| <script src="../../../resources/js-test.js"></script> |
| <style> |
| input:focus { |
| background: blue; |
| } |
| </style> |
| <body> |
| <input id="test" type="date"> |
| <a></a> |
| <script> |
| description('Setting value onBlur, should not keep element in focus.'); |
| var testInput = document.getElementById('test'); |
| testInput.addEventListener('blur', function() { |
| testInput.value = ''; |
| }); |
| |
| testInput.value = '2012-02-01'; |
| testInput.focus(); |
| var style = window.getComputedStyle(testInput); |
| shouldBeEqualToString('style.getPropertyValue("background-color")', 'rgb(0, 0, 255)'); |
| testInput.blur(); |
| style = window.getComputedStyle(testInput); |
| shouldBeEqualToString('style.getPropertyValue("background-color")', 'rgb(255, 255, 255)'); |
| </script> |
| </body> |
| </html> |