-
Notifications
You must be signed in to change notification settings - Fork 45
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
Page splitting: revamp, fix some issues #443
Conversation
Fix lvstring.cpp:127:42: runtime error: signed integer overflow: 1775760480 * 31 cannot be represented in type 'int'
Direct leak of 64 byte(s) in 4 object(s) allocated from: 00 in operator new(unsigned long) (libasan.so.6+0xb0087) 01 in OpcPart::readRelations() lvopc.cpp:73 02 in OpcPart::getRelatedPartName(char32_t const*, lString32) lvopc.cpp:33 03 in fb3ImportContext::openBook() fb3fmt.cpp:142 Indirect leak of 512 byte(s) in 4 object(s) allocated from: 00 in operator new[](unsigned long) (libasan.so.6+0xb01f7) 01 in LVHashTable<lString32, lString32>::LVHashTable(int) lvhashtable.h:107 02 in OpcPart::readRelations() lvopc.cpp:73 03 in OpcPart::getRelatedPartName(char32_t const*, lString32) lvopc.cpp:33 04 in fb3ImportContext::openBook() fb3fmt.cpp:142 Indirect leak of 96 byte(s) in 4 object(s) allocated from: 00 in operator new(unsigned long) (libasan.so.6+0xb0087) 01 in LVHashTable<lString32, lString32>::set(lString32 const&, lString32) vhashtable.h:174 02 in OpcPart::readRelations() lvopc.cpp:77 03 in OpcPart::getRelatedPartName(char32_t const*, lString32) lvopc.cpp:33 04 in fb3ImportContext::openBook() fb3fmt.cpp:142
Direct leak of 64 byte(s) in 1 object(s) allocated from: 00 in operator new(unsigned long) (libasan.so.6+0xb0087) 01 in tinyNodeCollection::allocTinyElement(ldomNode*, unsigned short, unsigned short) lvtinydom.cpp:16430 02 in ldomDocument::ldomDocument() lvtinydom.cpp:4136 03 in LVDocView::createEmptyDocument() lvdocview.cpp:4797 04 in LVDocView::loadDocumentInt(LVFastRef<LVStream>, bool) lvdocview.cpp:4438 05 in LVDocView::LoadDocument(char32_t const*, bool) lvdocview.cpp:4127
Direct leak of 128 byte(s) in 2 object(s) allocated from: 0 in operator new(unsigned long) (libasan.so.6+0xb0087) 1 in ldomNode::modify() lvtinydom.cpp:19148 2 in ldomNode::removeChild(unsigned int) lvtinydom.cpp:18643 3 in ldomNode::removeChildren(int, int) lvtinydom.cpp:5845 4 in ldomNode::autoboxChildren(int, int, bool) lvtinydom.cpp:5995 5 in ldomNode::initNodeRendMethod() lvtinydom.cpp:6842 6 in ldomElementWriter::onBodyExit() lvtinydom.cpp:7815 7 in ldomElementWriter::~ldomElementWriter() lvtinydom.cpp:7955 8 in ldomDocumentWriterFilter::popUpTo(ldomElementWriter*, unsigned short, int) lvtinydom.cpp:13895 9 in ldomDocumentWriterFilter::AutoOpenClosePop(int, unsigned short) lvtinydom.cpp:14126 10 in ldomDocumentWriterFilter::OnTagClose(char32_t const*, char32_t const*, bool) lvtinydom.cpp:14657 11 in LVXMLParser::Parse() lvxmlparser.cpp:278 Direct leak of 64 byte(s) in 1 object(s) allocated from: 0 in operator new(unsigned long) (libasan.so.6+0xb0087) 1 in ldomNode::modify() lvtinydom.cpp:19148 2 in ldomNode::insertChildElement(unsigned int, unsigned short, unsigned short) lvtinydom.cpp:18534 3 in ldomNode::autoboxChildren(int, int, bool) lvtinydom.cpp:5974 4 in ldomNode::initNodeRendMethod() lvtinydom.cpp:6842 5 in ldomElementWriter::onBodyExit() lvtinydom.cpp:7815 6 in ldomElementWriter::~ldomElementWriter() lvtinydom.cpp:7955 7 in ldomDocumentWriterFilter::popUpTo(ldomElementWriter*, unsigned short, int) lvtinydom.cpp:13895 8 in ldomDocumentWriterFilter::AutoOpenClosePop(int, unsigned short) lvtinydom.cpp:14126 9 in ldomDocumentWriterFilter::OnTagClose(char32_t const*, char32_t const*, bool) lvtinydom.cpp:14657 Direct leak of 64 byte(s) in 1 object(s) allocated from: 0 in operator new(unsigned long) (libasan.so.6+0xb0087) 1 in tinyNodeCollection::allocTinyElement(ldomNode*, unsigned short, unsigned short) lvtinydom.cpp:16424 2 in ldomNode::insertChildElement(unsigned int, unsigned short, unsigned short) lvtinydom.cpp:18538 3 in ldomNode::autoboxChildren(int, int, bool) lvtinydom.cpp:5974 4 in ldomNode::initNodeRendMethod() lvtinydom.cpp:6842 5 in ldomElementWriter::onBodyExit() lvtinydom.cpp:7815 6 in ldomElementWriter::~ldomElementWriter() lvtinydom.cpp:7955 7 in ldomDocumentWriterFilter::popUpTo(ldomElementWriter*, unsigned short, int) lvtinydom.cpp:13895 8 in ldomDocumentWriterFilter::AutoOpenClosePop(int, unsigned short) lvtinydom.cpp:14126 9 in ldomDocumentWriterFilter::OnTagClose(char32_t const*, char32_t const*, bool) lvtinydom.cpp:14657 10 in LVXMLParser::Parse() lvxmlparser.cpp:278 11 in LVHTMLParser::Parse() lvhtmlparser.cpp:157 Direct leak of 144 byte(s) in 2 object(s) allocated from: 0 in operator new(unsigned long) (libasan.so.6+0xb0087) 1 in CCRTable::LookupElem(ldomNode*, int, int) (cr3qt/cr3+0x1f6681a) 2 in CCRTable::LookupElem(ldomNode*, int, int) (cr3qt/cr3+0x1f65cb3) 3 in CCRTable::CCRTable(ldomNode*, int, bool, int, int, bool, bool, int, bool) lvrend.cpp:2243 4 in renderTable(LVRendPageContext&, ldomNode*, int, int, int, bool, int, int&, int, bool, bool, bool) lvrend.cpp:2276 5 in renderBlockElementEnhanced(FlowState*, ldomNode*, int, int, unsigned int) lvrend.cpp:7639 6 in renderBlockElementEnhanced(FlowState*, ldomNode*, int, int, unsigned int) lvrend.cpp:7860 7 in renderBlockElement(LVRendPageContext&, ldomNode*, int, int, int, int, int, int, int*, unsigned int) lvrend.cpp:8393 8 in renderBlockElement(LVRendPageContext&, ldomNode*, int, int, int, int, int, int, int*) lvrend.cpp:8409 9 in LVFormatter::measureText() lvtextfm.cpp:2045 10 in LVFormatter::processParagraph(int, int, bool) lvtextfm.cpp:3809 11 in LVFormatter::splitParagraphs() lvtextfm.cpp:4461 12 in LVFormatter::format() lvtextfm.cpp:4508 13 in LFormattedText::Format(unsigned short, unsigned short, int, int, int, bool, BlockFloatFootprint*) lvtextfm.cpp:4612 14 in ldomNode::renderFinalBlock(LVRef<LFormattedText>&, RenderRectAccessor*, int, BlockFloatFootprint*) lvtinydom.cpp:19074 15 in renderBlockElementEnhanced(FlowState*, ldomNode*, int, int, unsigned int) lvrend.cpp:8167 Indirect leak of 896 byte(s) in 28 object(s) allocated from: 0 in __interceptor_realloc (libasan.so.6+0xaea88) 1 in lxmlAttribute* cr_realloc<lxmlAttribute>(lxmlAttribute*, unsigned long) (cr3qt/cr3+0x1c890d6) 2 in ldomAttributeCollection::set(unsigned short, unsigned short, unsigned int) lvtinydom.cpp:3933 3 in ldomNode::setAttributeValue(unsigned short, unsigned short, char32_t const*) lvtinydom.cpp:17001 4 in fixupMathML mathml.cpp:2157 5 in fixupMathMLRecursive mathml.cpp:1737 6 in fixupMathMLRecursive mathml.cpp:1734 14 in fixupMathMLRecursive mathml.cpp:1734 15 in fixupMathMLMathElement(ldomNode*) mathml.cpp:1708 16 in ldomNode::initNodeRendMethod() lvtinydom.cpp:7777 17 in ldomElementWriter::onBodyExit() lvtinydom.cpp:7819 18 in ldomElementWriter::~ldomElementWriter() lvtinydom.cpp:7959
Footnote links inside floats were previously associated to the line before the float, which could make them shown on the previous page if the float needs a page break to be shown without break. We now delay these links associations, and associate them only when the float is fully passed by, so the footnote is never before the float.
Rewritten page splitter, which should be easier to understand and tweak. The old code was quite tedious, trying to do everything in one single pass. This new code first finds out group of consecutive lines that should be kept together (break avoid), and process each group when they end, and only then the footnotes they contain (with delay if they don't fit). This fixes 2 small issues: - footnotes could slice a paragraph with floats on the line the footnotes happen; now, they are delayed till the end of the block, and the full block can go to the next page (with its footnotes) if it is taller than the current page. - if a first footnote and its separator didn't fit on a page, a new page was made so it can be added, leaving some blank at bottom of previous page ; now, we delay footnotes in this case, allowing an additional line of the main text to be added if it fits.
No more CI checks :( |
Oh right, I forgot we were still using Travis here and there. I'll look into it. |
Well, yes, it would be more correct. |
Let's wait a week (unless you want to prep it, I can do some final editing and tagging pretty quickly most days). My cat is seriously sick. I'm in the waiting room atm with nothing to do but I didn't bring my laptop. |
Sorry to hear about your cat :/
You mean for the release, or for merging this PR ? |
I mean the release, yes. |
References <koreader#443 (comment)>.
References <#443 (comment)>. With fetch-depth: 0 is required for comparing to origin/master Also see actions/runner#342 for notes on $TRAVIS_COMMIT_RANGE.
(Upstream) lvstring: fix signed integer overflow
(Upstream) lvopc: fix memory leak
(Upstream) ldomDocument(): fix memory leak
(Upstream) lvtinydom: fix memory leaks
From buggins/coolreader#299
LVArray: fix indexOf() to work with any type
Fix oversight in our decb46c / buggins/coolreader@a112014#diff-f37b0ebc86a9c3391b92d47a8dce2d3cdb5cc270e2dcf07b4ef73af5e1d4af6f I guess,
(Pinging @virxkane for info).
LVDocView: fix m_twoVisiblePagesAsOnePageNumber uninitialised
CSS: line-break: accept "-cr-loose" to ignore no-break-spaces
Can be handy to counteract #423 (comment).
CSS: font-variant: extend effect of "normal" and "none"
See, and should allow closing koreader/koreader#7913.
lvrend: fix BlockFloat footnotes context line associations
Footnote links inside floats were previously associated to the line before the float, which could make them shown on the previous page if the float needs a page break to be shown without break.
We now delay these links associations, and associate them only when the float is fully passed by, so the footnote is never before the float.
In-page footnotes: support links inside inline-block
Was too lazy to handle it at the time, turned out it wasn't that complicated :)
Page splitting: revamp, fix some issues
Rewritten page splitter, which should be easier to understand and tweak.
The old code was quite tedious, trying to do everything in one single pass.
This new code first finds out group of consecutive lines that should be kept together (break avoid), and process each group when they end, and only then the footnotes they contain (with delay if they don't fit).
This fixes 2 small issues (see koreader/koreader#5031 (comment)):
This change is