focusin/focusout should be cancelable

Use-case: Building modal DOM-based elements (e.g. modal dialogs) is very
difficult right now. You need to capture and handle all sorts of events to
cancel (e.g. tab, mouse events, etc).

Instead, focusin/focusout should be cancelable. If either event is
cancelled, it should cancel the focus change within the page. The UA is
free, however, to blur the top-level window and, for example, focus the
address bar. This allows sites to provide a modal experience in a reliable
way, without a lot of code, but still disallows a web page from trapping
keyboard focus.

Currently focusin/focusout are not cancelable in IE or WebKit (the only
browsers that implement them). It seems it would likely be very safe in
terms of backwards compatibility to change this.

Ojan

Received on Thursday, 29 July 2010 23:42:00 UTC