[w3c/screen-orientation] lock() should not fail if another lock() is called in the change event (#184)

Technically the spec requires that but it is a really unexpected behaviour given that the orientation at that point will have succeeded and we shouldn't pretend that it failed because another `lock()` was called when the page should be notified.

I think the steps in [7.5](https://www.w3.org/TR/screen-orientation/#Screen-orientation-change) should be changed so that we copy the promise and clear the pending promises *before* firing the event. So if another `lock()` is called in the change event, they will behave as successive locks, the same way `await screen.orientation.lock(); await screen.orientation.lock();` would behave instead of conflicting locks like `screen.orientation.lock(); screen.orientation.lock();`.

@marcoscaceres WDYT?

FWIW, this was flagged because Chrome is now failing a WPT (https://bugs.chromium.org/p/chromium/issues/detail?id=980588) and I identified this as the root cause.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/screen-orientation/issues/184

Received on Thursday, 1 August 2019 23:12:10 UTC