object-constraint-validation.html (771B)
1 <!doctype html> 2 <title>The object element's constraint validation.</title> 3 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-object-element"> 4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-validitystate-customerror"> 5 <link rel="author" title="Peng Zhou" href="mailto:zhoupeng.1996@bytedance.com"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <object id="element"></object> 9 <script> 10 function check() { 11 assert_false(element.willValidate); 12 assert_true(element.checkValidity()); 13 assert_true(element.reportValidity()); 14 } 15 16 test(() => { 17 check(); 18 element.setCustomValidity("custom error"); 19 check(); 20 }, "the object element's constraint validation is correct") 21 </script>