| 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 42938a94cb096bddb2de666455d3226d1f9765df..34bdcaf1bd99cf9e9d9784c92fff77bb538a3f2a 100644
|
| --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
|
| +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
|
| @@ -1302,11 +1302,51 @@ InvalidState AXNodeObject::invalidState() const
|
| return InvalidStateUndefined;
|
| }
|
|
|
| +int AXNodeObject::positionInRadioGroup() const
|
| +{
|
| + if (!isHTMLInputElement(node()))
|
| + return 0;
|
| +
|
| + HTMLInputElement& input = toHTMLInputElement(*node());
|
| + const AtomicString& type = input.type();
|
| + if (type != InputTypeNames::radio)
|
| + return 0;
|
| +
|
| + int pos = input.positionInRadioGroup();
|
| + // If it has no pos in Group, it means that there is only itself.
|
| + if (!pos)
|
| + return 1;
|
| + return pos;
|
| +
|
| +}
|
| +
|
| +int AXNodeObject::sizeOfRadioGroup() const
|
| +{
|
| + if (!isHTMLInputElement(node()))
|
| + return 0;
|
| +
|
| + HTMLInputElement& input = toHTMLInputElement(*node());
|
| + const AtomicString& type = input.type();
|
| + if (type != InputTypeNames::radio)
|
| + return 0;
|
| +
|
| + int size = input.sizeOfRadioGroup();
|
| + // If it has no size in Group, it means that there is only itself.
|
| + if (!size)
|
| + return 1;
|
| + return size;
|
| +
|
| +}
|
| +
|
| int AXNodeObject::posInSet() const
|
| {
|
| if (supportsSetSizeAndPosInSet()) {
|
| if (hasAttribute(aria_posinsetAttr))
|
| return getAttribute(aria_posinsetAttr).toInt();
|
| +
|
| + if (int position = positionInRadioGroup())
|
| + return position;
|
| +
|
| return AXObject::indexInParent() + 1;
|
| }
|
|
|
| @@ -1319,6 +1359,9 @@ int AXNodeObject::setSize() const
|
| if (hasAttribute(aria_setsizeAttr))
|
| return getAttribute(aria_setsizeAttr).toInt();
|
|
|
| + if (int size = sizeOfRadioGroup())
|
| + return size;
|
| +
|
| if (parentObject()) {
|
| const auto& siblings = parentObject()->children();
|
| return siblings.size();
|
|
|