bump crengine: support inline-block, better text selection (#5763)

Includes:
- lvtinydom.cpp: fix Use-after-free
- lvtextfm: fix/cleanup lastnonspace code bits
- lvtextfm: fix vertical-align: top & bottom
- renderBlockElementEnhanced: minor fixes related to floats
- renderBlockElementEnhanced: compute baseline of block
- Add support for display: inline-block/inline-table
- Better selection highlighting by using getSegmentRects()
- getHtml(): add flag to get text soft-hyphenated

cre.cpp: toggable text selection highlighting method,
default to the new one using segments.

Update various cre flags to use the new features (and
to conform with some flags re-ordering):
- support display: inline-block in flat, book and web
  render modes.
- get HTML with soft-hyphens for footnote popups, so MuPDF
  can use them when rendering the footnote.
This commit is contained in:
poire-z
2020-01-14 01:14:15 +01:00
committed by GitHub
parent 4a6b8587d7
commit 7eee758149
4 changed files with 16 additions and 10 deletions

View File

@@ -783,17 +783,19 @@ function ReaderHighlight:viewSelectionHTML(debug_view)
end
if self.selected_text and self.selected_text.pos0 and self.selected_text.pos1 then
-- For available flags, see the "#define WRITENODEEX_*" in crengine/src/lvtinydom.cpp
local html_flags = 0x3030 -- valid and classic displayed HTML, with only block nodes indented
-- Start with valid and classic displayed HTML (with only block nodes indented),
-- including styles found in <HEAD>, and linked CSS files content.
local html_flags = 0x6030
if not debug_view then
debug_view = 0
end
if debug_view == 1 then
-- Each node on a line, with markers and numbers of skipped chars and siblings shown,
-- with possibly invalid HTML (text nodes not escaped)
html_flags = 0x3353
html_flags = 0x635A
elseif debug_view == 2 then
-- Additionally see rendering methods and unicode codepoint of each char
html_flags = 0x3757
html_flags = 0x675E
end
local html, css_files = self.ui.document:getHTMLFromXPointers(self.selected_text.pos0,
self.selected_text.pos1, html_flags, true)