New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FB2 image sizing & centering, and bottom border on empty block elements #563
Conversation
Assertions in LVFontCache::_removeDocumentFonts() would fail (when DEBUG enabled).
Followup to 1544bcf, where we made an image self container's width adjust to the image width, so text-align:center no longer does what was expected. Switch to margin-left/right:auto to get them centered again. Also, for standalone block images, set the strut and line-height to 0 (as we do for HTML) so they their block is adjusted to the page height when the image itself exceeds it, to avoid such images to be truncated and sliced on two pages.
There's a whole bunch of margin collapse test cases over here btw. "8.3.1 collapsing margins" http://test.csswg.org/suites/css21_dev/20110323/xhtml1/chapter-8.xht |
NOT passing in the current version:
and, um, probably all following but I got bored. :-) |
The ones that fail are related to overflow, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, lgtm
PS It's positioning
^_^
Fix some possible issues with empty block elements having some bottom border (included in padding_bottom) when previous vertical margins are collapsing. (Not 100% certain this is the right fix that won't cause side effects...)
EPUB: avoid crash when
@font-face
in<head><style>
Assertions in
LVFontCache::_removeDocumentFonts()
would fail (when DEBUG enabled).Noticed and investigated at #536 (comment).
FB2: fix block images sizing and centering
Followup to 1544bcf, where we made an image self container's width adjust to the image width, so
text-align:center
no longer does what was expected. Switch tomargin-left/right:auto
to get them centered again. See koreader/koreader#11623 (comment).Also, for standalone block images, set the strut and line-height to 0 (as we do for HTML) so they their block is adjusted to the page height when the image itself exceeds it, to avoid such images to be truncated and sliced on two pages. Noticed and investigated in #562.
Should allow closing koreader/koreader#11623.
lvrend: fix positionning of bottom border on empty block elements
Fix some possible issues with empty block elements having some bottom border (included in padding_bottom) when previous vertical margins are collapsing.
(Not 100% certain this is the right fix that won't cause side effects...)
Should allow closing koreader/koreader#11594.
This change is