OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta http-equiv="Content-Security-Policy" content="style-src 'sha1-pfeR
5wMA6np45oqDTP6Pj3tLpJo='"> |
| 5 </head> |
| 6 <body> |
| 7 <p>This tests the result of a valid style hash. It passes if this text i
s green, and a "PASS" alert is fired.</p> |
| 8 <style>p { color: green; }</style> |
| 9 <script> |
| 10 if (window.testRunner) |
| 11 testRunner.dumpAsText(); |
| 12 |
| 13 var color = window.getComputedStyle(document.querySelector('p')).col
or; |
| 14 if (color === "rgb(0, 128, 0)") |
| 15 alert("PASS: The 'p' element's text is green, which means the st
yle was correctly applied."); |
| 16 else |
| 17 alert("FAIL: The 'p' element's text is " + color + ", which mean
s the style was incorrectly applied."); |
| 18 </script> |
| 19 </body> |
| 20 </html> |
OLD | NEW |