Page MenuHomePhabricator

no padding between TOC numbers and TOC titles in RTL wikis
Closed, ResolvedPublic

Description

no padding between TOC numbers and TOC titles in RTL wikis.
Browser: Firefox (but works correctly in Chrome)
This is due to: https://gerrit.wikimedia.org/r/#/c/196541

Event Timeline

eranroz raised the priority of this task from to Needs Triage.
eranroz updated the task description. (Show Details)
eranroz subscribed.
eranroz triaged this task as High priority.Nov 7 2015, 8:23 AM
eranroz updated the task description. (Show Details)
eranroz set Security to None.
  1. I had to revert it locally in hewiki for now: https://he.wikipedia.org/w/index.php?title=%D7%9E%D7%93%D7%99%D7%94_%D7%95%D7%99%D7%A7%D7%99:Common.css&diff=17720868&oldid=17718721&uselang=en
  2. It seems that Firefox doesn't accept content:"" (e.g empty string) - a space (or other character) should work. However adding content may have other undesirable affects(?). Other option is to change the TOC generation to use ol instead of ul and let the browser handle it in its native way - but this change behaviour/design unless extra css/JS handle the whole li.

I guess the problem is that padding-right get not flipped to padding-left. The automatic flipping based on the direction of the user interface language and not on the direction of the page content language.

With several additional rules this can bind on .mw-content-ltr and .mw-content-rtl. With T89561 I request a improvement for this complicated rules.

In https://gerrit.wikimedia.org/r/196541 I used

.tocnumber:after {
	content: "";
	padding-right: 0.5em;
}

instead of

.tocnumber {
	padding-right: 0.5em;
}

so that IE7 and lower ignores the whole definition. The padding-right has also the flipping problem.

Maybe the flipping problem can avoided by using only CSS definitions which are not flippable.

Change 251700 had a related patch set uploaded (by Gerrit Patch Uploader):
TOC: Fix problems on RTL wikis

https://gerrit.wikimedia.org/r/251700

matmarex subscribed.

Change 251700 merged by jenkins-bot:
TOC: Fix problems on RTL wikis

https://gerrit.wikimedia.org/r/251700

Is this fixed globally? @eranroz I see extra whitespace in the TOC in hewiki due to your edit that is absent in other wikis (if you hover a section title, the leading space would be underlined, see below).

image.png (418×234 px, 12 KB)

On the other hand, if I switch off the styles you introduced in that edit, the TOC number padding is fine both in Chrome and in Firefox.

I came here because this style breaks correct RTL text display in the TOC in my script, Convenient-Discussions:

image.png (64×140 px, 1 KB)
instead of
image.png (68×145 px, 1 KB)