MCPcopy Index your code
hub / github.com/csev/py4e / zeroWidthElement

Function zeroWidthElement

tools/pythonauto/static/codemirror/codemirror.js:5748–5757  ·  view source on GitHub ↗
(measure)

Source from the content-addressed store, hash-verified

5746
5747 var zwspSupported;
5748 function zeroWidthElement(measure) {
5749 if (zwspSupported == null) {
5750 var test = elt("span", "\u200b");
5751 removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
5752 if (measure.firstChild.offsetHeight != 0)
5753 zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_lt8;
5754 }
5755 if (zwspSupported) return elt("span", "\u200b");
5756 else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
5757 }
5758
5759 // See if "".split is the broken IE version, if so, provide an
5760 // alternative way to split lines.

Callers 3

measureLineWidthFunction · 0.70
buildLineContentFunction · 0.70
buildCollapsedSpanFunction · 0.70

Calls 2

eltFunction · 0.70
removeChildrenAndAddFunction · 0.70

Tested by

no test coverage detected