Page MenuHomePhabricator

"namespaces" and "views" lists should not have a span in the anchor, for compatibility
Closed, ResolvedPublic

Description

Author: Amalthea.wikimedia

Description:
The divs "namespaces" and "views" now have a span tag inside the anchor, apparently for styling reasons.
Is there any way we can do without them? It's inconsistent with all other navigation lists where the text node is a direct child of the anchor, and it also means that the addPortletLink function from wikibits will not work with those two navigational areas.

Try the bookmarklet
javascript:addPortletLink("views", "#", "test");void(0)
on any vector-skinned page.

I realize that those navigational areas are supposed to be as empty as they are, for usability reasons, however established editors will still want an easy possibility to add additional links to those areas, and it would be really helpful if we could continue to use one common function to do that.
A possibility would be do add support for both ways in wikibits.js, but the far cleaner solution would be to stick to the established standard.


Version: unspecified
Severity: enhancement

Details

Reference
bz19531

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:38 PM
bzimport set Reference to bz19531.

To achieve the design from a visual standpoint on all browsers, the spans are necessary. I will look into how to solve this nicely.

After taking another look at my options, this is not possible.

Amalthea.wikimedia wrote:

Hmm, that seems a little defeatist. From some playing around, there seem to be ways to style it without the span. Could you elaborate a little about which browsers pose the problem?

A different approach would be to simply change wikibits.js and all current skins to always pack the text into a span tag. From a test of all current skins, this shouldn't cause any visual changes.
It would break some existing scripts, for example the site script in [[en:MediaWiki:Common.js]] that renames the article tab on the main page to "Main Page", but those will need to be adapted either way if this issue is not adressed at all.

Long-time editors *will* want to use those two areas to place their personal shortcuts, so much so that many or most wikis will have to workaround this issue with an adapted version of addPortletLink in the vector.js. From what I can tell, this is the last script compatibility issue that is still unsolved, I'm pretty happy with the way all other requests were resolved. I really hope we can resolve this one, too.

IE 5.5, IE 6, FF 1, and FF 2 (and possibly others) do not support the combination of block layout and vertical margins needed to avoid the span. We should not be wasting time worrying about spans or not spans when we've already had to spend way too much time getting old browsers to work. We have bigger priorities to be working on. If the wikibits.js code needs fixing, then let's just do that and move on.

Should be fixed in r56045: addPortletLink() now wraps the label in a <span> tag. Oh, and I fixed the code in [[en:MediaWiki:Common.js]].