refactor: address review nits

- merge gsapResizeIntercept's duplicate module imports
- move the core-constant imports to the file headers (picker, domEditingDom)
- justify the cross-realm HTMLElement casts (iframe-realm nodes fail
  instanceof; access is duck-typed)
This commit is contained in:
Miguel Angel Simon Sierra
2026-07-11 14:58:21 -04:00
parent b7fddd548a
commit 67cfae2587
4 changed files with 11 additions and 9 deletions
+4 -2
View File
@@ -319,8 +319,10 @@ export function applySoftReload(
if (allTargets.length > 0 && win.gsap?.set) {
const saved: Array<[HTMLElement, string]> = [];
for (const el of allTargets) {
const s = (el as HTMLElement).style;
if (s?.cssText != null) saved.push([el as HTMLElement, s.cssText]);
// Iframe-realm node: instanceof HTMLElement fails across realms, and
// gsap targets() only yields elements here — style access is duck-typed.
const styled = el as HTMLElement;
if (styled.style?.cssText != null) saved.push([styled, styled.style.cssText]);
}
try {
win.gsap.set(allTargets, { clearProps: "all" });