Last modified: 2012-04-03 05:48:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36470, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34470 - margin for edit section button on RTL wikis with LTR user interface is on the wrong side
margin for edit section button on RTL wikis with LTR user interface is on the...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Amir E. Aharoni
https://ar.wikipedia.org/wiki/%D9%87%...
:
Depends on:
Blocks: rtl
  Show dependency treegraph
 
Reported: 2012-02-17 12:23 UTC by Fomafix
Modified: 2012-04-03 05:48 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Fomafix 2012-02-17 12:23:42 UTC
On RTL wikis with LTR user interface the edit section buttons are correctly on the left side but the margin is on the left side.

actual effective style definitions:
    float: left;
    margin-left: 5px;

expected effective style definitions:
    float: left;
    margin-right: 5px;


Untested patch for skins/common/shared.css:
----- old -----
/* Edit section links */
.editsection {
	float: right;
	margin-left: 5px;
}
/* Correct directionality when page dir is different from site/user dir */
.mw-content-ltr .editsection,
.mw-content-rtl .mw-content-ltr .editsection {
	/* @noflip */
	float: right;
}
.mw-content-rtl .editsection,
.mw-content-ltr .mw-content-rtl .editsection {
	/* @noflip */
	float: left;
}
----- new -----
/* Edit section links */
/* Correct directionality when page dir is different from site/user dir */
.mw-content-ltr .editsection,
.mw-content-rtl .mw-content-ltr .editsection {
	/* @noflip */
	float: right;
	margin-left: 5px;
}
.mw-content-rtl .editsection,
.mw-content-ltr .mw-content-rtl .editsection {
	/* @noflip */
	float: left;
	margin-right: 5px;
}
Comment 1 Robin Pepermans (SPQRobin) 2012-02-18 12:54:34 UTC
The margin is so small that I didn't notice it when developing mw-content-ltr/rtl. We can do the above fix (the exact patch doesn't work but it can be adapted), or another solution could be to simply change it to margin: 0 5px; so it would be 5px on both sides regardless of LTR/RTL. I don't know if that would be OK or if there's a reason to have no margin at the end.
Comment 2 Fomafix 2012-02-18 21:57:22 UTC
margin: 0 5px is wrong because it generates an additional margin at the end.
Comment 3 Robin Pepermans (SPQRobin) 2012-02-19 02:25:39 UTC
(In reply to comment #2)
> margin: 0 5px is wrong because it generates an additional margin at the end.

Yes, but I meant, if there is no problem with having a margin at the end (I don't see any problem), then it's better to do it that way because that's simpler.
Comment 4 Fomafix 2012-02-19 10:58:06 UTC
The annoying left margin for the edit section buttons on RTL wikis with LTR user interface was my reason to open the bug.

The definition
.editsection {
    float: right;
}
is useless because it is always overwritten by one of the more specific definitions with class mw-content-ltr or class mw-content-rtl in the selector. Or is there still a situation for a edit section button without class mw-content-ltr or mw-content-rtl?
Comment 5 Fomafix 2012-02-19 12:59:10 UTC
Ok, there is one situation for a edit section button outside of the mw-content-ltr or mw-content-rtl container when you create a edit section button for the first heading as a gadget like [[de:MediaWiki:Gadget-Einleitung-bearbeiten.js]]. For this situation the automatic user interface based flipped definition is necessary:

.editsection {
    float: right;
    margin-left: 5px;
}

For edit section buttons inside the mw-content-ltr/mw-content-rtl container should not flipped and should depend mw-content-ltr/mw-content-rtl.

----- new -----
/* Edit section links */
/* outside of mw-content-ltr/mw-content-rtl */
.editsection {
    float: right;
    margin-left: 5px;
}
/* Correct directionality when page dir is different from site/user dir */
/* @noflip */
.mw-content-ltr .editsection,
.mw-content-rtl .mw-content-ltr .editsection {
    float: right;
    margin-left: 5px;
}
/* @noflip */
.mw-content-rtl .editsection,
.mw-content-ltr .mw-content-rtl .editsection {
    float: left;
    margin-right: 5px;
}
-----
LTR wikis with RTL user interface have the same problem with the margin. The float definition and the margin definition must kept together.

Why depends the language and the direction of the first heading on the user interface language and not on the page content language? I think the language and the direction of the first heading should also depend on the page content language.
Comment 6 Fomafix 2012-02-19 15:09:06 UTC
I created Bug 34514 for a first heading in page content language and direction. When this Bug is fixed I don't see any situations with a edit section button outside of a mw-content-ltr/mw-content-rtl container.
Comment 7 Amir E. Aharoni 2012-03-29 16:47:45 UTC
I applied a patch based on the first comment in
https://gerrit.wikimedia.org/r/#change,3920

Edit section links for the opening section are done using gadgets and user scripts today, so gadgets should care about their directionality.
Comment 8 Amir E. Aharoni 2012-03-29 16:48:46 UTC
Oh, and thanks a lot for the patch to fomafix@googlemail.com.
Comment 9 Amir E. Aharoni 2012-04-03 05:48:25 UTC
The patch was reviewed and approved by Brion. It will probably be deployed on Wikimedia projects next week.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links