-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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(render-blocking): handle amp-style stylesheets #4555
Conversation
@@ -90,6 +103,9 @@ | |||
</style> | |||
</template> | |||
|
|||
<!-- Force FCP to be ~5s out, necessary to make sure our render-blocking audits still work --> | |||
<!-- even when other forces were responsible for delaying the render. --> | |||
<script> while (Date.now() - performance.timing.responseStart < 5000) ; </script> |
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.
can we use an add'l stylesheet with delay=5000 instead? Seems more natural.
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.
unfortunately, no. since the only way we assert that we didn't flag the amp stylesheet is by asserting the overall render-blocking stylesheets value is <3s. in the future details, but extendedInfo-style world this will be easier :)
prev.push({ | ||
tag, | ||
transferSize: request.transferSize || 0, | ||
startTime: request.startTime, | ||
endTime: request.endTime, | ||
endTime: Math.min(request.endTime, request.startTime + earliestNonBlockingTime / 1000), |
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.
can you extract request.startTime + earliestNonBlockingTime / 1000)
into a variable above?
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.
done
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.
lgtm just naming ideas.
@@ -30,7 +30,7 @@ function installMediaListener() { | |||
window.___linkMediaChanges.push({ | |||
url: this.href, |
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.
naming bikesheds?
url => href
value => media
time => msSinceHTMLEnd
matches == matches
// Even if the request was initially blocking or appeared to be blocking once the | ||
// page was loaded, the media attribute could have been changed during load, capping the | ||
// amount of time it was render blocking. See https://github.com/GoogleChrome/lighthouse/issues/2832. | ||
const nonMatchingMediaChangeTimes = (tag.mediaChanges || []) |
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.
timesMediaSetToNonBlocking
?
fixes #2832