Web app manifest orientation property: What is the difference between its properties?
Asked Answered
S

1

17

What is the difference between "any" and "natural" ?
What is the difference between "landscape", "landscape-primary" and "landscape-secondary" ?
What is the difference between "portrait", "portrait-primary" and "portrait-secondary" ?

Scull answered 25/7, 2021 at 21:52 Comment(2)
All of them are explained in the API spec: w3c.github.io/screen-orientation/…Tonus
@Tonus Thank you, you can post it as an answer so I can accept itScull
T
18

Directly taking the definitions from the API Spec:

Landscape-primary is an orientation where the screen width is greater than the screen height. If the device's natural orientation is landscape, then it is in landscape-primary when held in that position. If the device's natural orientation is portrait, the user agent sets landscape-primary from the two options as shown in the screen orientation values table.

Landscape-secondary is an orientation where the screen width is greater than the screen height. If the device's natural orientation is landscape, it is in landscape-secondary when rotated 180º from its natural orientation. If the device's natural orientation is portrait, the user agent sets landscape-secondary from the two options as shown in the screen orientation values table.

Portrait-primary is an orientation where the screen width is less than or equal to the screen height. If the device's natural orientation is portrait, then it is in portrait-primary when held in that position. If the device's natural orientation is landscape, the user agent sets portrait-primary from the two options as shown in the screen orientation values table.

Portrait-secondary is an orientation where the screen width is less than or equal to the screen height. If the device's natural orientation is portrait, then it is in portrait-secondary when rotated 180º from its natural position. If the device's natural orientation is landscape, the user agent sets portrait-secondary from the two options as shown in the screen orientation values table.

Portrait is an orientation where the screen width is less than or equal to the screen height and depending on platform convention locking the screen to portrait can represent portrait-primary, portrait-secondary or both.

Landscape is an orientation where the screen width is greater than the screen height and depending on platform convention locking the screen to landscape can represent landscape-primary, landscape-secondary or both.

Natural is an orientation that refers to either portrait-primary or landscape-primary depending on the device's usual orientation. This orientation is usually provided by the underlying operating system.

Any is an orientation that means the screen can be locked to any one of portrait-primary, portrait-secondary, landscape-primary and landscape-secondary.

Tonus answered 25/7, 2021 at 21:58 Comment(1)
Primary: expected orientation for portrait/landscape (portrait -> upright) Secondary: not expected orientation (180º upside-down) Without Primary/Secondary: Both is possibleMitchmitchael

© 2022 - 2024 — McMap. All rights reserved.