<<THIS REPOSITORY IS DEPRECATED>> The HTTP Archive provides information about website performance such as # of HTTP requests, use of gzip, and amount of JavaScript. This information is recorded over time revealing trends in how the Internet is performing. Built using Open Source software, the code and data are available to everyone allowing researchers large and small to work from a common base.
I opted against using the IntersectionObserver because its async nature would add unnecessary complexity to the custom metric. Ultimately we want to return true if the image is in the visible viewport and do not need to monitor for changes resulting from scroll events.
Updated the Images custom metric
inViewport
property to check if the image is within the viewport, compared to simply checking thetop
position.Will be used in 2021 Resource Hints chapter.
Reference discussion: https://github.com/HTTPArchive/legacy.httparchive.org/pull/202#discussion_r647905245
I opted against using the
IntersectionObserver
because itsasync
nature would add unnecessary complexity to the custom metric. Ultimately we want to returntrue
if the image is in the visible viewport and do not need to monitor for changes resulting from scroll events.Sample WPT https://webpagetest.org/custom_metrics.php?test=210614_AiDcH0_5d6b574017a022b085beade79bf0deef&run=1&cached=0