blob: 3e7f0a62b20c065a08c3b9cca0ba788d37c87fb7 [file] [log] [blame]
Testing document.registerElement() type extension behaviours through createElement().
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS document.registerElement("x-foo", { prototype: Object.create(HTMLDivElement.prototype) }) threw exception NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-foo'. A type with that name is already registered..
PASS fooNewed.outerHTML is "<x-foo></x-foo>"
PASS fooNewed instanceof fooConstructor && fooNewed instanceof HTMLElement is true
PASS fooNewed instanceof HTMLUnknownElement is false
PASS barNewed.outerHTML is "<input is=\"x-bar\">"
PASS barNewed instanceof barConstructor && barNewed instanceof HTMLInputElement is true
PASS isFormControl(barNewed) is true
PASS bazNewed.outerHTML is "<x-baz></x-baz>"
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 "<input is=\"x-qux\">"
PASS isFormControl(quxNewed) is true
PASS fooCreated.outerHTML is "<x-foo></x-foo>"
PASS fooCreated instanceof fooConstructor is true
PASS barCreated.outerHTML is "<x-bar></x-bar>"
PASS barCreated instanceof barConstructor is false
PASS barCreated instanceof HTMLUnknownElement is false
PASS barCreated instanceof HTMLElement is true
PASS bazCreated.outerHTML is "<x-baz></x-baz>"
PASS bazCreated instanceof bazConstructor is true
PASS bazCreated instanceof HTMLUnknownElement is false
PASS quxCreated.outerHTML is "<x-qux></x-qux>"
PASS quxCreated instanceof quxConstructor is false
PASS quxCreated instanceof HTMLUnknownElement is false
PASS quxCreated instanceof HTMLElement is true
PASS divFooCreated.outerHTML is "<div is=\"x-foo\"></div>"
PASS divFooCreated instanceof fooConstructor is false
PASS divFooCreated instanceof HTMLDivElement is true
PASS inputBarCreated.outerHTML is "<input is=\"x-bar\">"
PASS inputBarCreated instanceof barConstructor is true
PASS inputBarCreated instanceof HTMLUnknownElement is false
PASS isFormControl(inputBarCreated) is true
PASS divBarCreated.outerHTML is "<div is=\"x-bar\"></div>"
PASS divBarCreated instanceof barConstructor is false
PASS divBarCreated instanceof HTMLDivElement is true
PASS fooBarCreated.outerHTML is "<x-foo is=\"x-bar\"></x-foo>"
PASS fooBarCreated instanceof fooConstructor is true
PASS barFooCreated.outerHTML is "<x-bar is=\"x-foo\"></x-bar>"
PASS barFooCreated instanceof HTMLUnknownElement is false
PASS barFooCreated instanceof HTMLElement is true
PASS fooCreatedNull.outerHTML is "<x-foo></x-foo>"
PASS fooCreatedNull instanceof fooConstructor is true
PASS fooCreatedEmpty.outerHTML is "<x-foo></x-foo>"
PASS fooCreatedEmpty instanceof fooConstructor is true
PASS document.createElement("@invalid", "x-bar") threw exception InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('@invalid') is not a valid name..
PASS fooCreatedNS.outerHTML is "<x-foo></x-foo>"
PASS fooCreatedNS instanceof fooConstructor is true
PASS barCreatedNS.outerHTML is "<input is=\"x-bar\">"
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 NamespaceError: Failed to execute 'createElementNS' on 'Document': The namespace URI provided ('http://example.com/2013/no-such-namespace') is not valid for the qualified name provided ('xml:lang')..
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 false
PASS namedBarParsed instanceof HTMLElement is true
PASS divBarParsed instanceof barConstructor is false
PASS divBarParsed instanceof HTMLDivElement is true
PASS successfullyParsed is true
TEST COMPLETE