Testing document.register() type extension behaviours through createElement(). On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS document.register('x-foo', { prototype: Object.create(HTMLDivElement.prototype) }) threw exception Error: InvalidStateError: DOM Exception 11. PASS fooNewed.outerHTML is '' PASS fooNewed instanceof fooConstructor && fooNewed instanceof HTMLElement is true PASS fooNewed instanceof HTMLUnknownElement is false PASS barNewed.outerHTML is '' PASS barNewed instanceof barConstructor && barNewed instanceof HTMLInputElement is true PASS isFormControl(barNewed) is true PASS bazNewed.outerHTML is '' PASS bazNewed instanceof bazConstructor && bazNewed instanceof HTMLElement is true PASS bazNewed instanceof HTMLUnknownElement is false PASS quxNewed instanceof quxConstructor && quxNewed instanceof barConstructor && quxNewed instanceof HTMLInputElement is true PASS quxNewed.outerHTML is '' PASS isFormControl(quxNewed) is true PASS fooCreated.outerHTML is '' PASS fooCreated instanceof fooConstructor is true PASS barCreated.outerHTML is '' PASS barCreated instanceof barConstructor is false PASS barCreated instanceof HTMLUnknownElement is true PASS bazCreated.outerHTML is '' PASS bazCreated instanceof bazConstructor is true PASS bazCreated instanceof HTMLUnknownElement is false PASS quxCreated.outerHTML is '' PASS quxCreated instanceof quxConstructor is false PASS quxCreated instanceof HTMLUnknownElement is true PASS divFooCreated.outerHTML is '
' PASS divFooCreated instanceof fooConstructor is false PASS divFooCreated instanceof HTMLDivElement is true PASS inputBarCreated.outerHTML is '' PASS inputBarCreated instanceof barConstructor is true PASS inputBarCreated instanceof HTMLUnknownElement is false PASS isFormControl(inputBarCreated) is true PASS divBarCreated.outerHTML is '
' PASS divBarCreated instanceof barConstructor is false PASS divBarCreated instanceof HTMLDivElement is true PASS fooBarCreated.outerHTML is '' PASS fooBarCreated instanceof fooConstructor is true PASS barFooCreated.outerHTML is '' PASS barFooCreated instanceof HTMLUnknownElement is true PASS fooCreatedNull.outerHTML is '' PASS fooCreatedNull instanceof fooConstructor is true PASS fooCreatedEmpty.outerHTML is '' PASS fooCreatedEmpty instanceof fooConstructor is true PASS document.createElement('@invalid', 'x-bar') threw exception Error: InvalidCharacterError: DOM Exception 5. PASS fooCreatedNS.outerHTML is '' PASS fooCreatedNS instanceof fooConstructor is true PASS barCreatedNS.outerHTML is '' PASS barCreatedNS instanceof barConstructor is true PASS isFormControl(barCreatedNS) is true PASS document.createElementNS('http://example.com/2013/no-such-namespace', 'xml:lang', 'x-bar') threw exception Error: NamespaceError: DOM Exception 14. PASS fooParsed instanceof fooConstructor is true PASS barParsed instanceof barConstructor is true PASS isFormControl(barParsed) is true PASS divFooParsed instanceof fooConstructor is false PASS divFooParsed instanceof HTMLDivElement is true PASS namedBarParsed instanceof barConstructor is false PASS namedBarParsed instanceof HTMLUnknownElement is true PASS divBarParsed instanceof barConstructor is false PASS divBarParsed instanceof HTMLDivElement is true PASS successfullyParsed is true TEST COMPLETE