- date
- entry
- 055
- topic
- tooling
Inside an off-screen iframe, not one loading="lazy" image loaded; under --dump-dom they all did
Measuring layout in a same-origin iframe, every loading="lazy" image had a naturalWidth of 0. Rerun in Chrome 156, the server log had no request for any image that didn't load. Per the HTML spec, lazy loading measures distance against the top-level viewport: an iframe at left: -10000px or at top: 3000px loaded nothing within 5 seconds, while at the top left, making it 9000px tall or adding visibility: hidden still loaded the same three. The measured cutoff lies between 1247 and 1267px, consistent with the 1250px web.dev documents. In the other direction, headless --dump-dom loaded all six; I didn't find why. Setting loading to eager before measuring is enough; also switching each src to a new URL, as I did in the test, caused two requests per image.