Topic on Manual talk:$wgLogos

Failed parsing 'srcset' attribute value since it has an unknown descriptor.

4
Rbirmann (talkcontribs)

After migating from wgLogo to wgLogos, I am getting multiple warnings for "Failed parsing 'srcset' attribute value since it has an unknown descriptor." and "Dropped srcset candidate ..." on Chrome console.

Here is my exact code on LocalSettings:

$mylogospath = "$wgScriptPath/customizations/logos/v02";

$wgLogos = [
	'1x' 	=> "$mylogospath/1x.png",
	'1.5x' 	=> "$mylogospath/1_5x.png",
	'2x' 	=> "$mylogospath/2x.png",
	'svg' 	=> "$mylogospath/vetor.svg",
	'icon' 	=> "$mylogospath/1x.png",	// A version of the logo without wordmark and tagline
	'wordmark' => [
		'src' => "$mylogospath/wm.png",	// path to wordmark version
		'1x'  => "$mylogospath/wm.svg",	// optional if you want to support browsers with SVG support with an SVG logo.
		'width' => 120,
		'height' => 25,
	],
];

And here is the console output:

Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Dropped srcset candidate "/w/customizations/logos/v02/vetor.svg"
Dropped srcset candidate "/w/customizations/logos/v02/1x.png"
Dropped srcset candidate "Array"
Dropped srcset candidate "/w/customizations/logos/v02/vetor.svg"
Dropped srcset candidate "/w/customizations/logos/v02/1x.png"
Dropped srcset candidate "Array"

Here's the generated img tag on my wiki:

<img alt="Mediawiki" decoding="auto" src="/w/customizations/logos/v02/1x.png" srcset="/w/customizations/logos/v02/1_5x.png 1.5x, /w/customizations/logos/v02/2x.png 2x, /w/customizations/logos/v02/vetor.svg svg, /w/customizations/logos/v02/1x.png icon, Array wordmark"/>

So, the thing is Mediawiki is passing invalid descriptors to the srcset attribute of the img tag, namely 'svg', 'icon' and 'wordmark'.

Any thoughts??

Cheers

Mainframe98 (talkcontribs)
Rbirmann (talkcontribs)

It is Timeless indeed.

Mainframe98 (talkcontribs)
Reply to "Failed parsing 'srcset' attribute value since it has an unknown descriptor."