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

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

Closed
nvaccessAuto opened this Issue Oct 26, 2012 · 6 comments

Comments

Projects
None yet
1 participant

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.

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.

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.

Thanks,
Jeff

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: http://jsfiddle.net/2uDCt/1/

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'
role: ROLE_BUTTON
states: STATE_FOCUSABLE, STATE_LINKED, STATE_FOCUSED
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 accRole: ROLE_SYSTEM_PUSHBUTTON
IAccessible accState: STATE_SYSTEM_FOCUSED, STATE_SYSTEM_FOCUSABLE, STATE_SYSTEM_LINKED, STATE_SYSTEM_VALID (5242884)
IAccessible accDescription: u'This is not a button'
IAccessible accValue: None
MSHTML node has ancestor IAccessible: False
MSHTML nodeName: u'A'

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

http://jsfiddle.net/2uDCt/1/

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((nodeName.compare(L"A")==0)&&(attribsMap.find(L"HTMLAttrib::href")==attribsMap.end())) {
        if(IAStates&STATE_SYSTEM_LINKED) IAStates-=STATE_SYSTEM_LINKED;
        if(IAStates&STATE_SYSTEM_FOCUSABLE) IAStates-=STATE_SYSTEM_FOCUSABLE;

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. :)

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

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

@nvaccessAuto nvaccessAuto added this to the 2013.2 milestone Nov 10, 2015

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