Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1155 by felix8a: keydown handlers attached to document
http://code.google.com/p/google-caja/issues/detail?id=1155

if a gadget tries to attach a keydown handler to document,
it doesn't work, because the pseudo-document node is
a div, and divs don't normally get keyboard focus,
so it never sees any keydown events.

a div can become focusable by giving it a tabindex,
such as tabindex=-1.  I think this works in all the
a-grade, but haven't tested them all yet.

a gadget can't easily do this for itself, because
1, caja doesn't whitelist tabindex for div
2, el.focus() is usually nullified by domita.

so... it's not clear to me what the kb focus policy
should be for gadgets.  neither "click to focus"
nor "focus follows mouse" is particularly intuitive
in the case of multiple gadgets on the same page.

maybe the right thing to do is to mimic the focus
behavior of iframes, but it's not clear to me that
this is do-able, because I can't think of a reliable
way for js to detect whether the ui is generally
click-to-focus or not.

maybe it's best to just whitelist div::tabindex
and let gadgets handle it themselves.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply via email to