| 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 c52d572336f4fc9625ad4609ec77a094f2b0086b..a189a1c9b66492df94a63ca91cd3a863a73bca03 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
|
| @@ -1418,8 +1418,9 @@ void AXNodeObject::Markers(Vector<DocumentMarker::MarkerType>& marker_types,
|
| case DocumentMarker::kTextMatch:
|
| case DocumentMarker::kActiveSuggestion:
|
| marker_types.push_back(marker->GetType());
|
| - marker_ranges.push_back(
|
| - AXRange(marker->StartOffset(), marker->EndOffset()));
|
| + marker_ranges.emplace_back(
|
| + const_cast<AXNodeObject*>(this), marker->StartOffset(),
|
| + const_cast<AXNodeObject*>(this), marker->EndOffset());
|
| break;
|
| case DocumentMarker::kComposition:
|
| // No need for accessibility to know about these marker types.
|
| @@ -2018,6 +2019,32 @@ bool AXNodeObject::NameFromLabelElement() const {
|
| return false;
|
| }
|
|
|
| +bool AXNodeObject::NameFromContents() const {
|
| + Node* node = GetNode();
|
| + if (!node || !node->IsElementNode())
|
| + return AXObject::NameFromContents();
|
| + // AXObject::nameFromContents determines whether an element should take its
|
| + // name from its descendant contents based on role. However, <select> is a
|
| + // special case, as unlike a typical pop-up button it contains its own pop-up
|
| + // menu's contents, which should not be used as the name.
|
| + if (isHTMLSelectElement(node))
|
| + return false;
|
| + return AXObject::NameFromContents();
|
| +}
|
| +
|
| +AXRange AXNodeObject::Selection() const {
|
| + if (!GetNode())
|
| + return AXObject::Selection();
|
| + if (IsTextControlElement(GetNode())) {
|
| + TextControlElement* text_control = ToTextControlElement(GetNode());
|
| + return AXRange(const_cast<AXNodeObject*>(this),
|
| + text_control->selectionStart(),
|
| + const_cast<AXNodeObject*>(this),
|
| + text_control->selectionEnd(), TextAffinity::kDownstream);
|
| + }
|
| + return AXObject::Selection();
|
| +}
|
| +
|
| void AXNodeObject::GetRelativeBounds(
|
| AXObjectImpl** out_container,
|
| FloatRect& out_bounds_in_container,
|
|
|