(display)
| 2965 | |
| 2966 | // Compute the default character width. |
| 2967 | function charWidth(display) { |
| 2968 | if (display.cachedCharWidth != null) return display.cachedCharWidth; |
| 2969 | var anchor = elt("span", "xxxxxxxxxx"); |
| 2970 | var pre = elt("pre", [anchor]); |
| 2971 | removeChildrenAndAdd(display.measure, pre); |
| 2972 | var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; |
| 2973 | if (width > 2) display.cachedCharWidth = width; |
| 2974 | return width || 10; |
| 2975 | } |
| 2976 | |
| 2977 | // OPERATIONS |
| 2978 |
no test coverage detected