Issue #3622332: Add WebP preload support when webp module is enabled

Summary

When the webp module is enabled, preload <link> tags now use WebP URLs and type="image/webp", matching <picture> output. Fixes https://www.drupal.org/project/responsive_image_preload/issues/3622332
Related: https://www.drupal.org/project/responsive_image_preload/issues/3229962

Approach

  • Optional @?webp.webp injection in PreloadGenerator
  • Webp::getWebpSrcset() for URL conversion (DRY with webp module)
  • WebP-only preloads when webp is available (no duplicate PNG/JPEG preloads)

Test plan

  • Reproduced mismatch on Drupal 11.4.4 with responsive_image_preload 2.0.1 + webp
  • Maintainer confirms preload links contain .webp and type="image/webp"
  • Behavior unchanged when webp module is disabled

Merge request reports

Loading
Loading