W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2014

Re: [whatwg] [notifications][editorial] tweaking the "Activating a notification" window.focus() note

From: Glenn Maynard <glenn@zewt.org>
Date: Wed, 16 Apr 2014 18:45:04 -0500
Message-ID: <CABirCh_pbd4oLxz_cS6d5GqNFq8qV58bsP01HS9nHcorihk=5g@mail.gmail.com>
To: "Edward O'Connor" <eoconnor@apple.com>
Cc: whatwg <whatwg@lists.whatwg.org>
On Wed, Apr 16, 2014 at 6:10 PM, Edward O'Connor <eoconnor@apple.com> wrote:

> Hi,
>
> In ยง4.6 Activating a notification, there's a note that currently reads
>
>     "User agents are strongly encouraged to make window.focus() work
>     from within the event listener for the event named click as a means
>     of focusing the browsing context related to the notification."
>
> This note assumes that the UA doesn't automatically focus the browsing
> context when a notification is activated. (Safari on OS X is one example
> of a UA which does this.) The note should be adjusted so that readers
> understand that calling window.focus() may not be necessary on some
> combinations of UA and system notification service.
>

Rather, pages should never be allowed to window.focus() when a notification
is activated.  If the platform's notification design wants that to happen,
it's the platform's job to do that, and pages shouldn't all be required to
call window.focus() to make this happen consistently.  (If for some reason
the platform doesn't want that to happen, the page shouldn't be able to
override that, either.)

If there are notifications that don't want to focus a page when activated,
that should be a setting on the notification.

-- 
Glenn Maynard
Received on Wednesday, 16 April 2014 23:45:30 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:28 UTC