* @return string
*/
function toHtml( $options = [] ) {
- global $wgPriorityHints, $wgPriorityHintsRatio, $wgElementTiming;
+ global $wgPriorityHints, $wgPriorityHintsRatio, $wgElementTiming, $wgNativeImageLazyLoading;
if ( func_num_args() == 2 ) {
throw new MWException( __METHOD__ . ' called in the old style' );
'decoding' => 'async',
];
+ if ( $wgNativeImageLazyLoading ) {
+ $attribs['loading'] = 'lazy';
+ }
+
$elementTimingName = 'thumbnail';
if ( $wgPriorityHints