W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2010

focusin/focusout should be cancelable

From: Ojan Vafai <ojan@chromium.org>
Date: Thu, 29 Jul 2010 16:41:10 -0700
Message-ID: <AANLkTik1WrOVSKkNV+9p2jWLVHLsuYXDkJFV=Bow90Vk@mail.gmail.com>
To: www-dom@w3.org
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.

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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:16 UTC