Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom-elements: createElement() should not throw for unknown "is" value. #9336

Merged
merged 1 commit into from Feb 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions custom-elements/Document-createElement.html
Expand Up @@ -342,6 +342,18 @@

}, 'document.createElement must report an exception thrown by a custom element constructor');

test(() => {
class MyElement extends HTMLDivElement {}

// createElement with unknown 'is' should not throw.
// https://github.com/w3c/webcomponents/issues/608
let div = document.createElement('div', { is: 'my-div' });
assert_false(div instanceof MyElement);

customElements.define('my-div', MyElement, { extends: 'div' });
document.body.appendChild(div);
assert_true(div instanceof MyElement, 'Undefined element is upgraded on connecting to a document');
}, 'document.createElement with unknown "is" value should create "undefined" state element');
</script>
</body>
</html>