w3c / screen-orientation

The screen orientation lock specification
https://w3c.github.io/screen-orientation/
Other
27 stars 29 forks source link

Allow unlock() to return a promise #231

Open marcoscaceres opened 2 years ago

marcoscaceres commented 2 years ago

Closes #104

The following tasks have been completed:

Implementation commitment:


Preview | Diff

annevk commented 2 years ago

Doesn't this have the problem that the promise is resolved before the lock might have been applied? (As that happens in parallel.)

marcoscaceres commented 2 years ago

It shouldn't (though maybe I didn't word it right?). That definitely should never happen: in parallel, (un)locking happens, maybe the event fires if the orientation changed, then the promise is resolved.

annevk commented 2 years ago

I think I understand, I got confused due to it sometimes early returning a successful promise.