* SUMMARY Lazy loaded images and iframes that have not been on screen yet, are not loaded when printing, producing empty elements. * STEPS TO REPRODUCE 1. Open Safari/WebKit. 2. Enable lazy loading of images in the Experimental features. 3. Visit a page that contains lazy loaded images or iframes that are not visible on page load (i.e. below the fold). 4. Print the page * EXPECTED RESULTS All images should be visible in the printed version * ACTUAL RESULTS Only images that were already loaded before executing the print command are visible. * REGRESSION I think this never worked. * TEST CASE https://www.ecb.europa.eu/lazy-loading-test/ Printing this page should show the numbers 1 through 6. * RELATED LINKS https://github.com/whatwg/html/issues/6581
<rdar://problem/76959554>
Created attachment 439736 [details] Patch
This bug still exists. The same issue in Chrome was fixed in January of 2022 https://bugs.chromium.org/p/chromium/issues/detail?id=875403 This is currently blocking Wikipedia (esp Desktop) from using the native attribute, as people still want to print Wikipedia and expect that to work. I even tried something like: <script> window.onbeforeprint = () => { console.log( 'print' ) document.querySelectorAll( 'img' ).forEach( (elem, index) => { elem.removeAttribute( 'loading' ); }) } </script> But it seems that this is only processed async, and the print still misses images. Related wikipedia ticket: https://phabricator.wikimedia.org/T148047