function extractTopLevelDocumentFragmentComments(documentFragment) {
  const elements = extractTopLevelHTMLElements(documentFragment)

  return documentFragment.comments.filter((comment) =>
    elements.every(
      (element) =>
        comment.range[1] <= element.range[0] ||
        element.range[1] <= comment.range[0]
    )
  )
}
Extracts the top-level comments in document fragment.
@param {VDocumentFragment} documentFragment The document fragment.
@returns {Token[]} The top-level comments