Index: Source/modules/accessibility/AXNodeObject.cpp |
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp |
index a5438ac4ada964ee02f7734e009ef76f7e326b59..247386d0d7ac508efbec4fd4a61534a67d7d32a2 100644 |
--- a/Source/modules/accessibility/AXNodeObject.cpp |
+++ b/Source/modules/accessibility/AXNodeObject.cpp |
@@ -511,8 +511,9 @@ void AXNodeObject::elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Ele |
} |
} |
-// If you call node->hasEditableStyle() since that will return true if an ancestor is editable. |
-// This only returns true if this is the element that actually has the contentEditable attribute set. |
+// This only returns true if this is the element that actually has the |
+// contentEditable attribute set, unlike node->hasEditableStyle() which will |
+// also return true if an ancestor is editable. |
bool AXNodeObject::hasContentEditableAttributeSet() const |
{ |
if (!hasAttribute(contenteditableAttr)) |
@@ -522,6 +523,21 @@ bool AXNodeObject::hasContentEditableAttributeSet() const |
return contentEditableValue.isEmpty() || equalIgnoringCase(contentEditableValue, "true"); |
} |
+bool AXNodeObject::isTextControl() const |
+{ |
+ if (hasContentEditableAttributeSet()) |
+ return true; |
+ |
+ switch (roleValue()) { |
+ case TextFieldRole: |
+ case ComboBoxRole: |
+ case SearchBoxRole: |
+ return true; |
+ default: |
+ return false; |
+ } |
+} |
+ |
bool AXNodeObject::isGenericFocusableElement() const |
{ |
if (!canSetFocusAttribute()) |