Motivation: Improve performance of the new Vector skin ( T278896)
We should split the mediawiki.legacy.shared module into non-legacy manageable parts. It's over a thousand lines of CSS that is loaded on all pages and all skins. We can do better than that.
Doing that would hopefully allow us to only load some parts when they are actually used, or allow skins to override the styles using [[https://www.mediawiki.org/w/index.php?title=Manual:$wgResourceModuleSkinStyles|$wgResourceModuleSkinStyles]].
Vaguely related:
* T56796#621744
* T62360#1050777
# Goal
To be done as part T281542
- The ResourceLoaderSkinModule will throw a deprecation message when the `legacy` module is requested inside the constructor, with directions on which modules to use instead.
htps://github.com/wikimedia/mediawiki/blob/master/includes/resourceloader/ResourceLoaderSkinModule.php#L160
- The `legacy` feature will no longer be used in any of Wikimedia-deployed skins and instead we will set sensible defaults from the new ResourceLoaderSkinModule features.
3) The https://github.com/wikimedia/mediawiki/blob/master/resources/src/mediawiki.skinning/legacy.less file will be deprecated and removed
# Sign off notes
As of April 29th the legacy feature contains several styles that will not be carried over to the new interfaces.
* Rules that are duplicated in the normalize feature e.g. `sub,sup {line-height: 1;}`
* Rules that are duplicated in the interface feature e.g. `.printfooter {display: none;}`
* True legacy rules. These include `#mw-credits a`, `xdebug-error`, `mw-ajax-loader`, `mw-small-spinner`, `visualClear`, `mw-infobox-left`, `mw-infobox-right`, `.error, .warning, .success` and `mw-infobox`. Extensions relying on these should be patched. If gadgets are using them we should move them to site/gadget styles.
* Directionality rules for .mw-content-ltr and .mw-content-rtl which will now be applied via HTML dir attributes instead.
* Directionality rules for `input` elements was dropped.
* We dropped unused wbr element support and mark element (IE<11 support, T248061))
* mw-label rules have been judged unnecessary. Will be moved to `mediawiki.htmlform.styles` during migration if learn otherwise.
# Changes
The following changes were made in a backwards compatible way to ensure that existing skins continued to load the same styles as before. For specific situations where that's not the case please raise a bug.
[x] Linker styles including mw-revdelundel-hidden styles were moved to `mediawiki.interface.helpers.styles`. This module now contains rules for minoredit, botedit and .autocomment
[x] mw-revdel-checkbox rules were moved to `mediawiki.special`
[x] wikitable rules are moved to a dedicated ResourceLoaderSkinModule feature. T278401
[x] T232903: Deprecate Html::infobox (T268078) and make sure the styles relating to mw-infobox-left and mw-infobox-right are moved into the installer stylesheet.
[x] A `mediawiki.action.styles` module was created for miscellanous UI-styles such as `mw-warning-with-logexcerpt`, `#mw-clearyourcache, #mw-sitecsspreview, #mw-sitejspreview, #mw-usercsspreview, #mw-userjspreview`, `.previewnote` (T278504, T278576). Styles for viewing an old revision were moved to a stylesheet loaded only when needed rather than for all page views (`#mw-revision-info`). `.not-patrolled,div.patrollink, .unpatrolled,div.patrollink` rules were added for handling patrol links. This also contains rules for ProtectionForm (T278576/T278504)
[x] Styles for table of contents should be moved into the existing `toc` feature.
[x] .mw-datatable rules are consolidated with resources/src/mediawiki.pager.tablePager/TablePager.less and resources/src/mediawiki.special/listFiles.less and removed from the ResourceLoaderSkinModule legacy file, so that they are only loaded when needed. T278374
[x] category links were split out into an interface-category (note Minerva doesn't use these styles so they make sense as a separate feature) T278373
[] T269877: Drop thumbnail direction styles in legacy
[x] The styles for `#toolbar` were dropped as part of T278563
[x] Styles for mw-userlink, span.deleted, history-deleted and span.comment were moved to mediawiki.interface.helpers.styles
[x] Styles for the editor relating to floats were moved to mediawiki.action.edit.styles module
[x] Preferences for link underlining was moved to the new `content.links` feature (and for backwards compatibility this feature is loaded by legacy). This feature also contains plainlink and red link handling.
[x] The .external.autonumber rules were grouped with other parser specific styles in the `content.parser-output` feature which may in future be named `content.body`
# sign off steps
[x] A task should be created about the removal of now deprecated styles e.g. .mw-infobox rules removed in T268194