Page MenuHomePhabricator

CSS classes mw-content-ltr/mw-content-rtl is missing
Closed, ResolvedPublic

Description

https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/shared.css?view=markup uses a lot of CSS definitions based on the CSS classes mw-content-ltr or mw-content-rtl. On the preview of [[Special:ExpandTemplates]] the CSS classes mw-content-ltr/mw-content-rtl doesn't exist. So the definitions doesn't work.

Expected result:
The preview should be in a <div class="mw-content-DIR" lang="LANG" dir="DIR"> container based on the direction DIR and the language LANG of the page content language of the context title.

Test case:

<div class="magnify">float right</div>

should aligned right on a ltr wiki and should left aligned on a rtl wiki.


Version: unspecified
Severity: normal
URL: https://www.mediawiki.org/w/index.php?title=Special:ExpandTemplates&contexttitle=MediaWiki:Edit/ar&input=%3Cdiv%20class=%22magnify%22%3Emagnify%3C/div%3EText https://www.mediawiki.org/w/index.php?title=Special:ExpandTemplates&contexttitle=MediaWiki:Edit/en&input=%3Cdiv%20class=%22magnify%22%3Emagnify%3C/div%3EText

Details

Reference
bz41036

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:49 AM
bzimport set Reference to bz41036.
bzimport added a subscriber: Unknown Object (MLST).

I'm not sure that I understand the example. "float right" here is just text. Did you mean to write it as CSS?

The ExpandTemplates page works correctly for me in an RTL wiki. The mw-content-rtl class is applied to the whole page.

What is the actual problem?

skins/common/shared.css contains:

/* @noflip */
.mw-content-ltr .magnify {

float: right;

}
/* @noflip */
.mw-content-rtl .magnify {

float: left;

}

class="magnify" should either be float:left or float:right. The text "float right" was just a dummy.

Better test case:
<div class="magnify">magnify</div>Text

should look like
<div style="float: right;">magnify</div>Text
on LTR page content language

and

should look like
<div style="float: left;">magnify</div>Text
on RTL page content language.

Actual result:
<div>magnify</div>Text
without float.

Oh, I get it now. Thanks for the clarification.

Patch for ExpandTemplates_body.php

Patch for ExpandTemplates_body.php added

Attached:

ping - patch available here, somebody need to bring it into Gerrit.

Equivalent patch seems to have landed in commit dc0ffb28482e01bcef46a139fe262827c84de9aa, 2013-02-03.

Resolving fixed.