Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/258662

Change subject: API: Avoid FOUC on help pages
......................................................................

API: Avoid FOUC on help pages

Loading CSS with OutputPage::addModules() often causes a FOUC. The
mediawiki.apihelp module is special and is pure CSS, but has a
dependency upon mediawiki.hlist which contains JavaScript. So we'll use
both addModules() to load the JavaScript and addModuleStyles() to load
the base CSS earlier to avoid the FOUC.

Bug: T117901
Change-Id: I1dfd194d686c05573eefc85d5dfd7ee2731bf286
---
M includes/api/ApiHelp.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/258662/1

diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php
index b1942bc..5438101 100644
--- a/includes/api/ApiHelp.php
+++ b/includes/api/ApiHelp.php
@@ -98,7 +98,12 @@
                }
 
                $out = $context->getOutput();
+               // The mediawiki.apihelp module is just CSS, but
+               // it also depends upon mediawiki.hlist, which has
+               // JavaScript so we need to use addModules() for the
+               // dependency, and addModuleStyles() to avoid a FOUC.
                $out->addModules( 'mediawiki.apihelp' );
+               $out->addModuleStyles( 'mediawiki.apihelp' );
                if ( !empty( $options['toc'] ) ) {
                        $out->addModules( 'mediawiki.toc' );
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/258662
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1dfd194d686c05573eefc85d5dfd7ee2731bf286
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to