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

2014-09-17 Thread Elliott Sprehn
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

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

2014-08-18 Thread Tab Atkins Jr.
On Mon, Aug 18, 2014 at 4:21 PM, Kornel Lesiński kor...@geekhood.net wrote: My biggest concern with the WakeLock API is that it's easy to forget (or fail) to release the lock. It's not a problem with the API per se, but a programming problem in general: resource management in non-trivial

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

2014-08-18 Thread Marcos Caceres
On Monday, August 18, 2014 at 7:21 PM, Kornel Lesiński wrote: My biggest concern with the WakeLock API is that it's easy to forget (or fail) to release the lock. It's not a problem with the API per se, but a programming problem in general: resource management in non-trivial programs is

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

2014-08-18 Thread Domenic Denicola
In general I feel this thread has taken a turn for the complex. Why don't we just do what other platforms do, and provide a simple global request/release mechanism (or toggleable Boolean property!), which developers can build on top of? A lot of the ideas here seem to be trying to create the

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

2014-08-18 Thread Tab Atkins Jr.
On Mon, Aug 18, 2014 at 5:10 PM, Domenic Denicola dome...@domenicdenicola.com wrote: In general I feel this thread has taken a turn for the complex. Why don't we just do what other platforms do, and provide a simple global request/release mechanism (or toggleable Boolean property!), which

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

2014-08-18 Thread Marcos Caceres
On Monday, August 18, 2014 at 8:10 PM, Domenic Denicola wrote: In general I feel this thread has taken a turn for the complex. Why don't we just do what other platforms do, and provide a simple global request/release mechanism (or toggleable Boolean property!), which developers can build

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

2014-08-18 Thread Marcos Caceres
(sorry, accidental send before!) On Monday, August 18, 2014 at 8:10 PM, Domenic Denicola wrote: In general I feel this thread has taken a turn for the complex. Why don't we just do what other platforms do, and provide a simple global request/release mechanism (or toggleable Boolean

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

2014-08-18 Thread Jonas Sicking
On Mon, Aug 18, 2014 at 5:35 PM, Marcos Caceres w...@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