Commit a754818b authored by Sheetal Umesh Kumar's avatar Sheetal Umesh Kumar

Fix IE 11 JS error which annotating PDFs.

The `whatToShow`, `filter` and `expandEntityReferences` arguments for
`Document.createNodeIterator()` are mandatory in IE although optional
according to the spec.
Pass default values to fix JS console errors.

See: https://github.com/hypothesis/client/issues/762
parent e86fa4a0
...@@ -285,7 +285,9 @@ exports.describe = (root, range, options = {}) -> ...@@ -285,7 +285,9 @@ exports.describe = (root, range, options = {}) ->
startPageIndex = getSiblingIndex(startTextLayer.parentNode) startPageIndex = getSiblingIndex(startTextLayer.parentNode)
endPageIndex = getSiblingIndex(endTextLayer.parentNode) endPageIndex = getSiblingIndex(endTextLayer.parentNode)
iter = document.createNodeIterator(startTextLayer, NodeFilter.SHOW_TEXT) # The `whatToShow`, `filter` and `expandEntityReferences` arguments are
# mandatory in IE although optional according to the spec.
iter = document.createNodeIterator(startTextLayer, NodeFilter.SHOW_TEXT, null, false);
start = seek(iter, range.start) start = seek(iter, range.start)
end = seek(iter, range.end) + start + range.end.textContent.length end = seek(iter, range.end) + start + range.end.textContent.length
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment