Re: [whatwg] Preventing wake lock leaks with DOM nodes

This is what the attached and detached callbacks are for on custom
elements. Someone can build an <app-screenlock> element that requests the
lock when it's attached (added to the viewed document) and releases when
it's detached (removed from the viewed document).

There's no reason to complicate this API, developers have the primitives to
do this already.


On Mon, Aug 18, 2014 at 6:20 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Mon, Aug 18, 2014 at 5:35 PM, Marcos Caceres <w3c@marcosc.com> wrote:
> > The reason I didn't make it a boolean was because of the IPC involved
> and because I wanted to support multiple types of locks without needing to
> add new attributes in the future (and if we need to add the complex stuff
> later).
>
> What's the problem with adding more attributes in the future?
>
> That said, I do think that a "timeout" for screen locks make sense, so
> a boolean wouldn't work. Though not as a timeout for when to release
> the lock, but rather as a "minimum time I'd like to keep the screen
> awake" as described at
>
> http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2014-August/297423.html
>
> / Jonas
>

Received on Wednesday, 17 September 2014 21:24:00 UTC