Closed bob2517 closed 2 years ago
fullscreen: [selector|document|window|body|close] [hide|show|auto];
fullscreen: [selector|body|close] [hide|show|auto];
Changing so that only body can be used to go page fullscreen. It's too confusing otherwise. The HTML node gets sent when entering fullscreen, and that's where it gets confusing in MDN with documentElement. It's like, wha? I'm just going to make any fullscreen pageness to be the body, as that's the part that gets displayed. The stuff above in the DOM is implied, as it is when an element goes fullscreen. There's no need to get weird about it, so it is now, with corresponding events (for page fullscreen. It's the same events, etc. for element fullscreen):
fullscreen: body;
body:fullscreenEnter {}
fullscreen: close;
body:fullscreenExit {}
This is all now working offline. You lose preventDefault, etc. on the event, but there's not much you can do when the browser fullscreenchange event is fired anyway. Will commit in a sec.
The existing commands aren't complete enough and don't work in all scenarios, so I've written a new action command which will be on the branch shortly to replace the existing two action commands. I'll leave the other one for the moment and mark it as deprecated.
Syntax will be:
The syntax covers setting and exiting fullscreen for both the document and elements, and includes the navigationUI option where applicable. It covers setting fullscreen on a target selector other than self, so it's the most flexible.