Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor tag with role of button but no href is not recognized as a button in Internet Explorer #2750

nvaccessAuto opened this issue Oct 26, 2012 · 6 comments


Copy link

@nvaccessAuto nvaccessAuto commented Oct 26, 2012

Reported by javis on 2012-10-26 14:26

This is a button This is a button This is a button

The following markup will only recognize the anchor tags with a href attribute as buttons in Internet Explorer. In Firefox they are all recognized as buttons.

Copy link

@nvaccessAuto nvaccessAuto commented Oct 29, 2012

Comment 1 by jteh on 2012-10-29 00:28
Can you please elaborate on what you mean by recognised as buttons? NVDA reports all of them as buttons for me in both browsers.

The one point that is different is that in Firefox, we don't require buttons to be focusable to be reached with the "b" quick navigation key, whereas in IE, we do, which is obviously inconsistent. (An "a" tag without an href is not focusable without a tabindex.) In general, buttons should be focusable, so I'm not sure which "fix" we will make here, but obviously it should be consistent.

Copy link

@nvaccessAuto nvaccessAuto commented Apr 1, 2013

Comment 2 by javis on 2013-04-01 14:23
Hey jteh,

We were concerned around the inconsistent behaviour when the user hits the "b" button to navigate the buttons. We cannot seem to determine an effective way to deal with the inconsistency.


Copy link

@nvaccessAuto nvaccessAuto commented Apr 9, 2013

Comment 3 by nmatthews on 2013-04-09 15:14
James, even with a tabIndex set to 0, the b quick nav key is not transferring focus to a button.

I've set up a jsfiddle (for support with IE9 or greater) here:

The fourth button cannot be accessed with the B key.
When I manually click on the fourth link (without an href, but with a tabindex) I then hit NVDA+1, NVDA+F1. Here is the debug output. Note that the system states include focusable.

Developer info for navigator object:
name: u'This is not a button'
isFocusable: False
hasFocus: True
Python object: <NVDAObjects.Dynamic_MSHTMLButtonIAccessible object at 0x065E6CD0>
Python class mro: (<class 'NVDAObjects.Dynamic_MSHTMLButtonIAccessible'>, <class 'NVDAObjects.IAccessible.MSHTML.MSHTML'>, <class 'NVDAObjects.IAccessible.Button'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: u'This is not a button'
location: (317, 62, 123, 18)
value: None
appModule: <'appModuleHandler' (appName u'iexplore', process ID 1972) at address 6466390>
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
windowHandle: 66790
windowClassName: u'Internet Explorer_Server'
windowControlID: 0
windowStyle: 1442840576
windowThreadID: 3204
windowText: u''
displayText: ''
IAccessibleObject: <POINTER(IAccessible) ptr=0x627f1a4 at 6468990>
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=66790, objectID=None, childID=0
IAccessible accName: u'This is not a button'
IAccessible accDescription: u'This is not a button'
IAccessible accValue: None
MSHTML node has ancestor IAccessible: False
MSHTML nodeName: u'A'

Copy link

@nvaccessAuto nvaccessAuto commented Apr 9, 2013

Comment 4 by jteh (in reply to comment 3) on 2013-04-09 23:45
Replying to nmatthews:

The fourth button cannot be accessed with the B key.

Thanks for reporting. This is a bug.

Technical: The problem is due to the code around line 932 of the mshtml vbuf backend (51f51d9:

    //IE exposes state_linked for anchors with no href, this is wrong
    if(("A")==0)&&(attribsMap.find(L"HTMLAttrib::href")==attribsMap.end())) {

This doesn't take into account that the role might be overridden with ARIA.

Note that if we don't require buttons to be focusable, we don't need to bother fixing this part. :)

Copy link

@nvaccessAuto nvaccessAuto commented Apr 9, 2013

Comment 5 by jteh on 2013-04-09 23:45
Milestone changed from None to 2013.2

Copy link

@nvaccessAuto nvaccessAuto commented May 8, 2013

Comment 6 by mdcurran on 2013-05-08 03:33
Fixed in 7caff7f.
State: closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant