-
Notifications
You must be signed in to change notification settings - Fork 21
Description
At the moment the FramePoolManager for reflowable EPUB is using the same strategy for both paginated and scroll when it comes to pushing resources in disposal and creation arrays:
this.positions.forEach((l, j) => {
if(j > (i + UPPER_BOUNDARY) || j < (i - UPPER_BOUNDARY)) {
if(!disposal.includes(l.href)) disposal.push(l.href);
}
if(j < (i + LOWER_BOUNDARY) && j > (i - LOWER_BOUNDARY)) {
if(!creation.includes(l.href)) creation.push(l.href);
}
});
i being the current position index in the positions list, and j the one in the loop.
This means that it will effectively push the next resource in the readingOrder when at the end of the current one, and the previous resource at the beginning.
Since we are using scroll affordances in Thorium Web/Readium Playground, it means the start and bottom of the document can actually have links to both the previous and next resource, with only a single one being ready to be shown in the pool.
While that does not necessarily create noticeable performance issues at the moment, maybe we should update this strategy so that each layout can be as optimised as possible, although it can be a tricky one, see preloading on hover, etc.