Are hasOwnProperty () test results for DOM elements standardized?

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?

+4
source share
1 answer

The HTML standard indicates which document properties should be straightforward and can be reliably checked with hasOwnProperty ()

, WebIDL . getter ( pointerLockElement readonly) document.prototype ( [Unforgeable]).

?

, - , , . , ( moz webkit), , . , , .

, - in, , , . !== undefined, null undefined.

+3

All Articles