* (bug 7492) Rights can now be assigned to specific IP addresses and ranges by
using $wgAutopromote (new defines: APCOND_ISIP and APCOND_IPINRANGE)
* Add a 'change block' link to Special:IPBlockList and Special:Log
+* (bug 16459) Use native getElementsByClassName where possible, for better
+ performance in modern browsers
=== Bug fixes in 1.14 ===
From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
*/
function getElementsByClassName(oElm, strTagName, oClassNames){
- var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
+ if ( typeof( oElm.getElementsByClassName ) == "function" ) {
+ /* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */
+ var arrNativeReturn = oElm.getElementsByClassName( oClassNames );
+ if ( strTagName == "*" )
+ return arrNativeReturn;
+ for ( var h=0; h < arrNativeReturn.length; h++ ) {
+ if( arrNativeReturn[h].tagName.toLowerCase() == strTagName.toLowerCase() )
+ arrReturnElements[arrReturnElements.length] = arrNativeReturn[h];
+ }
+ return arrReturnElements;
+ }
+ var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
var arrRegExpClassNames = new Array();
if(typeof oClassNames == "object"){
for(var i=0; i<oClassNames.length; i++){