You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cfi_navigation_logic.js, the function adjustRectangle offsets the clientRects one column to the left if the top of the rectangle is < 0. From the comments, I understand it's a workaround for a bug in Webkit. But I have situations (tested on Firefox with Open Dyslexic font) where the rectangle has a negative top for another reason: depending on the font used, the clientRects for a word on the first visible line of text may be taller than the line-height css property and thus the top of the clientRect is above the top of the viewport. This is more or less normal I believe. This results in isElementVisible returning a wrong value for elements containing the first visible line.
Is the Webkit workaround still necessary for the recent versions of webkit browser ? If yes, is it possible to find a way to distinguish the case where the rectangle must be adjusted from the case described above ?
Product
development branch of readium-shared-js
Firefox 52.1
The text was updated successfully, but these errors were encountered:
HGuillemet
changed the title
Workaround about visible rectangles for Webkit-based browsers cause problem in the general case
Workaround about visible rectangles for Webkit-based browsers causes problem in the general case
Jun 3, 2017
A simple way to reproduce the bug is to open a book with some problematic font (open sans or opendyslexic for instance), flip one page right, go back to library and back to the book : the saved CFI position is restored and it's the previous page that is shown, not the last one flipped.
Commenting out the content of adjustRectangle solves the problem, but I'm not sure to understand what's the rationale behind this function and the Webkit behaviour it's supposed to work around, and thus what's the implication of removing adjustRectangle.
This issue is a Bug
Observed behaviour
isElementVisible sometimes returns a wrong value.
In cfi_navigation_logic.js, the function adjustRectangle offsets the clientRects one column to the left if the top of the rectangle is < 0. From the comments, I understand it's a workaround for a bug in Webkit. But I have situations (tested on Firefox with Open Dyslexic font) where the rectangle has a negative top for another reason: depending on the font used, the clientRects for a word on the first visible line of text may be taller than the line-height css property and thus the top of the clientRect is above the top of the viewport. This is more or less normal I believe. This results in isElementVisible returning a wrong value for elements containing the first visible line.
Is the Webkit workaround still necessary for the recent versions of webkit browser ? If yes, is it possible to find a way to distinguish the case where the rectangle must be adjusted from the case described above ?
Product
development branch of readium-shared-js
Firefox 52.1
The text was updated successfully, but these errors were encountered: