(display)
| 2859 | |
| 2860 | // Compute the default character width. |
| 2861 | function charWidth(display) { |
| 2862 | if (display.cachedCharWidth != null) return display.cachedCharWidth; |
| 2863 | var anchor = elt("span", "xxxxxxxxxx"); |
| 2864 | var pre = elt("pre", [anchor]); |
| 2865 | removeChildrenAndAdd(display.measure, pre); |
| 2866 | var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; |
| 2867 | if (width > 2) display.cachedCharWidth = width; |
| 2868 | return width || 10; |
| 2869 | } |
| 2870 | |
| 2871 | // OPERATIONS |
| 2872 |
no test coverage detected