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:
@@ -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);
|
||||
|
||||
+1
-1
Submodule packages/foliate-js updated: 18d304bd62...828d6132ea
Reference in New Issue
Block a user