mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
196092ae69
* fix: audit incorrectly flagging images as above the fold (#10891) Previously used lement.offsetTop to find the y position of the image, which does not work when the element parent has a position: relative property. Instead, this uses lement.getBoundingClientRect().y top get real y position of the image. There's one issue though, which is that getBoundingClientRect returns the position relative to the user's viewport, not the absolute position. So, add window.scrollY to the value to cancel that effect out, and you have the element's absolute position. https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY * chore: add changeset |
||
---|---|---|
.. | ||
astro | ||
astro-prism | ||
astro-rss | ||
create-astro | ||
db | ||
integrations | ||
internal-helpers | ||
markdown/remark | ||
studio | ||
telemetry | ||
underscore-redirects | ||
upgrade |