function toggleDetails(header, invalidations)
    {
        var wasExpanded = header.classList.contains("expanded");
        header.classList.toggle("expanded", !wasExpanded);
        header.parentElement.classList.toggle("expanded", !wasExpanded);

        if (wasExpanded) {
            var content = header.nextElementSibling;
            if (content)
                content.remove();
        } else {
            createInvalidationGroupDetails(header.parentElement, invalidations);
        }
    }
@param {!Element} header
@param {!Array.<!WebInspector.InvalidationTrackingEvent>} invalidations