<li> <b>E{display%=2}</b> css value "display" that is evenly divisible by 2</li>
<li> <b>E{display!=none}</b> css value "display" that does not equal "none"</li>
</ul>
- * @singleton
+ * @static
*/
Roo.DomQuery = function(){
var cache = {}, simpleCache = {}, valueCache = {};
}
var r = [], ri = -1, cn;
for(var i = 0, ci; ci = c[i]; i++){
- if((' '+ci.className+' ').indexOf(v) != -1){
+
+
+ if((' '+
+ ( (ci instanceof SVGElement) ? ci.className.baseVal : ci.className)
+ +' ').indexOf(v) != -1){
r[++ri] = ci;
}
}
return n.htmlFor;
}
if(attr == "class" || attr == "className"){
- return n.className;
+ return (n instanceof SVGElement) ? n.className.baseVal : n.className;
}
return n.getAttribute(attr) || n[attr];
a = Roo.DomQuery.getStyle(ci, attr);
}
else if(attr == "class" || attr == "className"){
- a = ci.className;
+ a = (ci instanceof SVGElement) ? ci.className.baseVal : ci.className;
}else if(attr == "for"){
a = ci.htmlFor;
}else if(attr == "href"){
var tk = Roo.DomQuery.matchers;
var tklen = tk.length;
var mm;
- Roo.log('path!!!');
- Roo.log(path)
-
- Roo.log('compile!!!');
- Roo.log(q);
+
// accept leading mode switch
- Roo.log('modeRe');
- Roo.log(modeRe);
var lmode = q.match(modeRe);
-
- Roo.log('lmode');
- Roo.log(lmode);
-
if(lmode && lmode[1]){
fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";';
q = q.replace(lmode[1], "");
while(path.substr(0, 1)=="/"){
path = path.substr(1);
}
- Roo.log('lg!!!');
- Roo.log(lq);
+
while(q && lq != q){
lq = q;
var tm = q.match(tagTokenRe);
for(var i = 0, len = paths.length; i < len; i++){
var p = paths[i].replace(trimRe, "");
if(!cache[p]){
- Roo.log('p!!!');
- Roo.log(p);
cache[p] = Roo.DomQuery.compile(p);
if(!cache[p]){
throw p + " is not a valid selector";