mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Currently, `elementHandle.screenshot` passes bounding box into the `page.captureScreenshot` method. This is wrong since `captureScreenshot` accepts viewport, not bounding box. This patch uses layout metrics to convert bounding box into viewport. Fixes #1315.
168 B
54x54px
168 B
54x54px
![](/github/puppeteer/raw/commit/3d7ae2a2591a55e4f94c67d62a22f7103698cba5/test/golden/screenshot-element-scrolled-into-view.png)