List of steps to reproduce (step by step, including full links if applicable):
What happens?:
- Plainlist is not plain and hlist gets styling from core definition
- This is because MobileFrontend removes the full style definition of those elements which happen to appear in MobileFrontend-stripped HTML, and de-duplication in TemplateStyles causes the remaining tags to be <link> rather than at least one <style> with a definition.
What should have happened instead?:
The styles should have definitions on the page from the local TemplateStyles sheets
Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
Currently, this 'technique' is (ab)used by en.wp and ja.wp to remove navbox TemplateStyles from mobile, for which it more or less is reasonable (since navboxes are 'always' removed).
However, for most other styles defined in TemplateStyles, this is a problem where styles may not make it to the end user. Hopefully the templates are outputting nice HTML for a fallback, but no way to provide a systematic guarantee.
This would most likely be noticed with .hlist styles, soon to be TemplateStyles only on en.wp (and which already are so on mediawikiwiki) because there are two metatemplates (Template:Sidebar and Template:Military_navigation as campaignboxes) which are in the class of items which are removed by MobileFrontend and which occur near the top of the page, but I can imagine catching hapless uses of other styles like Template:Fraction/styles.css also existing inside of sidebars etc.
I plan to work around this as best I can with hlist, and I might be able to do some "parse everything looking for templatestyles tags and move them all outside the element" in the major problematic templates like Sidebar, but it should still get its own task and hopefully some chatter about how to resolve it best. (T124168: Show Navbox templates in mobile skins would resolve it, but only coincidentally, and I don't think that one will get done any sooner than say Parsoid read views and the post parse filtering that's been suggested... somewhere down the related-task-rabbithole of T200206: Omit `<link rel="mw-deduplicated-inline-style">` from page view HTML). In other words, we've gotten lucky so far and not too much styling has vanished. But we're getting to some of the more well-used styles now.
See also:
- T292277: Text incorrectly classified as part of a template because of TemplateStyles where it's been suggested to always put TemplateStyles inside some template's defining element