mediawiki.util: Don't hardcode selectors in updateTooltipAccessKeys if possible
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 30 Jan 2014 15:36:01 +0000 (16:36 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 30 Jan 2014 15:40:58 +0000 (16:40 +0100)
commited85c1361b6a01783bd7afb216bdf4326989ca06
tree4396e7268d235f4e84ed474fb7e7344e322d551a
parent99a5bee47aa795133a078608cd7183976bd60f7c
mediawiki.util: Don't hardcode selectors in updateTooltipAccessKeys if possible

If we're running on a browser where we can do this efficiently, just
find all elements that have accesskeys using document.querySelectorAll.
We can't use jQuery's polyfill for the selector since looping over all
elements on page load might be too slow.

Otherwise (IE<=7, Firefox<=3), just as it was done previously, go
through some elements likely to have accesskeys and update only them.
Unfortunately this will not fully work for custom skins with different
HTML structures, but you can't have everything. Also added 'button' to
the selector used in this case.

Bug: 58255
Change-Id: I3306ac4b2d32a5f0f6567e6aab176ecd6682062f
resources/mediawiki/mediawiki.util.js