MCPcopy Create free account
hub / github.com/sql-js/sql.js / zeroWidthElement

Function zeroWidthElement

GUI/codemirror/lib/codemirror.js:7163–7172  ·  view source on GitHub ↗
(measure)

Source from the content-addressed store, hash-verified

7161
7162 var zwspSupported;
7163 function zeroWidthElement(measure) {
7164 if (zwspSupported == null) {
7165 var test = elt("span", "\u200b");
7166 removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
7167 if (measure.firstChild.offsetHeight != 0)
7168 zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_upto7;
7169 }
7170 if (zwspSupported) return elt("span", "\u200b");
7171 else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
7172 }
7173
7174 // Feature-detect IE's crummy client rect reporting for bidi text
7175 var badBidiRects;

Callers 1

buildLineContentFunction · 0.85

Calls 2

eltFunction · 0.85
removeChildrenAndAddFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…