Re: [whatwg] Notification's click event should be cancelable

On 08/26/2014 12:53 PM, Jonas Sicking wrote:
> On Tue, Aug 26, 2014 at 2:18 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
>> On Tue, Aug 26, 2014 at 11:06 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>>> I don't see a problem with firing events on all Notification
>>> instances, and only changing focus if none of the events were
>>> cancelled.
>>
>> It's a somewhat complex design compared to what we probably need long
>> term, if long term is service workers.
>
> I'm not convinced that even with SW, the proper design is to tell
> websites to always funnel click notifications through a SW.
>
> Alternatively we don't use events here at all. Instead we could use a
> .clicked property which returns a promise. This is a typical "one
> shot" notification where Promises are better suited than DOM Events.
>

Unless you want the cancellability.



> However I don't actually think that firing events on multiple
> EventTargets is that complex.

It can be complex if we have several processes firing those events.
Some process might be really slow and the parent process would need to wait for all the
child processes to reply before doing some default handling (like focus the initiator tab).

-Olli


>
> / Jonas
>

Received on Tuesday, 26 August 2014 13:07:34 UTC