_toggleTreeItem(root, show = false) {
    // Pause translation when collapsing/expanding the subtree.
    this._l10n.pause();

    this._lastToggleIsShow = show;
    for (const toggler of root.querySelectorAll(".treeItemToggler")) {
      toggler.classList.toggle("treeItemsHidden", !show);
    }
    this._l10n.resume();
  }
Collapse or expand the subtree of a tree item.

@param {Element} root - the root of the item (sub)tree.
@param {boolean} show - whether to show the item (sub)tree. If false,
  the item subtree rooted at `root` will be collapsed.
@private