Index: trunk/phase3/includes/ResourceLoaderContext.php |
— | — | @@ -31,6 +31,7 @@ |
32 | 32 | protected $modules; |
33 | 33 | protected $language; |
34 | 34 | protected $direction; |
| 35 | + protected $flip; |
35 | 36 | protected $skin; |
36 | 37 | protected $debug; |
37 | 38 | protected $only; |
— | — | @@ -39,7 +40,7 @@ |
40 | 41 | /* Methods */ |
41 | 42 | |
42 | 43 | public function __construct( WebRequest $request, $server ) { |
43 | | - global $wgUser, $wgLang, $wgDefaultSkin; |
| 44 | + global $wgUser, $wgLang, $wgContLang, $wgDefaultSkin; |
44 | 45 | |
45 | 46 | $this->request = $request; |
46 | 47 | $this->server = $server; |
— | — | @@ -60,6 +61,8 @@ |
61 | 62 | if ( !$this->skin ) { |
62 | 63 | $this->skin = $wgDefaultSkin; |
63 | 64 | } |
| 65 | + // Evaluate flip |
| 66 | + $this->flip = $wgContLang->getDir() !== $this->direction; |
64 | 67 | } |
65 | 68 | |
66 | 69 | public function getRequest() { |
— | — | @@ -77,11 +80,15 @@ |
78 | 81 | public function getLanguage() { |
79 | 82 | return $this->language; |
80 | 83 | } |
81 | | - |
| 84 | + |
82 | 85 | public function getDirection() { |
83 | 86 | return $this->direction; |
84 | 87 | } |
85 | 88 | |
| 89 | + public function getFlip() { |
| 90 | + return $this->flip; |
| 91 | + } |
| 92 | + |
86 | 93 | public function getSkin() { |
87 | 94 | return $this->skin; |
88 | 95 | } |
Index: trunk/phase3/includes/ResourceLoader.php |
— | — | @@ -294,7 +294,7 @@ |
295 | 295 | $context->shouldIncludeStyles() && |
296 | 296 | ( $styles .= self::$modules[$name]->getStyle( $context ) ) !== '' |
297 | 297 | ) { |
298 | | - if ( $context->getDirection() == 'rtl' ) { |
| 298 | + if ( $context->getFlip() ) { |
299 | 299 | $styles = self::filter( 'flip-css', $styles ); |
300 | 300 | } |
301 | 301 | $styles = $context->getDebug() ? $styles : self::filter( 'minify-css', $styles ); |