| 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 924e391ebe25113e85d14b37112b80eb7878781d..3c086e529dfd91d301098eb0c6bd197aaf8cbb90 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 i false
|
| + 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.
|
|
|