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.0
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],
299 for(var i = 0, ci; ci = cs[i]; i++){
300 // skip non-element nodes.
301 if(ci.nodeType != 1){
305 innerHTML = ci.innerHTML;
306 // we only need to change the property names if we're dealing with html nodes, not XML
307 if(innerHTML !== null && innerHTML !== undefined){
309 a = Ext.DomQuery.getStyle(ci, attr);
310 } else if (attr == "class" || attr == "className"){
312 } else if (attr == "for"){
314 } else if (attr == "href"){
315 // getAttribute href bug
316 // http://www.glennjones.net/Post/809/getAttributehrefbug.htm
317 a = ci.getAttribute("href", 2);
319 a = ci.getAttribute(attr);
322 a = ci.getAttribute(attr);
324 if((fn && fn(a, value)) || (!fn && a)){
331 function byPseudo(cs, name, value){
332 return Ext.DomQuery.pseudos[name](cs, value);
335 function nodupIEXml(cs){
338 cs[0].setAttribute("_nodup", d);
340 for(var i = 1, len = cs.length; i < len; i++){
342 if(!c.getAttribute("_nodup") != d){
343 c.setAttribute("_nodup", d);
347 for(var i = 0, len = cs.length; i < len; i++){
348 cs[i].removeAttribute("_nodup");
357 var len = cs.length, c, i, r = cs, cj, ri = -1;
358 if(!len || typeof cs.nodeType != "undefined" || len == 1){
361 if(isIE && typeof cs[0].selectSingleNode != "undefined"){
362 return nodupIEXml(cs);
366 for(i = 1; c = cs[i]; i++){
371 for(var j = 0; j < i; j++){
374 for(j = i+1; cj = cs[j]; j++){
386 function quickDiffIEXml(c1, c2){
389 for(var i = 0, len = c1.length; i < len; i++){
390 c1[i].setAttribute("_qdiff", d);
392 for(var i = 0, len = c2.length; i < len; i++){
393 if(c2[i].getAttribute("_qdiff") != d){
397 for(var i = 0, len = c1.length; i < len; i++){
398 c1[i].removeAttribute("_qdiff");
403 function quickDiff(c1, c2){
404 var len1 = c1.length,
410 if(isIE && typeof c1[0].selectSingleNode != "undefined"){
411 return quickDiffIEXml(c1, c2);
413 for(var i = 0; i < len1; i++){
416 for(var i = 0, len = c2.length; i < len; i++){
417 if(c2[i]._qdiff != d){
424 function quickId(ns, mode, root, id){
426 var d = root.ownerDocument || root;
427 return d.getElementById(id);
429 ns = getNodes(ns, mode, "*");
434 getStyle : function(el, name){
435 return Ext.fly(el).getStyle(name);
437 <div id="method-Ext.DomQuery-compile"></div>/**
438 * Compiles a selector/xpath query into a reusable function. The returned function
439 * takes one parameter "root" (optional), which is the context node from where the query should start.
440 * @param {String} selector The selector/xpath query
441 * @param {String} type (optional) Either "select" (the default) or "simple" for a simple selector match
444 compile : function(path, type){
445 type = type || "select";
448 var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"],
451 matchers = Ext.DomQuery.matchers,
452 matchersLn = matchers.length,
454 // accept leading mode switch
455 lmode = path.match(modeRe);
457 if(lmode && lmode[1]){
458 fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";';
459 path = path.replace(lmode[1], "");
462 // strip leading slashes
463 while(path.substr(0, 1)=="/"){
464 path = path.substr(1);
467 while(path && lastPath != path){
469 var tokenMatch = path.match(tagTokenRe);
470 if(type == "select"){
473 if(tokenMatch[1] == "#"){
474 fn[fn.length] = 'n = quickId(n, mode, root, "'+tokenMatch[2]+'");';
476 fn[fn.length] = 'n = getNodes(n, mode, "'+tokenMatch[2]+'");';
478 path = path.replace(tokenMatch[0], "");
479 }else if(path.substr(0, 1) != '@'){
480 fn[fn.length] = 'n = getNodes(n, mode, "*");';
485 if(tokenMatch[1] == "#"){
486 fn[fn.length] = 'n = byId(n, "'+tokenMatch[2]+'");';
488 fn[fn.length] = 'n = byTag(n, "'+tokenMatch[2]+'");';
490 path = path.replace(tokenMatch[0], "");
493 while(!(modeMatch = path.match(modeRe))){
495 for(var j = 0; j < matchersLn; j++){
497 var m = path.match(t.re);
499 fn[fn.length] = t.select.replace(tplRe, function(x, i){
502 path = path.replace(m[0], "");
507 // prevent infinite loop on bad selector
509 throw 'Error parsing selector, parsing failed at "' + path + '"';
513 fn[fn.length] = 'mode="'+modeMatch[1].replace(trimRe, "")+'";';
514 path = path.replace(modeMatch[1], "");
518 fn[fn.length] = "return nodup(n);\n}";
520 // eval fn and return it
525 <div id="method-Ext.DomQuery-jsSelect"></div>/**
526 * Selects a group of elements.
527 * @param {String} selector The selector/xpath query (can be a comma separated list of selectors)
528 * @param {Node/String} root (optional) The start of the query (defaults to document).
529 * @return {Array} An Array of DOM elements which match the selector. If there are
530 * no matches, and empty Array is returned.
532 jsSelect: function(path, root, type){
533 // set root to doc if not specified.
534 root = root || document;
536 if(typeof root == "string"){
537 root = document.getElementById(root);
539 var paths = path.split(","),
542 // loop over each selector
543 for(var i = 0, len = paths.length; i < len; i++){
544 var subPath = paths[i].replace(trimRe, "");
545 // compile and place in cache
547 cache[subPath] = Ext.DomQuery.compile(subPath);
549 throw subPath + " is not a valid selector";
552 var result = cache[subPath](root);
553 if(result && result != document){
554 results = results.concat(result);
558 // if there were multiple selectors, make sure dups
560 if(paths.length > 1){
561 return nodup(results);
565 isXml: function(el) {
566 var docEl = (el ? el.ownerDocument || el : 0).documentElement;
567 return docEl ? docEl.nodeName !== "HTML" : false;
569 select : document.querySelectorAll ? function(path, root, type) {
570 root = root || document;
571 if (!Ext.DomQuery.isXml(root)) {
573 var cs = root.querySelectorAll(path);
574 return Ext.toArray(cs);
578 return Ext.DomQuery.jsSelect.call(this, path, root, type);
579 } : function(path, root, type) {
580 return Ext.DomQuery.jsSelect.call(this, path, root, type);
583 <div id="method-Ext.DomQuery-selectNode"></div>/**
584 * Selects a single element.
585 * @param {String} selector The selector/xpath query
586 * @param {Node} root (optional) The start of the query (defaults to document).
587 * @return {Element} The DOM element which matched the selector.
589 selectNode : function(path, root){
590 return Ext.DomQuery.select(path, root)[0];
593 <div id="method-Ext.DomQuery-selectValue"></div>/**
594 * Selects the value of a node, optionally replacing null with the defaultValue.
595 * @param {String} selector The selector/xpath query
596 * @param {Node} root (optional) The start of the query (defaults to document).
597 * @param {String} defaultValue
600 selectValue : function(path, root, defaultValue){
601 path = path.replace(trimRe, "");
602 if(!valueCache[path]){
603 valueCache[path] = Ext.DomQuery.compile(path, "select");
605 var n = valueCache[path](root), v;
608 // overcome a limitation of maximum textnode size
609 // Rumored to potentially crash IE6 but has not been confirmed.
610 // http://reference.sitepoint.com/javascript/Node/normalize
611 // https://developer.mozilla.org/En/DOM/Node.normalize
612 if (typeof n.normalize == 'function') n.normalize();
614 v = (n && n.firstChild ? n.firstChild.nodeValue : null);
615 return ((v === null||v === undefined||v==='') ? defaultValue : v);
618 <div id="method-Ext.DomQuery-selectNumber"></div>/**
619 * Selects the value of a node, parsing integers and floats. Returns the defaultValue, or 0 if none is specified.
620 * @param {String} selector The selector/xpath query
621 * @param {Node} root (optional) The start of the query (defaults to document).
622 * @param {Number} defaultValue
625 selectNumber : function(path, root, defaultValue){
626 var v = Ext.DomQuery.selectValue(path, root, defaultValue || 0);
627 return parseFloat(v);
630 <div id="method-Ext.DomQuery-is"></div>/**
631 * Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child)
632 * @param {String/HTMLElement/Array} el An element id, element or array of elements
633 * @param {String} selector The simple selector to test
636 is : function(el, ss){
637 if(typeof el == "string"){
638 el = document.getElementById(el);
640 var isArray = Ext.isArray(el),
641 result = Ext.DomQuery.filter(isArray ? el : [el], ss);
642 return isArray ? (result.length == el.length) : (result.length > 0);
645 <div id="method-Ext.DomQuery-filter"></div>/**
646 * Filters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child)
647 * @param {Array} el An array of elements to filter
648 * @param {String} selector The simple selector to test
649 * @param {Boolean} nonMatches If true, it returns the elements that DON'T match
650 * the selector instead of the ones that match
651 * @return {Array} An Array of DOM elements which match the selector. If there are
652 * no matches, and empty Array is returned.
654 filter : function(els, ss, nonMatches){
655 ss = ss.replace(trimRe, "");
656 if(!simpleCache[ss]){
657 simpleCache[ss] = Ext.DomQuery.compile(ss, "simple");
659 var result = simpleCache[ss](els);
660 return nonMatches ? quickDiff(result, els) : result;
663 <div id="prop-Ext.DomQuery-matchers"></div>/**
664 * Collection of matching regular expressions and code snippets.
665 * Each capture group within () will be replace the {} in the select
666 * statement as specified by their index.
670 select: 'n = byClassName(n, " {1} ");'
672 re: /^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
673 select: 'n = byPseudo(n, "{1}", "{2}");'
675 re: /^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
676 select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
679 select: 'n = byId(n, "{1}");'
682 select: 'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'
686 <div id="method-Ext.DomQuery-operators"></div>/**
687 * Collection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=.
688 * 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, > <.
691 "=" : function(a, v){
694 "!=" : function(a, v){
697 "^=" : function(a, v){
698 return a && a.substr(0, v.length) == v;
700 "$=" : function(a, v){
701 return a && a.substr(a.length-v.length) == v;
703 "*=" : function(a, v){
704 return a && a.indexOf(v) !== -1;
706 "%=" : function(a, v){
709 "|=" : function(a, v){
710 return a && (a == v || a.substr(0, v.length+1) == v+'-');
712 "~=" : function(a, v){
713 return a && (' '+a+' ').indexOf(' '+v+' ') != -1;
717 <div id="prop-Ext.DomQuery-pseudos"></div>/**
718 * <p>Object hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed
719 * two parameters:</p><div class="mdetail-params"><ul>
720 * <li><b>c</b> : Array<div class="sub-desc">An Array of DOM elements to filter.</div></li>
721 * <li><b>v</b> : String<div class="sub-desc">The argument (if any) supplied in the selector.</div></li>
723 * <p>A filter function returns an Array of DOM elements which conform to the pseudo class.</p>
724 * <p>In addition to the provided pseudo classes listed above such as <code>first-child</code> and <code>nth-child</code>,
725 * developers may add additional, custom psuedo class filters to select elements according to application-specific requirements.</p>
726 * <p>For example, to filter <code><a></code> elements to only return links to <i>external</i> resources:</p>
728 Ext.DomQuery.pseudos.external = function(c, v){
730 for(var i = 0, ci; ci = c[i]; i++){
731 // Include in result set only if it's a link to an external resource
732 if(ci.hostname != location.hostname){
738 * Then external links could be gathered with the following statement:<code><pre>
739 var externalLinks = Ext.select("a:external");
743 "first-child" : function(c){
744 var r = [], ri = -1, n;
745 for(var i = 0, ci; ci = n = c[i]; i++){
746 while((n = n.previousSibling) && n.nodeType != 1);
754 "last-child" : function(c){
755 var r = [], ri = -1, n;
756 for(var i = 0, ci; ci = n = c[i]; i++){
757 while((n = n.nextSibling) && n.nodeType != 1);
765 "nth-child" : function(c, a) {
767 m = nthRe.exec(a == "even" && "2n" || a == "odd" && "2n+1" || !nthRe2.test(a) && "n+" + a || a),
768 f = (m[1] || 1) - 0, l = m[2] - 0;
769 for(var i = 0, n; n = c[i]; i++){
770 var pn = n.parentNode;
771 if (batch != pn._batch) {
773 for(var cn = pn.firstChild; cn; cn = cn.nextSibling){
774 if(cn.nodeType == 1){
781 if (l == 0 || n.nodeIndex == l){
784 } else if ((n.nodeIndex + l) % f == 0){
792 "only-child" : function(c){
793 var r = [], ri = -1;;
794 for(var i = 0, ci; ci = c[i]; i++){
795 if(!prev(ci) && !next(ci)){
802 "empty" : function(c){
804 for(var i = 0, ci; ci = c[i]; i++){
805 var cns = ci.childNodes, j = 0, cn, empty = true;
808 if(cn.nodeType == 1 || cn.nodeType == 3){
820 "contains" : function(c, v){
822 for(var i = 0, ci; ci = c[i]; i++){
823 if((ci.textContent||ci.innerText||'').indexOf(v) != -1){
830 "nodeValue" : function(c, v){
832 for(var i = 0, ci; ci = c[i]; i++){
833 if(ci.firstChild && ci.firstChild.nodeValue == v){
840 "checked" : function(c){
842 for(var i = 0, ci; ci = c[i]; i++){
843 if(ci.checked == true){
850 "not" : function(c, ss){
851 return Ext.DomQuery.filter(c, ss, true);
854 "any" : function(c, selectors){
855 var ss = selectors.split('|'),
857 for(var i = 0, ci; ci = c[i]; i++){
858 for(var j = 0; s = ss[j]; j++){
859 if(Ext.DomQuery.is(ci, s)){
869 return this["nth-child"](c, "odd");
872 "even" : function(c){
873 return this["nth-child"](c, "even");
876 "nth" : function(c, a){
880 "first" : function(c){
884 "last" : function(c){
885 return c[c.length-1] || [];
888 "has" : function(c, ss){
889 var s = Ext.DomQuery.select,
891 for(var i = 0, ci; ci = c[i]; i++){
892 if(s(ss, ci).length > 0){
899 "next" : function(c, ss){
900 var is = Ext.DomQuery.is,
902 for(var i = 0, ci; ci = c[i]; i++){
911 "prev" : function(c, ss){
912 var is = Ext.DomQuery.is,
914 for(var i = 0, ci; ci = c[i]; i++){
926 <div id="method-Ext-query"></div>/**
927 * Selects an array of DOM nodes by CSS/XPath selector. Shorthand of {@link Ext.DomQuery#select}
928 * @param {String} path The selector/xpath query
929 * @param {Node} root (optional) The start of the query (defaults to document).
934 Ext.query = Ext.DomQuery.select;