Closed Bug 259062 Opened 16 years ago Closed 14 years ago

Support key events for navigation: onkeydown, onkeyup, and onkeypress event attributes


(Core :: SVG, defect, critical)

Not set





(Reporter: jay, Unassigned)





(1 file, 3 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040702
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040702

use the keyboard to type a letter, teh keycode is displayed on screen, well it
should be and is in safari.

essential for many games, and accessibility for keyboard users, such as the blind

Reproducible: Always
Steps to Reproduce:
2.type a letter using a keyboard

Actual Results:  

Expected Results:  
screen should display keycode for letter typed

this code works in safari, and msie

This is and accessibility issue and is critical, without this feature people
unable to use a mouse cannot access SVG.

A related bug deals with a
similar issue using SVG plugin on the main Mozilla browser.
For the record, SVG 1.1 does not provide key events.

"As in  DOM2 Key events, the SVG specification does not provide a key event set.
An event set designed for use with keyboard input devices will be included in a
later version of the DOM and SVG specifications."

There are now Text events and Keyboard events we could support as described in
the W3C Note DOM Level 3 Events at


but the SVG 1.2 draft does not describe corresponding event attributes for these
events. Instead the declarative handling mechanism is a new <handler> element

This bug is a request for us to support event attributes that correspond to key
events despite the fact that the specs don't require this. The attributes to be
supported would be:

  * onkeydown
  * onkeyup
  * onkeypress

The rational for this would be that other SVG implementations such as Adobe's
SVG Viewer support these attributes, and SVG content that uses them has now
become widespread. 

Changed bug's subject from "keycode doesn't register, does in safari (Adobe SVG
Viewer)" to "support key events and the onkeydown, onkeyup, and onkeypress event
Ever confirmed: true
OS: MacOS X → All
Hardware: Macintosh → All
Summary: keycode doesn't register, does in safari (Adobe SVG Viewer) → Support key events and the onkeydown, onkeyup, and onkeypress event attributes
Jonas, would you take ownership of this bug if we decide we do want to do this?
Mass reassign of SVG bugs that aren't currently being worked on by Alex to
general@svg.bugs. If you think someone should be assigned to your bug you can
join the #svg channel on's IRC server ( irc:// )
where you can try to convince one of the SVG hackers to work on it. We aren't
always there, so if you don't get a response straight away please try again later. 
Assignee: alex → general
whilst considering this bug it might be as well to be aware of:
Mozilla/Gecko Keyboard Navigation Proposal
I'm really concerned at the lack of progress, over 6 months, now and still not
assigned. Accessibility is a significant part of compliance, please read the 1.1
specification and User Agent guidelines:
"To conform to the SVG specification, an SVG user agent should conform to UAAG. "
" Ensure that the user can operate, through keyboard input alone, any user agent
functionality available through the user interface"
"While this document only requires keyboard operation for conformance, it
promotes input device independence by also allowing people to claim conformance
for full pointing device support or full voice support."
"The user may have to operate the user interface with a variety of input devices
(e.g., keyboard, pointing device, and voice input) and output modalities"

so it can be said the specs do require keyboard functionality.

as a minimum it is clear that some means of navigation, (frequently 'tab' and
'enter') is a requirement

I asked the DOMWG regarding this and received this response from Joseph Kesselman:

Certainly the accessability working group could, and probably should,
address this. But I think "keyboard navigation" is out of scope for the

Remember, the DOM is a Document Model API. Screen navigation is an user
interface issue. The DOM will happily pass those characters through its
event system. But how they're interpreted by the UI is not under the DOM's
control, so there isn't anything the DOM spec can usefully say about this.
Summary: Support key events and the onkeydown, onkeyup, and onkeypress event attributes → Support key events for navigation: onkeydown, onkeyup, and onkeypress event attributes
Why is this bug still open?

Deer park looks to be a significant leap for SVG, but:

is just no fun on a mac, no keystrokes ~:"

It has been open nearly a year, and took more than that to get accepted and left

Alex, Jonathan and Tor, have you tried SVGtetris on a mac?

congratulations on DeerPark, and please muscle in on Aaron Leventhal.
Well this is my first major bug that has been sorted.

Congratulations to all concerned including hixie, tor, jwatt and aaronL.

Accessibility is important, and I can now endeavour to live up to the excellent example you are setting.

Closed: 14 years ago
Resolution: --- → FIXED
Attached image alert dialogue provides keycode (obsolete) —
Attached image <g id="this"> should be <a id="that"> (obsolete) —
Attachment #222913 - Attachment description: <g id="this"> should be <a id="that> → <g id="this"> should be <a id="that">
see attachment #222913 [details]

Erik@Opera helped me understand that perhaps <a id="such&such"> should be the result to evt.currentTarget rather than the current <g id="containerForAnchor">

I apologise for not having spotted this earlier, as the code worked I was elated.

Might keycode be supported as well as charcode?
Resolution: FIXED → ---
I was amazed, that after the two year struggle to get this bug accepted, to find that :focus is part of the standard:


"Processing of any relevant dynamic pseudo-classes (i.e., :hover, :active and :focus), after which the event is passed on for:"
Attached image tab or focus anchor broken (obsolete) —
Attachment #222028 - Attachment is obsolete: true
Attachment #222913 - Attachment is obsolete: true
Attachment #226135 - Attachment is obsolete: true
could this be OS X specific?
As stated in comment 1, SVG 1.1 does not specify key event attributes, and as such we will not implement them.  Closing bug.

Closed: 14 years ago14 years ago
Resolution: --- → WONTFIX
agreed as there has been significant drift from the summary.

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