Closed Bug 855844 Opened 12 years ago Closed 12 years ago

XPConnect bindings get prototype chain wrong.

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: erik, Unassigned)

Details

The following is really broken. window.HTMLElement = function () {}; console.log(HTMLCanvasElement.prototype instanceof HTMLElement); it prints true. HTMLCanvasElement.prototype should not change when I change the global HTMLElement. However, if I first HTMLCanvasElement things work. HTMLCanvasElement window.HTMLElement = function () {}; console.log(HTMLCanvasElement.prototype instanceof HTMLElement); As far as I can tell this only happens with the non Paris bindings.
What version is this? I don't see this behavior on trunk.
XPConnect prototypes are lazily created and look up their prototype at creation time. Which is why order matters for them. As you noted, this does not happen with WebIDL bindings. And for the XPConnect ones, it's not going to change. Note that HTMLCanvasElement should be on WebIDL bindings fairly soon.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
Summary: DOM bindings get prototype chain wrong. → XPConnect bindings get prototype chain wrong.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.