serenity icon indicating copy to clipboard operation
serenity copied to clipboard

LibWeb: Set size of canvas used to take WebDriver screenshots explicitly

Open ADKaster opened this issue 2 years ago • 1 comments

The default canvas size is 150x150 pixels. If the element or document we are trying to screenshot for the WebDriver is not at least that size, then we will create a canvas that is taller or larger than the actual element we are painting, resulting in a bunch of transparent pixels falling off the end.

This fixes 14 WPT css/CSS2/floats tests that we run in CI, and presumably a ton of other reftests in the WPT test suite.

ADKaster avatar Feb 21 '24 00:02 ADKaster

The default canvas size is 150x150 pixels

Spec says it is 300px x 150px https://html.spec.whatwg.org/multipage/canvas.html#attr-canvas-width

kalenikaliaksandr avatar Feb 21 '24 00:02 kalenikaliaksandr

Spec says it is 300px x 150px html.spec.whatwg.org/multipage/canvas.html#attr-canvas-width

Fixed in the commit message and PR desc, thanks!

ADKaster avatar Feb 21 '24 01:02 ADKaster