function invalidateTemplate(template) {
  // default the current version to 0
  template[CURRENT_VERSION] = template[CURRENT_VERSION] || 0;
  // ensure the "validating for" flag exists
  template[VALIDATING_VERSION] = template[VALIDATING_VERSION] || 0;
  // increment the next version
  template[NEXT_VERSION] = (template[NEXT_VERSION] || 0) + 1;
}
This function can be called multiple times to mark a template invalid
and signal that the style inside must be regenerated.

Use `startValidatingTemplate` to begin an asynchronous validation cycle.
During that cycle, call `templateIsValidating` to see if the template must
be revalidated
@param {HTMLTemplateElement} template