-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Conversation
There was a problem hiding this 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/element-screenshot-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; |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough :)
lighthouse-core/report/html/renderer/element-screenshot-renderer.js
Outdated
Show resolved
Hide resolved
lighthouse-core/test/report/html/renderer/element-screenshot-renderer-test.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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?
ref #11121