DOM methods are not defined on the correct object

RESOLVED DUPLICATE of bug 390411

Status

()

Core
DOM
RESOLVED DUPLICATE of bug 390411
6 years ago
6 years ago

People

(Reporter: Erik Arvidsson, Unassigned)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
The spec defines appendChild (and others) on Node.

assert(Node.prototype.appendChild)

In Firefox different "subclasses" of Node implement these. For example

Object.getOwnPropertyDescriptor(Text.prototype, 'appendChild');
Object.getOwnPropertyDescriptor(Element.prototype, 'appendChild');

what is worse is that every single DOM interface that implements Node redefines these.

Object.getOwnPropertyDescriptor(Element.prototype, 'appendChild');
Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'appendChild');
Object.getOwnPropertyDescriptor(HTMLBodyElement.prototype, 'appendChild');

and these are not reflected as the same function object

assert(Element.prototype.appendChild === HTMLElement.prototype.appendChild)

This can be manually fixed by doing something like:

Node.prototype.appendChild = Element.prototype.appendChild;
delete Element.prototype.appendChild;
delete HTMLElement.prototype.appendChild;
delete HTMLBodyElement.prototype.appendChild;
...
Yep, known and is fixed for the new bindings.
Depends on: 580070
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 390411
You need to log in before you can comment on or make changes to this bug.