Screen orientation in windows

Содержание
  1. How to Change the Screen Orientation in Windows
  2. Related
  3. Monitor Orientation Considerations
  4. Preparing to Change Monitor Orientation
  5. Landscape or Portrait Monitor Setup
  6. Looking at Other Options
  7. Change Display Orientation in Windows 10
  8. Change Display Orientation by Rotating Display
  9. To Change Display Orientation in Windows 10,
  10. Change Display Orientation in NVIDIA Control Panel
  11. About Sergey Tkachenko
  12. Change Screen Orientation Portrait / Landscape in Windows 10
  13. how to change orientation of your screen in Windows 10.
  14. Related Posts:
  15. Reader Interactions
  16. Comments
  17. Screen Orientation does not show up in Windows Mobility Center
  18. Replies (3) 
  19. Screen orientation in windows
  20. Introduction
  21. Goals
  22. Examples
  23. Locking to a specific orientation and unlocking
  24. Locking the screen before calling a function
  25. Alerting the user if the API is not supported
  26. Extensions to the `Screen` interface
  27. attribute
  28. interface
  29. method: Lock screen to a specific orientation
  30. method: Unlock screen to default orientation
  31. attribute: Get current orientation
  32. attribute: Get orientation angle
  33. attribute: Handle orientation changes
  34. Extensions to the `Document` interface
  35. Internal Slots
  36. Concepts
  37. Screen orientation types and locks
  38. Reading the screen orientation
  39. Locking the screen orientation
  40. Locking to the default orientation
  41. Interactions with other specifications
  42. Interaction with Fullscreen API
  43. Interaction with Web Application Manifest
  44. Interaction with CSS Device Adaptation
  45. Interaction with Web Content Accessibility Guidelines
  46. Algorithms
  47. Updating the orientation information
  48. Apply an orientation lock
  49. Locking the orientation
  50. Determining the active orientation lock
  51. Screen orientation change
  52. Privacy and Security Considerations
  53. Access to aspects of a user’s local computing environment
  54. Dependencies
  55. Acknowledgments

How to Change the Screen Orientation in Windows

Whether you’re using a single monitor for a specific purpose at your business or you want to add some variety to a multiple-monitor setup, you have some additional work to do besides physically positioning the monitor vertically or horizontally. Windows doesn’t automatically detect the monitor’s orientation, so you have to adjust the display settings so that the screen content rotates appropriately. While adjusting the monitor, you also have some decisions to make that affect the layout and scale of the monitor. Take a look at some steps for landscape and portrait monitor setup.

Monitor Orientation Considerations

You may want to change the monitor orientation if you’re experiencing a problem where on-screen content appears flipped or upside down suddenly. This problem can occur if you accidentally pressed a key combination that switches the Windows orientation settings. You might also have an issue with the installed monitor software, so it’s worth checking with the manufacturer’s troubleshooting resources if the problem happens multiple times after you fix the settings.

If you’re changing the monitor orientation voluntarily, know there are pros and cons to both orientations. SmartFile explains that a portrait monitor orientation helps software developers see more code and work more efficiently, but this setting leads to more glare. On the other hand, the landscape monitor orientation makes it easier to work with more programs at the same time, and it is often used for giving presentations or multitasking.

Preparing to Change Monitor Orientation

Before you proceed with the landscape or portrait monitor setup process in Windows, position the monitor in the orientation you plan to use. This makes it easier to determine whether you’ve chosen the right settings and to adjust configurations such as the screen resolution to suit your needs. You also must have your monitor connected, turned on, and set up in Windows so that it appears in the display devices list.

Landscape or Portrait Monitor Setup

When you’re ready, Microsoft recommends Windows 10 users open the «Settings» app, look for the «System» option, and then select «Display» to bring up the scale and layout options. You can also type «display settings» in the Windows search box and click the corresponding option if you’d rather save some time. Look for a «Display orientation» drop-down menu in the «Scale and layout» settings group and select either portrait or landscape monitor mode. The choice should match your monitor’s physical orientation.

Microsoft suggests that you can then make other changes to your display settings so that the text on the screen is big enough for you to read and looks clear. You can use the «Display resolution» drop-down list to select one of the resolution options available for your monitor. Keep in mind that higher resolutions mean that you get better visual quality, but the text and other screen elements look smaller. If you find that a problem, you’ll also find a drop-down list above the resolution settings where you can select a percentage to scale items such as text and apps.

Looking at Other Options

According to IONOS, you can try keyboard shortcuts to rotate your screen orientation and not change the other display settings. For example, using the «CTRL + ALT + Up Arrow» shortcut can get you to landscape mode, while «CTRL + ALT + Left Arrow» could get you to portrait mode. While using shortcuts, you want to consider the current orientation and adjust the arrow key used accordingly.

Monitor manufacturers might have their own software on your computer to control screen orientation. For example, Dell explains you can use the Dell Display Manager utility to set a Dell monitor in portrait mode.

Change Display Orientation in Windows 10

How to Change Display Orientation in Windows 10

Modern tablets and convertibles support screen rotation thanks to built-in hardware sensors. When you turn your device, its desktop may change the display to a portrait or landscape orientation. This post will show you how to change the display orientation in Windows 10.

Landscape and portrait display orientation

The display orientation can be changed with a number of methods. Windows 10 offers a native option to change it. Also, hardware vendors, for example, NVDIA, ship drivers that also allow changing the display orientation when supported.

In most cases, you can change the display orientation by rotating your display, by changing Display Orientation in Settings, or change Display Orientation in NVIDIA Control Panel if you have an NVIDIA GPU installed in your computer.

Change Display Orientation by Rotating Display

This option is usually available for tablets and 2-in-1 devices, such as convertible and hybrid laptops.

Just manually rotate the display, and the the display orientation will change to landscape or portrait automatically. This will be triggered by the built-in hardware sensors.

Note: If you have Rotation Lock enabled, the display orientation will not change when you rotate the display.

Alternatively, you can use Settings to change the display orientation.

To Change Display Orientation in Windows 10,

  1. Open Settings.
  2. Navigate to Settings > Display.
  3. If you have multiple screens, pick the screen on the right for which you want to change the display orientation.
  4. On the right, select Landscape, Portrait, Landscape (flipped), or Portrait (flipped) from the Display orientation drop-down list for what you want.
  5. If the selected display orientation suits your needs, click on the Keep changes button in the confirmation dialog.
  6. Otherwise, you click on Revert to restore the previous display orientation.

Finally, if you have a video adapter made by NVIDIA, you can use its control panel tool to change the display orientation.

Change Display Orientation in NVIDIA Control Panel

  1. Right-click anywhere on your Desktop.
  2. Select NVIDIA Control Panel from the context menu.
  3. In the app, go to Display > Rotate display on the left.
  4. On the right, select the proper connected display if you have a few.
  5. Select Landscape, Portrait, Landscape (flipped), or Portrait (flipped) under Choose the orientation for what you want, and click Apply.
  6. If everything looks as you expected, click Yes in the confirmation box. Otherwise, click No.

Note: The previously used display orientation will be automatically restored in 20 seconds if you do not take any action. This is useful if the changes you made prevent the display from showing the proper image.

Articles of interest:

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

Share this post

About Sergey Tkachenko

Sergey Tkachenko is a software developer from Russia who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

Читайте также:  Native instruments audio kontrol 1 driver windows 10

Change Screen Orientation Portrait / Landscape in Windows 10

Windows 10 offers the flexibility of changing orientation for normal viewing. Commonly, there are two basic modes of orientation used for viewing untill now. They are: – Portrait and Landscape

Landscape mode allows the wider part of the image to be covered in which the width of the image is more than its height (e.g. Panoramic View) whereas Portrait mode allows the height of the image to be more than its width (e.g. Book View).Whenever the angle of rotation of the screen changes to 90°, the modes are inter changed (i.e. Landscape to Portrait and vice-versa) and when the angle of rotation of the screen changes to 180°, the modes are flipped (i.e. Landscape to Landscape (flipped)).

In computers, Landscape mode is preferred over the Portrait mode whereas in Mobile phones/ Tablets, Portrait mode is the sole option for display.

Windows 10 allows four different ways of Orientation. They are:-

These modes are categorized below “Customize of display” section that can be found under the “Settings” app in Windows 10.

how to change orientation of your screen in Windows 10.

Step 1: Right-click on the desktop screen anywhere and click on “Display settings” for direct path access to the display configuration settings under the “Settings” app.

Step 2: Under Display section, look for “Orientation”. In “Orientation” section, click below the drop down menu to choose any one of the following options.

If you choose any other option apart from the current viewing mode, a confirmation message will be displayed like this:

The confirmation message will start a 10 second timer for the user to decide whether he wants to go with the changed orientation or reverting back to the current one. If the users fails to choose between the two options, they current viewing mode will stay subsequently.

Saurav is associated with IT industry and computers for more than a decade and is writing on The Geek Page on topics revolving on windows 10 and softwares.

Reader Interactions

Comments

I have three screens… Left is HD, middle is UHD, right is HD.
I have the left and right monitors rotated into portrait mode.
I used Win 10 display settings to rotate the displays accordingly.
I Apply, and OK the trial period… It works fine.
I can power cycle the computer and everything comes up correct.

HOWEVER, if I allow the computer to go to SLEEP mode,
when it comes out of SLEEP mode, the right monitor is not recognized and the left display (in Win 10) is incorrectly rotated.

I power cycle monitors. no change.
I power cycle the computer, and the previously unrecognized (right) monitor gets recognized again, but both HD monitors have the incorrect orientation.
I have to manually reconfigure the displays to portrait mode to get back the desired configuration after SLEEP mode.

Screen Orientation does not show up in Windows Mobility Center

I can’t seem to rotate my screen now. I have a laptop and an external monitor that I’d like to view as portrait, but the Orientation box does not show up in the Win Mob Cent. (Only 7 boxes)

Not sure if this is the only way to rotate the screen (external monitor) because no other option shows up under Screen properties.

Win7 Pro should do it nicely, like in Vista.

Replies (3) 

Thanks for posting in Microsoft answers!

If a setting doesn’t appear, it might be because the required hardware, such as adapter, or driver is missing or turned off.

So, if you do not see the option to change the screen orientation on your laptop, you may have to update the display and graphic drivers.

There are three ways to update a driver:

• Use Windows Update. You might need to set Windows Update to automatically download and install recommended updates.

• Install software from the device manufacturer. For example, if your device came with a disc, that disc might contain software that installs a driver for the device.

• Download and update the driver yourself. Use this method to install a driver that you download from the manufacturer’s website. Do this if Windows Update can’t find a driver for your device and the device didn’t come with software that installs a driver.

Refer the below links for more details:

For more details on Windows Mobility Center, refer the below links:

Using Windows Mobility Center
http://windows.microsoft.com/en-US/windows7/Using-Windows-Mobility-Center

Alternate method:

To change the orientation of the screen, follow the below steps:

1. Right click on desktop and select “Screen resolution”
2. Under “Display”, select external monitor or the one you wish.
3. Under “Orientation”, select “Portrait” or “Landscape”.

Refer the below link for details:

Hope this helps!
Gokul – Microsoft Support

Screen orientation in windows

The Screen Orientation API provides the ability to read the screen orientation type and angle, to be informed when the screen orientation changes, and to lock the screen to a specific orientation.

This document is a work in progress.

Introduction

For web applications, the Screen Orientation API exposes the type and angle of a device’s current screen orientation, and can provide notification if the device’s orientation changes. This allows web applications to programmatically adapt the user experience for many possible screen orientations (in concert with CSS). The API also allows locking the screen to a particular orientation. This is useful in applications such as computer games where users physically rotate the device but the screen orientation itself mustn’t change.

Goals

  • Allow a web application to have control over screen orientation where needed and without being intrusive to end users.
  • Support a better user experience by providing developers with information on screen orientation changes so web applications can update correspondingly.

Examples

Locking to a specific orientation and unlocking

In this example, clicking the «Lock» button makes a request to go into fullscreen and then lock the screen to the opposite orientation. Pressing the «Unlock» button unlocks the screen so it rotates if the user turns the device.

The developer console logs the change in orientation type and angle.

Locking the screen before calling a function

This example waits to go into fullscreen, then locks to landscape before calling `ready()`.

Alerting the user if the API is not supported

In this example, if the Screen Orientation API is not supported, or the screen orientation <> rejects, the user is alerted to rotate their screen manually to landscape.

Extensions to the `Screen` interface

The [[[CSSOM-View]]] specification defines the interface, which this specification extends:

attribute

The <> attribute is an instance of <>. This attribute provides the current orientation, current angle and whether there was an onchange event. The user agent MUST run the update the orientation information algorithm steps to initialize the values and return the <> attribute.

interface

The enum represents the screen orientations to which a screen can be locked: the «» enum value represents the any orientation, the «» enum represents the natural orientation, the «» enum represents the landscape orientation, the «» enum represents the portrait orientation, the «» enum represents the portrait-primary orientation, the «» enum represents the portrait-secondary orientation, the «» enum represents the landscape-primary orientation, and the «» enum represents the landscape-secondary orientation.

The enum represents the actual current screen orientation that the screen is in irrespective of which lock is applied: the «» enum represents the portrait-primary orientation, the «» enum represents the portrait-secondary orientation, the «» enum represents the landscape-primary orientation, and the «» enum represents the landscape-secondary orientation.

method: Lock screen to a specific orientation

When the <> method is invoked, the user agent MUST run the apply an orientation lock steps to the [=environment settings object / responsible document=] using |orientation|.

method: Unlock screen to default orientation

When the <> method is invoked, the user agent MUST run the steps to lock the orientation of the [=environment settings object / responsible document=] to its default screen orientation.

<> does not return a promise because it is equivalent to locking to the default screen orientation which might or might not be known by the user agent. Hence, the user agent can not predict what the new orientation is going to be and even if it is going to change at all.

Читайте также:  Включение компонентов системы windows

attribute: Get current orientation

When getting the <> attribute, the user agent MUST return the [=environment settings object / responsible document=]’s current orientation type.

attribute: Get orientation angle

When getting the <> attribute, the user agent MUST return the [=environment settings object / responsible document=]’s current orientation angle.

<> represents how far the user has turned the device counterclockwise from the natural orientation. When the device is rotated 90° counterclockwise, the screen compensates by rotating 90° clockwise, so <> returns `90`.

The screen orientation values table shows how the angle changes depending on the how the device is rotated.

The value returned by this property is always in the range 0-359. It never returns negative values.

attribute: Handle orientation changes

The <> attribute is an event handler whose corresponding event handler event type is `»change»`.

Extensions to the `Document` interface

Internal Slots

Internal Slot Description
The <<[[orientationLock]]>> represents a document’s orientation lock as an ordered set of <>.
An ordered set of orientations to which the screen orientation is locked when not explicitly locked by this API or any other means.
Either `null` or a <>. When assigned a <>, that promise represents a request to lock the screen to one of the supported orientations. The promise resolves after locking the orientation succeeds or rejects if locking fails.

Concepts

The term is equivalent to the screen of the output device associated to the <>, as per [[CSSOM-VIEW]].

Algorithms defined in this specification assume that for each document there is an <<[[orientationPendingPromise]]>>.

Screen orientation types and locks

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.

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.

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.

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.

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.

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.

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.

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

The is the set of orientations to which the screen is locked when there is no current orientation lock. This orientation is determined by the device’s operating system, or the user agent (e.g., ), or controlled by the end-user.

Reading the screen orientation

All documents have a and a . Both of them SHOULD be initialized when the document is created, otherwise they MUST be initialized the first time they are accessed and before their value is read. The user agent MUST update the orientation information of the document to initialize them.

For a given document, the current orientation type and the current orientation angle are strongly linked in the sense that for any given type, there will be a specific angle associated.

One primary orientation will always be determined by the natural orientation of the device and this will then determine the secondary value of its related orientation.

For example a device held in its natural portrait orientation would have a current orientation of portrait-primary and its portrait-secondary orientation would be its position when rotated 180°.

The user agent can associate the other `*-primary` and `*-secondary` values at will. For example, it can be based on the device preferred angles, the user’s preferred orientations or the current orientation when the application starts.

The screen orientation values table presents the possible orientation types: portrait-primary, portrait-secondary, landscape-primary and landscape-secondary. The table shows the primary and secondary values that are determined by the device’s natural orientation and the possibilities available to the user agent for setting the other primary and secondary orientation values.

The

Natural Orientation Primary Orientation 1 Secondary Orientation 1 Primary Orientation 2 Secondary Orientation 2
Portrait portrait-primary
<> `0`
portrait-secondary
<> `180`
landscape-primary
User agent to set at either <> `90` or <> `270`
landscape-secondary
Set at the angle not used for landscape-primary
Landscape landscape-primary
<> `0`
landscape-secondary
<> `180`
portrait-primary
User agent to set at either <> `90` or <> `270`
portrait-secondary
Set at the angle not used for portrait-primary

Once the user agent has set the primary and secondary values from the options in the screen orientation values table, the current orientation type and the current orientation angle relation MUST be kept consistent for any given document.

<> and <> relationship Never assume any cross-devices relationship between the screen orientation type and the screen orientation angle. Any assumption would be wrong given that a device might have `90` and `270` as the angles for `landscape` types but another device will have `0` and `180`, depending on its natural orientation. Instead, it is recommended to check during runtime the relationship between angle and type.

Locking the screen orientation

The user agent MAY require a document and its associated [=Document/browsing context=] to meet one or more in order to lock the screen orientation. For example, a user agent might require a document’s top-level browsing context to be fullscreen (see ) in order to allow an orientation lock.

The user agent MAY reject all attempts to lock the screen orientation if the platform conventions do not expect applications to be able to change the screen orientation. For example, on most desktop platforms, applications can not change the screen orientation.

If the user agent supports locking the screen orientation, it MUST allow the screen to be locked to all of the states of the <> enum.

An is in place when the screen has successfully been locked to a specific orientation.

Locking to the default orientation

From the perspective of a document, locking to the default screen orientation is equivalent to unlocking because it means that it no longer has a lock applied.

This does not mean that the <<[[defaultOrientation]]>> will only contain the item any. The default screen orientation is likely device-specific and <<[[defaultOrientation]]>> could for example contain portrait-primary and/or landscape-primary. Alternatively, the user could restrict the default orientation to a specific orientation via some OS or browser level preference for accessibility reasons. The user agent can also set the default orientation e.g., .

Interactions with other specifications

This section explains how this specification interacts with other related specifications of the platform.

Interaction with Fullscreen API

As a pre-lock condition, a user agent MAY restrict locking the screen orientation exclusively to when the top-level browsing context’s document’s is full screen. When that pre-lock condition applies, whenever the document’s fullscreen element is empty and a screen orientation lock is applied, the user agent MUST lock the orientation of the document to the document’s default screen orientation.

Interaction with Web Application Manifest

The [[[appmanifest]]] allows web applications to set the document’s default screen orientation.

Interaction with CSS Device Adaptation

The [[[CSS-ADAPTATION]]] specification defines, independently of this document, a way to lock the screen orientation for a web page using CSS.

Interaction with Web Content Accessibility Guidelines

​The intent of this Success Criterion is to ensure that all essential content and functionality is available regardless of the display orientation (portrait or landscape). Some websites and applications automatically set the screen to a particular display orientation and expect that users will respond by rotating their device to match.

However, some users may have their devices mounted in a fixed orientation (e.g. on the arm of a power wheelchair). Therefore, websites and applications need to support both orientations by making sure essential content and functionality is available in each orientation. While the order of content and method of functionality may have differences the content and functionality must always be available. When a particular orientation is essential, the user needs to be advised of the orientation requirements.​

Algorithms

Updating the orientation information

The steps to of a document are as follows:

  1. If the screen width is greater than the screen height, set the document’s current orientation type to landscape-primary or landscape-secondary.
  2. Otherwise, if the screen width is less than or equal to the screen height, set the document’s current orientation type to portrait-primary or portrait-secondary.
  3. Set the document’s current orientation angle to the clockwise angle in degrees between the orientation of the viewport as it is drawn and the natural orientation of the device (i.e., the top of the physical screen). This is the opposite of the physical rotation. In other words, if a device is turned 90 degrees on the right, the current orientation angle would be 270 degrees. The screen orientation values table gives the options for each orientation and possible associated angles.

Apply an orientation lock

The steps to to a document using |orientation| are as follows:

  1. If the user agent does not support locking the screen orientation, return a promise rejected with a `»NotSupportedError»` <> and abort these steps.
  2. If the document’s has the sandboxed orientation lock browsing context flag set, or user agent doesn’t meet the pre-lock conditions to perform an orientation change, return a promise rejected with a `»SecurityError»` <> and abort these steps.
  3. Set |doc|’s <<[[orientationPendingPromise]]>> to a newly-created promise.
  4. Return |doc|’s <<[[orientationPendingPromise]]>> and in parallel:
    1. Let |browsing contexts| be the list of the descendant browsing contexts of the top-level browsing context’s document.
    2. If one of the |browsing contexts|’s document’s <<[[orientationPendingPromise]]>> is not `null`:
      1. Let |doc| be the document which has a not `null` <<[[orientationPendingPromise]]>>.
      2. Reject |doc|’s <<[[orientationPendingPromise]]>> with `»AbortError»` <>.
      3. Set |doc|’s <<[[orientationPendingPromise]]>> to `null` .
    3. Let |orientations| be an empty list.
    4. Depending on |orientation| value, do the following: portrait-primary or portrait-secondary or landscape-primary or landscape-secondary Append |orientation| to |orientations|. landscape Depending on platform convention, append `landscape-primary`, or `landscape-secondary`, or both to |orientations|. portrait Depending on platform convention, append `portrait-primary`, or `portrait-secondary`, or both to |orientations|. natural Append `portrait-primary` or `landscape-primary` to |orientations| such as the associated current orientation angle is 0. `any` Append `portrait-primary`, `portrait-secondary`, `landscape-primary` and `landscape-secondary` to |orientations|.
    5. Lock the orientation of the document to |orientations|.
    6. If locking the orientation did not result in a change of orientation, as part of the next animation frame task, resolve <<[[orientationPendingPromise]]>> with `undefined` and set <<[[orientationPendingPromise]]>> to `null`.

Locking the orientation

The steps to to |orientation| are as follows.

  1. Set the document’s <<[[orientationLock]]>> to |orientations|.
  2. If the active orientation lock is not the document’s <<[[orientationLock]]>>, abort these steps.
  3. If the active orientation lock value is equal to |orientations| value, abort these steps.
  4. If |orientations| contains only one value, run the following sub-steps:
    1. Let |orientation| be the value contained in |orientations|.
    2. Change how the viewport is drawn so that the document’s current orientation type will be equal to |orientation|.
    3. After the change has happened, prevent the document’s top-level browsing context’s screen orientation from changing until those steps are run again.
    4. Abort these steps.
  5. If the document’s current orientation type is not part of |orientations|, change how the viewport is drawn such as the document’s current orientation type will be equal to one of |orientations|’ values.
  6. Otherwise, depending on platform conventions, change how the viewport is drawn in order to make it match another screen orientation type. However, it has to be part of |orientations|.
  7. Allow the user to change the screen orientation to any value part of |orientations| and only those values until those steps are run again. The method to define the current screen orientation has to match the platform conventions.

Determining the active orientation lock

The steps to determine the are as follows:

  1. If there is only one top-level browsing context with a document that is visible per [[PAGE-VISIBILITY]], the active orientation lock is the document’s <<[[orientationLock]]>>.
  2. Otherwise, if there are more than one top-level browsing context with a document that is visible per [[PAGE-VISIBILITY]] but only one of those documents is focused, the active orientation lock is the focused document’s <<[[orientationLock]]>>.
  3. Otherwise, the active orientation lock SHOULD be the latest focused document’s <<[[orientationLock]]>>, unless stated otherwise by the platform conventions.

Screen orientation change

Whenever the viewport’s angle changes, the user agent MUST run the following steps as part of the next animation frame task:

  1. Let |browsing contexts| be the list of the descendant browsing contexts of the top-level browsing context’s document.
  2. For each |context:browsing context| in |browsing contexts|, run the following sub-steps:
    1. Let |doc| be the |context|’s active document.
    2. If |doc| is not visible per [[PAGE-VISIBILITY]], abort these steps.
    3. Update the orientation information of |doc|.
    4. If the orientation change was triggered by a user gesture such as the user turning the device, as opposed to a call to <>, the task MUST be annotated with `process user orientation change` when running the next step.
    5. Fire an event named `change` at |doc|’s <> object.
    6. If |doc|’s <<[[orientationPendingPromise]]>> is not `null`:
      1. Resolve |doc|’s <<[[orientationPendingPromise]]>> with `undefined`.
      2. Set |doc|’s <<[[orientationPendingPromise]]>> to `null` .

Whenever a document becomes visible per [[PAGE-VISIBILITY]], in other words after the now visible algorithm is run, the user agent MUST run the following substeps as part of the next animation frame task:

  1. Let |type| and |angle| be respectively the document’s current orientation type and current orientation angle.
  2. Update the orientation information of the document.
  3. If |type| is different from the document’s current orientation type or |angle| from the document’s current orientation angle, run the following sub-steps:
    1. If the orientation change was triggered by a user gesture such as the user turning the device, as opposed to a call to lock(), the task MUST be annotated with `process user orientation change` when running the next step.
    2. Fire an event named `change` at the document’s <> object.
    3. If the document’s <<[[orientationPendingPromise]]>> is not `null`:
      1. Resolve the document’s <<[[orientationPendingPromise]]>> with `undefined`.
      2. Set the document’s <<[[orientationPendingPromise]]>> to `null`.

An algorithm is if the task in which the algorithm is running is annotated with `process user orientation change`.

Developers need to be aware that a <> object from a document that is not visible, as per [[PAGE-VISIBILITY]], will not receive an orientation change event. This is to prevent unnecessary changes to layout, etc. in the non-visible web application.

Privacy and Security Considerations

Access to aspects of a user’s local computing environment

The screen orientation type and angle of the device can be accessed with the API specified in this document, and can be a potential fingerprinting vector.

The screen orientation type can already be known by using the screen width and height. In practice, the additional information provided with the API concerning the angle of the device and the primary or secondary screen orientation is unlikely to be used by any competent attack.

Dependencies

The following concepts and interfaces are defined in [[HTML]]: .

The following is defined in [[PAGE-VISIBILITY]]: .

The following is used but not defined in [[FULLSCREEN]]: .

This specification defines conformance criteria that apply to a single product: the that implements the interfaces that it contains.

Acknowledgments

Thanks Christophe Dumez, Anne van Kesteren, Chundong Wang, Fuqiao Xue, and Chaals McCathie Nevile for their useful comments.

Special thanks to Chris Jones and Jonas Sicking for their contributions to the initial design of this API.

Читайте также:  Защита windows 10 не дает активировать office
Оцените статью