From b498d872be328bf14e2ab81b66a6ab708cd3c3d6 Mon Sep 17 00:00:00 2001 From: poire-z Date: Fri, 25 May 2018 00:22:08 +0200 Subject: [PATCH] bump crengine: LI and CITE fixes are now the defaults (#3976) Books previously opened (that have a metadata.lua, whether with highlights or not, but because they all have a last_xpointer that points to the current page, that can be broken too by the changes) will continue to have the old wrong behaviour, so they won't be impacted by the breaking changes. Update cre_dom_version code to use the new functions from cre.cpp. Remove these Workarounds from Style tweaks. --- base | 2 +- .../apps/reader/modules/readerstyletweak.lua | 1 + frontend/document/credocument.lua | 9 +++---- frontend/ui/data/css_tweaks.lua | 26 ------------------- frontend/ui/wikipedia.lua | 4 --- 5 files changed, 5 insertions(+), 37 deletions(-) diff --git a/base b/base index 354d71a97..5c230bc5e 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 354d71a97837708e4f91a69a8ceaf47077ce2cf9 +Subproject commit 5c230bc5e906fd1a7b67907168b19bc9312419e2 diff --git a/frontend/apps/reader/modules/readerstyletweak.lua b/frontend/apps/reader/modules/readerstyletweak.lua index b997f8247..fe3739fd6 100644 --- a/frontend/apps/reader/modules/readerstyletweak.lua +++ b/frontend/apps/reader/modules/readerstyletweak.lua @@ -380,6 +380,7 @@ You can enable individual tweaks on this book with a tap, or view more details a end, enabled_func = is_enabled, sub_item_table = sub_item_table, + separator = item.separator, }) elseif item.id then -- tweak menu item -- Set a default priority of 0 if item doesn't have one diff --git a/frontend/document/credocument.lua b/frontend/document/credocument.lua index b015a49d3..78b9ad4aa 100644 --- a/frontend/document/credocument.lua +++ b/frontend/document/credocument.lua @@ -20,7 +20,6 @@ local CreDocument = Document:new{ _document = false, _loaded = false, - _cre_dom_version = nil, line_space_percent = 100, default_font = "Noto Serif", @@ -121,9 +120,6 @@ function CreDocument:init() error(self._document) -- will contain error message end - -- get DOM engine latest version - self._cre_dom_version = self._document:getIntProperty("crengine.dom.version") - -- adjust font sizes according to screen dpi self._document:adjustFontSizes(Screen:getDPI()) @@ -143,7 +139,7 @@ function CreDocument:init() end function CreDocument:getLatestDomVersion() - return self._cre_dom_version + return cre.getLatestDomVersion() end function CreDocument:getOldestDomVersion() @@ -151,7 +147,8 @@ function CreDocument:getOldestDomVersion() end function CreDocument:requestDomVersion(version) - self._document:setIntProperty("crengine.dom.version", version) + logger.dbg("CreDocument: requesting DOM version:", version) + cre.requestDomVersion(version) end function CreDocument:loadDocument(full_document) diff --git a/frontend/ui/data/css_tweaks.lua b/frontend/ui/data/css_tweaks.lua index b09bcac82..93bf3f38c 100644 --- a/frontend/ui/data/css_tweaks.lua +++ b/frontend/ui/data/css_tweaks.lua @@ -128,32 +128,6 @@ img { }, { title = _("Workarounds"), - { - id = "html_tags_fix"; - title = _("Correct handling of some HTML elements"), - description = _("Make some HTML elements (eg: ) behave as they should (inline/block).\nThis may break past bookmarks and highlights."), - css = [[ -cite { display: inline; font-style: italic; } - ]], - }, - { - id = "list_item_block"; - title = _("Better rendering of list items"), - description = _("Correctly render list items as block elements.\nThis may break past bookmarks and highlights."), - css = [[ -li {display: -cr-list-item-block; } - ]], - }, - { - id = "list_items_fix"; - title = _("Fix some list items issues"), - description = _("Work around some crengine list items rendering issues."), - css = [[ -li > p:first-child { display: inline !important; } -li > div:first-child { display: inline !important; } - ]], - separator = true, - }, { id = "border_all_none"; title = _("Remove all borders"), diff --git a/frontend/ui/wikipedia.lua b/frontend/ui/wikipedia.lua index 1d92e5f71..ea457c58f 100644 --- a/frontend/ui/wikipedia.lua +++ b/frontend/ui/wikipedia.lua @@ -963,10 +963,6 @@ ul, ol { li.gallerybox { display: inline; } -/* helps crengine to not display them as block elements */ -time, abbr, sup { - display: inline; -} ]]) -- ----------------------------------------------------------------