Deprecate Parser implementation methods (will be private in next release)
[lhc/web/wiklou.git] / includes / media / ThumbnailImage.php
index 7ee6dcb..6e4412c 100644 (file)
@@ -110,7 +110,7 @@ class ThumbnailImage extends MediaTransformOutput {
         * @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' );
@@ -126,6 +126,10 @@ class ThumbnailImage extends MediaTransformOutput {
                        'decoding' => 'async',
                ];
 
+               if ( $wgNativeImageLazyLoading ) {
+                       $attribs['loading'] = 'lazy';
+               }
+
                $elementTimingName = 'thumbnail';
 
                if ( $wgPriorityHints