First visible locator (EPUBS) improvements #99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have detected some different publications where the first visible locator is not working as expected. Doing an investigation, most of the cases are related to a crash in the usage of "cssSelectorGenerator" method. Additionally, there is another case covered here, when a publication has a list which is long enough to be shown entirely in the current pages.
Cases explanation:
In the first case, I've detected that, when using TTS for some publications in which the elements have custom properties (eg. xml:lang), the css selector process will crash, so the first visible locator will not be in the actual current page, but in the page in which the latest known element is.
1a- Current behavior in Sept comme setteur publication:
Notice that even if I try to start in the page 46, it will go back to the page 40 (the beginning of the current chapter).
Screen.Recording.2025-01-10.at.3.04.44.PM.mov
1b- New behavior in Sept comme setteur publication:
As now the cssSelectorGenerator is not crashing, it's able to get the right element to start.
Screen.Recording.2025-01-10.at.3.05.14.PM.mov
In the second case, the publication I found is a little bit special, most of the content is wrapped into an UL element.
This situation make the whole list of elements to act as list items, and that's why the current
"display: block"
validation is not enough to detect the right element to be selected as the first visible element.2a- Current behavior in CRAAV Therapy publication:
Notice that I'm starting in the page 72, but as most of the content is ignored, the "first visible locator" will be the beginning of the UL (in page 5)
Screen.Recording.2025-01-10.at.3.09.53.PM.mov
2b- New behavior in CRAAV Therapy publication:
As now the elements are not ignored, the first visible locator is actually getting the right one.
Screen.Recording.2025-01-10.at.3.10.28.PM.mov