http://www.quirksmode.org/bugreports/archives/safari/index.html "When the font size is enlarged in Safari, generated content can cause the text to be pushed outside of its bounding box. Test page http://www.easy-designs.net/articles/safariGeneratedContentWidthBug/ Workaround is not included Reported by: Aaron Gustafson."
Confirmed, this could be tricky, but generated content should be considered when checking if text is still inside it's box.
*** Bug 6287 has been marked as a duplicate of this bug. ***
Created attachment 460470 [details] Test case - from Wayback Archive I am unable to reproduce this bug in Safari 15.5 on macOS 12.4. Based on attach test case, when I try to zoom-in to enlarge the visual viewport to cause text to overflow, it does not work. You can see the old Safari behavior screenshot from here: https://web.archive.org/web/20061011194908/http://easy-designs.net/articles/safariGeneratedContentWidthBug/ and you can check new behavior using attached test case or below JS Fiddle: https://jsfiddle.net/v5khbmad/show (I was not sure on JSFiddle forcing Quirks mode - hence, I created local test case). I think this got fixed along the lines and can now be marked as 'RESOLVED CONFIGURATION CHANGED'. Thanks!
NOTE - All browser renders this as Safari 15.5.
Thank you for testing!