diff --git a/index.html b/index.html index 57963d3..0ef0762 100644 --- a/index.html +++ b/index.html @@ -47,11 +47,11 @@ specification, exposes the current type and angle of the device's screen orientation, and dispatches events when it changes. This enables web applications to programmatically adapt the user experience for - multiple screen orientations, working alongside CSS. The API also - allows for the screen orientation to be locked under certain - preconditions. This is particularly useful for applications such as - computer games, where users physically rotate the device, but the - screen orientation itself should not change. + multiple screen orientations, working alongside CSS. This API is + particularly useful for applications such as computer games, where + users physically rotate the device, but the screen orientation itself + should not change. The API restricts locking the screen orientation + only if certain [=pre-lock conditions=] are met.

@@ -393,17 +393,19 @@

`lock()` method

+

+ pre-lock conditions are optional requirements that a + [=user agent=] MAY impose before allowing screen orientation locking. + Common pre-lock conditions include requiring the document to be in + fullscreen mode or being part of an installed web application. See + [[[#appmanifest-interaction]]] and [[[#fullscreen-interaction]]] for + specific examples. +

When the {{lock()}} method is invoked with {{OrientationLockType}} |orientation:OrientationLockType|, the [=user agent=] MUST run the following steps.

-

- The [=user agent=] MAY require a [=document=] and its associated - [=Document/browsing context=] to meet one or more pre-lock - conditions in order to [=lock the screen orientation=]. See - [[[#appmanifest-interaction]]] and [[[#fullscreen-interaction]]]. -

  1. Let |document:Document| be [=this=]'s [=relevant global object=]'s [=associated `Document`=]. @@ -416,6 +418,12 @@

    orientation to |orientation|, return [=a promise rejected with=] a {{"NotSupportedError"}} {{DOMException}} and abort these steps.

  2. +
  3. If the [=user agent=] requires |document| and its associated + [=Document/browsing context=] to meet [=pre-lock conditions=] in + order to [=lock the screen orientation=], and those conditions are + not met, return [=a promise rejected with=] a {{"NotAllowedError"}} + {{DOMException}} and abort these steps. +
  4. If |document|'s {{Document/[[orientationPendingPromise]]}} is not `null`, [=reject and nullify the current lock promise=] of |document| with an