blob: 50dce2626a5fc722bb049dc541ae45b6be702ad6 [file] [log] [blame]
<!DOCTYPE html>
<body>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
test(() => {
class MyElement1 extends HTMLElement {}
customElements.define('my-element1', MyElement1);
const element = new MyElement1();
const internals = element.attachInternals();
assert_throws('NotSupportedError', () => { internals.setFormValue(''); });
assert_throws('NotSupportedError', () => { internals.form; });
assert_throws('NotSupportedError', () => { internals.setValidity({}); });
assert_throws('NotSupportedError', () => { internals.willValidate; });
assert_throws('NotSupportedError', () => { internals.validity; });
assert_throws('NotSupportedError', () => { internals.validationMessage; });
assert_throws('NotSupportedError', () => { internals.checkValidity(); });
assert_throws('NotSupportedError', () => { internals.reportValidity(); });
assert_throws('NotSupportedError', () => { internals.labels; });
}, 'Form-related operations and attributes should throw NotSupportedErrors' +
' for non-form-associated custom elements.');
</script>
</body>