serenity icon indicating copy to clipboard operation
serenity copied to clipboard

headless-browser: Allow passing the window size as an argument

Open implicitfield opened this issue 2 years ago • 2 comments

This PR also makes the WebContent service respect the window size when taking a screenshot.

implicitfield avatar Dec 12 '23 17:12 implicitfield

Re: the second commit, that is the entire point of that API. See #15934

It is used for take_screenshot(ScreenshotType::Full). There is take_screenshot(ScreenshotType::Visible) to only grab what is visible in the window.

trflynn89 avatar Dec 12 '23 17:12 trflynn89

Ah, I see. This'll need a bit more refactoring then since take_screenshot doesn't return a Bitmap, so drafting this for now.

EDIT: Turns out that take_document_screenshot does far more repainting than take_screenshot, which manages to cover up some situations where neither ViewImplementation's front bitmap nor backup bitmap is valid. Not sure about the root cause of that issue, so I've dropped the second commit from this PR.

implicitfield avatar Dec 12 '23 17:12 implicitfield

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Jan 03 '24 22:01 stale[bot]

This pull request has been closed because it has not had recent activity. Feel free to re-open if you wish to still contribute these changes. Thank you for your contributions!

stale[bot] avatar Jan 13 '24 10:01 stale[bot]