Use offsetWidth instead of scrollWidth

scrollWidth does not work on Chrome with `display: inline` element.
This commit is contained in:
yutaka
2017-03-08 05:11:26 +00:00
parent f0d5b40121
commit 2ec756fd6b
+2 -2
View File
@@ -296,9 +296,9 @@ function checkBoldBroken(terminal) {
const el = document.createElement('span');
el.innerHTML = 'hello world';
terminal.appendChild(el);
const w1 = el.scrollWidth;
const w1 = el.offsetWidth;
el.style.fontWeight = 'bold';
const w2 = el.scrollWidth;
const w2 = el.offsetWidth;
terminal.removeChild(el);
return w1 !== w2;
}