X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/src/core/core/DomQuery.js diff --git a/src/core/core/DomQuery.js b/src/core/core/DomQuery.js index 8cbfc8f7..0286f57b 100644 --- a/src/core/core/DomQuery.js +++ b/src/core/core/DomQuery.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.0.3 + * Ext JS Library 3.1.0 * Copyright(c) 2006-2009 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license @@ -84,7 +84,6 @@ Ext.DomQuery = function(){ // IE runs the same speed using setAttribute, however FF slows way down // and Safari completely fails so they need to continue to use expandos. isIE = window.ActiveXObject ? true : false, - isOpera = Ext.isOpera, key = 30803; // this eval is stop the compressor from @@ -179,7 +178,7 @@ Ext.DomQuery = function(){ }else if(mode == "/" || mode == ">"){ var utag = tagName.toUpperCase(); for(var i = 0, ni, cn; ni = ns[i]; i++){ - cn = isOpera ? ni.childNodes : (ni.children || ni.childNodes); + cn = ni.childNodes; for(var j = 0, cj; cj = cn[j]; j++){ if(cj.nodeName == utag || cj.nodeName == tagName || tagName == '*'){ result[++ri] = cj; @@ -359,7 +358,7 @@ Ext.DomQuery = function(){ if(!len1){ return c2; } - if(isIE && c1[0].selectSingleNode){ + if(isIE && typeof c1[0].selectSingleNode != "undefined"){ return quickDiffIEXml(c1, c2); } for(var i = 0; i < len1; i++){ @@ -523,9 +522,11 @@ Ext.DomQuery = function(){ if(!valueCache[path]){ valueCache[path] = Ext.DomQuery.compile(path, "select"); } - var n = valueCache[path](root), - v; + var n = valueCache[path](root), v; n = n[0] ? n[0] : n; + + if (typeof n.normalize == 'function') n.normalize(); + v = (n && n.firstChild ? n.firstChild.nodeValue : null); return ((v === null||v === undefined||v==='') ? defaultValue : v); },