Support ScreenOrientation.lock
Categories
(GeckoView :: General, enhancement, P1)
Tracking
(firefox97 fixed)
Tracking | Status | |
---|---|---|
firefox97 | --- | fixed |
People
(Reporter: agi, Assigned: calu)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-complete, Whiteboard: [geckoview:m97])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
While working on Bug 1694481, I noticed that we don't support ScreenOrientation.lock
, while Fennec did. https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/lock
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Backed out for causing mozlint failures. CLOSED TREE
Backout link: https://hg.mozilla.org/integration/autoland/rev/edb720848dda959588345d7f5a9496518ee20006
Link to failure log: https://treeherder.mozilla.org/logviewer?job_id=360129086&repo=autoland&lineNumber=1522
Assignee | ||
Comment 6•3 years ago
|
||
I updated the changelog which was causing the mozlint failure, and will try to land again.
Comment 8•3 years ago
|
||
Backed out for causing failures at lock-sandboxed-iframe.html.
Backout link: https://hg.mozilla.org/integration/autoland/rev/2c7761571266820af22be7a87f7def1f7d5a0414
Failure log: https://treeherder.mozilla.org/logviewer?job_id=360147885&repo=autoland&lineNumber=4584
Assignee | ||
Comment 9•3 years ago
|
||
I updated the web tests to add set a preference dom.screenorientation.allow-lock
to true to keep previous behavior. I will try to land again.
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
bugherder |
Comment 12•3 years ago
|
||
This change is in Gecko 97, but CHANGELOG.md change says in 96. :calu, could you move this entry to v97 section?
Assignee | ||
Comment 13•3 years ago
|
||
(In reply to Makoto Kato [:m_kato] from comment #12)
This change is in Gecko 97, but CHANGELOG.md change says in 96. :calu, could you move this entry to v97 section?
Thanks for pointing this out. I opened a bug and a patch to move it to v97: https://phabricator.services.mozilla.com/D133912
Comment 14•3 years ago
|
||
Docs work for this can be tracked in https://github.com/mdn/content/issues/11594
My understanding is that support for ScreenOrientation.lock() disappeared at some point and has now been restored behind a preference. Note that by "supported" I mean "the API exists, even if it can't be used on a particular device".
However if you look at the browser compatibility table on the API there is no indication that it hasn't worked "forever" on all platforms. Can you tell me/give me some indication what version it stopped working on?
Assignee | ||
Comment 15•3 years ago
|
||
(In reply to Hamish Willee from comment #14)
Docs work for this can be tracked in https://github.com/mdn/content/issues/11594
My understanding is that support for ScreenOrientation.lock() disappeared at some point and has now been restored behind a preference. Note that by "supported" I mean "the API exists, even if it can't be used on a particular device".
However if you look at the browser compatibility table on the API there is no indication that it hasn't worked "forever" on all platforms. Can you tell me/give me some indication what version it stopped working on?
From the bugs on bugzilla (https://bugzilla.mozilla.org/show_bug.cgi?id=1681572), looks like it stopped working as early as Dec 9, 2020, version 85.
Comment 16•3 years ago
|
||
I would not assume that 85 was the first version to break this. I suspect it was broken on Firefox 69 or so as part of the Fenix rewrite or as part of the Fennec code removal project (bug 1582218). If someone wants to manually bisect there are builds on https://github.com/mozilla-mobile/fenix/releases/
Mozregression is unlikely to work in this case because full Fenix builds are not supported, just the lightweight Geckoview Example browser.
Comment 17•3 years ago
|
||
This doesn't work for me on FF97.0a1 Nightly on Google Pixel 3XL, using the test attachment (and after enabling the preference): https://bugzilla.mozilla.org/attachment.cgi?id=9192275
Specifically, I am told that the lock was called, but the promise never resolves.
It does work on Chrome browser.
The basic test here crashed nightly: https://w3c-test.org/screen-orientation/lock-basic.html
Assignee | ||
Comment 18•3 years ago
|
||
(In reply to Hamish Willee from comment #17)
This doesn't work for me on FF97.0a1 Nightly on Google Pixel 3XL, using the test attachment (and after enabling the preference): https://bugzilla.mozilla.org/attachment.cgi?id=9192275
Specifically, I am told that the lock was called, but the promise never resolves.
It does work on Chrome browser.The basic test here crashed nightly: https://w3c-test.org/screen-orientation/lock-basic.html
Hm, I’m not able to reproduce the message that the lock was called, but promise was not resolved with the additional test demo. The behavior for me is when Lock is clicked, it produces a “SecurityError: The operation is insecure.”. Once fullscreen, the promise is resolved.
If that’s the behavior you’re seeing, this may be resolved by the current patch: https://phabricator.services.mozilla.com/D134872. Otherwise, could you clarify?
Meanwhile, I’ll look into the w3c test, thanks for bringing it up.
Comment 19•3 years ago
|
||
@calu
So when I run https://bugzilla.mozilla.org/attachment.cgi?id=9192275 in Chrome and it is in portrait mode, and then put in fullscreen, and then press lock, after a few seconds the screen rotates and locks in the landscape position.
However if I do the same thing in firefox nightly (after enabling the pref) it just sits in portrait forever. The promise DOES resolve if I turn the phone on its side. In other words, it will resolve the promise BUT, it isn't locked - if I turn the phone back to portrait it moves back to portrait.
I have no idea how to build a patch and test it. If you can point to an APK I can try that?
Assignee | ||
Comment 20•3 years ago
|
||
(In reply to Hamish Willee from comment #19)
@calu
So when I run https://bugzilla.mozilla.org/attachment.cgi?id=9192275 in Chrome and it is in portrait mode, and then put in fullscreen, and then press lock, after a few seconds the screen rotates and locks in the landscape position.
However if I do the same thing in firefox nightly (after enabling the pref) it just sits in portrait forever. The promise DOES resolve if I turn the phone on its side. In other words, it will resolve the promise BUT, it isn't locked - if I turn the phone back to portrait it moves back to portrait.
I have no idea how to build a patch and test it. If you can point to an APK I can try that?
Regardless of the patch, I am not seeing that behavior you're mentioning, when I try to reproduce in central/default
. Are you able to build firefox mobile on the branch and reproduce the problem?
I can also try to build FF97.0a1 Nightly, but I'm not sure how to do that. If you could point me to instructions or something, I can try to reproduce the problem you're seeing on nightly.
Comment 21•3 years ago
|
||
Thanks @calu
I can't build Firefox - I don't know how and I'm not set up for it.
I can also try to build FF97.0a1 Nightly, but I'm not sure how to do that. If you could point me to instructions or something, I can try to reproduce the problem you're seeing on nightly.
I get this from Google Play Store - just enter Firefox Nightly in search and it comes up. The current version obviously changes, but I can still reproduce this error on todays update.
Note, also docs for this have been completed (changes can be tracked fromhttps://github.com/mdn/content/issues/11594)
Comment 22•3 years ago
|
||
Hello @calu,
I'm looking to integrate this in Fenix and I want to double check that the fullscreen precondition is checked before OrientationDelegate.onOrientationLock so that we as integrators would get called only when all preconditions are met to just lock the screen orientation and return GeckoResult.allow()
everytime.
Assignee | ||
Comment 23•3 years ago
|
||
Yes, it will check for fullscreen preconditions in ScreenOrientation::GetLockOrientationPermission
(https://searchfox.org/mozilla-central/source/dom/base/ScreenOrientation.cpp#473).
Description
•