MCPcopy Create free account
hub / github.com/TruthHun/BookStack / hasBadBidiRects

Function hasBadBidiRects

static/editor.md/lib/codemirror/lib/codemirror.js:8275–8282  ·  view source on GitHub ↗
(measure)

Source from the content-addressed store, hash-verified

8273 // Feature-detect IE's crummy client rect reporting for bidi text
8274 var badBidiRects;
8275 function hasBadBidiRects(measure) {
8276 if (badBidiRects != null) return badBidiRects;
8277 var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"));
8278 var r0 = range(txt, 0, 1).getBoundingClientRect();
8279 if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780)
8280 var r1 = range(txt, 1, 2).getBoundingClientRect();
8281 return badBidiRects = (r1.right - r0.right < 3);
8282 }
8283
8284 // See if "".split is the broken IE version, if so, provide an
8285 // alternative way to split lines.

Callers 1

buildLineContentFunction · 0.70

Calls 1

removeChildrenAndAddFunction · 0.70

Tested by

no test coverage detected