constructor (elem, attrs, text) {
    super()
    this.elem = elem
    this.text = text ? ('Change ' + elem.tagName + ' ' + text) : ('Change ' + elem.tagName)
    this.newValues = {}
    this.oldValues = attrs
    for (const attr in attrs) {
      if (attr === '#text') {
        this.newValues[attr] = (elem) ? elem.textContent : ''
      } else if (attr === '#href') {
        this.newValues[attr] = getHref(elem)
      } else {
        this.newValues[attr] = elem.getAttribute(attr)
      }
    }
  }
@param {Element} elem - The DOM element that was changed
@param {module:history.CommandAttributes} attrs - Attributes to be changed with the values they had *before* the change
@param {string} text - An optional string visible to user related to this change