3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.2
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
16 * This is code is also distributed under MIT license for use
17 * with jQuery and prototype JavaScript libraries.
19 <div id="cls-Ext.DomQuery"></div>/**
21 Provides high performance selector/xpath processing by compiling queries into reusable functions. New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in).
23 DomQuery supports most of the <a href="http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#selectors">CSS3 selectors spec</a>, along with some custom selectors and basic XPath.</p>
26 All selectors, attribute filters and pseudos below can be combined infinitely in any order. For example "div.foo:nth-child(odd)[@foo=bar].bar:first" would be a perfectly valid selector. Node filters are processed in the order in which they appear, which allows you to optimize your queries for your document structure.
28 <h4>Element Selectors:</h4>
30 <li> <b>*</b> any element</li>
31 <li> <b>E</b> an element with the tag E</li>
32 <li> <b>E F</b> All descendent elements of E that have the tag F</li>
33 <li> <b>E > F</b> or <b>E/F</b> all direct children elements of E that have the tag F</li>
34 <li> <b>E + F</b> all elements with the tag F that are immediately preceded by an element with the tag E</li>
35 <li> <b>E ~ F</b> all elements with the tag F that are preceded by a sibling element with the tag E</li>
37 <h4>Attribute Selectors:</h4>
38 <p>The use of @ and quotes are optional. For example, div[@foo='bar'] is also a valid attribute selector.</p>
40 <li> <b>E[foo]</b> has an attribute "foo"</li>
41 <li> <b>E[foo=bar]</b> has an attribute "foo" that equals "bar"</li>
42 <li> <b>E[foo^=bar]</b> has an attribute "foo" that starts with "bar"</li>
43 <li> <b>E[foo$=bar]</b> has an attribute "foo" that ends with "bar"</li>
44 <li> <b>E[foo*=bar]</b> has an attribute "foo" that contains the substring "bar"</li>
45 <li> <b>E[foo%=2]</b> has an attribute "foo" that is evenly divisible by 2</li>
46 <li> <b>E[foo!=bar]</b> has an attribute "foo" that does not equal "bar"</li>
48 <h4>Pseudo Classes:</h4>
50 <li> <b>E:first-child</b> E is the first child of its parent</li>
51 <li> <b>E:last-child</b> E is the last child of its parent</li>
52 <li> <b>E:nth-child(<i>n</i>)</b> E is the <i>n</i>th child of its parent (1 based as per the spec)</li>
53 <li> <b>E:nth-child(odd)</b> E is an odd child of its parent</li>
54 <li> <b>E:nth-child(even)</b> E is an even child of its parent</li>
55 <li> <b>E:only-child</b> E is the only child of its parent</li>
56 <li> <b>E:checked</b> E is an element that is has a checked attribute that is true (e.g. a radio or checkbox) </li>
57 <li> <b>E:first</b> the first E in the resultset</li>
58 <li> <b>E:last</b> the last E in the resultset</li>
59 <li> <b>E:nth(<i>n</i>)</b> the <i>n</i>th E in the resultset (1 based)</li>
60 <li> <b>E:odd</b> shortcut for :nth-child(odd)</li>
61 <li> <b>E:even</b> shortcut for :nth-child(even)</li>
62 <li> <b>E:contains(foo)</b> E's innerHTML contains the substring "foo"</li>
63 <li> <b>E:nodeValue(foo)</b> E contains a textNode with a nodeValue that equals "foo"</li>
64 <li> <b>E:not(S)</b> an E element that does not match simple selector S</li>
65 <li> <b>E:has(S)</b> an E element that has a descendent that matches simple selector S</li>
66 <li> <b>E:next(S)</b> an E element whose next sibling matches simple selector S</li>
67 <li> <b>E:prev(S)</b> an E element whose previous sibling matches simple selector S</li>
68 <li> <b>E:any(S1|S2|S2)</b> an E element which matches any of the simple selectors S1, S2 or S3//\\</li>
70 <h4>CSS Value Selectors:</h4>
72 <li> <b>E{display=none}</b> css value "display" that equals "none"</li>
73 <li> <b>E{display^=none}</b> css value "display" that starts with "none"</li>
74 <li> <b>E{display$=none}</b> css value "display" that ends with "none"</li>
75 <li> <b>E{display*=none}</b> css value "display" that contains the substring "none"</li>
76 <li> <b>E{display%=2}</b> css value "display" that is evenly divisible by 2</li>
77 <li> <b>E{display!=none}</b> css value "display" that does not equal "none"</li>
81 Ext.DomQuery = function(){
86 trimRe = /^\s+|\s+$/g,
88 modeRe = /^(\s?[\/>+~]\s?|\s|$)/,
89 tagTokenRe = /^(#)?([\w-\*]+)/,
90 nthRe = /(\d*)n\+?(\d*)/,
92 // This is for IE MSXML which does not support expandos.
93 // IE runs the same speed using setAttribute, however FF slows way down
94 // and Safari completely fails so they need to continue to use expandos.
95 isIE = window.ActiveXObject ? true : false,
98 // this eval is stop the compressor from
99 // renaming the variable to something shorter
100 eval("var batch = 30803;");
102 // Retrieve the child node from a particular
103 // parent at the specified index.
104 function child(parent, index){
106 n = parent.firstChild;
118 // retrieve the next element node
120 while((n = n.nextSibling) && n.nodeType != 1);
124 // retrieve the previous element node
126 while((n = n.previousSibling) && n.nodeType != 1);
130 // Mark each child node with a nodeIndex skipping and
131 // removing empty text nodes.
132 function children(parent){
133 var n = parent.firstChild,
137 nextNode = n.nextSibling;
138 // clean worthless empty nodes.
139 if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){
140 parent.removeChild(n);
142 // add an expando nodeIndex
143 n.nodeIndex = ++nodeIndex;
151 // nodeSet - array of nodes
153 function byClassName(nodeSet, cls){
157 var result = [], ri = -1;
158 for(var i = 0, ci; ci = nodeSet[i]; i++){
159 if((' '+ci.className+' ').indexOf(cls) != -1){
166 function attrValue(n, attr){
167 // if its an array, use the first node.
168 if(!n.tagName && typeof n.length != "undefined"){
178 if(attr == "class" || attr == "className"){
181 return n.getAttribute(attr) || n[attr];
187 // mode - false, /, >, +, ~
188 // tagName - defaults to "*"
189 function getNodes(ns, mode, tagName){
190 var result = [], ri = -1, cs;
194 tagName = tagName || "*";
196 if(typeof ns.getElementsByTagName != "undefined"){
200 // no mode specified, grab all elements by tagName
203 for(var i = 0, ni; ni = ns[i]; i++){
204 cs = ni.getElementsByTagName(tagName);
205 for(var j = 0, ci; ci = cs[j]; j++){
209 // Direct Child mode (/ or >)
210 // E > F or E/F all direct children elements of E that have the tag
211 } else if(mode == "/" || mode == ">"){
212 var utag = tagName.toUpperCase();
213 for(var i = 0, ni, cn; ni = ns[i]; i++){
215 for(var j = 0, cj; cj = cn[j]; j++){
216 if(cj.nodeName == utag || cj.nodeName == tagName || tagName == '*'){
221 // Immediately Preceding mode (+)
222 // E + F all elements with the tag F that are immediately preceded by an element with the tag E
223 }else if(mode == "+"){
224 var utag = tagName.toUpperCase();
225 for(var i = 0, n; n = ns[i]; i++){
226 while((n = n.nextSibling) && n.nodeType != 1);
227 if(n && (n.nodeName == utag || n.nodeName == tagName || tagName == '*')){
232 // E ~ F all elements with the tag F that are preceded by a sibling element with the tag E
233 }else if(mode == "~"){
234 var utag = tagName.toUpperCase();
235 for(var i = 0, n; n = ns[i]; i++){
236 while((n = n.nextSibling)){
237 if (n.nodeName == utag || n.nodeName == tagName || tagName == '*'){
246 function concat(a, b){
250 for(var i = 0, l = b.length; i < l; i++){
256 function byTag(cs, tagName){
257 if(cs.tagName || cs == document){
263 var result = [], ri = -1;
264 tagName = tagName.toLowerCase();
265 for(var i = 0, ci; ci = cs[i]; i++){
266 if(ci.nodeType == 1 && ci.tagName.toLowerCase() == tagName){
273 function byId(cs, id){
274 if(cs.tagName || cs == document){
280 var result = [], ri = -1;
281 for(var i = 0, ci; ci = cs[i]; i++){
282 if(ci && ci.id == id){
290 // operators are =, !=, ^=, $=, *=, %=, |= and ~=
292 function byAttribute(cs, attr, value, op, custom){
295 useGetStyle = custom == "{",
296 fn = Ext.DomQuery.operators[op],
301 for(var i = 0, ci; ci = cs[i]; i++){
302 // skip non-element nodes.
303 if(ci.nodeType != 1){
306 // only need to do this for the first node
308 xml = Ext.DomQuery.isXml(ci);
312 // we only need to change the property names if we're dealing with html nodes, not XML
315 a = Ext.DomQuery.getStyle(ci, attr);
316 } else if (attr == "class" || attr == "className"){
318 } else if (attr == "for"){
320 } else if (attr == "href"){
321 // getAttribute href bug
322 // http://www.glennjones.net/Post/809/getAttributehrefbug.htm
323 a = ci.getAttribute("href", 2);
325 a = ci.getAttribute(attr);
328 a = ci.getAttribute(attr);
330 if((fn && fn(a, value)) || (!fn && a)){
337 function byPseudo(cs, name, value){
338 return Ext.DomQuery.pseudos[name](cs, value);
341 function nodupIEXml(cs){
344 cs[0].setAttribute("_nodup", d);
346 for(var i = 1, len = cs.length; i < len; i++){
348 if(!c.getAttribute("_nodup") != d){
349 c.setAttribute("_nodup", d);
353 for(var i = 0, len = cs.length; i < len; i++){
354 cs[i].removeAttribute("_nodup");
363 var len = cs.length, c, i, r = cs, cj, ri = -1;
364 if(!len || typeof cs.nodeType != "undefined" || len == 1){
367 if(isIE && typeof cs[0].selectSingleNode != "undefined"){
368 return nodupIEXml(cs);
372 for(i = 1; c = cs[i]; i++){
377 for(var j = 0; j < i; j++){
380 for(j = i+1; cj = cs[j]; j++){
392 function quickDiffIEXml(c1, c2){
395 for(var i = 0, len = c1.length; i < len; i++){
396 c1[i].setAttribute("_qdiff", d);
398 for(var i = 0, len = c2.length; i < len; i++){
399 if(c2[i].getAttribute("_qdiff") != d){
403 for(var i = 0, len = c1.length; i < len; i++){
404 c1[i].removeAttribute("_qdiff");
409 function quickDiff(c1, c2){
410 var len1 = c1.length,
416 if(isIE && typeof c1[0].selectSingleNode != "undefined"){
417 return quickDiffIEXml(c1, c2);
419 for(var i = 0; i < len1; i++){
422 for(var i = 0, len = c2.length; i < len; i++){
423 if(c2[i]._qdiff != d){
430 function quickId(ns, mode, root, id){
432 var d = root.ownerDocument || root;
433 return d.getElementById(id);
435 ns = getNodes(ns, mode, "*");
440 getStyle : function(el, name){
441 return Ext.fly(el).getStyle(name);
443 <div id="method-Ext.DomQuery-compile"></div>/**
444 * Compiles a selector/xpath query into a reusable function. The returned function
445 * takes one parameter "root" (optional), which is the context node from where the query should start.
446 * @param {String} selector The selector/xpath query
447 * @param {String} type (optional) Either "select" (the default) or "simple" for a simple selector match
450 compile : function(path, type){
451 type = type || "select";
454 var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],
457 matchers = Ext.DomQuery.matchers,
458 matchersLn = matchers.length,
460 // accept leading mode switch
461 lmode = path.match(modeRe);
463 if(lmode && lmode[1]){
464 fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";';
465 path = path.replace(lmode[1], "");
468 // strip leading slashes
469 while(path.substr(0, 1)=="/"){
470 path = path.substr(1);
473 while(path && lastPath != path){
475 var tokenMatch = path.match(tagTokenRe);
476 if(type == "select"){
479 if(tokenMatch[1] == "#"){
480 fn[fn.length] = 'n = quickId(n, mode, root, "'+tokenMatch[2]+'");';
482 fn[fn.length] = 'n = getNodes(n, mode, "'+tokenMatch[2]+'");';
484 path = path.replace(tokenMatch[0], "");
485 }else if(path.substr(0, 1) != '@'){
486 fn[fn.length] = 'n = getNodes(n, mode, "*");';
491 if(tokenMatch[1] == "#"){
492 fn[fn.length] = 'n = byId(n, "'+tokenMatch[2]+'");';
494 fn[fn.length] = 'n = byTag(n, "'+tokenMatch[2]+'");';
496 path = path.replace(tokenMatch[0], "");
499 while(!(modeMatch = path.match(modeRe))){
501 for(var j = 0; j < matchersLn; j++){
503 var m = path.match(t.re);
505 fn[fn.length] = t.select.replace(tplRe, function(x, i){
508 path = path.replace(m[0], "");
513 // prevent infinite loop on bad selector
515 throw 'Error parsing selector, parsing failed at "' + path + '"';
519 fn[fn.length] = 'mode="'+modeMatch[1].replace(trimRe, "")+'";';
520 path = path.replace(modeMatch[1], "");
524 fn[fn.length] = "return nodup(n);\n}";
526 // eval fn and return it
531 <div id="method-Ext.DomQuery-jsSelect"></div>/**
532 * Selects a group of elements.
533 * @param {String} selector The selector/xpath query (can be a comma separated list of selectors)
534 * @param {Node/String} root (optional) The start of the query (defaults to document).
535 * @return {Array} An Array of DOM elements which match the selector. If there are
536 * no matches, and empty Array is returned.
538 jsSelect: function(path, root, type){
539 // set root to doc if not specified.
540 root = root || document;
542 if(typeof root == "string"){
543 root = document.getElementById(root);
545 var paths = path.split(","),
548 // loop over each selector
549 for(var i = 0, len = paths.length; i < len; i++){
550 var subPath = paths[i].replace(trimRe, "");
551 // compile and place in cache
553 cache[subPath] = Ext.DomQuery.compile(subPath);
555 throw subPath + " is not a valid selector";
558 var result = cache[subPath](root);
559 if(result && result != document){
560 results = results.concat(result);
564 // if there were multiple selectors, make sure dups
566 if(paths.length > 1){
567 return nodup(results);
571 isXml: function(el) {
572 var docEl = (el ? el.ownerDocument || el : 0).documentElement;
573 return docEl ? docEl.nodeName !== "HTML" : false;
575 select : document.querySelectorAll ? function(path, root, type) {
576 root = root || document;
577 if (!Ext.DomQuery.isXml(root)) {
579 var cs = root.querySelectorAll(path);
580 return Ext.toArray(cs);
584 return Ext.DomQuery.jsSelect.call(this, path, root, type);
585 } : function(path, root, type) {
586 return Ext.DomQuery.jsSelect.call(this, path, root, type);
589 <div id="method-Ext.DomQuery-selectNode"></div>/**
590 * Selects a single element.
591 * @param {String} selector The selector/xpath query
592 * @param {Node} root (optional) The start of the query (defaults to document).
593 * @return {Element} The DOM element which matched the selector.
595 selectNode : function(path, root){
596 return Ext.DomQuery.select(path, root)[0];
599 <div id="method-Ext.DomQuery-selectValue"></div>/**
600 * Selects the value of a node, optionally replacing null with the defaultValue.
601 * @param {String} selector The selector/xpath query
602 * @param {Node} root (optional) The start of the query (defaults to document).
603 * @param {String} defaultValue
606 selectValue : function(path, root, defaultValue){
607 path = path.replace(trimRe, "");
608 if(!valueCache[path]){
609 valueCache[path] = Ext.DomQuery.compile(path, "select");
611 var n = valueCache[path](root), v;
614 // overcome a limitation of maximum textnode size
615 // Rumored to potentially crash IE6 but has not been confirmed.
616 // http://reference.sitepoint.com/javascript/Node/normalize
617 // https://developer.mozilla.org/En/DOM/Node.normalize
618 if (typeof n.normalize == 'function') n.normalize();
620 v = (n && n.firstChild ? n.firstChild.nodeValue : null);
621 return ((v === null||v === undefined||v==='') ? defaultValue : v);
624 <div id="method-Ext.DomQuery-selectNumber"></div>/**
625 * Selects the value of a node, parsing integers and floats. Returns the defaultValue, or 0 if none is specified.
626 * @param {String} selector The selector/xpath query
627 * @param {Node} root (optional) The start of the query (defaults to document).
628 * @param {Number} defaultValue
631 selectNumber : function(path, root, defaultValue){
632 var v = Ext.DomQuery.selectValue(path, root, defaultValue || 0);
633 return parseFloat(v);
636 <div id="method-Ext.DomQuery-is"></div>/**
637 * Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child)
638 * @param {String/HTMLElement/Array} el An element id, element or array of elements
639 * @param {String} selector The simple selector to test
642 is : function(el, ss){
643 if(typeof el == "string"){
644 el = document.getElementById(el);
646 var isArray = Ext.isArray(el),
647 result = Ext.DomQuery.filter(isArray ? el : [el], ss);
648 return isArray ? (result.length == el.length) : (result.length > 0);
651 <div id="method-Ext.DomQuery-filter"></div>/**
652 * Filters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child)
653 * @param {Array} el An array of elements to filter
654 * @param {String} selector The simple selector to test
655 * @param {Boolean} nonMatches If true, it returns the elements that DON'T match
656 * the selector instead of the ones that match
657 * @return {Array} An Array of DOM elements which match the selector. If there are
658 * no matches, and empty Array is returned.
660 filter : function(els, ss, nonMatches){
661 ss = ss.replace(trimRe, "");
662 if(!simpleCache[ss]){
663 simpleCache[ss] = Ext.DomQuery.compile(ss, "simple");
665 var result = simpleCache[ss](els);
666 return nonMatches ? quickDiff(result, els) : result;
669 <div id="prop-Ext.DomQuery-matchers"></div>/**
670 * Collection of matching regular expressions and code snippets.
671 * Each capture group within () will be replace the {} in the select
672 * statement as specified by their index.
676 select: 'n = byClassName(n, " {1} ");'
678 re: /^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
679 select: 'n = byPseudo(n, "{1}", "{2}");'
681 re: /^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
682 select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
685 select: 'n = byId(n, "{1}");'
688 select: 'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'
692 <div id="method-Ext.DomQuery-operators"></div>/**
693 * Collection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=.
694 * New operators can be added as long as the match the format <i>c</i>= where <i>c</i> is any character other than space, > <.
697 "=" : function(a, v){
700 "!=" : function(a, v){
703 "^=" : function(a, v){
704 return a && a.substr(0, v.length) == v;
706 "$=" : function(a, v){
707 return a && a.substr(a.length-v.length) == v;
709 "*=" : function(a, v){
710 return a && a.indexOf(v) !== -1;
712 "%=" : function(a, v){
715 "|=" : function(a, v){
716 return a && (a == v || a.substr(0, v.length+1) == v+'-');
718 "~=" : function(a, v){
719 return a && (' '+a+' ').indexOf(' '+v+' ') != -1;
723 <div id="prop-Ext.DomQuery-pseudos"></div>/**
724 * <p>Object hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed
725 * two parameters:</p><div class="mdetail-params"><ul>
726 * <li><b>c</b> : Array<div class="sub-desc">An Array of DOM elements to filter.</div></li>
727 * <li><b>v</b> : String<div class="sub-desc">The argument (if any) supplied in the selector.</div></li>
729 * <p>A filter function returns an Array of DOM elements which conform to the pseudo class.</p>
730 * <p>In addition to the provided pseudo classes listed above such as <code>first-child</code> and <code>nth-child</code>,
731 * developers may add additional, custom psuedo class filters to select elements according to application-specific requirements.</p>
732 * <p>For example, to filter <code><a></code> elements to only return links to <i>external</i> resources:</p>
734 Ext.DomQuery.pseudos.external = function(c, v){
736 for(var i = 0, ci; ci = c[i]; i++){
737 // Include in result set only if it's a link to an external resource
738 if(ci.hostname != location.hostname){
744 * Then external links could be gathered with the following statement:<code><pre>
745 var externalLinks = Ext.select("a:external");
749 "first-child" : function(c){
750 var r = [], ri = -1, n;
751 for(var i = 0, ci; ci = n = c[i]; i++){
752 while((n = n.previousSibling) && n.nodeType != 1);
760 "last-child" : function(c){
761 var r = [], ri = -1, n;
762 for(var i = 0, ci; ci = n = c[i]; i++){
763 while((n = n.nextSibling) && n.nodeType != 1);
771 "nth-child" : function(c, a) {
773 m = nthRe.exec(a == "even" && "2n" || a == "odd" && "2n+1" || !nthRe2.test(a) && "n+" + a || a),
774 f = (m[1] || 1) - 0, l = m[2] - 0;
775 for(var i = 0, n; n = c[i]; i++){
776 var pn = n.parentNode;
777 if (batch != pn._batch) {
779 for(var cn = pn.firstChild; cn; cn = cn.nextSibling){
780 if(cn.nodeType == 1){
787 if (l == 0 || n.nodeIndex == l){
790 } else if ((n.nodeIndex + l) % f == 0){
798 "only-child" : function(c){
799 var r = [], ri = -1;;
800 for(var i = 0, ci; ci = c[i]; i++){
801 if(!prev(ci) && !next(ci)){
808 "empty" : function(c){
810 for(var i = 0, ci; ci = c[i]; i++){
811 var cns = ci.childNodes, j = 0, cn, empty = true;
814 if(cn.nodeType == 1 || cn.nodeType == 3){
826 "contains" : function(c, v){
828 for(var i = 0, ci; ci = c[i]; i++){
829 if((ci.textContent||ci.innerText||'').indexOf(v) != -1){
836 "nodeValue" : function(c, v){
838 for(var i = 0, ci; ci = c[i]; i++){
839 if(ci.firstChild && ci.firstChild.nodeValue == v){
846 "checked" : function(c){
848 for(var i = 0, ci; ci = c[i]; i++){
849 if(ci.checked == true){
856 "not" : function(c, ss){
857 return Ext.DomQuery.filter(c, ss, true);
860 "any" : function(c, selectors){
861 var ss = selectors.split('|'),
863 for(var i = 0, ci; ci = c[i]; i++){
864 for(var j = 0; s = ss[j]; j++){
865 if(Ext.DomQuery.is(ci, s)){
875 return this["nth-child"](c, "odd");
878 "even" : function(c){
879 return this["nth-child"](c, "even");
882 "nth" : function(c, a){
886 "first" : function(c){
890 "last" : function(c){
891 return c[c.length-1] || [];
894 "has" : function(c, ss){
895 var s = Ext.DomQuery.select,
897 for(var i = 0, ci; ci = c[i]; i++){
898 if(s(ss, ci).length > 0){
905 "next" : function(c, ss){
906 var is = Ext.DomQuery.is,
908 for(var i = 0, ci; ci = c[i]; i++){
917 "prev" : function(c, ss){
918 var is = Ext.DomQuery.is,
920 for(var i = 0, ci; ci = c[i]; i++){
932 <div id="method-Ext-query"></div>/**
933 * Selects an array of DOM nodes by CSS/XPath selector. Shorthand of {@link Ext.DomQuery#select}
934 * @param {String} path The selector/xpath query
935 * @param {Node} root (optional) The start of the query (defaults to document).
940 Ext.query = Ext.DomQuery.select;