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
![](/thunderstrike/puppeteer/raw/commit/c4b1ac99b0099ae6cb291fa11ff19e1eaeab1ff6/test/golden/screenshot-element-scrolled-into-view.png)