From 2c98768b84f820a39c7f8a9e7c2b5acdd9e606b5 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 23 Sep 2024 10:04:05 -0400 Subject: [PATCH] fix: only use getComputedStyle with elements (#13366) --- .changeset/cool-yaks-run.md | 5 +++++ packages/svelte/src/animate/index.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/cool-yaks-run.md diff --git a/.changeset/cool-yaks-run.md b/.changeset/cool-yaks-run.md new file mode 100644 index 000000000000..8b316a8cafda --- /dev/null +++ b/.changeset/cool-yaks-run.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: only use getComputedStyle with elements diff --git a/packages/svelte/src/animate/index.js b/packages/svelte/src/animate/index.js index b04fe6492bcc..7c3eb90e5518 100644 --- a/packages/svelte/src/animate/index.js +++ b/packages/svelte/src/animate/index.js @@ -52,7 +52,7 @@ function get_zoom(element) { while (current !== null) { zoom *= +getComputedStyle(current).zoom; - current = /** @type {Element | null} */ (current.parentNode); + current = /** @type {Element | null} */ (current.parentElement); } return zoom;