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

Unified Diff: LayoutTests/accessibility/is-richly-editable.html

Issue 1149293009: Added tests for issue 1156353003, ability to distinguish between rich and plain text editable eleme… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed property name from isContentRichlyEditable to isRichlyEditable. Created 5 years, 6 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
« no previous file with comments | « no previous file | LayoutTests/accessibility/is-richly-editable-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/accessibility/is-richly-editable.html
diff --git a/LayoutTests/accessibility/is-richly-editable.html b/LayoutTests/accessibility/is-richly-editable.html
new file mode 100644
index 0000000000000000000000000000000000000000..5af84fae1014602f44a2847ceeb7339cf91c984a
--- /dev/null
+++ b/LayoutTests/accessibility/is-richly-editable.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html> <head>
+<script src="../resources/js-test.js"></script>
+
+<!-- Richly editable elements. -->
+<div id="richly_editable1" contentEditable></div>
+<div id="richly_editable2" contentEditable="true"></div>
+<div contentEditable>
+ <p id="richly_editable3">Some text.</p>
+</div>
+<div contentEditable="true">
+ <p id="richly_editable4">Some text.</p>
+</div>
+<iframe id="richly_editable5"
+ src="data:text/html,<html><body><p>Some text.</p></body></html>">
+</iframe>
+
+<!-- Non-richly editable elements. -->
+<input id="non_richly_editable1" type="text" value="Some text.">
+<textarea id="non_richly_editable2">
+Some text.</textarea>
+<div id="non_richly_editable3" contentEditable="plaintext-only"></div>
+<div id="non_richly_editable4" contentEditable style="-webkit-user-modify: read-only;"></div>
+<div contentEditable="plaintext-only">
+ <p id="non_richly_editable5">Some text.</p>
+</div>
+<p id="non_richly_editable6" tabindex="0">Some text.</p>
+<button id="non_richly_editable7">Button</button>
+
+<script>
+ description("This tests that only elements that allow the user to edit rich text in them are recognized as being richly editable.");
+
+ var iframeId = "richly_editable5";
+ var iframeDocument = document.getElementById(iframeId).contentDocument;
+ iframeDocument.designMode = "on";
+
+ if (window.accessibilityController) {
+
+ for (var i = 1; i <= 5; ++i) {
+ var elementId = "richly_editable" + i;
+ var element = document.getElementById(elementId);
+ element.focus();
+ var axElement = accessibilityController.focusedElement;
+ shouldBeTrue("axElement.isRichlyEditable");
+ }
+
+ iframeDocument.body.focus();
+ var axElement = accessibilityController.focusedElement;
+ shouldBeTrue("axElement.isRichlyEditable");
+
+
+ for (var i = 1; i <= 7; ++i) {
+ var elementId = "non_richly_editable" + i;
+ var element = document.getElementById(elementId);
+ element.focus();
+ var axElement = accessibilityController.focusedElement;
+ shouldBeFalse("axElement.isRichlyEditable");
+ }
+
+ }
+</script>
« no previous file with comments | « no previous file | LayoutTests/accessibility/is-richly-editable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698