MCPcopy
hub / github.com/csev/py4e / zeroWidthElement

Function zeroWidthElement

tools/pythonauto/static/codemirrorepl/codemirror.js:7105–7114  ·  view source on GitHub ↗
(measure)

Source from the content-addressed store, hash-verified

7103
7104 var zwspSupported;
7105 function zeroWidthElement(measure) {
7106 if (zwspSupported == null) {
7107 var test = elt("span", "\u200b");
7108 removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
7109 if (measure.firstChild.offsetHeight != 0)
7110 zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_upto7;
7111 }
7112 if (zwspSupported) return elt("span", "\u200b");
7113 else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
7114 }
7115
7116 // Feature-detect IE's crummy client rect reporting for bidi text
7117 var badBidiRects;

Callers 1

buildLineContentFunction · 0.70

Calls 2

eltFunction · 0.70
removeChildrenAndAddFunction · 0.70

Tested by

no test coverage detected