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): drop max datauri size constraints #11689

Merged
merged 12 commits into from
Nov 25, 2020

Conversation

paulirish
Copy link
Member

(this PR is building off #11688 )

back here i discovered this data uri limit that was in the implementation wasn't a real limit. #11402 (comment) patrick confirmed.

I made another test here:

image

The chromium bug regarding that limit: https://bugs.chromium.org/p/chromium/issues/detail?id=69227 Yah as patrick said, it's likely this limit is about the data uri that you can navigate to in chrome. I definitely can't nav to a 2.5MB data uri. But it's totally fine as an <img src>

@paulirish paulirish requested a review from a team as a code owner November 20, 2020 00:12
@paulirish paulirish requested review from adamraine and removed request for a team November 20, 2020 00:12
@google-cla google-cla bot added the cla: yes label Nov 20, 2020
}
}

let screenshot = await this._takeScreenshot(passContext);
Copy link
Member

Choose a reason for hiding this comment

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

nit: Can we remove the afterPass_ function and call _takeScreenshot directly?

@@ -119,8 +103,6 @@ class FullPageScreenshot extends Gatherer {
return {
width: document.documentElement.clientWidth,
height: document.documentElement.clientHeight,
screenWidth: window.screen.width,
Copy link
Member

Choose a reason for hiding this comment

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

Was this necessary before this patch? Looks like screenWidth and screenHeight are not change in this gatherer.

Copy link
Member Author

Choose a reason for hiding this comment

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

fair. i meant to include it in #11688 instead. just moved it there.

Copy link
Member

@adamraine adamraine left a comment

Choose a reason for hiding this comment

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

LGTM

@connorjclark
Copy link
Collaborator

connorjclark commented Nov 23, 2020

Did you test in other browsers?

Also, this isn't just preventing a possibly faulty image, it also attempts to put a cap on how much data a screenshot will be (the soon-to-be largest part of the LHR). For that purpose, maybe we ought to just lessen the quality instead of capping the height?

@connorjclark connorjclark changed the title core(fps): drop max datauri size constraints core(full-page-screenshot): drop max datauri size constraints Nov 24, 2020
@paulirish
Copy link
Member Author

Did you test in other browsers?

tested with a 14.9MB data uri string. works great in chrome/saf/ff.

Also, this isn't just preventing a possibly faulty image, it also attempts to put a cap on how much data a screenshot will be (the soon-to-be largest part of the LHR). For that purpose, maybe we ought to just lessen the quality instead of capping the height?

kinda frustrating....

so i feel confident i've put the max_datauri_size issue to bed. the comments/code were wrong and i've proven that.

as for LHR data size.. agree the FPS is big. but, we don't have any criteria to determine an LHR is too big. So I don't see a great path forward in picking a threshold to retake a smaller screenshot.

@connorjclark
Copy link
Collaborator

so i feel confident i've put the max_datauri_size issue to bed. the comments/code were wrong and i've proven that.

Yea, we're on the same page here. This change LGTM

as for LHR data size.. agree the FPS is big. but, we don't have any criteria to determine an LHR is too big. So I don't see a great path forward in picking a threshold to retake a smaller screenshot.

Just pointing out the secondary effect of this change. If we don't want to address it now, at least we might recall this is a way to shrink an LHR in the future if a specific need arises.

@paulirish paulirish mentioned this pull request Nov 24, 2020
3 tasks
Base automatically changed from dpr1 to master November 24, 2020 21:12
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.

4 participants