Book reader incorrectly go to table of contents items

Bug #1918437 reported by George Potapov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

When reading books in built in book reader and trying to jump to a table of contents item the viewer jumps to location a little after of needed location. I.e. instead of going to the beginning of a chapter it will jump to several pages after the beginning of the chapter. Also the current location marked incorrectly. When looking at the start of a chapter the previous chapter is highlighted in the table of contents.

On the screenshot attached, I just clicked on the "8" chapter. As you can see, the beginning of the chapter is not visible because the viewer landed way after the chapter start.

Revision history for this message
George Potapov (nephrite) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1918437

That will be because the table of contents in the book you are reading
is incorrectly linked. If you feel differently, then attach the EPUB
file and I will verify.

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
George Potapov (nephrite) wrote :

Here is the epub file I was reading.

Changed in calibre:
status: Invalid → New
Revision history for this message
George Potapov (nephrite) wrote :

The file is linked correctly and other readers jump to table contents correctly.
I tested in FBReader and Lucidor.
However, I noticed that the file uses long <span> elements encoppassing entire chapters.
Maybe it is the root of the problem.

Revision history for this message
George Potapov (nephrite) wrote :

I edited the file to remove the long <spans> and changed the elements the toc was pointing to to first <p> of the chapter and calibre started to jump correctly.

Revision history for this message
Kovid Goyal (kovid) wrote :

This is caused by a bug in Qt WebEngine, when wrapping large blocks in
inline elements split over columns. scrollIntoView() for such elements
does not scroll to the start of the element. And the boundingclientrect
is incorrect. So as you discovered, dont wrap block elements inside
inline ones and you will be fine.

 status invalid

Revision history for this message
Kovid Goyal (kovid) wrote :

Oh and you can also switch the viewer to flow mode instead of paged mode
to wrokaround.

Changed in calibre:
status: New → Invalid
Revision history for this message
Kovid Goyal (kovid) wrote :

Actually, turns out I can fairly easily detect the case of an inline
element wrapping a block one and workaround the webengine bug.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: Invalid → Fix Released
Revision history for this message
Frank Mouson (fmouson) wrote (last edit ):

Thank you for explaining how to fix this error. It's frustrating when the built-in book reader can't jump exactly to the right place in the table of contents. I've encountered a similar problem where the viewer jumps to a point beyond the beginning of the chapter instead of landing in the intended location. Also, the current location marker seems to be mismarked, highlighting the previous chapter instead of the current one. This flaw almost cost me a bad grade for the assignment. Fortunately, I found a helpful resource https://graduateway.com/essay-examples/rogerian-argument/ that helped me gather information for my research paper. The platform provided me with relevant examples and a solid foundation for my work. Hopefully, the problem of reading books is solved for good, as it interferes with reading and makes the process of learning content impossible.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.