(measure)
| 12 | |
| 13 | let zwspSupported |
| 14 | export function zeroWidthElement(measure) { |
| 15 | if (zwspSupported == null) { |
| 16 | let test = elt("span", "\u200b") |
| 17 | removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])) |
| 18 | if (measure.firstChild.offsetHeight != 0) |
| 19 | zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) |
| 20 | } |
| 21 | let node = zwspSupported ? elt("span", "\u200b") : |
| 22 | elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px") |
| 23 | node.setAttribute("cm-text", "") |
| 24 | return node |
| 25 | } |
| 26 | |
| 27 | // Feature-detect IE's crummy client rect reporting for bidi text |
| 28 | let badBidiRects |
no test coverage detected