Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid location/CFI received #453

Open
EdwinGuzman opened this issue Feb 8, 2019 · 2 comments
Open

Invalid location/CFI received #453

EdwinGuzman opened this issue Feb 8, 2019 · 2 comments

Comments

@EdwinGuzman
Copy link

This issue is a Bug

Related issue

*Example: See also #388 *

Observed behavior

We tested this on the debugger using Readium's Readium_cloud-reader-lite.zip
(hosted here: https://readium.org/technical/technical-notes/_posts/testing-with-cloudreader/)

Under certain circumstances, a location/CFI reported by the SDK becomes invalid (or no longer exists in the new DOM structure). The easiest way to demonstrate is to:

  1. Ask the SDK to give us its current location.
  2. Make some change that affects the page structure or DOM.
  3. Navigate away to some random spot (best if a different chapter).
  4. Attempt to re-apply the CFI from step 1.

Outcome:

  1. The open request fails, either sending the user to the beginning of the chapter (the idref from the attempted page open), or it just silently fails and you stay on the page you're already on.

In our test, we ask for the current location calling bookmarkCurrentPage(), make the font change, navigate away, and then try to navigate back to that spot using openSpineElementCfi().

Steps to reproduce

The "changes" we've tested so far that we know will cause the bug:

  1. Changing the text size
  2. Applying the CFI across different browsers (Android to iOS or vice versa)

Test file(s)

We tested on a handful of DRM-free Epub's, which we can provide but don't expect to make a difference.

Product

  • Readium cloud reader app
  • When using the readium-shared-js library on Android and iOS platforms.
@danielweck
Copy link
Member

Just a note: I am not sure about the version of Readium_cloud-reader-lite.zip available on the readium.org website. I would recommend using the official GitHub releases:
https://github.com/readium/readium-js-viewer/releases/tag/0.31.1

@danielweck
Copy link
Member

By design, CFI references do break if the DOM / document markup changes. There is no way around that, other than blacklisting / skipping injected elements that are added at runtime for specific presentation / rendering purposes (i.e. not part of the original authored publication, and not meant to be persistent). For example, Readium blacklists the markup generated for MathJax, annotations, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants