setInert(root, inert) {
    if (inert) {
      if (this._inertRoots.has(root))   // element is already inert
        return;

      const inertRoot = new InertRoot(root, this);
      root.setAttribute('inert', '');
      this._inertRoots.set(root, inertRoot);
      // If not contained in the document, it must be in a shadowRoot.
      // Ensure inert styles are added there.
      if (!this._document.body.contains(root)) {
        let parent = root.parentNode;
        while (parent) {
          if (parent.nodeType === 11) {
            addInertStyle(parent);
          }
          parent = parent.parentNode;
        }
      }
    } else {
      if (!this._inertRoots.has(root))  // element is already non-inert
        return;

      const inertRoot = this._inertRoots.get(root);
      inertRoot.destructor();
      this._inertRoots.delete(root);
      root.removeAttribute('inert');
    }
  }
Set whether the given element should be an inert root or not.
@param {Element} root
@param {boolean} inert