Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2043)

Side by Side Diff: LayoutTests/accessibility/inline-text-word-boundaries.html

Issue 23983002: Expose InlineTextBoxes in the accessibility tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address feedback Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="../fast/js/resources/js-test-pre.js"></script>
6 </head>
7 <body>
8
9 <p id="paragraph" style="width: 8em; word-wrap: break-word;">
10 Ace ten twenty-one thirty-five. xxxxxxxxxxxxxxxxxxx
aboxhall 2013/10/17 22:27:55 Can we comment that the xxxxx... is intended to wr
dmazzoni 2013/10/19 06:48:07 Done.
11 </p>
12
13 <p id="description"></p>
14
15 <div id="console"></div>
16
17 <script>
18
19 description("Tests that we can compute word boundaries for any character ind ex from the accessibility tree.");
20
21 // Note: all that matters is that characters within actual words are mapped correctly.
22 // Whether a character between words is mapped to the previous or next word is arbitrary;
23 // all that matters is that we expose the start and end of real words.
24 if (window.accessibilityController) {
25 var axParagraph = accessibilityController.accessibleElementById('paragra ph');
26 var axStaticText = axParagraph.childAtIndex(0);
27 var text = axStaticText.stringValue.substr(9);
28 debug("Accessible text: \"" + text + "\"");
29
30 for (var i = 0; i < text.length; i++) {
31 // Get the bounds from the accessibility tree.
32 var wordStart = axStaticText.wordStart(i);
33 var wordEnd = axStaticText.wordEnd(i);
34 debug("Character " + i + ": '" + text.substr(i, 1) +
35 "' word=(" + wordStart + ", " + wordEnd + "): '" +
36 text.substr(wordStart, wordEnd - wordStart) + "'");
37 }
38 }
39 </script>
40
41 <script src="../fast/js/resources/js-test-post.js"></script>
42 </body>
43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698