| <!DOCTYPE html> | |
| <script src="../resources/testharness.js"></script> | |
| <script src="../resources/testharnessreport.js"></script> | |
| <div id="main" role="main"> | |
| <input id="input" type="text" value="Line 1"> | |
| <div id="contenteditable-textbox" role="textbox" contenteditable="true"> | |
| <input id="inner-input" value="Line 1"> | |
| <textarea id="inner-textarea" rows="1" cols="40">Line 2</textarea> | |
| </div> | |
| <div id="contenteditable-div" contenteditable> | |
| <p id="paragraph1">Line 1<br> | |
| Line 2</p> | |
| <p id="paragraph2">Line 3</p> | |
| </div> | |
| </div> | |
| <script> | |
| test(function() { | |
| var axInput = accessibilityController.accessibleElementById('input'); | |
| assert_true(axInput.isEditableRoot); | |
| }, 'An input element is an editable root.'); | |
| test(function() { | |
| var axContentEditable = accessibilityController.accessibleElementById('contenteditable-textbox'); | |
| assert_true(axContentEditable.isEditableRoot); | |
| }, 'A content editable with a role of textbox is an editable root.'); | |
| test(function() { | |
| var axInnerInput = accessibilityController.accessibleElementById('inner-input'); | |
| assert_true(axInnerInput.isEditableRoot); | |
| }, 'An input element embedded inside a content editable is an editable root.'); | |
| test(function() { | |
| var axInnerTextarea = accessibilityController.accessibleElementById('inner-textarea'); | |
| assert_true(axInnerTextarea.isEditableRoot); | |
| }, 'A textarea embedded inside a content editable is an editable root.'); | |
| test(function() { | |
| var axContentEditable = accessibilityController.accessibleElementById('contenteditable-div'); | |
| var axParagraph1 = accessibilityController.accessibleElementById('paragraph1'); | |
| var axParagraph2 = accessibilityController.accessibleElementById('paragraph2'); | |
| assert_true(axContentEditable.isEditableRoot); | |
| assert_false(axParagraph1.isEditableRoot); | |
| assert_false(axParagraph2.isEditableRoot); | |
| }, 'A paragraph within a content editable is not an editable root but the content editable is.'); | |
| if (window.testRunner) | |
| document.getElementById("main").style.display = "none"; | |
| </script> |