 // After this assignment, dirtiness=true
  assertDirty(elem, isSelected);

  elem.selected = !isSelected;  // Change the value, still dirty
  assertDirty(elem, !isSelected);
};

function assertDirty(elem, expect) {
  assert_equals(elem.selected, expect);

  elem.setAttribute("selected", "");
  assert_equals(elem.selected, expect);

  elem.removeAttribute("selected");
  assert_equals(elem.selected, expect);

  elem.defaultSelected = true;
  assert_equals(elem.selected, expect);

  elem.defaultSelected = fal