MCPcopy
hub / github.com/DHTMLX/gantt / zeroWidthElement

Function zeroWidthElement

samples/common/codehighlight/codemirror.js:638–649  ·  view source on GitHub ↗
(measure)

Source from the content-addressed store, hash-verified

636
637 var zwspSupported;
638 function zeroWidthElement(measure) {
639 if (zwspSupported == null) {
640 var test = elt("span", "\u200b");
641 removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
642 if (measure.firstChild.offsetHeight != 0)
643 { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }
644 }
645 var node = zwspSupported ? elt("span", "\u200b") :
646 elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
647 node.setAttribute("cm-text", "");
648 return node
649 }
650
651 // Feature-detect IE's crummy client rect reporting for bidi text
652 var badBidiRects;

Callers 1

buildLineContentFunction · 0.85

Calls 2

eltFunction · 0.85
removeChildrenAndAddFunction · 0.85

Tested by

no test coverage detected