为什么 classList 会抛出 HTTP 响应代码?

Why would a classList throw an HTTP response code?

我有一些自定义元素代码。出于某种奇怪的原因,它在没有网络 activity.

的代码部分向我抛出 Chrome 中的 404

控制台说它正在尝试点击 http://localhost:4000/null,但网络选项卡中没有 activity。这不会发生在 Firefox 上。

下面是该函数的完整范围:

attributeChangedCallback(attr, oldVal, newVal) {

  switch (attr) {

    case 'show':
      this.classList.toggle('modal-window--show', newVal == 'true')
      break;
    case 'heading':
      this.querySelector('.modal-window__header').textContent = newVal
      break;

  }
}

我正在使用 Document Register Element pollyfill。

我在这里很密集。

错误的请求没有显示在我的网络面板上,因为我打开了 XHTTPRequests 过滤器。如果我看到网络请求,我就会知道网络请求是针对通过 class 应用的背景图像。因此,在切换 class 后引发错误。