@@ -792,6 +793,19 @@ addUiaTask(
"IsReadOnly correct"
);
+ // Verify that text inputs are not read-only by default.
+ await runPython(`
+ global range
+ textInputAcc = findUiaByDomId(doc, "text-input")
+ range = docText.RangeFromChild(textInputAcc)
+ `);
+ info("checking IsReadOnly");
+ is(
+ await runPython(`range.GetAttributeValue(UIA_IsReadOnlyAttributeId)`),
+ false,
+ "IsReadOnly correct for text input"
+ );
+
// ================== UIA_AnnotationTypesAttributeId - AnnotationType_SpellingError ==================
await runPython(`
global range
diff --git a/accessible/windows/uia/UiaTextRange.cpp b/accessible/windows/uia/UiaTextRange.cpp
index e65eac37801b..0c0e365ea1a1 100644
--- a/accessible/windows/uia/UiaTextRange.cpp
+++ b/accessible/windows/uia/UiaTextRange.cpp
@@ -1307,15 +1307,20 @@ struct AttributeTraits {
if (!aPoint.mAcc) {
return {};
}
- // Check the parent of the leaf, since the leaf itself will never be
- // editable, but the parent may. Check for both text fields and hypertexts,
- // since we might have something like or a contenteditable .
Accessible* acc = aPoint.mAcc;
- Accessible* parent = acc->Parent();
- if (parent && parent->IsHyperText()) {
- acc = parent;
- } else {
- return Some(true);
+ // If the TextLeafPoint we're dealing with is itself a hypertext, don't
+ // bother checking its parent since this is the Accessible we care about.
+ if (!acc->IsHyperText()) {
+ // Check the parent of the leaf, since the leaf itself will never be
+ // editable, but the parent may. Check for both text fields and
+ // hypertexts, since we might have something like or a
+ // contenteditable .
+ Accessible* parent = acc->Parent();
+ if (parent && parent->IsHyperText()) {
+ acc = parent;
+ } else {
+ return Some(true);
+ }
}
const uint64_t state = acc->State();
if (state & states::READONLY) {