@@ -142,12 +142,17 @@ <h2>
142
142
show();
143
143
updateDetails(document.getElementById("button"));
144
144
});
145
+
146
+ async function doUnlock() {
147
+ await screen.orientation.unlock();
148
+ await document.exitFullscreen();
149
+ }
145
150
</script>
146
151
147
152
<button onclick="rotate(this)" id="button">
148
153
Lock
149
154
</button>
150
- <button onclick="screen.orientation.unlock ()">
155
+ <button onclick="doUnlock ()">
151
156
Unlock
152
157
</button>
153
158
</ pre >
256
261
[Exposed=Window]
257
262
interface ScreenOrientation : EventTarget {
258
263
Promise<void> lock(OrientationLockType orientation);
259
- void unlock();
264
+ Promise< void> unlock();
260
265
readonly attribute OrientationType type;
261
266
readonly attribute unsigned short angle;
262
267
attribute EventHandler onchange;
@@ -324,17 +329,9 @@ <h2>
324
329
</ h2 >
325
330
< p >
326
331
When the {{unlock()}} method is invoked, the < a > user agent</ a > MUST
327
- run the steps to < a > lock the orientation</ a > of the < a > responsible
328
- document</ a > to its < a > default orientation</ a > .
332
+ run the steps to < a > apply an orientation lock </ a > of the
333
+ < a > responsible document</ a > to its < a > default orientation</ a > .
329
334
</ p >
330
- < p class ='note ' title ="Why does unlock() not return a promise? ">
331
- {{unlock()}} does not return a promise because it is equivalent to
332
- locking to the < a > default orientation</ a > which might or might not be
333
- known by the < a > user agent</ a > . Hence, the < a > user agent</ a > can not
334
- predict what the new orientation is going to be and even if it is
335
- going to change at all.
336
- </ p >
337
- < div class ="issue " data-number ="104 "> </ div >
338
335
</ section >
339
336
< section >
340
337
< h2 >
827
824
</ h2 >
828
825
< p >
829
826
The steps to < dfn > apply an orientation lock</ dfn > to a
830
- < a > document</ a > using |orientation| are as follows:
827
+ < a > document</ a > using |orientation:OrientationLockType| are as
828
+ follows:
831
829
</ p >
832
830
< ol >
833
831
< li > If the < a > user agent</ a > does not support locking the screen
0 commit comments