MCPcopy
hub / github.com/witheve/Eve / hasBadBidiRects

Function hasBadBidiRects

src/codemirror.js:8548–8555  ·  view source on GitHub ↗
(measure)

Source from the content-addressed store, hash-verified

8546 // Feature-detect IE's crummy client rect reporting for bidi text
8547 var badBidiRects;
8548 function hasBadBidiRects(measure) {
8549 if (badBidiRects != null) return badBidiRects;
8550 var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"));
8551 var r0 = range(txt, 0, 1).getBoundingClientRect();
8552 if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780)
8553 var r1 = range(txt, 1, 2).getBoundingClientRect();
8554 return badBidiRects = (r1.right - r0.right < 3);
8555 }
8556
8557 // See if "".split is the broken IE version, if so, provide an
8558 // alternative way to split lines.

Callers 1

buildLineContentFunction · 0.85

Calls 1

removeChildrenAndAddFunction · 0.85

Tested by

no test coverage detected