* @return string
*/
function toHtml( $options = [] ) {
- global $wgPriorityHints;
+ global $wgPriorityHints, $wgElementTiming;
if ( count( func_get_args() ) == 2 ) {
throw new MWException( __METHOD__ . ' called in the old style' );
'decoding' => 'async',
];
+ $elementTimingName = 'thumbnail';
+
if ( $wgPriorityHints
&& !self::$firstNonIconImageRendered
&& $this->width * $this->height > 100 * 100 ) {
- self::$firstBigImageRendered = true;
+ self::$firstNonIconImageRendered = true;
$attribs['importance'] = 'high';
+ $elementTimingName = 'thumbnail-high';
+ }
+
+ if ( $wgElementTiming ) {
+ $attribs['elementtiming'] = $elementTimingName;
}
if ( !empty( $options['custom-url-link'] ) ) {