From 02012ea416186678acc47bb23e23025a35f484f6 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Wed, 19 Nov 2025 19:52:15 +0900 Subject: [PATCH 1/2] Docs: Fix Safari scrolling to anchors in iframes. --- utils/docs/template/static/scripts/page.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/utils/docs/template/static/scripts/page.js b/utils/docs/template/static/scripts/page.js index b828f04ccf682e..21cce9c2254e2b 100644 --- a/utils/docs/template/static/scripts/page.js +++ b/utils/docs/template/static/scripts/page.js @@ -32,7 +32,26 @@ if ( typeof hljs !== 'undefined' ) { const element = document.getElementById( hash ); - if ( element ) element.scrollIntoView(); + if ( element ) { + + // Safari needs a small delay for iframe scrolling + const isSafari = /^((?!chrome|android).)*safari/i.test( navigator.userAgent ); + + if ( isSafari ) { + + setTimeout( function () { + + element.scrollIntoView(); + + }, 100 ); + + } else { + + element.scrollIntoView(); + + } + + } } From 1a4756d77019da17c423ce1c50167c404c9590ad Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Fri, 28 Nov 2025 18:16:29 +0100 Subject: [PATCH 2/2] Update page.js Increase timeout. --- utils/docs/template/static/scripts/page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/docs/template/static/scripts/page.js b/utils/docs/template/static/scripts/page.js index 21cce9c2254e2b..ff4eb704d8ac03 100644 --- a/utils/docs/template/static/scripts/page.js +++ b/utils/docs/template/static/scripts/page.js @@ -43,7 +43,7 @@ if ( typeof hljs !== 'undefined' ) { element.scrollIntoView(); - }, 100 ); + }, 250 ); } else {