Closed Bug 1763052 Opened 3 years ago Closed 2 years ago

screen.orientation.unlock shouldn't throw an exception when not fullscreen?

Categories

(Core :: DOM: Core & HTML, defect)

Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox100 --- wontfix
firefox101 --- wontfix
firefox102 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Chrome doesn't throw any exception when calling screen.orientation.unlock. But Firefox will throw NS_ERROR_DOM_SECURITY_ERR by https://searchfox.org/mozilla-central/rev/fbb1e8462ad82b0e76b5c13dd0d6280cfb69e68d/dom/base/ScreenOrientation.cpp#347 when document isn't fullscreen. So this is different behavior.

Shouldn't screen.orientation.unlock throw an exception even if not fullscreen?

Severity: -- → S2

Makoto-san,
Are you going to work on this?

Flags: needinfo?(m_kato)

Yes.

Assignee: nobody → m_kato
Flags: needinfo?(m_kato)

Some web platform tests of screen orientation API will be failure due to
unhandled promise rejection. Our screen.orientation.unlock() implementation
may set rejected promise since we create promise internally.

Actually, screen.orientation.unlock() doesn't return promise, so we
shouldn't end up reporting it.

(In reply to Makoto Kato [:m_kato] from comment #3)

Some web platform tests of screen orientation API will be failure due to
unhandled promise rejection. Our screen.orientation.unlock() implementation
may set rejected promise since we create promise internally.

Actually, screen.orientation.unlock() doesn't return promise, so we
shouldn't end up reporting it.

I think we have means of marking rejected promises as handled so they don't trigger the unhandled promise rejection callback. Arai-san will know.

(In reply to Brian Birtles (:birtles) from comment #4)

I think we have means of marking rejected promises as handled so they don't trigger the unhandled promise rejection callback. Arai-san will know.

SetAnyPromiseIsHandled used in the patch is it.

(In reply to Tooru Fujisawa [:arai] from comment #5)

SetAnyPromiseIsHandled used in the patch is it.

Oh, my bad. I didn't even look at the patch since I was on my phone. I guess I misunderstood the comment about WPT failures.

Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/c450e1515d0f
Don't throw unhandled promise rejection when screen.orientation.unlock() is called without fullscreen. r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/34104 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
Upstream PR merged by moz-wptsync-bot

Agi says this feature is not enabled by default. No need to uplift to Beta 101.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: