Comment 201 for bug 263435

Revision history for this message
In , Timwi (timwi) wrote :

Here is a constructive idea.

I've been thinking about this bug and its effects. I've also read most of the comments. Apparently the biggest question is whether any particular keystroke should be sent to the plugin at all or not.

Looking at it from a user's perspective, I think all keystrokes can be divided into three categories:

1) Keystrokes that pertain to Firefox itself and should be independent of any
   content displayed. This includes Ctrl+Tab, Ctrl+T, Ctrl+W, Ctrl+L, Ctrl+I,
   and basically everything else I've forgotten.

   The user expects that these work, full-stop. The user does not generally
   expect that something _inside_ a tab should have an effect on something
   like Ctrl+Tab that works on a higher level.

   I therefore suggest that such keystrokes should be handled by Firefox
   directly and never sent to any content.

2) Keystrokes that pertain to the thing that forms the full contents of the
   current tab. This is usually a website, but it can be a plug-in if the file
   displayed is not HTML but something like PDF or SWF. Examples of keystrokes
   that fall into this category are Ctrl+P, Ctrl+U, Alt+Shift+Letter, etc.

   The user has a certain expectation for these to have specific functions in
   the context of a website, but when a plugin is displayed, the function can
   vary. This way, each plugin can decide whether things like Print or View
   Source make sense, and either act accordingly or implement a different
   function (or ignore the keystroke).

3) Keystrokes that pertain to something which can be contained within a
   website. This includes, for example, the arrow keys, because they behave
   differently in a textbox than they do if the website has focus.

   These keys should be sent to whichever element currently has focus and it is
   then up to this element to bubble (forward) the event up to its parent if it
   doesn't know how to handle it. This is how it works already.

So basically I think the user expects keys to fall into these three categories, but Firefox handles all keys as the third category.

Does this sound like a reasonable implementation plan?