Last Comment Bug 664142 - DEFAULT state exposed incorrectly for HTML
: DEFAULT state exposed incorrectly for HTML
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: 8 Branch
: x86 All
: -- normal (vote)
: mozilla10
Assigned To: alexander :surkov
:
Mentors:
Depends on:
Blocks: statea11y
  Show dependency treegraph
 
Reported: 2011-06-14 07:52 PDT by Aaron Leventhal
Modified: 2011-10-03 18:49 PDT (History)
5 users (show)
surkov.alexander: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Partial testcase (1.24 KB, text/html)
2011-06-14 07:52 PDT, Aaron Leventhal
no flags Details
patch (5.73 KB, patch)
2011-10-03 01:06 PDT, alexander :surkov
tbsaunde+mozbugs: review+
Details | Diff | Splinter Review

Description Aaron Leventhal 2011-06-14 07:52:31 PDT
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
Comment 1 David Bolter [:davidb] ***PTO until 29th*** 2011-06-14 08:02:47 PDT
Mounir is there an intrinsic state for this?
Comment 2 Mounir Lamouri (:mounir) 2011-06-14 08:06:51 PDT
(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
Comment 3 alexander :surkov 2011-10-03 01:06:50 PDT
Created attachment 564138 [details] [diff] [review]
patch
Comment 4 Trevor Saunders (:tbsaunde) 2011-10-03 03:27:31 PDT
Comment on attachment 564138 [details] [diff] [review]
patch

stealing  review per irc
Comment 5 alexander :surkov 2011-10-03 07:31:38 PDT
inbound land https://hg.mozilla.org/integration/mozilla-inbound/rev/265d39da5c3d
Comment 6 Matt Brubeck (:mbrubeck) 2011-10-03 16:54:19 PDT
https://hg.mozilla.org/mozilla-central/rev/265d39da5c3d

Note You need to log in before you can comment on or make changes to this bug.