Use offsetWidth instead of scrollWidth
scrollWidth does not work on Chrome with `display: inline` element.
This commit is contained in:
+2
-2
@@ -296,9 +296,9 @@ function checkBoldBroken(terminal) {
|
|||||||
const el = document.createElement('span');
|
const el = document.createElement('span');
|
||||||
el.innerHTML = 'hello world';
|
el.innerHTML = 'hello world';
|
||||||
terminal.appendChild(el);
|
terminal.appendChild(el);
|
||||||
const w1 = el.scrollWidth;
|
const w1 = el.offsetWidth;
|
||||||
el.style.fontWeight = 'bold';
|
el.style.fontWeight = 'bold';
|
||||||
const w2 = el.scrollWidth;
|
const w2 = el.offsetWidth;
|
||||||
terminal.removeChild(el);
|
terminal.removeChild(el);
|
||||||
return w1 !== w2;
|
return w1 !== w2;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user