Merge "Put font size control before limited width control"

This commit is contained in:
jenkins-bot 2023-12-01 17:42:15 +00:00 committed by Gerrit Code Review
commit a0deea2158

View file

@ -13,6 +13,8 @@ let /** @type {MwApi} */ api;
*/
/**
* Get the list of client preferences that are active on the page, including hidden.
*
* @return {string[]} of active client preferences
*/
function getClientPreferences() {
@ -21,6 +23,17 @@ function getClientPreferences() {
).map( ( className ) => className.split( '-clientpref-' )[ 0 ] );
}
/**
* Get the list of client preferences that are active on the page and not hidden.
*
* @return {string[]} of user facing client preferences
*/
function getVisibleClientPreferences() {
const active = getClientPreferences();
// Order should be based on key in config.json
return Object.keys( config ).filter( ( key ) => active.indexOf( key ) > -1 );
}
/**
* @param {string} featureName
* @param {string} value
@ -175,7 +188,7 @@ function render( selector ) {
if ( mw.user.isAnon() ) {
throw new Error( 'T335317: Unexpected state expected. This will cause a performance problem.' );
}
getClientPreferences().forEach( ( pref ) => {
getVisibleClientPreferences().forEach( ( pref ) => {
mw.loader.using( 'codex-styles' ).then( () => {
mw.requestIdleCallback( () => {
makeClientPreference( node, pref );