TextRange.getBoundingClientRect on PDF.js is giving all zeros in IE10/IE11

281 Views Asked by At

textRange.getBoundingClientRect is returning all zeros (left, top, width, height, ...) in IE10/IE11 when it's executed in pages rendered using PDF.js.

https://mozilla.github.io/pdf.js/web/viewer.html

getBoundingClientRect method is giving correct values in Firefox and Chrome but not in IE. Open above URL, make a multi-line selection, and execute following code in developer console:

window.getSelection().getRangeAt(0).getBoundingClientRect();

From what I understood after inspecting the PDF.js DOM is that IE return all zeros when elements are positioned absolute. I verified this assumption in following demo:

http://jsfiddle.net/0px1ee59/3/

After opening above URL, open developer console and try selecting some text. If you make selection that span multiple elements positioned absolute, IE will give all zeros.

So my question is what could be the alternate of getting range dimensions in PDF.js page in IE?

0

There are 0 best solutions below