MCPcopy Index your code
hub / github.com/witheve/Eve / zeroWidthElement

Function zeroWidthElement

src/codemirror.js:8533–8544  ·  view source on GitHub ↗
(measure)

Source from the content-addressed store, hash-verified

8531
8532 var zwspSupported;
8533 function zeroWidthElement(measure) {
8534 if (zwspSupported == null) {
8535 var test = elt("span", "\u200b");
8536 removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
8537 if (measure.firstChild.offsetHeight != 0)
8538 zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8);
8539 }
8540 var node = zwspSupported ? elt("span", "\u200b") :
8541 elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
8542 node.setAttribute("cm-text", "");
8543 return node;
8544 }
8545
8546 // Feature-detect IE's crummy client rect reporting for bidi text
8547 var badBidiRects;

Callers 1

buildLineContentFunction · 0.85

Calls 2

eltFunction · 0.85
removeChildrenAndAddFunction · 0.85

Tested by

no test coverage detected