Page MenuHomePhabricator

accessKeyLabel not available in Firefox for addPortletLink
Closed, ResolvedPublic


Firefox supports localized access key labels but only when the element is appended to the DOM tree:

$('<span>').attr('accesskey', 'g').appendTo('body')[0].accessKeyLabel
--> "Alt+Umschalt+g"

$('<span>').attr('accesskey', 'g')[0].accessKeyLabel
--> ""

mw.util.addPortletLink() calls updateTooltipAccessKeys() before appending to DOM tree, so the tooltip for the access key label is not localized:

mw.util.addPortletLink( 'p-views', '#', 'Foo', 't-foo', 'Foo tooltip', 'g' );
--> Tooltip is "Foo tooltip [alt-shift-g]".

Expected result:
--> Tooltip is "Foo tooltip [Alt+Umschalt-g]". (On a German Firefox)

Version: 1.24rc
Severity: minor



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:27 AM
bzimport set Reference to bz67946.

Change 145889 had a related patch set uploaded by Gerrit Patch Uploader:
Get localized access key tooltip mw.util.addPortletLink()

Change 160300 had a related patch set uploaded by Gerrit Patch Uploader:
jquery.accessKeyLabel: Append element into DOM on empty accessKeyLabel

Change 145889 merged by jenkins-bot:
mediawiki.util: Insert node before updating tooltip for accesskey

As I understand it this issue is fixed, with the jquery.accessKeyLabel patch being a more generic solution.

a fix landed upstream on October 15th 2014 it seems.

Confirmed in Firefox Aurora 36.0a2. Detached elements now have a proper value in the accessKeyLabel property:

a = document.createElement('div')

a.accessKey = 'a'