Add Fullscreen API compatibility for Safari (#2948)

This commit is contained in:
daxpedda 2023-07-11 00:34:02 +02:00 committed by GitHub
parent af26f01b95
commit 50b17a3907
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 110 additions and 19 deletions

View file

@ -1,6 +1,7 @@
mod canvas;
pub mod event;
mod event_handle;
mod fullscreen;
mod intersection_handle;
mod media_query_handle;
mod pointer;
@ -26,7 +27,7 @@ pub fn throw(msg: &str) {
}
pub fn exit_fullscreen(document: &Document) {
document.exit_fullscreen();
fullscreen::exit_fullscreen(document);
}
pub struct PageTransitionEventHandle {
@ -115,7 +116,7 @@ pub fn set_canvas_style_property(raw: &HtmlCanvasElement, property: &str, value:
}
pub fn is_fullscreen(document: &Document, canvas: &HtmlCanvasElement) -> bool {
match document.fullscreen_element() {
match fullscreen::fullscreen_element(document) {
Some(elem) => {
let canvas: &Element = canvas;
canvas == &elem