Chromium Code Reviews| Index: Source/modules/accessibility/AXLayoutObject.cpp |
| diff --git a/Source/modules/accessibility/AXLayoutObject.cpp b/Source/modules/accessibility/AXLayoutObject.cpp |
| index 46ead68c75698a1e6654024b5115b0f297c38d9e..b6d010cdc597ae98de5f0cb6085f9421f89ad23c 100644 |
| --- a/Source/modules/accessibility/AXLayoutObject.cpp |
| +++ b/Source/modules/accessibility/AXLayoutObject.cpp |
| @@ -1590,16 +1590,12 @@ AXObject::PlainTextRange AXLayoutObject::selectedTextRange() const |
| if (!isTextControl()) |
| return PlainTextRange(); |
| - AccessibilityRole ariaRole = ariaRoleAttribute(); |
| - if (isNativeTextControl() && ariaRole == UnknownRole && m_layoutObject->isTextControl()) { |
| + if (isNativeTextControl() && m_layoutObject->isTextControl()) { |
|
dmazzoni
2015/04/10 21:23:24
Is this redundant? Any reason this couldn't be jus
|
| HTMLTextFormControlElement* textControl = toLayoutTextControl(m_layoutObject)->textFormControlElement(); |
| return PlainTextRange(textControl->selectionStart(), textControl->selectionEnd() - textControl->selectionStart()); |
| } |
| - if (ariaRole == UnknownRole) |
| - return PlainTextRange(); |
| - |
| - return ariaSelectedTextRange(); |
| + return visibleSelectionUnderObject(); |
| } |
| VisibleSelection AXLayoutObject::selection() const |
| @@ -1788,7 +1784,9 @@ int AXLayoutObject::indexForVisiblePosition(const VisiblePosition& pos) const |
| return 0; |
| Position indexPosition = pos.deepEquivalent(); |
| - if (indexPosition.isNull() || highestEditableRoot(indexPosition, HasEditableAXRole) != node) |
| + if (indexPosition.isNull() |
| + || highestEditableRoot(indexPosition) != node |
| + && highestEditableRoot(indexPosition, HasEditableAXRole) != node) |
| return 0; |
| RefPtrWillBeRawPtr<Range> range = Range::create(m_layoutObject->document()); |
| @@ -1877,7 +1875,7 @@ void AXLayoutObject::ariaListboxSelectedChildren(AccessibilityChildrenVector& re |
| } |
| } |
| -AXObject::PlainTextRange AXLayoutObject::ariaSelectedTextRange() const |
| +AXObject::PlainTextRange AXLayoutObject::visibleSelectionUnderObject() const |
| { |
| Node* node = m_layoutObject->node(); |
| if (!node) |