| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../../resources/js-test.js"></script> |
| <script src="../../resources/accessibility-helper.js"></script> |
| </head> |
| <body> |
| |
| <div id="content" style="width:200px;"> |
| This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. |
| This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. |
| This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. |
| </div> |
| |
| <script> |
| if (window.accessibilityController) { |
| let output = "This protects against a crash in asking for visible point for position to ensure that it can handle all RenderText objects.\n\n"; |
| |
| var content = accessibilityController.accessibleElementById("content"); |
| // Get the text marker at this point. It should not crash. |
| var marker = content.textMarkerForPoint(content.x + content.width / 2, content.y + content.height / 2); |
| // Verify the element is the same as the one we wanted. |
| var element = content.accessibilityElementForTextMarker(marker); |
| output += expect("content.childAtIndex(0).isEqual(element)", "true"); |
| |
| document.getElementById("content").style.visibility = "hidden"; |
| debug(output); |
| } |
| </script> |
| </body> |
| </html> |