Last modified: 2014-09-24 00:53:24 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 T44241, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42241 - Vector: Middle click on <a href="#"> in tabs should not open "{current url}#" in a new window
Vector: Middle click on <a href="#"> in tabs should not open "{current url}#"...
Status: PATCH_TO_REVIEW
Product: MediaWiki skins
Classification: Unclassified
Vector (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks: 44881
  Show dependency treegraph
 
Reported: 2012-11-18 13:04 UTC by Fomafix
Modified: 2014-09-24 00:53 UTC (History)
7 users (show)

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


Attachments
Patch for Vector.php (969 bytes, patch)
2012-11-18 13:04 UTC, Fomafix
Details
Patch for Bug 42241 (1.65 KB, patch)
2012-11-19 21:25 UTC, Fomafix
Details
Patch for Bug 42241 (1.77 KB, patch)
2012-11-30 20:06 UTC, Fomafix
Details

Description Fomafix 2012-11-18 13:04:40 UTC
Created attachment 11389 [details]
Patch for Vector.php

Skin Vector contains <a href="#"></a> for variants and for actions. This generates a annoying link to # when clicking with a middle click or when JavaScript is disabled.

Please remove href="#".
Comment 1 Krinkle 2012-11-18 13:29:22 UTC
Removing href="#" does not solve the problem. That will instead create a link to the current url (and the behaviour is unstable in older browsers).

This is likely a case of a forgotten call to e.preventDefault().
Comment 2 Krinkle 2012-11-18 13:30:49 UTC
Also, these anchor tags on the headings shouldn't exist afaik. Are they still there? I thought we're styling the <h5> directory now, or at least adding them dynamically.
Comment 3 Fomafix 2012-11-18 21:16:52 UTC
With e.preventDefault() it is not possible to prevent a middle click to open a new tab at least in Firefox 16 and Opera 12. And when JavaScript is disabled the link is always active. This is annoying.

Why is there a <a href="#"></a>? Would a simple <div></div> be enough?
Comment 4 Krinkle 2012-11-19 02:51:13 UTC
(In reply to comment #3)
> With e.preventDefault() it is not possible to prevent a middle click to open a
> new tab at least in Firefox 16 and Opera 12. And when JavaScript is disabled
> the link is always active. This is annoying.
> 
> Why is there a <a href="#"></a>? Would a simple <div></div> be enough?

Yes, as I said already:

(comment #2)
> [..] these anchor tags on the headings shouldn't exist. 

They are only there for style (blue links, and pointy cursor). Which is already being handled on the javascript side. Without javascript, the links don't belong there.
Comment 5 Fomafix 2012-11-19 21:25:24 UTC
Created attachment 11391 [details]
Patch for Bug 42241

Replace <a href="#"></a> by <div></div>
Comment 6 Andre Klapper 2012-11-20 17:58:38 UTC
Fomafix:
You are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier for us to review it quickly.
Comment 7 Fomafix 2012-11-30 20:06:51 UTC
Created attachment 11438 [details]
Patch for Bug 42241

Rebased patch with <h3> instead of <h5>.

Simplified because display: block is default for <div>.

With <div> there is no workaround for Internet Explorer 6 necessary. Tested with Internet Explorer 6.
Comment 8 Sumana Harihareswara 2012-12-14 15:11:52 UTC
Fomafix, can you submit your change in Git?
Comment 9 Merlijn van Deen (test) 2013-10-15 20:35:21 UTC
Unfortunately, this patch does not apply cleanly to master.

Fomafix, you can also submit patches using the web-based uploader at https://tools.wmflabs.org/gerrit-patch-uploader . Please use 'Bug: 42241' in your commit message to link it to this bug.
Comment 10 Gerrit Notification Bot 2014-06-02 06:04:02 UTC
Change 136711 had a related patch set uploaded by Gerrit Patch Uploader:
Vector: Use <div> instead of <a> for action menu

https://gerrit.wikimedia.org/r/136711
Comment 11 Gerrit Notification Bot 2014-06-16 08:30:20 UTC
Change 139795 had a related patch set uploaded by Gerrit Patch Uploader:
Use <a> instead of <a href="#"> for JavaScript click events

https://gerrit.wikimedia.org/r/139795
Comment 12 Gerrit Notification Bot 2014-08-17 09:28:01 UTC
Change 154453 had a related patch set uploaded by Gerrit Patch Uploader:
Use <div> instead of <a> for action menu

https://gerrit.wikimedia.org/r/154453
Comment 13 Gerrit Notification Bot 2014-08-17 10:09:06 UTC
Change 136711 abandoned by Bartosz Dziewoński:
Vector: Use <div> instead of <a> for action menu

Reason:
Thank you.

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

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


Navigation
Links