Browse Source

[js] html externs: enable requestFullscreen() flag (#7785)

George Corney 6 years ago
parent
commit
89e95f8af2
2 changed files with 23 additions and 0 deletions
  1. 6 0
      std/js/html/DOMElement.hx
  2. 17 0
      std/js/html/Document.hx

+ 6 - 0
std/js/html/DOMElement.hx

@@ -500,6 +500,12 @@ extern class DOMElement extends Node
 	**/
 	**/
 	function attachShadow( shadowRootInitDict : ShadowRootInit ) : ShadowRoot;
 	function attachShadow( shadowRootInitDict : ShadowRootInit ) : ShadowRoot;
 	
 	
+	/**
+		Asynchronously asks the browser to make the element full-screen.
+		@throws DOMError
+	**/
+	function requestFullscreen() : Void;
+	
 	/**
 	/**
 		Allows to asynchronously ask for the pointer to be locked on the given element.
 		Allows to asynchronously ask for the pointer to be locked on the given element.
 	**/
 	**/

+ 17 - 0
std/js/html/Document.hx

@@ -186,6 +186,22 @@ extern class Document extends Node
 	**/
 	**/
 	var applets(default,null) : HTMLCollection;
 	var applets(default,null) : HTMLCollection;
 	
 	
+	/**
+		`true` when the document is in `Using_full-screen_mode`.
+	**/
+	var fullscreen(default,null) : Bool;
+	var fullscreenEnabled(default,null) : Bool;
+	
+	/**
+		Is an `EventHandler` representing the code to be called when the `fullscreenchange` event is raised.
+	**/
+	var onfullscreenchange : haxe.Constraints.Function;
+	
+	/**
+		Is an `EventHandler` representing the code to be called when the `fullscreenerror` event is raised.
+	**/
+	var onfullscreenerror : haxe.Constraints.Function;
+	
 	/**
 	/**
 		Represents the event handling code for the `pointerlockchange` event.
 		Represents the event handling code for the `pointerlockchange` event.
 	**/
 	**/
@@ -484,6 +500,7 @@ extern class Document extends Node
 		Releases the current mouse capture if it's on an element in this document.
 		Releases the current mouse capture if it's on an element in this document.
 	**/
 	**/
 	function releaseCapture() : Void;
 	function releaseCapture() : Void;
+	function exitFullscreen() : Void;
 	
 	
 	/**
 	/**
 		Release the pointer lock.
 		Release the pointer lock.