[Bug 24697] Use Promises for lockOrientation

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24697

--- Comment #5 from Mounir Lamouri <mounir@lamouri.fr> ---
(In reply to Domenic Denicola from comment #2)
> > void unlockOrientation ();
> 
> Is unlocking the orientation always synchronous? That is, can the caller
> depend on the orientation being unlocked immediately after making the
> `unlockOrientation()` call?
> 
> It seems like not, since
> 
> > The unlockOrientation() method, when invoked, MUST asynchronously lock the orientation to the default orientation
> 
> In that case, a promise should be used so that users can reason about their
> program in the sense of knowing when the orientation is finished unlocking.

We can't reliably know when the unlock is done given that it means that we lock
to the default orientation which might be platform specific and the browser
might not actually know it. I don't even mention odd behaviours like Android on
phones that will accept portrait-secondary if you locked to 'any', will not
accept you to switch to that orientation if you are locked to the default
orientation but will not change your orientation to something else if you
unlock... In short, having a promise here would be very hard to implement
reliably, I don't think it is a good idea to require this.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 3 July 2014 17:53:13 UTC