fullscreen icon indicating copy to clipboard operation
fullscreen copied to clipboard

Fullscreen position adjustment algorithm for documentElement

Open dtapuska opened this issue 7 years ago • 2 comments
trafficstars

If the documentElement is fullscreened Chrome places the document element in the topLayer. However FireFox does not.

When the style adjustment for fullscreened top layer elements runs this causes the documentElement (which is statically positioned because it isn't forced to be fixed due to avoiding the !:root(..) selector for fullscreen elements). The documentElement gets the position set to be absolute.

However since the documentElement doesn't have any sizing the calculation of the width for the element ends up being 0.

Chrome avoided applying the aboslute poisiton to the document element in: https://chromium-review.googlesource.com/c/chromium/src/+/1186961

dtapuska avatar Aug 27 '18 14:08 dtapuska

@upsuper can you describe the Gecko model here?

foolip avatar Aug 29 '18 13:08 foolip

Oh... I indeed didn't pay much attention on this side.

What Gecko currently does is that, we have an internal (non-web-exposed) CSS property -moz-top-layer, which we apply value top for :fullscreen:not(:root). And when the property is set to top, we apply the styling magic (specifically set position to absolute when it's not fixed), and we only render such elements in the top layer.

So the observation is correct that Gecko doesn't put the document element in the top layer for rendering purpose, but Gecko does indeed put that element into the top layer stack for other purpose (and the stack is still called "fullscreen stack" in Gecko currently since that's still the only thing it's serving).

It's not clear what's the best way to spec this. Maybe change

Each element and ::backdrop pseudo-element in a top layer has the following characteristics:

to something like

Each element excluding the document element, and ::backdrop pseudo-element in a top layer has the following characteristics:

upsuper avatar Aug 30 '18 04:08 upsuper