{"action":"created","issue":{"url":"https://api.github.com/repos/readium/readium-shared-js/issues/206","labels_url":"https://api.github.com/repos/readium/readium-shared-js/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/readium/readium-shared-js/issues/206/comments","events_url":"https://api.github.com/repos/readium/readium-shared-js/issues/206/events","html_url":"https://github.com/readium/readium-shared-js/issues/206","id":103739937,"number":206,"title":"[Android Weview] Reflowable view:  Wrong scrollHeight returned when launching the reader","user":{"login":"don-jomedia","id":8886701,"avatar_url":"https://avatars.githubusercontent.com/u/8886701?v=3","gravatar_id":"","url":"https://api.github.com/users/don-jomedia","html_url":"https://github.com/don-jomedia","followers_url":"https://api.github.com/users/don-jomedia/followers","following_url":"https://api.github.com/users/don-jomedia/following{/other_user}","gists_url":"https://api.github.com/users/don-jomedia/gists{/gist_id}","starred_url":"https://api.github.com/users/don-jomedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/don-jomedia/subscriptions","organizations_url":"https://api.github.com/users/don-jomedia/orgs","repos_url":"https://api.github.com/users/don-jomedia/repos","events_url":"https://api.github.com/users/don-jomedia/events{/privacy}","received_events_url":"https://api.github.com/users/don-jomedia/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/readium/readium-shared-js/labels/Android","name":"Android","color":"fad8c7"},{"url":"https://api.github.com/repos/readium/readium-shared-js/labels/priority%20high%20[critical]","name":"priority high [critical]","color":"eb6420"},{"url":"https://api.github.com/repos/readium/readium-shared-js/labels/ReflowPagination","name":"ReflowPagination","color":"fbca04"},{"url":"https://api.github.com/repos/readium/readium-shared-js/labels/Shared-JS","name":"Shared-JS","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-28T15:29:07Z","updated_at":"2015-08-28T16:40:32Z","closed_at":null,"body":"We are adding a feature to our book reader for our Android application that will remember the last page the user was at in the book and the next time we launch the same book in the book reader, we will set the book at that page.  We are using the book reader bookmarks mechanism for this.\r\n\r\nWhat we are observing is that when we open the book at another location than the default first page of the book, the number of pages for that particular chapter is always close to double the expected number of pages.\r\n\r\nWe traced this in reflowable_view.js, in the updatePagination() method, this call:\r\n\r\n_$epubHtml[0].scrollHeight\r\n\r\nThe value returned for scrollHeight is always wrong at launch, it always larger than what is expected.  The result of that is that number of columns returned (which is the number of pages) is always larger, so we end up with a bunch of blank pages at the end of the chapter.  Once the book is loaded and we switch chapter and then go back to that chapter, the number of pages returned is corrected and we don't have blank pages any longer.\r\n\r\nPlease let us know if you require more details.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/readium/readium-shared-js/issues/comments/135827927","html_url":"https://github.com/readium/readium-shared-js/issues/206#issuecomment-135827927","issue_url":"https://api.github.com/repos/readium/readium-shared-js/issues/206","id":135827927,"user":{"login":"danielweck","id":625201,"avatar_url":"https://avatars.githubusercontent.com/u/625201?v=3","gravatar_id":"","url":"https://api.github.com/users/danielweck","html_url":"https://github.com/danielweck","followers_url":"https://api.github.com/users/danielweck/followers","following_url":"https://api.github.com/users/danielweck/following{/other_user}","gists_url":"https://api.github.com/users/danielweck/gists{/gist_id}","starred_url":"https://api.github.com/users/danielweck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielweck/subscriptions","organizations_url":"https://api.github.com/users/danielweck/orgs","repos_url":"https://api.github.com/users/danielweck/repos","events_url":"https://api.github.com/users/danielweck/events{/privacy}","received_events_url":"https://api.github.com/users/danielweck/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T16:40:32Z","updated_at":"2015-08-28T16:40:32Z","body":"Thank you for reporting this bug. Are you able to reproduce the behaviour with any EPUB, or with those that load CSS font-faces? See: https://github.com/readium/readium-shared-js/pull/179\r\n\r\nGenerally-speaking (i.e. irrespective of font-face delayed rendering), it sounds like `triggerLayout()` does not guarantee that `scrollHeight` is computed correctly? See:\r\nhttps://github.com/readium/readium-shared-js/blob/develop/js/views/reflowable_view.js#L644\r\n\r\nThere are a number of known issues related to reflowable pagination (well, CSS column-ization), but the incorrect `scrollHeight` reported by the web browser is new, I think. See: https://github.com/readium/readium-shared-js/labels/ReflowPagination\r\n\r\n"}}