Skip to content

bump crengine: CSS enhancements and other fixes, improve text selection#2270

Merged
poire-z merged 3 commits into
koreader:masterfrom
poire-z:bump_crengine
Feb 14, 2026
Merged

bump crengine: CSS enhancements and other fixes, improve text selection#2270
poire-z merged 3 commits into
koreader:masterfrom
poire-z:bump_crengine

Conversation

@poire-z

@poire-z poire-z commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

bump crengine: CSS enhancements and other fixes

Includes:

cre.cpp: add requestRender()

Currently not used, but was requested for some user-patch koreader/koreader#13462.
Might be useful some day for frontend to trigger a re-rendering, bypassing crengine own hashes checks.

cre.cpp: getTextFromPositions(): improvements

Update logic to account for crengine's change "ldomDocument::createXPointer(pt): better consistency" after which we no longer get different xpointers whether in the left or right half of a glyph.
This make single char selection easier and consistent.
Also make selection when pointing in the margins more natural, avoiding grabbing any content on prev/next lines when panning in the opposite direction.
(the diff shows not-real changes because of switch from annoying tabs to spaces.)

Painfully achieved over the last 18 months and the many edge cases noticed in koreader/koreader#12135. It's not perfect, the changes are not always accurately explainable, but after many ideas, these ones seem to get me something I'm satisfied with, while staying quite simple.
Should allow closing koreader/koreader#12135.


This change is Reviewable

Includes:
- Add support for CSS width: fit-content
- fb2def.h: add a few common attributes
- lvtext: includes src->t.offset in word->t.start
- CSS: support for pseudo element ::first-letter
- ::first-letter: fix when single letter text node
- ldomXPointer::getRectEx(): return optional context
- ldomXRange::getSegmentRects(): fix when BiDi/RTL
- testAuthorDotTitleFormat: fix off-by-one error
- Epub ncx TOC: don't skip items with invalid href
- Avoid some compiler warnings
- ldomDocument::createXPointer(pt): better consistency
- CSS: add support for "ruby-position: over/under/alternate"
- MathML: don't handle anything when no def style set
Currently not used, but was requested for some user-patch.
Might be useful some day for frontend to trigger a
re-rendering, bypassing crengine own hashes checks.
Update logic to account for crengine's change
"ldomDocument::createXPointer(pt): better consistency"
after which we no longer get different xpointers whether
in the left or right half of a glyph.
This make single char selection easier and consistent.
Also make selection when pointing in the margins more
natural, avoiding grabbing any content on prev/next
lines when panning in the opposite direction.
(the diff shows not-real changes because of switch
from annoying tabs to spaces.)

@Frenzie Frenzie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump together with those other PRs?

@poire-z

poire-z commented Feb 14, 2026

Copy link
Copy Markdown
Contributor Author

Yes, go ahead, merge them first.

@poire-z poire-z merged commit 0f56ce5 into koreader:master Feb 14, 2026
3 checks passed
@poire-z poire-z deleted the bump_crengine branch February 14, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants