/// <summary>Exits a fullscreen viewing.</summary> public void exitFullscreen() { if (fullscreenElement == null) { return; } // Trigger fullscreen event: Dom.Event e = new Dom.Event("fullscreenchange"); e.SetTrusted(); if (!dispatchEvent(e)) { // Something killed the request. return; } // Restore style: fullscreenElement.style.cssText = HtmlElement.CachedFullscreenStyle; // Restore original parent: if (HtmlElement.CachedFullscreenParent != null) { fullscreenElement.parentNode.removeChild(fullscreenElement); HtmlElement.CachedFullscreenParent.appendChild(fullscreenElement); // Clear: HtmlElement.CachedFullscreenParent = null; } // Clear it: HtmlElement.CachedFullscreenStyle = null; // Clear attrib: fullscreenElement.removeAttribute("fullscreen"); // Update local style: fullscreenElement.style.Computed.RefreshLocal(); // Clear fullscreen ele: fullscreenElement = null; }