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

report: do not show element screenshot if out of bounds #11538

Merged
merged 3 commits into from
Oct 8, 2020

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Oct 8, 2020

ref #11121

image

@connorjclark connorjclark requested a review from a team as a code owner October 8, 2020 16:47
@connorjclark connorjclark requested review from brendankenny and removed request for a team October 8, 2020 16:47
@google-cla google-cla bot added the cla: yes label Oct 8, 2020
Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

Fixes #11121

also you'll have to hash out if this DPR stuff is resolved with @patrickhulce and/or @paulirish if we want to close that :)

lighthouse-core/report/html/renderer/details-renderer.js Outdated Show resolved Hide resolved
@@ -17,6 +17,22 @@
/** @typedef {LH.Artifacts.Rect} Rect */
/** @typedef {{width: number, height: number}} Size */

/**
* Returns whether rect2 is contained entirely within rect1;
Copy link
Member

@brendankenny brendankenny Oct 8, 2020

Choose a reason for hiding this comment

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

Returns whether rect2 is contained entirely within rect1

should it not have a screenshot even if it's partially in bounds? e.g. what if just a few pixels are over the edge? Alternative would be to clip to bounds (and maybe return null if some percentage threshold isn't shown or something).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

eh, I'm inclined to keep it like this as it's simpler and this seems like an edge case (hehe).

Copy link
Member

Choose a reason for hiding this comment

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

fair enough :)

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

This change LGTM, whether or not it fully resolves #11121. Maybe we should land this but leave that issue open until all parties agree and/or we discuss next eng sync?

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.

None yet

3 participants