Closed Bug 1135801 Opened 9 years ago Closed 6 years ago

[[Prototype]] of self.NodeFilter should be Object.prototype, not Function.prototype

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: Ms2ger, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Per <https://heycam.github.io/webidl/#interface-object>, after the first Note. Tested by dom/interfaces.html ("NodeFilter interface: existence and properties of interface object").
Um... this test doesn't test anything other than the value NodeFilter.__proto__?

In particular, it seems to not test that typeof should be "object", that Object.prototype.toString.call(NodeFilter) should be "[object Object]", that NodeFilter.toString() should be "[object Object]", that NodeFilter should have no "length" property, etc.

That said, what do browsers actually do here?  Because it's not clear to me why this shouldn't just be a Function object, really...
Flags: needinfo?(cam)
Inheriting from Function.prototype for consistency with non-callback interface objects may make sense, but is NodeFilter as ES6-class-y as other interface objects?  It's more just a storage place for some named constants.

In terms of what browsers do currently:

http://people.mozilla.org/~cmccormack/tests/callback-interface-proto.html

Gecko: Function.prototype
Blink: Function.prototype
WebKit: Object.prototype
IE11: Object.prototype
Flags: needinfo?(cam)
Note that in WebKit all DOM interface objects have Object.prototypw as their prototype....
The spec was changed in https://github.com/heycam/webidl/issues/96.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: