blob: f529927d7167a7fd819857a5b647a3a8b1254a0d [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
'use strict';
const kElementNameDOMInvalidHTMLParserValid = 1968;
const kElementNameDOMValidHTMLParserInvalid = 1969;
test(() => {
assert_false(internals.isUseCounted(document, kElementNameDOMInvalidHTMLParserValid),
'element name: DOM invalid, HTML valid');
assert_false(internals.isUseCounted(document, kElementNameDOMValidHTMLParserInvalid),
'element name: DOM valid, HTML invalid');
assert_throws('InvalidCharacterError', () => document.createElement('foo"'));
assert_true(internals.isUseCounted(document, kElementNameDOMInvalidHTMLParserValid),
'element name: DOM invalid, HTML valid');
assert_false(internals.isUseCounted(document, kElementNameDOMValidHTMLParserInvalid),
'element name: DOM valid, HTML invalid');
document.createElement(':foo');
assert_true(internals.isUseCounted(document, kElementNameDOMValidHTMLParserInvalid),
'element name: DOM valid, HTML invalid');
}, 'name validity failures tickle use counters');
</script>
</html>