-
Notifications
You must be signed in to change notification settings - Fork 45
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
Measure ad-related layout shift #205
Conversation
|
||
// Maybe we should look at the parent elements (created by the publisher and | ||
// passed to the ad tag) rather than the iframe itself. | ||
const ads = iframes.filter(isGptIframe); |
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.
Does it make sense to filter only ads in the viewport?
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.
i don't think so. Layout shift events are already limited to user-visible events and there shouldn't be too many ads for this to be a performance concern.
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.
But I'll see how much code complexity it adds
Measures ad-related layout shift by summing scores across layout shifts where the
old_rect
was later occupied by an ad.Some possible TODOs for follow-up PRs
Feedback would be appreciated