Index: trunk/phase3/skins/common/wikibits.js |
— | — | @@ -454,8 +454,19 @@ |
455 | 455 | From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/ |
456 | 456 | */ |
457 | 457 | function getElementsByClassName(oElm, strTagName, oClassNames){ |
| 458 | + var arrReturnElements = new Array(); |
| 459 | + if ( typeof( oElm.getElementsByClassName ) == "function" ) { |
| 460 | + /* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */ |
| 461 | + var arrNativeReturn = oElm.getElementsByClassName( oClassNames ); |
| 462 | + if ( strTagName == "*" ) |
| 463 | + return arrNativeReturn; |
| 464 | + for ( var h=0; h < arrNativeReturn.length; h++ ) { |
| 465 | + if( arrNativeReturn[h].tagName.toLowerCase() == strTagName.toLowerCase() ) |
| 466 | + arrReturnElements[arrReturnElements.length] = arrNativeReturn[h]; |
| 467 | + } |
| 468 | + return arrReturnElements; |
| 469 | + } |
458 | 470 | var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); |
459 | | - var arrReturnElements = new Array(); |
460 | 471 | var arrRegExpClassNames = new Array(); |
461 | 472 | if(typeof oClassNames == "object"){ |
462 | 473 | for(var i=0; i<oClassNames.length; i++){ |
Index: trunk/phase3/CREDITS |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | * Daniel Kinzler |
20 | 20 | * Danny B. |
21 | 21 | * David McCabe |
| 22 | +* Derk-Jan Hartman |
22 | 23 | * Domas Mituzas |
23 | 24 | * Fran Rogers |
24 | 25 | * Greg Sabino Mullane |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -233,6 +233,8 @@ |
234 | 234 | * (bug 7492) Rights can now be assigned to specific IP addresses and ranges by |
235 | 235 | using $wgAutopromote (new defines: APCOND_ISIP and APCOND_IPINRANGE) |
236 | 236 | * Add a 'change block' link to Special:IPBlockList and Special:Log |
| 237 | +* (bug 16459) Use native getElementsByClassName where possible, for better |
| 238 | + performance in modern browsers |
237 | 239 | |
238 | 240 | === Bug fixes in 1.14 === |
239 | 241 | |