/** Test for Bug 817420 **/
is(Object.getPrototypeOf(HTMLElement.prototype), Element.prototype, "Must have correct proto chain for HTMLElement.prototype");
is(Object.getPrototypeOf(document.createElementNS(null, "x")),
Element.prototype, "Must have correct proto chain for random element");
is(Object.getPrototypeOf(document.createElement("noSuchElementName")),
HTMLUnknownElement.prototype, "Must have correct proto chain for random HTML element");
// And check that it's really working as it should
function checkPropPresent(propName, objList, expected)
{
for (obj of objList) {
is(propName in obj,
expected,
obj + " should " + (expected ? "" : "not ") + "have the property");
}
} var objList = [ Element.prototype,
HTMLElement.prototype,
document.createElementNS(null, "x"),
document.createElement("noSuchElementName"),
document.body ]
checkPropPresent("somePropertyThatBetterNeverExist", objList, false);
Element.prototype.somePropertyThatBetterNeverExist = 1;
checkPropPresent("somePropertyThatBetterNeverExist", objList, true);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.