readium / readium-css

🌈 A set of reference stylesheets for EPUB Reading Systems, starting with Readium Mobile
https://readium.org/readium-css/
BSD 3-Clause "New" or "Revised" License
93 stars 20 forks source link

Unexpected document dimensions in paginated mode #158

Open qnga opened 5 days ago

qnga commented 5 days ago

Document dimensions in paginated mode are weird. Height is huge because of the blank space left below content.

Steps to reproduce the issue/enhancement:

  1. Version in the Kotlin toolkit, in an Android WebView
  2. No custom properties injected

What is the expected behaviour? No blank space below content, a height value of the screen height.

What is the current behaviour? Capture d’écran du 2024-11-22 09-21-10

JayPanoz commented 5 days ago

Alright, so after checking old screenshots from years ago, the good news is that it’s always been like that. And it doesn’t impact document.scrollableElement negatively.

The bad news is that I can’t explain why we didn’t add an height to body so that the number is the same as :root/html. Could be that it messed up fragmentation, with lines being clipped at the top or the bottom of columns, but I couldn’t find any confirmation in issues, documentation, nor comments. Or maybe it messed up columns → scroll update, I can’t tell, that was not documented, unfortunately.

This would be a simple fix then (setting a max-height dimension to body in pagination, and resetting it in scroll), but I can’t tell the impact at the moment. This would have to be stress-tested first.