Bug 242930 - Make webkit*Fullscreen properties as an alias of standard fullscreen ones
Summary: Make webkit*Fullscreen properties as an alias of standard fullscreen ones
Status: RESOLVED DUPLICATE of bug 158125
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-07-19 19:56 PDT by Karl Dubost
Modified: 2022-10-13 11:39 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Dubost 2022-07-19 19:56:20 PDT
Currently WebKit is the only rendering engine using the prefixed property for fullScreen: window.document.webkitFullscreenElement

the standard property is implemented on Gecko and Blink.
See https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenElement#browser_compatibility

It is probably time to add aliases 

* fullscreenElement <- webkitFullscreenElement.
* requestFullscreen <- webkitRequestFullscreen
* exitFullscreen    <- webkitExitFullscreen


it is common to see code such as 

```
{
  key: "isFullscreen",
  value: function() {
      return window.document.fullscreenElement || window.document.webkitFullscreenElement || window.document.mozFullScreenElement || window.document.msFullscreenElement
  }
}
```

This can't be fully removed because of probable webcompat breakage.

worse it encourages code like this. (if you read this, do not do that)

```
const isFullScreenCapable =
    document.fullscreenElement || document.webkitFullScreenElement;
  const isWebkit = document.webkitFullScreenElement;

  if (isFullScreenCapable) {
    if (isWebkit) {
      document.webkitExitFullscreen();
    } else {
      document.exitFullscreen();
    }
  }

  if (isWebkit) {
    canvas.webkitRequestFullscreen();
  } else {
    canvas.requestFullscreen();
  }
```

and allow for fingerprinting.
Comment 1 Radar WebKit Bug Importer 2022-07-19 19:57:23 PDT
<rdar://problem/97296290>
Comment 2 Sam Sneddon [:gsnedders] 2022-07-20 05:34:31 PDT

*** This bug has been marked as a duplicate of bug 158125 ***