fix(reader): stretch Duokan fullscreen cover to fill the page (#4679)

Bump foliate-js so paginated Duokan full-page covers
(data-duokan-page-fullscreen) render with object-fit: fill instead of
contain. The cover now fills the whole page, distorting to fit when the
aspect ratio differs, matching Duokan's native full-page render. Adds a
browser test asserting the fullscreen cover computes object-fit: fill.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Huang Xin
2026-06-20 11:33:47 +08:00
committed by GitHub
parent f7e1bddda6
commit a9526377a2
2 changed files with 20 additions and 1 deletions
@@ -104,6 +104,25 @@ describe('Paginator Duokan fullscreen cover (#4379)', () => {
expect(img!.offsetHeight).toBeGreaterThan(0);
});
it('stretches the fullscreen cover to fill the page (object-fit: fill)', async () => {
paginator = createPaginator();
paginator.open(book);
const stabilized = waitForStabilized(paginator);
await paginator.goTo({ index: 0 });
await stabilized;
const img = getCoverImg(paginator);
expect(img).toBeTruthy();
await waitForImgLoaded(img!);
await waitForVisibleHeight(img!);
// The fullscreen treatment stretches the cover edge-to-edge, ignoring the
// image's aspect ratio, to match Duokan's native full-page rendering.
const cs = img!.ownerDocument.defaultView!.getComputedStyle(img!);
expect(cs.objectFit).toBe('fill');
});
it('shows the cover image in scrolled mode', async () => {
paginator = createPaginator();
paginator.open(book);