headless-browser: Allow passing the window size as an argument
This PR also makes the WebContent service respect the window size when taking a screenshot.
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.
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.
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!
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!