code: def is_root(self, el):
          
  
          root = self.root and self.root is el
          if not root:
              parent = self.get_parent(el)
              root = parent is not None and self.is_html and self.is_iframe(parent)
          return root
docs: Return whether element is a root element.
  
          We check that the element is the root of the tree (which we have already pre-calculated),
          and we check if it is the root element under an `iframe`.