(display)
| 1850 | |
| 1851 | // Compute the default character width. |
| 1852 | function charWidth(display) { |
| 1853 | if (display.cachedCharWidth != null) return display.cachedCharWidth; |
| 1854 | var anchor = elt("span", "xxxxxxxxxx"); |
| 1855 | var pre = elt("pre", [anchor]); |
| 1856 | removeChildrenAndAdd(display.measure, pre); |
| 1857 | var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; |
| 1858 | if (width > 2) display.cachedCharWidth = width; |
| 1859 | return width || 10; |
| 1860 | } |
| 1861 | |
| 1862 | // OPERATIONS |
| 1863 |
no test coverage detected