mdn / mdn/browser-compat-data

api.ScreenOrientation - `unlock()` incorrectly described as throwing exceptions

Open
#16,872 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

browser:multiple data:api
Dominant language
JSON
Stars
5.8k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
186

Description

What type of issue is this?

Incorrect support data (ex. Chrome says "86" but support was added in "40")

What information was incorrect, unhelpful, or incomplete?

The 'unlock()' method is described as 'partially compatible' and 'Always throws NotSupportedError' on https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation.

However, unlike lock(), unlock() does not involve a Promise and is not described as throwing exceptions in the spec. Furthermore, real-life testing shows that no exceptions are generated in current browsers including Chrome and Firefox.

Possibly this discrepancy was due to an assumption that it behaves the same as lock() — otherwise, I am rather at a loss as to why the exception cannot be observed on production desktop browsers.

This error is also visible on https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/unlock as well as https://caniuse.com/mdn-api_screenorientation_unlock

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet), Firefox, Safari

What did you expect to see?

No response

Did you test this? If so, how?

No response

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation
https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/unlock

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation

MDN metadata
MDN page report details
  • Query: api.ScreenOrientation
  • Report started: 2022-07-07T17:35:37.031Z

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ScreenOrientation compatibility data associated with the MDN ScreenOrientation and ScreenOrientation/unlock pages, then compare the unlock() behavior with the relevant specification and current browser behavior. Update the support information so it no longer claims that unlock() always throws NotSupportedError, and verify that both linked MDN pages and the caniuse data reflect the correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.