Last Comment Bug 747442 - Only unlock orientation if the received mozfullscreenchange is for fullscreen being disabled
: Only unlock orientation if the received mozfullscreenchange is for fullscreen...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla14
Assigned To: Mounir Lamouri (:mounir)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: 740188
  Show dependency treegraph
 
Reported: 2012-04-20 09:58 PDT by Mounir Lamouri (:mounir)
Modified: 2012-04-30 16:19 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-
fixed


Attachments
Patch v1 (1.34 KB, patch)
2012-04-20 09:58 PDT, Mounir Lamouri (:mounir)
bugs: review+
mark.finkle: approval‑mozilla‑central+
Details | Diff | Splinter Review

Description Mounir Lamouri (:mounir) 2012-04-20 09:58:09 PDT
Created attachment 617024 [details] [diff] [review]
Patch v1

It happens that if you do something like:
addEventListener("mozfullscreenchange", function() {
  screen.mozLockOrientation("landscape");
});

The orientation will be changed to "landscape-foo" then back to the previous orientation is that when lock() is called, we add an event listener listening to the 'mozfullscreenchange' event which - and I had no idea that was the case before - is called immediately. The handler of that event is unlocking the screen so basically the lock() becomes some kind of a no-op.
Comment 1 Mounir Lamouri (:mounir) 2012-04-20 09:59:12 PDT
We should fix that for Gecko 14 because it could be quite an annoying bug for that new experimental feature (which comes with Gecko 14).
Comment 2 Olli Pettay [:smaug] 2012-04-20 10:56:52 PDT
Comment on attachment 617024 [details] [diff] [review]
Patch v1

Can we get a a testcase for this?
Comment 3 Mounir Lamouri (:mounir) 2012-04-20 11:05:31 PDT
(In reply to Olli Pettay [:smaug] from comment #2)
> Comment on attachment 617024 [details] [diff] [review]
> Patch v1
> 
> Can we get a a testcase for this?

We actually don't have tests for that. That would require writing Android tests (this is no fun) and screen orientation is using hardware sensors so even if we could test a few things it might limit us and generate random oranges. I was planning to dig into this later actually.
Comment 4 Mounir Lamouri (:mounir) 2012-04-23 01:48:44 PDT
https://hg.mozilla.org/mozilla-central/rev/6b26bdffa1bc

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