(display)
| 2986 | |
| 2987 | // Compute the default character width. |
| 2988 | function charWidth(display) { |
| 2989 | if (display.cachedCharWidth != null) return display.cachedCharWidth; |
| 2990 | var anchor = elt("span", "xxxxxxxxxx"); |
| 2991 | var pre = elt("pre", [anchor]); |
| 2992 | removeChildrenAndAdd(display.measure, pre); |
| 2993 | var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; |
| 2994 | if (width > 2) display.cachedCharWidth = width; |
| 2995 | return width || 10; |
| 2996 | } |
| 2997 | |
| 2998 | // OPERATIONS |
| 2999 |
no test coverage detected