"Catrope" posted a comment on MediaWiki.r107066.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/107066#c28936

Commit summary for MediaWiki.r107066:

apply CSS::Janus when user preview its CSS style

follow up r94421

Catrope's comment:

This doesn't actually trigger CSSJanus, look at the addInlineStyle() code:
<pre>
        /**
         * Adds inline CSS styles
         * @param $style_css Mixed: inline CSS
         * @param $flip String: Set to 'flip' to flip the CSS if needed
         */
        public function addInlineStyle( $style_css, $flip = 'noflip' ) {
                if( $flip === 'flip' && $this->getLanguage()->isRTL() ) {
                        # If wanted, and the interface is right-to-left, flip 
the CSS
                        $style_css = CSSJanus::transform( $style_css, true, 
false );
                }
                $this->mInlineStyles .= Html::inlineStyle( $style_css );
        }
</pre>

Also, the rules for when to apply Janusing to site/user styles are different. 
Software styles are assumed to be LTR, so they are flipped if the interface is 
RTL. However, site/user styles are assumed to have a directionality that 
''matches the content language'' (i.e. are assumed LTR if $wgLanguageCode is an 
LTR language, and RTL if it's an RTL language), so they're flipped if the 
interface language and the content language have different directionalities 
(viewing a wiki with LTR content in an RTL interface or vice versa).

Thirdly, this change loads the previewed CSS in the wrong place (too early -- 
user CSS is one of the last things in the head), as Nikerabbit suggested. So 
because it's breaking the loading order while not actually fixing anything 
(Janus behavior is unchanged), I'm gonna revert this. I'll look at a better way 
to handle Janusing properly.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to