Closed Bug 1757431 Opened 2 years ago Closed 2 years ago

ScreenOrientation requests lock after coming back to the tab

Categories

(GeckoView :: General, defect, P3)

All
Android
defect

Tracking

(firefox-esr91 disabled, firefox99 disabled, firefox100 disabled, firefox101 fixed)

RESOLVED FIXED
101 Branch
Tracking Status
firefox-esr91 --- disabled
firefox99 --- disabled
firefox100 --- disabled
firefox101 --- fixed

People

(Reporter: petru, Assigned: m_kato)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached video RelockAfterUnlock.mp4

Saw while adding support for the https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/lock api on Fenix
by implementing the https://bugzilla.mozilla.org/show_bug.cgi?id=1697647 and https://bugzilla.mozilla.org/show_bug.cgi?id=1744101 GeckoView callbacks
in https://github.com/mozilla-mobile/fenix/pull/24027 and https://github.com/mozilla-mobile/android-components/pull/11789
that after we get the unlock callback from GeckoView, switch to another tab then return to that same tab which previously called onOrientationUnlock we immediately get an unexpected onOrientationLock call and as such the app will try to set an orientation lock.

This seems like a bug in GeckoView which doesn't update an internal state to know that orientation lock finished.

@calu, please advise.

Flags: needinfo?(calu)

Makoto, do you know if any of the currently filed bugs addresses this?

Flags: needinfo?(calu) → needinfo?(m_kato)

From https://w3c.github.io/screen-orientation/#interaction-with-fullscreen-api

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.

I think that we shouldn't lock orientation again when exiting full screen by switching other tab. It depends on full screen state.

Flags: needinfo?(m_kato)

Makoto, do you know if any of the currently filed bugs addresses this?

I guess no.

Makoto, is this bug related to your other full screen bugs? How soon should we fix this bug?

Severity: -- → S3
Flags: needinfo?(m_kato)
Priority: -- → P3

(In reply to Chris Peterson [:cpeterson] from comment #5)

Makoto, is this bug related to your other full screen bugs? How soon should we fix this bug?

No, this is screen orientation issue. Actually we don't enable lock orientation on all channels yet, so this isn't urgent.

Blocks: 1744125
Flags: needinfo?(m_kato)

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

No, this is screen orientation issue. Actually we don't enable lock orientation on all channels yet, so this isn't urgent.

Thanks. In that case, I'll leave this bug at P3.

Hardware: ARM64 → All

Orientation lock allows on full screen state only now. Then if exiting full
screen, orientation lock is unlocked without screen.orientation.unlock call.

Although we store orientation lock state in browsing context, we don't clear
when exiting full screen. So when current content is re-activated by switching
tab etc, we try to apply orientation lock state from browsing context
unfortunately.

So we should clear this state when exiting full screen even if unlock isn't
called.

Assignee: nobody → m_kato
Status: NEW → ASSIGNED
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/51f668ac4278
Update orientation lock information in browsing context when exiting full screen. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch

Setting status-firefox100=disabled because we don't need to uplift to Beta 100. The dom.screenorientation.allow-lock pref is false by default, so this bug doesn't affect regular users.

See Also: → 1786171
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: