r72367 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72366‎ | r72367 | r72368 >
Date:10:28, 4 September 2010
Author:tparscal
Status:reverted
Tags:
Comment:
Only flip CSS if dir is different from $wgContLang
Modified paths:
  • /trunk/phase3/includes/ResourceLoader.php (modified) (history)
  • /trunk/phase3/includes/ResourceLoaderContext.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ResourceLoaderContext.php
@@ -31,6 +31,7 @@
3232 protected $modules;
3333 protected $language;
3434 protected $direction;
 35+ protected $flip;
3536 protected $skin;
3637 protected $debug;
3738 protected $only;
@@ -39,7 +40,7 @@
4041 /* Methods */
4142
4243 public function __construct( WebRequest $request, $server ) {
43 - global $wgUser, $wgLang, $wgDefaultSkin;
 44+ global $wgUser, $wgLang, $wgContLang, $wgDefaultSkin;
4445
4546 $this->request = $request;
4647 $this->server = $server;
@@ -60,6 +61,8 @@
6162 if ( !$this->skin ) {
6263 $this->skin = $wgDefaultSkin;
6364 }
 65+ // Evaluate flip
 66+ $this->flip = $wgContLang->getDir() !== $this->direction;
6467 }
6568
6669 public function getRequest() {
@@ -77,11 +80,15 @@
7881 public function getLanguage() {
7982 return $this->language;
8083 }
81 -
 84+
8285 public function getDirection() {
8386 return $this->direction;
8487 }
8588
 89+ public function getFlip() {
 90+ return $this->flip;
 91+ }
 92+
8693 public function getSkin() {
8794 return $this->skin;
8895 }
Index: trunk/phase3/includes/ResourceLoader.php
@@ -294,7 +294,7 @@
295295 $context->shouldIncludeStyles() &&
296296 ( $styles .= self::$modules[$name]->getStyle( $context ) ) !== ''
297297 ) {
298 - if ( $context->getDirection() == 'rtl' ) {
 298+ if ( $context->getFlip() ) {
299299 $styles = self::filter( 'flip-css', $styles );
300300 }
301301 $styles = $context->getDebug() ? $styles : self::filter( 'minify-css', $styles );

Follow-up revisions

RevisionCommit summaryAuthorDate
r72368Better solution for r72367, this allows file modules to always be written in ...tparscal10:53, 4 September 2010

Status & tagging log