@monospaced/set-core 0.14.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2141,16 +2141,16 @@ function Yt() {
2141
2141
  if (!(i.length === 0 || this.ownerDocument.defaultView?.matchMedia?.(t).matches))
2142
2142
  for (const a of i) this.#t(a);
2143
2143
  }
2144
- // Drive the overlay's hide from playback readiness rather than render, so a
2145
- // slow connection can't clip the hand-off before the frames have loaded.
2144
+ // Arm the overlay's hide from playback readiness. The CSS hide only runs
2145
+ // once `data-sequencing` is set, so until then the lead holds its last
2146
+ // frame — nothing can clip the hand-off before the frames have loaded.
2146
2147
  #t(i) {
2147
2148
  const r = i.querySelector("img");
2148
2149
  if (!r) return;
2149
- i.style.animation = "none";
2150
2150
  const a = () => {
2151
- i.offsetWidth, i.style.animation = "";
2151
+ i.setAttribute("data-sequencing", "");
2152
2152
  };
2153
- r.complete ? a() : r.addEventListener("load", a, { once: !0 });
2153
+ r.complete && r.naturalWidth > 0 ? a() : (r.addEventListener("load", a, { once: !0 }), r.addEventListener("error", a, { once: !0 }));
2154
2154
  }
2155
2155
  }
2156
2156
  customElements.define(K, n);