Page MenuHomePhabricator

ResourceLoaderImageModule always gets loaded in head
Closed, InvalidPublic

Description

Despite skins.minervas.icons.images and ext.gather.menu.icon both specifying 'position' => 'bottom' in RL definition it seems to be ignored and these get loaded in the head.

Event Timeline

Jdlrobson assigned this task to Gilles.
Jdlrobson raised the priority of this task from to Medium.
Jdlrobson updated the task description. (Show Details)
matmarex renamed this task from ResourceLoaderImage module always gets loaded in head to ResourceLoaderImageModule always gets loaded in head.May 6 2015, 7:57 PM
matmarex set Security to None.
matmarex subscribed.
matmarex claimed this task.

This is the expected behavior, because you load these modules with addModuleStyles. If you loaded them with addModules, they would be at the bottom (and they'd only load on browsers with JavaScript enabled). @Gilles is apparently doing some work to make this not so (T97410?), but I wasn't following it.

(ResourceLoaderImageModule, in fact, ignores the 'position' option entirely and always uses 'bottom'.)

Indeed, this is what I'm trying to fix in T97410

Hmm.. Why am I seeing this module load in a style tag in the top of the page? Am I missing a commit in core?

Hmm.. Why am I seeing this module load in a link tag in the top of the page? Am I missing a commit in core?

Just saw your comment.. Doesn't add modules force them to load via JavaScript though?

Yes, it does. It is a pretty major shortcoming of ResourceLoader.

Mm.. Of course we can't inline styles at bottom and ensure cache validation can we... :-/