57 lines
1.7 KiB
HTML
57 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<body id="body">
|
|
<script src="../../resources/js-test-pre.js"></script>
|
|
<div id="content">
|
|
|
|
<div contenteditable="true" id="contenteditable">current1</div>
|
|
|
|
</div>
|
|
|
|
<p id="description"></p>
|
|
<div id="console"></div>
|
|
|
|
<script>
|
|
|
|
description("This tests that you can set the value of a contenteditable element.");
|
|
|
|
if (window.accessibilityController) {
|
|
jsTestIsAsync = true;
|
|
|
|
accessibilityController.addNotificationListener(function(element, notification) {
|
|
if (notification == "AXValueChanged") {
|
|
debug("Value change notification received");
|
|
var axElement = accessibilityController.accessibleElementById("contenteditable");
|
|
debug("Updated Value: " + axElement.stringValue);
|
|
document.getElementById("content").style.visibility = "hidden";
|
|
accessibilityController.removeNotificationListener();
|
|
finishJSTest();
|
|
}
|
|
});
|
|
|
|
function testElement(idValue) {
|
|
var axElement = accessibilityController.accessibleElementById(idValue);
|
|
debug("Role: " + axElement.role);
|
|
debug("Value: " + axElement.stringValue);
|
|
|
|
var writable = axElement.isAttributeSettable("AXValue");
|
|
debug("Writable: " + writable);
|
|
|
|
document.getElementById(idValue).focus();
|
|
|
|
axElement.setValue(" leading and trailing spaces ");
|
|
}
|
|
|
|
debug("\nContenteditable");
|
|
testElement("contenteditable");
|
|
|
|
} else {
|
|
testFailed("Could not load accessibility controller");
|
|
}
|
|
|
|
</script>
|
|
|
|
<script src="../../resources/js-test-post.js"></script>
|
|
</body>
|
|
</html>
|