title: HTML Input validity not checked when value is changed by Javascript
body: <p>I have a text input with <code>minlength</code> defined.  When a user enters text, the input's <code>validity</code> state is updated immediately.  If I alter the value in code, the validity state reset to show as valid -- even with a constraint violated, <code>validity.valid</code> is true.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const input = document.getElementById("input");
  const label = document.getElementById("label");
  document.getElementById("rightButton").addEventListener("click", evt =&gt; {
    input.value = "ABCDE";
  });
  document.getElementById("wrongButton").addEventListener("click", evt =&gt; {
    input.value = "AB";
  });
  
  setInterval(() =&gt; label.innerHTML = input.validity.valid, 250);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="text" id="input" minlength="4"&gt;
  &lt;span id="label"&gt;&lt;/span&gt;
  &lt;hr/&gt;
  &lt;button id="rightButton"&gt;Make It Right&lt;/button&gt;
  &lt;button id="wrongButton"&gt;Make It Wrong&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Why doesn't automatic validity checking run when I assign to <code>input.value</code>?  Is this documented somewhere?  Is there a method I can call to trigger the browser's internal validation process, rather than having to do my own checks and call <code>setCustomValidity</code>?</p>