I was surprised to find that in the Firefox console:
> document.mozPointerLockElement
> null
> 'mozPointerLockElement' in document
> true
> document.hasOwnProperty('mozPointerLockElement')
> false
While in the test equivalent of the console, Chrome hasOwnProperty()returns true:
> document.webkitPointerLockElement
> null
> 'webkitPointerLockElement' in document
> true
> document.hasOwnProperty('webkitPointerLockElement')
> true
Does the HTML standard indicate which document properties should be straightforward and can be reliably checked with hasOwnProperty(), or are all such tests implementation-specific and not portable?
source
share