| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <link rel="stylesheet" href="../../resources/touch-hover-active-tests.css"> |
| 3 <style type="text/css"> | 4 <style type="text/css"> |
| 4 #box { | 5 #box { |
| 5 position: absolute; | 6 position: absolute; |
| 6 background-color: blue; | |
| 7 width: 300px; | 7 width: 300px; |
| 8 height: 100px; | 8 height: 100px; |
| 9 top: 100px; | 9 top: 100px; |
| 10 } | 10 } |
| 11 | |
| 12 #box:active { | |
| 13 background-color: red; | |
| 14 } | |
| 15 | |
| 16 </style> | 11 </style> |
| 17 <script> | 12 <body> |
| 18 var color; | 13 <div id='box' class='touch-interactive'>Gestures go here</div> |
| 19 function isBoxActive() | |
| 20 { | |
| 21 // These need to match the background-color used above, after round-tripping
. | |
| 22 var defaultColor = "rgb(0, 0, 255)"; | |
| 23 var activeColor = "rgb(255, 0, 0)"; | |
| 24 | |
| 25 var b = document.getElementById('box'); | |
| 26 color = getComputedStyle(b).backgroundColor; | |
| 27 if (color == activeColor) | |
| 28 return true; | |
| 29 if (color != defaultColor) | |
| 30 throw "Got unexpected backgroundColor: " + color; | |
| 31 return false; | |
| 32 } | |
| 33 | |
| 34 </script> | |
| 35 <body onload='parent.runTests(isBoxActive)'> | |
| 36 <div id='box'>Gestures go here</div> | |
| 37 </body> | 14 </body> |
| 38 </html> | 15 </html> |
| OLD | NEW |