diff --git a/index.html b/index.html index 8a89fba..94e7d5d 100644 --- a/index.html +++ b/index.html @@ -142,12 +142,17 @@

show(); updateDetails(document.getElementById("button")); }); + + async function doUnlock() { + await screen.orientation.unlock(); + await document.exitFullscreen(); + } </script> <button onclick="rotate(this)" id="button"> Lock </button> - <button onclick="screen.orientation.unlock()"> + <button onclick="doUnlock()"> Unlock </button> @@ -256,7 +261,7 @@

[Exposed=Window] interface ScreenOrientation : EventTarget { Promise<void> lock(OrientationLockType orientation); - void unlock(); + Promise<void> unlock(); readonly attribute OrientationType type; readonly attribute unsigned short angle; attribute EventHandler onchange; @@ -324,17 +329,9 @@

When the {{unlock()}} method is invoked, the user agent MUST - run the steps to lock the orientation of the responsible - document to its default orientation. + run the steps to apply an orientation lock of the + responsible document to its default orientation.

-

- {{unlock()}} does not return a promise because it is equivalent to - locking to the default orientation which might or might not be - known by the user agent. Hence, the user agent can not - predict what the new orientation is going to be and even if it is - going to change at all. -

-

@@ -827,7 +824,8 @@

The steps to apply an orientation lock to a - document using |orientation| are as follows: + document using |orientation:OrientationLockType| are as + follows:

  1. If the user agent does not support locking the screen