chromium-bidi
chromium-bidi copied to clipboard
Document screenshots are not using document scroll height
The issue can be reproduced by the following test in Puppeteer:
it('should work with odd clip size on Retina displays', async () => {
const {page} = await getTestState();
const screenshot = await page.screenshot({
clip: {
x: 0,
y: 0,
width: 11,
height: 11,
},
});
expect(screenshot).toBeGolden('screenshot-clip-odd-size.png');
});
The screenshot is taken using origin=document. The test passes in Chrome while it should not according to the spec. The spec says that the document elements scroll height should be used to determine the screenshot size and in this case the scroll height is only 8px so it should not be possible to generate the screenshot with the height of 11px.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1873090
@jrandolf it looks like the final spec text deviated from the original intention here? at least it looks like chromium-bidi implementation is not matching the spec completely so it is possible that a screenshot with fullPage=true is smaller than the fullPage=false. WDYT? it looks like we should fix it on the chromium-bidi side and adjust Puppeteer tests.
There was some discussion on Matrix.
We will fix the issue in Chromium BiDi.