| | 17 | |
| | 18 | == An example of js-test.js test == |
| | 19 | |
| | 20 | {{{ |
| | 21 | <!DOCTYPE html> |
| | 22 | <html> |
| | 23 | <head> |
| | 24 | <script src="../../resources/js-test.js"></script> |
| | 25 | <script> |
| | 26 | description("Test a class selector for <a href=\"http://webkit.org/b/XXXX\">Bug XXXX</a>: WebKit does not apply class-selector"); |
| | 27 | jsTestIsAsync = true; |
| | 28 | |
| | 29 | onload = ()=> |
| | 30 | { |
| | 31 | const block = document.getElementsByClassName('block')[0]; |
| | 32 | color = document.defaultView.getComputedStyle(block, null).getPropertyValue('color'); |
| | 33 | shouldBeEqualToString("color", 'rgb(0, 128, 0)'); |
| | 34 | finishJSTest(); |
| | 35 | |
| | 36 | } |
| | 37 | </script> |
| | 38 | <style> |
| | 39 | .block { color: green; } |
| | 40 | </style> |
| | 41 | </head> |
| | 42 | <body> |
| | 43 | <p class="block"></p> |
| | 44 | </body> |
| | 45 | </html> |
| | 46 | }}} |