Use globalThis instead of window (S7764)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -329,7 +329,7 @@ function getTextWidth(text, e) {
|
||||
const hiddenSpan = document.createElement("span");
|
||||
|
||||
hiddenSpan.textContent = processedText;
|
||||
hiddenSpan.style.font = window.getComputedStyle(e).font;
|
||||
hiddenSpan.style.font = globalThis.getComputedStyle(e).font;
|
||||
hiddenSpan.style.visibility = "hidden";
|
||||
document.body.appendChild(hiddenSpan);
|
||||
const width = hiddenSpan.getBoundingClientRect().width;
|
||||
|
||||
Reference in New Issue
Block a user