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

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

Issue 23983002: Expose InlineTextBoxes in the accessibility tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove platform differences from inline-text-textarea output Created 7 years, 3 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 <script src="../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7
8 <textarea id="textarea" cols=30 rows=20>This textarea contains several lines of text. It demonstrates
9 how updating a single InlineTextBox is a lot more efficient than updating the wh ole TextArea.</textarea>
10
11 <p id="description"></p>
12
13 <div id="console"></div>
14
15 <script>
16
17 description("Demonstrates that when typing in a textarea, not all of the Inl ineTextBoxes need to be updated for every character pressed.");
18
19 if (window.accessibilityController) {
20 var axTextarea = accessibilityController.accessibleElementById('textarea ');
21 var axDiv = axTextarea.childAtIndex(0);
22 var axStaticText = axDiv.childAtIndex(0);
23 var count = axStaticText.childrenCount;
24
25 var axInlineBeforeFirstInline = axStaticText.childAtIndex(0);
26 var axInlineBeforeLastInline = axStaticText.childAtIndex(count - 1);
27
28 document.getElementById("textarea").focus();
29 document.getElementById("textarea").setSelectionRange(45, 45);
30
31 // Insert a character in the first paragraph.
32 document.execCommand("InsertText", false, 'x');
33
34 // The inline text boxes in the first paragraph change, but the
35 // inline text boxes in the last paragraph are reused.
36 var axInlineAfterFirstInline = axStaticText.childAtIndex(0);
37 var axInlineAfterLastInline = axStaticText.childAtIndex(count - 1);
38 shouldBe("axStaticText.childrenCount", "count");
39 shouldBe("axInlineBeforeFirstInline.isEqual(axInlineAfterFirstInline)", "false");
40 shouldBe("axInlineBeforeLastInline.isEqual(axInlineAfterLastInline)", "t rue");
41 }
42 </script>
43
44 <script src="../fast/js/resources/js-test-post.js"></script>
45 </body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698