[fullscreen] Make fullscreenElement and fullscreenEnabled [Replaceable]? (#2)

https://fullscreen.spec.whatwg.org/#api

There are sites that do funny things that write to `Document.fullscreenEnabled`.

>From lego.com (http://cache.lego.com/r/www/r/mediaplayer/ko-KR/services/mediaplayerapi.ashx?t=635642663650000000)

```
t.fullscreenElement = t.fullscreenElement || []
```

where `t` is `document`.

>From http://justdancenow.com/ (http://jdnowweb-s.cdn.ubi.com/prod/20150505_1450/web/js/application.min.js)

```
document.fullscreenEnabled = !!(document.fullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled || document.documentElement.webkitRequestFullScreen);
```

This throws in strict mode.

It's not clear how widespread such usage is. There is a risk to making `fullscreenElement` `[Replaceable]`, namely that in a browser that only has the unprefixed API, it would be impossible to observe later changes to `fullscreenElement`. Making the setter do nothing would be a more conservative fix here.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fullscreen/issues/2

Received on Thursday, 7 May 2015 07:16:02 UTC