| <html> |
| <html> |
| <head> |
| <script src='../../resources/js-test-pre.js'></script> |
| </head> |
| <body id='body'> |
| <header tabindex='0' id='header01'>Header outside section and article elements.</header> |
| <article> |
| <header tabindex='0' id='header02'>Header inside an article.</header> |
| </article> |
| <section> |
| <header tabindex='0' id='header03'>Header inside a section.</header> |
| </section> |
| <pre id='result'></pre> |
| <script> |
| function log(str) { |
| var result = document.querySelector('#result'); |
| result.appendChild(document.createTextNode(str)); |
| } |
| |
| function expectRole(expectedRole, expectedDescription, id) { |
| if (!window.accessibilityController) |
| return; |
| var el = document.querySelector(id); |
| el.focus(); |
| shouldBeEqualToString('accessibilityController.focusedElement.role', "AXRole: " + expectedRole); |
| shouldBeEqualToString('accessibilityController.focusedElement.roleDescription', "AXRoleDescription: " + expectedDescription); |
| } |
| |
| expectRole('AXGroup', 'banner', '#header01'); |
| expectRole('AXGroup', 'group', '#header02'); |
| expectRole('AXGroup', 'group', '#header03'); |
| </script> |
| <script src='../../resources/js-test-post.js'></script> |
| </body> |
| </html> |