Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4714)

Unified Diff: Source/modules/accessibility/AXLayoutObject.cpp

Issue 1056763002: Reland: Made content editables report the caret and text selection by treating them as text controls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moved layout tests to other CLs. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698