DEFAULT state exposed incorrectly for HTML

RESOLVED FIXED in mozilla10

Status

()

Core
Disability Access APIs
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Aaron Leventhal, Assigned: surkov)

Tracking

(Blocks: 1 bug)

8 Branch
mozilla10
x86
All
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
Created attachment 539208 [details]
Partial testcase

The IA2/ATK state DEFAULT must indicate which button will be triggered if the user hits Enter in a form (in any control which doesn't already consume Enter).

However, our logic is currently too simple. Some problems:
1. <input type="image"> will act as a submit button (triggered on Enter), but we don't expose DEFAULT for it.
2. Only the first submit button in a form is triggered by Enter, but we expose DEFAULT for all of them.

I've created a test case but haven't checked out what happens when HTML 4 buttons are added (<button type="button"> or <button type="submit">). Most likely we need some common code for nsHTMLButtonAccessible and nsHTML4ButtonAccessible which will 1) allow input type="image" to be considered a default button and 2) only allow the first submit button to be marked as default.

http://mxr.mozilla.org/mozilla-central/source/accessible/src/html/nsHTMLFormControlAccessible.cpp#263
Mounir is there an intrinsic state for this?
(In reply to comment #1)
> Mounir is there an intrinsic state for this?

Sure, it's NS_EVENT_STATE_DEFAULT (which is used by the pseudo-class :default).
See:
https://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsGenericHTMLElement.cpp#2765
(Assignee)

Updated

6 years ago
Blocks: 640520
Target Milestone: --- → mozilla7
Version: unspecified → 8 Branch
(Assignee)

Updated

6 years ago
Target Milestone: mozilla7 → ---
(Assignee)

Comment 3

6 years ago
Created attachment 564138 [details] [diff] [review]
patch
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #564138 - Flags: review?(bolterbugz)
Comment on attachment 564138 [details] [diff] [review]
patch

stealing  review per irc
Attachment #564138 - Flags: review?(bolterbugz) → review+
(Assignee)

Comment 5

6 years ago
inbound land https://hg.mozilla.org/integration/mozilla-inbound/rev/265d39da5c3d
https://hg.mozilla.org/mozilla-central/rev/265d39da5c3d
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
(Assignee)

Updated

6 years ago
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.