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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/accessibility/inline-text-textarea.html
diff --git a/LayoutTests/accessibility/inline-text-textarea.html b/LayoutTests/accessibility/inline-text-textarea.html
new file mode 100644
index 0000000000000000000000000000000000000000..454fcafed68293832125dabea8f12e46427da94a
--- /dev/null
+++ b/LayoutTests/accessibility/inline-text-textarea.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+
+<textarea id="textarea" cols=30 rows=20>This textarea contains several lines of text. It demonstrates
+how updating a single InlineTextBox is a lot more efficient than updating the whole TextArea.</textarea>
+
+<p id="description"></p>
+
+<div id="console"></div>
+
+<script>
+
+ description("Demonstrates that when typing in a textarea, not all of the InlineTextBoxes need to be updated for every character pressed.");
+
+ if (window.accessibilityController) {
+ var axTextarea = accessibilityController.accessibleElementById('textarea');
+ var axDiv = axTextarea.childAtIndex(0);
+ var axStaticText = axDiv.childAtIndex(0);
+ var count = axStaticText.childrenCount;
+
+ var axInlineBeforeFirstInline = axStaticText.childAtIndex(0);
+ var axInlineBeforeLastInline = axStaticText.childAtIndex(count - 1);
+
+ document.getElementById("textarea").focus();
+ document.getElementById("textarea").setSelectionRange(45, 45);
+
+ // Insert a character in the first paragraph.
+ document.execCommand("InsertText", false, 'x');
+
+ // The inline text boxes in the first paragraph change, but the
+ // inline text boxes in the last paragraph are reused.
+ var axInlineAfterFirstInline = axStaticText.childAtIndex(0);
+ var axInlineAfterLastInline = axStaticText.childAtIndex(count - 1);
+ shouldBe("axStaticText.childrenCount", "count");
+ shouldBe("axInlineBeforeFirstInline.isEqual(axInlineAfterFirstInline)", "false");
+ shouldBe("axInlineBeforeLastInline.isEqual(axInlineAfterLastInline)", "true");
+ }
+</script>
+
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698