IndexSizeError: cfi_navigation_logic.js - findVisibleLeafNodeCfi
This issue is a Bug
Expected Behaviour
Get the range of selected nodes and highlight them.
Observed behaviour
findVisibleLeafNodeCfi is generating this error:
IndexSizeError: Index or size is negative or greater than the allowed amount
Steps to reproduce
- Open an epub with a fixed-layout and an image background
- Set breakpoint at highlights manager line 117 and if
spineItem.paginationInfoisn't defined, default it to{}(see this bug for reference) 3: Select some text 4: Try to add highlight
Product
- Readium cloud reader app
- latest development build uploaded at https://readium.firebaseapp.com
- Firefox 48
- Multiple OS
Additional information
Please find a sample epub attached where we're seeing this issue. fixed_layout.epub.zip
Also, if you pull in this ePub with text overlays you can very consistently replicate the issue as follows.
NOTE: Requires same paginationInfo work-around as defined in step 2 above.
- Navigate to a page with a full background image
- Click on the background image for the overlay to fade in
- Select some text in the overlay
- This may cause overlay to fade out, just click image again to bring it back
- Click the Highlight icon
Duplicated issue? https://github.com/readium/readium-shared-js/issues/280
No, this isn't a dup. This is the error that you'll see once #280 is fixed, as I've included the workaround for #280 in the instructions for reproducing the issue.
Okay thanks for the clarification! :)
@bradleygore I suspect that the empty paginationInfo object simply "postpones" the occurrence of the bug (because the data in paginationInfo is needed for highlights to function properly, right?). I need to run some tests too, but ultimately, paginationInfo cannot just be empty.
@danielweck You're very likely right - I'm still trying to grok what all is going on, so could be that once the paginationInfo issue is fixed the right way, vs my poor hack around, that this will get resolved along with it :)