Bug: T230897
Depends-On: I6c0b01fafe2c4498852e9c9b81151aba759dc5eb
Change-Id: I0307563b8f433dab062effe4dbfd7d4a9bbb8764
*/
$wgSpecialSearchFormOptions = [];
+/**
+ * Toggles native image lazy loading, via the "loading" attribute.
+ *
+ * @warning EXPERIMENTAL!
+ *
+ * @since 1.34
+ * @var array
+ */
+$wgNativeImageLazyLoading = false;
+
/**
* For really cool vim folding this needs to be at the end:
* vim: foldmarker=@{,@} foldmethod=marker
* @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