Last Comment Bug 700741 - Add a scriptable way to know if an element is focusable
: Add a scriptable way to know if an element is focusable
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla11
Assigned To: Eitan Isaacson [:eeejay]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-08 11:31 PST by Eitan Isaacson [:eeejay]
Modified: 2011-11-11 02:15 PST (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Add and implement nsIFocusManager.elementIsFocusable (1.37 KB, patch)
2011-11-08 11:31 PST, Eitan Isaacson [:eeejay]
enndeakin: review+
Details | Diff | Review
Add and implement nsIFocusManager.elementIsFocusable (1.39 KB, patch)
2011-11-10 08:22 PST, Eitan Isaacson [:eeejay]
no flags Details | Diff | Review

Description Eitan Isaacson [:eeejay] 2011-11-08 11:31:23 PST
Created attachment 572919 [details] [diff] [review]
Add and implement nsIFocusManager.elementIsFocusable

It is useful for extensions to know if an element is focusable without experimenting or reinventing the logic in the platform code. For example the spatial navigation extension that was in mc until recently did a bad job at figuring out what was focusable[1].

1. http://hg.mozilla.org/mozilla-central/file/fa82e3fa46b9/toolkit/spatial-navigation/SpatialNavigation.js
Comment 1 Olli Pettay [:smaug] 2011-11-08 12:25:15 PST
Neil should probably review the patch.
Comment 2 Neil Deakin 2011-11-10 07:34:38 PST
Comment on attachment 572919 [details] [diff] [review]
Add and implement nsIFocusManager.elementIsFocusable

>+  *rv = CheckIfFocusable(aContent, aFlags) != nsnull;
>+

Change 'rv' to some other name (such as aIsFocusable). 'rv' is often used as an locally declared nsresult and I was momentarily confused by this.
Comment 3 Eitan Isaacson [:eeejay] 2011-11-10 08:22:24 PST
Created attachment 573523 [details] [diff] [review]
Add and implement nsIFocusManager.elementIsFocusable

Changed variable name
Comment 5 Marco Bonardo [::mak] 2011-11-11 02:15:28 PST
https://hg.mozilla.org/mozilla-central/rev/0b200d3bd408

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