RESOLVED INVALID135008
document.body.hasOwnProperty('childNodes') returns false
https://bugs.webkit.org/show_bug.cgi?id=135008
Summary document.body.hasOwnProperty('childNodes') returns false
ShihChi Huang
Reported 2014-07-16 22:45:23 PDT
I cannot use webkit nightly in Yosemite so not sure if it's still a problem in latest build. However, both Safari 8.0 and iOS Safari 8.0 returns false while executing below expression ```js document.body.hasOwnProperty('childNodes') ```
Attachments
Sam Weinig
Comment 1 2014-07-17 15:42:26 PDT
This is expected, since the childNodes property is now on the prototype. Is this breaking something for you?
ShihChi Huang
Comment 2 2014-07-17 17:54:06 PDT
May I know what's the expected behavior? in safari prior to ios8 / yosemite and latest stable chrome browser it still returns true while executing document.body.hasOwnProperty('childNodes')
Junwei Liang
Comment 3 2014-10-27 23:37:42 PDT
Any update on this? We have exactly the same problem when call 'hasOwnProperty' on DOM elements. In safari prior to ios8/yosemite, it always returns true! ````js var el = document.getElementById('dummy-div-id'); console.log(el.hasOwnProperty('className')); // false ````
Anne van Kesteren
Comment 4 2023-12-29 03:12:53 PST
This is the expected behavior as per comment 1 and all browsers these days agree.
Note You need to log in before you can comment on or make changes to this bug.