insertBefore(el, ref) {
      if(ref == null) return this.appendChild(el);
      const idx = this.children.indexOf(ref);
      if(idx >= 0) {
        this.children.splice(idx, 0, el);