Bug 135008 - document.body.hasOwnProperty('childNodes') returns false
Summary: document.body.hasOwnProperty('childNodes') returns false
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-16 22:45 PDT by ShihChi Huang
Modified: 2023-12-29 03:12 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ShihChi Huang 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')
```
Comment 1 Sam Weinig 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?
Comment 2 ShihChi Huang 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')
Comment 3 Junwei Liang 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
````
Comment 4 Anne van Kesteren 2023-12-29 03:12:53 PST
This is the expected behavior as per comment 1 and all browsers these days agree.