diff --git a/index.html b/index.html index 9f3acc2..f5caa7c 100644 --- a/index.html +++ b/index.html @@ -51,7 +51,9 @@ 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. + screen orientation itself should not change. The specification also + defines CSS media features to enable feature detection of orientation + locking capabilities.
+ The can-lock-orientation media feature is
+ used to query whether the user agent supports locking the screen
+ orientation in the current context.
+
+ Value: none | auto
+
+ The can-lock-orientation media feature can be used to test + whether the user agent supports screen orientation locking + functionality. +
++ The user agent does not support screen orientation locking, or + locking is not possible in the current context. This includes + cases where: +
++ This keyword value evaluates as false in the [=boolean context=]. +
++ The can-lock-orientation media feature evaluates to `auto` + when orientation locking functionality is available, but this doesn't + guarantee that a specific lock request will succeed. Factors such as + platform limitations or specific orientation support may still cause + {{ScreenOrientation/lock()}} to fail. +
++ The following example shows how to use the + can-lock-orientation media feature to conditionally display + orientation-related UI: +
+
+ /* Hide rotation controls when orientation locking is not supported */
+ .rotation-controls {
+ display: none;
+ }
+
+ @media (can-lock-orientation) {
+ .rotation-controls {
+ display: block;
+ }
+ }
+
+ + In JavaScript, the media feature can be queried using: +
+
+ if (window.matchMedia('(can-lock-orientation)').matches) {
+ // Orientation locking is potentially available
+ showOrientationControls();
+ } else {
+ // Orientation locking is not available
+ hideOrientationControls();
+ }
+
+ + To prevent fingerprinting through user preferences or device + capabilities, user agents SHOULD consider the following privacy + mitigations: +
++ These privacy considerations ensure that the + can-lock-orientation media feature provides useful + functionality for progressive enhancement while minimizing + potential fingerprinting vectors. +
+