(display)
| 2966 | var measureText; |
| 2967 | // Compute the default text height. |
| 2968 | function textHeight(display) { |
| 2969 | if (display.cachedTextHeight != null) return display.cachedTextHeight; |
| 2970 | if (measureText == null) { |
| 2971 | measureText = elt("pre"); |
| 2972 | // Measure a bunch of lines, for browsers that compute |
| 2973 | // fractional heights. |
| 2974 | for (var i = 0; i < 49; ++i) { |
| 2975 | measureText.appendChild(document.createTextNode("x")); |
| 2976 | measureText.appendChild(elt("br")); |
| 2977 | } |
| 2978 | measureText.appendChild(document.createTextNode("x")); |
| 2979 | } |
| 2980 | removeChildrenAndAdd(display.measure, measureText); |
| 2981 | var height = measureText.offsetHeight / 50; |
| 2982 | if (height > 3) display.cachedTextHeight = height; |
| 2983 | removeChildren(display.measure); |
| 2984 | return height || 1; |
| 2985 | } |
| 2986 | |
| 2987 | // Compute the default character width. |
| 2988 | function charWidth(display) { |
no test coverage detected