<!DOCTYPE html>
<title>Selectedness is updated during moveBefore()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>

<select>
  <option value=A>A</option>
  <optgroup label=Optgroup>
    <option value=B>B</option>
  </optgroup>
  <option value=C>C</option>
</select>

<script>
test(t => {
  const optionA = document.querySelector('option[value=A]');
  const optionB = document.querySelector('option[value=B]');
  const optionC = document.qu