Even if overflow: hidden, the scrollHeight will be increased after overflow, so it is possible to determine overflow. javascript - Check if an element's content is overflowing? - Stack Overflow
I can't test it in jsdom because scrollHeight is 0.
This page is auto-translated from /nishio/✅フォントサイズの自動調整ができるか? using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.