Bug 816647 - mozFullScreen meets inline activity #6798

merged 1 commit into from Dec 6, 2012


None yet

4 participants

Mozilla-B2G member

No description provided.

Mozilla-B2G member

ping @ian-liu


The pr also works for Bug 817501 - [Bluetooth] Device list got blocked when you share image

@davidflanagan davidflanagan commented on the diff Dec 4, 2012
@@ -55,7 +55,7 @@ var StatusBar = {
/* For other modules to acquire */
get height() {
if (this.screen.classList.contains('fullscreen-app') ||
- document.querySelector('#screen:-moz-full-screen-ancestor')) {
+ document.mozFullScreen) {
davidflanagan Dec 4, 2012

I don't know anything about the status line, or how fullscreen is implemented, so I don't know how to review this line.

Is the query selector an old way of doing it? Does it not work anymore?

I'm actually sort of surprised that the system app can use document.mozFullScreen to detech whether a child app is in fullscreen mode...

timdream Dec 5, 2012 Mozilla-B2G member

This is a valid clean up :)

Yes, system app, as the embedder of the app iframe, can do this.

alivedise Dec 5, 2012 Mozilla-B2G member

the querySelector surely works but this is a cleanup to match the implementation already existed in window manager.

@davidflanagan davidflanagan commented on the diff Dec 4, 2012
@@ -230,8 +230,14 @@ var WindowManager = (function() {
var frame = inlineActivityFrame;
frame.style.width = appFrame.style.width;
- frame.style.height = appFrame.style.height;
- frame.style.top = appFrame.offsetTop + 'px';
+ if (document.mozFullScreen) {
+ frame.style.height = window.innerHeight + 'px';
+ frame.style.top = '0px';
+ } else {
+ frame.style.height = appFrame.style.height;
+ frame.style.top = appFrame.offsetTop + 'px';
+ }
davidflanagan Dec 4, 2012

I don't understand why the existing code didn't work. If the app is fullscreen, won't its heght be the window height and its top offset be zero?

Does this fix the bug where the activity frame isn't quite the right size? I've seen that happen, but don't know how to reproduce it now.

alivedise Dec 5, 2012 Mozilla-B2G member

We have two kinds of way to achieve fullscreen in an app:

  • Specify fullscreen: true in manifest.
  • use mozRequestFullScreen() in your app.

The first one is done by window manager hook:
1. Resize the app by using window.innerWidth and window.innerHeight
2. Set the top to 0 by css.
We do this because this way resolves many z-index problems about app transitioning, instead of only using mozRequestFullScreen in system app for the app. They have the same effect.

The second one is done by gecko surely.
The case here is:

  • Open gallery app, click an image. Click share and choose the wallpaper, which is designed to be an inline activity. Once the line in z-index.css applies, you will see the activity frame is cutten :) Because we forgot the second usage of fullscreen. So copy the height form activity caller doesn't work for this case. That's why I do these.
@davidflanagan davidflanagan commented on the diff Dec 4, 2012
@@ -182,6 +182,7 @@
/* We promotes the following overlays on top of the fullscreen web content. */
+#screen:-moz-full-screen-ancestor > [data-z-index-level="app"] > iframe.appWindow.inlineActivity,
davidflanagan Dec 4, 2012

I think this is the only line of the pull request that I understand :-)

If I understand correctly, this is what makes the activity visible, right?

alivedise Dec 5, 2012 Mozilla-B2G member

You got it ;)

Mozilla-B2G member

I'll do some more solid test about keypad case tomorrow before I land this. Thanks @timdream and @davidflanagan

@alivedise alivedise merged commit c458b50 into mozilla-b2g:master Dec 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment