Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core(full-page-screenshot): resolve inaccuracies related to dpr #11532

Closed
wants to merge 1 commit into from

Conversation

connorjclark
Copy link
Collaborator

Fixes #11121

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DPR change itself looks fine but exposed issue with our reset?

@@ -31,7 +31,6 @@ class FullPageScreenshot extends Gatherer {
async _takeScreenshot(passContext, maxScreenshotHeight) {
const driver = passContext.driver;
const metrics = await driver.sendCommand('Page.getLayoutMetrics');
const deviceScaleFactor = await driver.evaluateAsync('window.devicePixelRatio');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taking another look at our reset, shouldn't we collect DPR, width, height, etc before we muck with all of it using our emulation override?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that was an oversight. I'll open a separate PR for that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright 👍

@@ -48,7 +47,7 @@ class FullPageScreenshot extends Gatherer {
screenHeight: height,
width,
screenWidth: width,
deviceScaleFactor,
deviceScaleFactor: 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to this moment, the page has a DPR of 2.625, at least in our own mobile emulation.

Switching the page to be DPR of 1 is a significant change and could trigger all sorts of different media queries and srcset rules that weren't used before.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh kinda felt like all bets were off on reacting to a page that's 16000px tall to me. Do you suspect this is going to be fundamentally worse? (I was also under the impression the screenshot would happen after the first render not necessarily waiting for many images to load from the network, is that not the case?)

@connorjclark
Copy link
Collaborator Author

Closing, I think we have a different problem to solve. see #11121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

full-page-screenshot: handle elements beyond MAX_SCREENSHOT_HEIGHT
4 participants