diff --git a/accessible/src/html/HTMLFormControlAccessible.cpp b/accessible/src/html/HTMLFormControlAccessible.cpp index 09691fd2f7e6..f940f5f9fdf3 100644 --- a/accessible/src/html/HTMLFormControlAccessible.cpp +++ b/accessible/src/html/HTMLFormControlAccessible.cpp @@ -172,8 +172,8 @@ HTMLRadioButtonAccessible::GetPositionAndSizeInternal(int32_t* aPosInSet, if (inputElm->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type, type, eCaseMatters) && inputElm->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, - name, eCaseMatters)) { - count++; + name, eCaseMatters) && mDoc->HasAccessible(inputElm)) { + count++; if (inputElm == mContent) indexOf = count; } diff --git a/accessible/tests/mochitest/attributes/test_obj_group.html b/accessible/tests/mochitest/attributes/test_obj_group.html index 4b222ab28d17..979605152684 100644 --- a/accessible/tests/mochitest/attributes/test_obj_group.html +++ b/accessible/tests/mochitest/attributes/test_obj_group.html @@ -40,6 +40,10 @@ testGroupAttrs("radio3", 1, 2); testGroupAttrs("radio4", 2, 2); + ////////////////////////////////////////////////////////////////////////// + // Hidden HTML input@type="radio" + testGroupAttrs("radio5", 1, 1); + ////////////////////////////////////////////////////////////////////////// // HTML ul/ol testGroupAttrs("li1", 1, 3); @@ -319,5 +323,9 @@