| Index: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| index 1585354fce6f6cde6b69deb1aa9c78284951f5d8..2a2b061b2ee7bc4fe464453a4c9181eec8d34a80 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
|
| @@ -1819,10 +1819,14 @@ AXObject::AXRange AXLayoutObject::selection() const
|
| if (selection.isNone())
|
| return AXRange();
|
|
|
| - Position visibleStart = selection.visibleStart().toParentAnchoredPosition();
|
| - Position visibleEnd = selection.visibleEnd().toParentAnchoredPosition();
|
| -
|
| - Node* anchorNode = visibleStart.anchorNode();
|
| + VisiblePosition visibleStart = selection.visibleStart();
|
| + Position start = visibleStart.toParentAnchoredPosition();
|
| + TextAffinity startAffinity = visibleStart.affinity();
|
| + VisiblePosition visibleEnd = selection.visibleEnd();
|
| + Position end = visibleEnd.toParentAnchoredPosition();
|
| + TextAffinity endAffinity = visibleEnd.affinity();
|
| +
|
| + Node* anchorNode = start.anchorNode();
|
| ASSERT(anchorNode);
|
|
|
| AXLayoutObject* anchorObject = nullptr;
|
| @@ -1840,7 +1844,7 @@ AXObject::AXRange AXLayoutObject::selection() const
|
| anchorNode = anchorNode->parentNode();
|
| }
|
|
|
| - Node* focusNode = visibleEnd.anchorNode();
|
| + Node* focusNode = end.anchorNode();
|
| ASSERT(focusNode);
|
|
|
| AXLayoutObject* focusObject = nullptr;
|
| @@ -1858,15 +1862,12 @@ AXObject::AXRange AXLayoutObject::selection() const
|
| if (!anchorObject || !focusObject)
|
| return AXRange();
|
|
|
| - int anchorOffset = anchorObject->indexForVisiblePosition(
|
| - selection.visibleStart());
|
| + int anchorOffset = anchorObject->indexForVisiblePosition(visibleStart);
|
| ASSERT(anchorOffset >= 0);
|
| - int focusOffset = focusObject->indexForVisiblePosition(
|
| - selection.visibleEnd());
|
| + int focusOffset = focusObject->indexForVisiblePosition(visibleEnd);
|
| ASSERT(focusOffset >= 0);
|
| - return AXRange(
|
| - anchorObject, anchorOffset,
|
| - focusObject, focusOffset);
|
| + return AXRange(anchorObject, anchorOffset, startAffinity,
|
| + focusObject, focusOffset, endAffinity);
|
| }
|
|
|
| // Gets only the start and end offsets of the selection computed using the
|
| @@ -1923,12 +1924,15 @@ AXObject::AXRange AXLayoutObject::textControlSelection() const
|
| if (!axObject || !axObject->isAXLayoutObject())
|
| return AXRange();
|
|
|
| + VisibleSelection selection = layout->frame()->selection().selection();
|
| HTMLTextFormControlElement* textControl = toLayoutTextControl(
|
| layout)->textFormControlElement();
|
| ASSERT(textControl);
|
| int start = textControl->selectionStart();
|
| int end = textControl->selectionEnd();
|
| - return AXRange(axObject, start, axObject, end);
|
| +
|
| + return AXRange(axObject, start, selection.visibleStart().affinity(),
|
| + axObject, end, selection.visibleEnd().affinity());
|
| }
|
|
|
| int AXLayoutObject::indexForVisiblePosition(const VisiblePosition& position) const
|
|
|