| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| </head> |
| <body id="body"> |
| <h1>A text header</h1> |
| <h4><a href='foo'><span style='display:block;'>Block span in a link in a heading</span><span>Inline span in a link in a heading</span></a></h4> |
| <h4><span style='display:block;'>Block span in a heading</span><span>Inline span in a heading</span></h4> |
| <p id="description"></p> |
| <div id="console"></div> |
| <script> |
| description("This tests the ability to get element text for a specified range."); |
| if (window.accessibilityController) { |
| document.getElementById("body").focus(); |
| var webArea = accessibilityController.focusedElement; |
| |
| var heading1 = webArea.childAtIndex(0); |
| var heading2 = webArea.childAtIndex(1); |
| var heading3 = webArea.childAtIndex(2); |
| shouldBe("heading1.stringForRange(0, -1)", "'A text header'"); |
| shouldBe("heading2.stringForRange(0, -1)", "'Block span in a link in a heading\\nInline span in a link in a heading'"); |
| shouldBe("heading3.stringForRange(0, -1)", "'Block span in a heading\\nInline span in a heading'"); |
| } |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |