(display)
| 1830 | var measureText; |
| 1831 | // Compute the default text height. |
| 1832 | function textHeight(display) { |
| 1833 | if (display.cachedTextHeight != null) return display.cachedTextHeight; |
| 1834 | if (measureText == null) { |
| 1835 | measureText = elt("pre"); |
| 1836 | // Measure a bunch of lines, for browsers that compute |
| 1837 | // fractional heights. |
| 1838 | for (var i = 0; i < 49; ++i) { |
| 1839 | measureText.appendChild(document.createTextNode("x")); |
| 1840 | measureText.appendChild(elt("br")); |
| 1841 | } |
| 1842 | measureText.appendChild(document.createTextNode("x")); |
| 1843 | } |
| 1844 | removeChildrenAndAdd(display.measure, measureText); |
| 1845 | var height = measureText.offsetHeight / 50; |
| 1846 | if (height > 3) display.cachedTextHeight = height; |
| 1847 | removeChildren(display.measure); |
| 1848 | return height || 1; |
| 1849 | } |
| 1850 | |
| 1851 | // Compute the default character width. |
| 1852 | function charWidth(display) { |
no test coverage detected