 i < subfrag.childNodes.length; i++) {
      clone.appendChild(subfrag.childNodes[i]);
    }
  }

  // "Return frag."
  return frag;
}

function restoreIframe(iframe, i) {
  // Most of this function is designed to work around the fact that Opera
  // doesn't let you add a doctype to a document that no longer has one, in
  // any way I can figure out.  I eventually compromised on something that
  // will still let Opera pass most tests that don't actually involve
  // doctypes.
  while (iframe.contentDocumen