Page MenuHomePhabricator

Make Parsoid work with wgNativeImageLazyLoading and support mobile
Closed, DuplicatePublic

Description

Steps to replicate the issue (include links if applicable):

  • Add $wgNativeImageLazyLoading = true; to LocalSettings.php
  • Visit a page with images in the legacy parser
  • Visit a page with images in Parsoid

What happens?:
In legacy parser loading="lazy" is present on all img tags. In Parsoid it is not.

What should have happened instead?:

  • loading="lazy" should be present on images output via Parsoid.
  • Provide a method that allows mobile to enable lazy loading cheaply (currently it has to rewrite the whole DOM tree).

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

I thought there was some client-side JS involved here as well to load the images as the page becomes visible? Is it really just an attribute which is needed?

I thought there was some client-side JS involved here as well to load the images as the page becomes visible? Is it really just an attribute which is needed?

Yes. That simple :) No JS needed!