-
Notifications
You must be signed in to change notification settings - Fork 220
Description
While working on a Firefox patch to clip oversized elements during screenshots (to prevent massive canvas allocation failures), we noticed a potential quirk in the classic WebDriver spec.
Right now, the algorithm to draw a bounding box from the framebuffer uses the initial viewport as its reference.
The issue with using initial viewport is that if the browser window gets resized after the page first renders, using those initial dimensions to calculate intersections or bounds can lead to incorrectly clipped screenshots.
It feels like the spec should be updated to use the viewport (or visual viewport) instead. This would actually bring Classic into parity with WebDriver BiDi, which already does the right thing by using the current viewport when getting the origin rectangle.
We're moving ahead with updating the Firefox implementation to match the BiDi logic for this, but it would be great to get the Classic spec updated to reflect this as well so we don't have diverging behaviors!
Let me know what you think.