Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</p>
</section>
<section id="sotd">
Expand Down Expand Up @@ -393,17 +393,19 @@ <h2>
<h2>
`lock()` method
</h2>
<p>
<dfn>pre-lock conditions</dfn> 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.
</p>
<p>
When the {{lock()}} method is invoked with {{OrientationLockType}}
|orientation:OrientationLockType|, the [=user agent=] MUST run the
following steps.
</p>
<p>
The [=user agent=] MAY require a [=document=] and its associated
[=Document/browsing context=] to meet one or more <dfn>pre-lock
conditions</dfn> in order to [=lock the screen orientation=]. See
[[[#appmanifest-interaction]]] and [[[#fullscreen-interaction]]].
</p>
<ol class="algorithm">
<li>Let |document:Document| be [=this=]'s [=relevant global
object=]'s [=associated `Document`=].
Expand All @@ -416,6 +418,12 @@ <h2>
orientation to |orientation|, return [=a promise rejected with=] a
{{"NotSupportedError"}} {{DOMException}} and abort these steps.
</li>
<li>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.
</li>
<li data-tests="lock-basic.html">If |document|'s
{{Document/[[orientationPendingPromise]]}} is not `null`, [=reject
and nullify the current lock promise=] of |document| with an
Expand Down