_watchForInert(records, self) {
    for (let record of records) {
      switch (record.type) {
      case 'childList':
        for (let node of Array.from(record.addedNodes)) {
          if (node.nodeType !== Node.ELEMENT_NODE)
            continue;
          const inertElements = Array.from(node.querySelectorAll('[inert]'));
          if (node.matches('[inert]'))
            inertElements.unshift(node);
          for (let inertElement of inertElements)
            this.setInert(inertElement, true);
        }
        break;
      case 'attributes':
        if (record.attributeName !== 'inert')
          continue;
        const target = record.target;
        const inert = target.hasAttribute('inert');
        this.setInert(target, inert);
        break;
      }
    }
  }
Callback used when mutation observer detects attribute changes.
@param {MutationRecord} records
@param {MutationObserver} self