rem: document.getElementsByClassName = function(className, parentElement) { if (Prototype.BrowserFeatures.XPath) { var q = ". return document._getElementsByXPath(q, parentElement); } else { var children = ($(parentElement) || document.body).getElementsByTagName('*'); var elements = [], child; for (var i = 0, length = children.length; i < length; i++) { child = children[i]; if (Element.hasClassName(child, className)) elements.push(Element.extend(child)); } return elements; 
add: } else document.getElementsByClassName = function(className, parentElement) { var children = ($(parentElement) || document.body).getElementsByTagName('*'); var elements = [], child, pattern = new RegExp("(^|\\s)" + className + "(\\s|$)"); for (var i = 0, length = children.length; i < length; i++) { child = children[i]; var elementClassName = child.className; if (elementClassName.length == 0) continue; if (elementClassName == className || elementClassName.match(pattern)) elements.push(Element.extend(child)); 
context: document.getElementsByClassName = function(className, parentElement) {  if (Prototype.BrowserFeatures.XPath) {    var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]";    return document._getElementsByXPath(q, parentElement);  } else {    var children = ($(parentElement) || document.body).getElementsByTagName('*');    var elements = [], child;    for (var i = 0, length = children.length; i < length; i++) {      child = children[i];      if (Element.hasClassName(child, className))        elements.push(Element.extend(child));    }    return elements;  }};
meta: 7608	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/7608/d556a0875c83645645bd2067594241546d26d052/prototype.js/buggy/web/js/prototype.js