CSS: add a few style tweaks helpers, and other fixes #485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CSS: add "
-cr-hint: late
" to increase selectors specificityShould allow
'* { -cr-hint: late; ... }'
to be checked and applied after other selectors with higher specifity.This can be useful with style tweaks, and makes tweaks a lot simpler.
See koreader/koreader#5863 (comment)
CSS: add a few non-static "
-cr-only-if
:" valuesExisting values are static, and depend on the document and rendering options.
Add a few non-static ones, that need to be saved in the declaration and checked on each node.
This allows such combinations:
See koreader/koreader#5863 (comment)
getStyledImageSize(): fix missing images when gRenderDPI=0
When
gRenderDPI
=0 (old crengine behaviour),lengthToPx()
returns 0 for absolute CSS units (in, cm, mm, pt, pc), which might be ok for margins and such, but not for images: we want non-zero w/h: so do as if no style when the unit is one of these, to avoid missing images.See koreader/koreader#9281 (comment)
Text: fix possible crash with floats and
<br/>
With:
<p><span dir="ltr"><img src="..." style="float: right"/><br/></span></p>
we would crash soon after with:
FATAL ERROR #130: Unexpected object type for word
This just avoids getting this fatal error, but does not really do the proper handling this edgy construction should get.
(Noticed while trying to test/understand why we got blank pages with the book from koreader/koreader#9281 - it looks like we don't really handle correctly paragraphs made only of collapsed spaces, ignorable bidi unicode chars, and floats....)
LVImg: fix crash on GIF images without color table
See koreader/koreader#9297 (comment)
Should allow closing koreader/koreader#9297
This change is