https://bugzilla.wikimedia.org/show_bug.cgi?id=31417

--- Comment #6 from Daniel Friesen <[email protected]> 
2011-10-06 20:28:30 UTC ---
(In reply to comment #5)
> Hm, I thought jQuery selectors work very slowly on browsers that don't support
> querySelectorAll...
> 
> (Not going to respond to the next part, I don't see what could be wrong with
> the script.)
My eyes were bleeding from looking at soo much dom. But there's a straight
equals on className not taking the potential for another class to be added into
account (you're going to have a bug if that's used on a page with only hidden
categories). And I wish RegExp's constructor didn't have to be abused that way.
I have problems with some of those == conditional. And rather than .live you
should probably be using .delegate and not embedding unescaped user specified
contents in your jQuery selector. (fun tip, if that code you used .live on had
used .append you would have an XSS vector on your hands)

> That's the way it used to work, looking through h2s, ignoring the h2
> occasionally inside toc and preview note, and sorting things like that, but it
> was significantly slower than pulling everything out at once, temporarily
> holding the contents in a documentfragment, and then sorting through 
> everything
> outside the display before dumping everything back in.

That could be a result of the new code using a document fragment but the old
code not, rather than anything to do with other queries being slower. Document
fragments are fast because they are isolated from the document and when you put
stuff into them the browser gets to omit piles and piles of extra work like
firing events because you've removed the nodes from the document while you work
on them. jQuery even makes good use of them.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to