| Index: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
|
| diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
|
| index 5976ccf44b0ac11c8c54fd7ffe37b60d541e3fde..b76b00fff44bd51f605002cc4d2fc35114810e88 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
|
| @@ -792,6 +792,35 @@ void AXNodeObject::AccessibilityChildrenFromAttribute(
|
| }
|
| }
|
|
|
| +bool AXNodeObject::IsMultiline() const {
|
| + Node* node = this->GetNode();
|
| + if (!node)
|
| + return false;
|
| +
|
| + const AccessibilityRole role = RoleValue();
|
| + const bool is_edit_box = role == kSearchBoxRole || role == kTextFieldRole;
|
| + if (!IsEditable() && !is_edit_box)
|
| + return false; // Doesn't support multiline.
|
| +
|
| + // Supports aria-multiline, so check for attribute.
|
| + bool is_multiline = false;
|
| + if (HasAOMPropertyOrARIAAttribute(AOMBooleanProperty::kMultiline,
|
| + is_multiline)) {
|
| + return is_multiline;
|
| + }
|
| +
|
| + // Default for <textarea> is true.
|
| + if (isHTMLTextAreaElement(*node))
|
| + return true;
|
| +
|
| + // Default for other edit boxes is false, including for ARIA, says CORE-AAM.
|
| + if (is_edit_box)
|
| + return false;
|
| +
|
| + // Root of contenteditable area.
|
| + return HasContentEditableAttributeSet();
|
| +}
|
| +
|
| // 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.
|
| @@ -805,6 +834,9 @@ bool AXNodeObject::HasContentEditableAttributeSet() const {
|
| EqualIgnoringASCIICase(content_editable_value, "true");
|
| }
|
|
|
| +// TODO(aleventhal) Find a more appropriate name or consider returning false
|
| +// for everything but a searchbox or textfield, as a combobox and spinbox
|
| +// can contain a field but should not be considered edit controls themselves.
|
| bool AXNodeObject::IsTextControl() const {
|
| if (HasContentEditableAttributeSet())
|
| return true;
|
|
|