diff --git a/apps/readest-app/src/__tests__/document/paginator-duokan-cover.browser.test.ts b/apps/readest-app/src/__tests__/document/paginator-duokan-cover.browser.test.ts index 05938081..21393302 100644 --- a/apps/readest-app/src/__tests__/document/paginator-duokan-cover.browser.test.ts +++ b/apps/readest-app/src/__tests__/document/paginator-duokan-cover.browser.test.ts @@ -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); diff --git a/packages/foliate-js b/packages/foliate-js index 18d304bd..828d6132 160000 --- a/packages/foliate-js +++ b/packages/foliate-js @@ -1 +1 @@ -Subproject commit 18d304bd6201fb65fac20b7e39cfc630d4f2db1b +Subproject commit 828d6132ea4ad973657b68832f18757dbb289f85