From: Gilles Dubuc Date: Mon, 25 May 2015 14:04:57 +0000 (+0200) Subject: Add ability to load plain CSS files at the bottom X-Git-Tag: 1.31.0-rc.0~11285 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=d6b4d3c537fa5944c2f234213b20037fe3192d62;p=lhc%2Fweb%2Fwiklou.git Add ability to load plain CSS files at the bottom Currently all styles modules added to the page using addModuleStyles are put into the head, regardless of their "position" value. Bug: T97420 Change-Id: Ie4287e17d6f298cc63f42f257b1f67ee36961b77 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 770cf47f6e..a3a5a2730a 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -591,6 +591,19 @@ class OutputPage extends ContextSource { * @return array Array of module names */ public function getModuleStyles( $filter = false, $position = null ) { + // T97420 + $resourceLoader = $this->getResourceLoader(); + + foreach ( $this->mModuleStyles as $val ) { + $module = $resourceLoader->getModule( $val ); + + if ( $module instanceof ResourceLoaderModule && $module->isPositionDefault() ) { + $warning = __METHOD__ . ': style module should define its position explicitly: ' . $val . ' ' . get_class( $module ); + wfDebugLog( 'resourceloader', $warning ); + wfLogWarning( $warning ); + } + } + return $this->getModules( $filter, $position, 'mModuleStyles' ); } @@ -3008,11 +3021,17 @@ class OutputPage extends ContextSource { // Scripts "only" requests marked for bottom inclusion // If we're in the , use load() calls rather than