Last modified: 2007-01-14 02:30:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 8622 - Avoid multiple checks for action=edit and action=submit in akeytt
Avoid multiple checks for action=edit and action=submit in akeytt
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.9.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/skins-1.5/com...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-13 20:05 UTC by Mike Dillon
Modified: 2007-01-14 02:30 UTC (History)
1 user (show)

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


Attachments

Description Mike Dillon 2007-01-13 20:05:29 UTC
The akeytt() function currently does a regex match against
window.location.search on every iteration of the main loop to see if the current
page has either "action=edit" or "action=submit". This check should be done
before the loop since the result is the same every time. I didn't see a huge
performance improvment from the change, but it can't hurt.

The changes can be seen at
http://en.wikipedia.org/wiki/User:Mike_Dillon/Scripts/timeOnload.js
Comment 1 Mike Dillon 2007-01-13 20:16:46 UTC
I also changed the check to be more readable:

    if (a && !(isEditOrSubmit && (id == 'ca-watch' || id == 'ca-unwatch')))

The old version seems a little inverted and hard to understand.
Comment 2 Brion Vibber 2007-01-13 21:53:27 UTC
Searching for action=edit or action=submit in the URL is *extremely* unreliable,
as the URL doesn't necessarily contain those (POST requests, $wgActionUrls, etc).

If some code relies on these it is buggy and must be removed or fixed.
Comment 3 Mike Dillon 2007-01-13 22:35:33 UTC
I was actually thinking the same thing. In this case, it would probably be good
to use wgIsArticle==false instead, but I haven't tested it.

That assumes that ca-watch and ca-unwatch should only have their accesskey
settings ignored when wgIsArticle is false, which seems like a safe assumption
as those tabs are only added to pages that can be edited and in the case that an
edit is in progress wgIsArticle is false.
Comment 4 Brion Vibber 2007-01-13 23:06:23 UTC
I'm not sure why this code exists to begin with...

Either the tabs are *present* or they're *not present*. If they're present, make
sure their tooltips are set right. If they're not present, don't mess with them.

I don't see any requirement for such a check.
Comment 5 Mike Dillon 2007-01-13 23:15:12 UTC
I think the idea was that the accessKey conflicts with the one used for the
checkbox when in editing mode. But I'm not certain either.
Comment 6 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-01-14 01:39:40 UTC
(In reply to comment #5)
> I think the idea was that the accessKey conflicts with the one used for the
> checkbox when in editing mode. But I'm not certain either.

That's correct.
Comment 7 Brion Vibber 2007-01-14 02:03:06 UTC
In that case the sensible thing is probably to check for the existence of the
checkbox, rather than trying to guess that it _might_ be present based on
aura/phase of the moon. ;)

It should be easy to identify by its id:
<input tabindex='4' type='checkbox' name='wpWatchthis' checked='checked'
accesskey="w" id='wpWatchthis'  />
Comment 8 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-01-14 02:30:44 UTC
D'oh.  Good point.  Fixed in r19223.

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


Navigation
Links