From 84a71be8e4dde45f9b29da08ac412fafc72ce2e3 Mon Sep 17 00:00:00 2001 From: Nic <162764842+Nic-Polumeyv@users.noreply.github.com> Date: Fri, 12 Jun 2026 19:46:10 -0400 Subject: [PATCH] breaking: remove Safari <18 overflow workaround in transitions --- .changeset/shiny-donuts-applaud.md | 5 ++++ .../client/dom/elements/transitions.js | 25 +------------------ 2 files changed, 6 insertions(+), 24 deletions(-) create mode 100644 .changeset/shiny-donuts-applaud.md diff --git a/.changeset/shiny-donuts-applaud.md b/.changeset/shiny-donuts-applaud.md new file mode 100644 index 0000000000..7294e05c20 --- /dev/null +++ b/.changeset/shiny-donuts-applaud.md @@ -0,0 +1,5 @@ +--- +'svelte': major +--- + +breaking: remove Safari <18 `overflow: hidden` transition workaround diff --git a/packages/svelte/src/internal/client/dom/elements/transitions.js b/packages/svelte/src/internal/client/dom/elements/transitions.js index 7c4d385807..ccdf1b0245 100644 --- a/packages/svelte/src/internal/client/dom/elements/transitions.js +++ b/packages/svelte/src/internal/client/dom/elements/transitions.js @@ -204,13 +204,6 @@ export function transition(flags, element, get_fn, get_params) { var inert = element.inert; - /** - * The default overflow style, stashed so we can revert changes during the transition - * that are necessary to work around a Safari <18 bug - * TODO 6.0 remove this, if older versions of Safari have died out enough - */ - var overflow = element.style.overflow; - /** @type {Animation | undefined} */ var intro; @@ -260,8 +253,6 @@ export function transition(flags, element, get_fn, get_params) { // Ensure we cancel the animation to prevent leaking intro?.abort(); intro = current_options = undefined; - - element.style.overflow = overflow; } ); }, @@ -420,29 +411,15 @@ function animate(element, options, counterpart, t2, on_begin, on_finish) { var keyframes = []; if (duration > 0) { - /** - * Whether or not the CSS includes `overflow: hidden`, in which case we need to - * add it as an inline style to work around a Safari <18 bug - * TODO 6.0 remove this, if possible - */ - var needs_overflow_hidden = false; - if (css) { var n = Math.ceil(duration / (1000 / 60)); // `n` must be an integer, or we risk missing the `t2` value for (var i = 0; i <= n; i += 1) { var t = t1 + delta * easing(i / n); - var styles = css_to_keyframe(css(t, 1 - t)); - keyframes.push(styles); - - needs_overflow_hidden ||= styles.overflow === 'hidden'; + keyframes.push(css_to_keyframe(css(t, 1 - t))); } } - if (needs_overflow_hidden) { - /** @type {HTMLElement} */ (element).style.overflow = 'hidden'; - } - get_t = () => { var time = /** @type {number} */ ( /** @type {globalThis.Animation} */ (animation).currentTime