Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme background image disappears on fullscreen in firefox #1621

Closed
wanderview opened this issue Jun 16, 2016 · 5 comments
Closed

theme background image disappears on fullscreen in firefox #1621

wanderview opened this issue Jun 16, 2016 · 5 comments

Comments

@wanderview
Copy link

I'm working on some slides and made my own theme to display a consistent background for the deck. I noticed, however, that the image disappears when I enter fullscreen.

I investigated this a bit with this layout guys and it seems that reveal.js can work around the issue by simply requesting fullscreen on documentElement instead of body.

So something like:

        function enterFullscreen() {
                // Use documentElement instead of body to avoid layering issues in some browsers.
                var element = document.documentElement;

                // Check which implementation is available
                var requestMethod = element.requestFullscreen ||
                                                        element.webkitRequestFullscreen ||
                                                        element.webkitRequestFullScreen ||
                                                        element.mozRequestFullScreen ||
                                                        element.msRequestFullscreen;

                if( requestMethod ) {
                        requestMethod.apply( element );
                }
        }

Also note the standard fullscreen method is requestFullscreen() with a lower-case "s". The current code has an upper case "s" in its compat check here.

@wanderview
Copy link
Author

Oh, my reduced test case is here:

https://github.com/wanderview/bg-image-bug

And the firefox bug is here:

https://bugzilla.mozilla.org/show_bug.cgi?id=714809

And @annevk thinks there might be a spec issue related to this:

whatwg/fullscreen#40

@upsuper
Copy link

upsuper commented Jun 17, 2016

I believe all browsers agree with the same behavior that a fullscreen body whose background has been propagated has a black background. This isn't a Firefox-specific thing.

@wanderview
Copy link
Author

I believe all browsers agree with the same behavior that a fullscreen body whose background has been propagated has a black background. This isn't a Firefox-specific thing.

I did not get this behavior in chrome. It was unclear to me which of firefox/chrome/spec is wrong. In this case I think it would just be easier for reveal.js to fullscreen the documentElement instead of the body.

@upsuper
Copy link

upsuper commented Jun 17, 2016

At least in your reduced test case, if you make it webkit-prefixed, you should see the same behavior in Chrome.

@hakimel
Copy link
Owner

hakimel commented Jun 21, 2016

Requesting fullscreen on the documentElement looks like a solid fix. Thanks @wanderview!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants