Page MenuHomePhabricator

In Parsoid, self-links are clickable
Open, Needs TriagePublicBUG REPORT

Description

Steps to reproduce

  1. Open https://en.wikipedia.org/w/index.php?title=Shahrak-e_Emam_Khomeyni,_Chaharmahal_and_Bakhtiari&useparsoid=0 and open the navbox.
  2. Click on the self-link (bold Shahrak-e Emam Khomeyni).
  3. ✅ Notice that nothing happens.
  4. Open https://en.wikipedia.org/w/index.php?title=Shahrak-e_Emam_Khomeyni,_Chaharmahal_and_Bakhtiari&useparsoid=1 and open the navbox.
  5. Click on the self-link again.

Actual result

  1. ❌ Notice that you’re navigated away (to the canonical URL).

Expected result

  1. ✅ Notice that still nothing happens.

Other information

Since everything that can be overridden using CSS is overridden (color, underlining, cursor type etc.), this behavior is very surprising. Couldn’t the href attribute removed from self-links? It’s obvious anyway where they point.

Event Timeline

ABreault-WMF added subscribers: cscott, ABreault-WMF.

From when self-links were implemented in Parsoid,
https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/991827/13#message-2613035d7d4b3b21eaa956ad815b77dd962b26cd

href's are left around in the non-fragment case. That can be explored separately since it has consequences to rt.

@cscott wrote,

I'd prefer to keep the hrefs around for all self-links and just use CSS to suppress the link. pointer-events: none and maybe another CSS rule to ensure that the pointer shape doesn't change to a hand.

What I’d like to be strict about is the Expected result, not the Other information – the latter is only explanation and an idea. I didn’t know about pointer-events:none, but now that I explored it, I noticed it goes too far – it not only disables link behavior, but also other things (at least in Firefox, where I tested it):

  • cursor: since it does as if the text wasn’t there at all, it doesn’t show a text (I-beam) cursor, but rather the standard default (arrow) cursor.
  • Drag-and-drop: the text can be selected using the mouse, but it can’t be dragged and dropped.
  • (There can be other inconsistencies as well, which I haven’t noticed.)