2 * @class Ext.EventManager
3 * Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides
4 * several useful events directly.
5 * See {@link Ext.EventObject} for more details on normalized event objects.
10 // --------------------- onReady ---------------------
13 * Check if we have bound our global onReady listener
16 hasBoundOnReady: false,
19 * Check if fireDocReady has been called
25 * Timer for the document ready event in old IE versions
31 * Checks if we have bound an onreadystatechange event
34 hasOnReadyStateChange: false,
37 * Holds references to any onReady functions
40 readyEvent: new Ext.util.Event(),
43 * Check the ready state for old IE versions
45 * @return {Boolean} True if the document is ready
47 checkReadyState: function(){
48 var me = Ext.EventManager;
50 if(window.attachEvent){
51 // See here for reference: http://javascript.nwbox.com/IEContentLoaded/
56 document.documentElement.doScroll('left');
63 if (document.readyState == 'complete') {
67 me.readyTimeout = setTimeout(arguments.callee, 2);
72 * Binds the appropriate browser event for checking if the DOM has loaded.
75 bindReadyEvent: function(){
76 var me = Ext.EventManager;
77 if (me.hasBoundOnReady) {
81 if (document.addEventListener) {
82 document.addEventListener('DOMContentLoaded', me.fireDocReady, false);
83 // fallback, load will ~always~ fire
84 window.addEventListener('load', me.fireDocReady, false);
86 // check if the document is ready, this will also kick off the scroll checking timer
87 if (!me.checkReadyState()) {
88 document.attachEvent('onreadystatechange', me.checkReadyState);
89 me.hasOnReadyStateChange = true;
91 // fallback, onload will ~always~ fire
92 window.attachEvent('onload', me.fireDocReady, false);
94 me.hasBoundOnReady = true;
98 * We know the document is loaded, so trigger any onReady events.
101 fireDocReady: function(){
102 var me = Ext.EventManager;
104 // only unbind these events once
105 if (!me.hasFiredReady) {
106 me.hasFiredReady = true;
108 if (document.addEventListener) {
109 document.removeEventListener('DOMContentLoaded', me.fireDocReady, false);
110 window.removeEventListener('load', me.fireDocReady, false);
112 if (me.readyTimeout !== null) {
113 clearTimeout(me.readyTimeout);
115 if (me.hasOnReadyStateChange) {
116 document.detachEvent('onreadystatechange', me.checkReadyState);
118 window.detachEvent('onload', me.fireDocReady);
125 me.readyEvent.fire();
130 * Adds a listener to be notified when the document is ready (before onload and before images are loaded). Can be
131 * accessed shorthanded as Ext.onReady().
132 * @param {Function} fn The method the event invokes.
133 * @param {Object} scope (optional) The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window.
134 * @param {boolean} options (optional) Options object as passed to {@link Ext.core.Element#addListener}.
136 onDocumentReady: function(fn, scope, options){
137 options = options || {};
138 var me = Ext.EventManager,
139 readyEvent = me.readyEvent;
141 // force single to be true so our event is only ever fired once.
142 options.single = true;
144 // Document already loaded, let's just fire it
146 readyEvent.addListener(fn, scope, options);
149 options.delay = options.delay || 1;
150 readyEvent.addListener(fn, scope, options);
156 // --------------------- event binding ---------------------
159 * Contains a list of all document mouse downs, so we can ensure they fire even when stopEvent is called.
162 stoppedMouseDownEvent: new Ext.util.Event(),
165 * Options to parse for the 4th argument to addListener.
168 propRe: /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate|freezeEvent)$/,
171 * Get the id of the element. If one has not been assigned, automatically assign it.
172 * @param {Mixed} element The element to get the id for.
173 * @return {String} id
175 getId : function(element) {
176 var skipGarbageCollection = false,
179 element = Ext.getDom(element);
181 if (element === document || element === window) {
182 id = element === document ? Ext.documentId : Ext.windowId;
185 id = Ext.id(element);
187 // skip garbage collection for special elements (window, document, iframes)
188 if (element && (element.getElementById || element.navigator)) {
189 skipGarbageCollection = true;
193 Ext.core.Element.addToCache(new Ext.core.Element(element), id);
194 if (skipGarbageCollection) {
195 Ext.cache[id].skipGarbageCollection = true;
202 * Convert a "config style" listener into a set of flat arguments so they can be passed to addListener
204 * @param {Object} element The element the event is for
205 * @param {Object} event The event configuration
206 * @param {Object} isRemove True if a removal should be performed, otherwise an add will be done.
208 prepareListenerConfig: function(element, config, isRemove){
213 // loop over all the keys in the object
214 for (key in config) {
215 if (config.hasOwnProperty(key)) {
216 // if the key is something else then an event option
217 if (!propRe.test(key)) {
219 // if the value is a function it must be something like click: function(){}, scope: this
220 // which means that there might be multiple event listeners with shared options
221 if (Ext.isFunction(value)) {
223 args = [element, key, value, config.scope, config];
225 // if its not a function, it must be an object like click: {fn: function(){}, scope: this}
226 args = [element, key, value.fn, value.scope, value];
229 if (isRemove === true) {
230 me.removeListener.apply(this, args);
232 me.addListener.apply(me, args);
240 * Normalize cross browser event differences
242 * @param {Object} eventName The event name
243 * @param {Object} fn The function to execute
244 * @return {Object} The new event name/function
246 normalizeEvent: function(eventName, fn){
247 if (/mouseenter|mouseleave/.test(eventName) && !Ext.supports.MouseEnterLeave) {
249 fn = Ext.Function.createInterceptor(fn, this.contains, this);
251 eventName = eventName == 'mouseenter' ? 'mouseover' : 'mouseout';
252 } else if (eventName == 'mousewheel' && !Ext.supports.MouseWheel && !Ext.isOpera){
253 eventName = 'DOMMouseScroll';
256 eventName: eventName,
262 * Checks whether the event's relatedTarget is contained inside (or <b>is</b>) the element.
264 * @param {Object} event
266 contains: function(event){
267 var parent = event.browserEvent.currentTarget,
268 child = this.getRelatedTarget(event);
270 if (parent && parent.firstChild) {
272 if (child === parent) {
275 child = child.parentNode;
276 if (child && (child.nodeType != 1)) {
285 * Appends an event handler to an element. The shorthand version {@link #on} is equivalent. Typically you will
286 * use {@link Ext.core.Element#addListener} directly on an Element in favor of calling this version.
287 * @param {String/HTMLElement} el The html element or id to assign the event handler to.
288 * @param {String} eventName The name of the event to listen for.
289 * @param {Function} handler The handler function the event invokes. This function is passed
290 * the following parameters:<ul>
291 * <li>evt : EventObject<div class="sub-desc">The {@link Ext.EventObject EventObject} describing the event.</div></li>
292 * <li>t : Element<div class="sub-desc">The {@link Ext.core.Element Element} which was the target of the event.
293 * Note that this may be filtered by using the <tt>delegate</tt> option.</div></li>
294 * <li>o : Object<div class="sub-desc">The options object from the addListener call.</div></li>
296 * @param {Object} scope (optional) The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>.
297 * @param {Object} options (optional) An object containing handler configuration properties.
298 * This may contain any of the following properties:<ul>
299 * <li>scope : Object<div class="sub-desc">The scope (<b><code>this</code></b> reference) in which the handler function is executed. <b>Defaults to the Element</b>.</div></li>
300 * <li>delegate : String<div class="sub-desc">A simple selector to filter the target or look for a descendant of the target</div></li>
301 * <li>stopEvent : Boolean<div class="sub-desc">True to stop the event. That is stop propagation, and prevent the default action.</div></li>
302 * <li>preventDefault : Boolean<div class="sub-desc">True to prevent the default action</div></li>
303 * <li>stopPropagation : Boolean<div class="sub-desc">True to prevent event propagation</div></li>
304 * <li>normalized : Boolean<div class="sub-desc">False to pass a browser event to the handler function instead of an Ext.EventObject</div></li>
305 * <li>delay : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after te event fires.</div></li>
306 * <li>single : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
307 * <li>buffer : Number<div class="sub-desc">Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed
308 * by the specified number of milliseconds. If the event fires again within that time, the original
309 * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
310 * <li>target : Element<div class="sub-desc">Only call the handler if the event was fired on the target Element, <i>not</i> if the event was bubbled up from a child node.</div></li>
312 * <p>See {@link Ext.core.Element#addListener} for examples of how to use these options.</p>
314 addListener: function(element, eventName, fn, scope, options){
315 // Check if we've been passed a "config style" event.
316 if (Ext.isObject(eventName)) {
317 this.prepareListenerConfig(element, eventName);
321 var dom = Ext.getDom(element),
328 sourceClass: 'Ext.EventManager',
329 sourceMethod: 'addListener',
330 targetElement: element,
331 eventName: eventName,
332 msg: 'Error adding "' + eventName + '\" listener for nonexistent element "' + element + '"'
337 sourceClass: 'Ext.EventManager',
338 sourceMethod: 'addListener',
339 targetElement: element,
340 eventName: eventName,
341 msg: 'Error adding "' + eventName + '\" listener. The handler function is undefined.'
346 // create the wrapper function
347 options = options || {};
349 bind = this.normalizeEvent(eventName, fn);
350 wrap = this.createListenerWrap(dom, eventName, bind.fn, scope, options);
353 if (dom.attachEvent) {
354 dom.attachEvent('on' + bind.eventName, wrap);
356 dom.addEventListener(bind.eventName, wrap, options.capture || false);
359 if (dom == document && eventName == 'mousedown') {
360 this.stoppedMouseDownEvent.addListener(wrap);
363 // add all required data into the event cache
364 this.getEventListenerCache(dom, eventName).push({
372 * Removes an event handler from an element. The shorthand version {@link #un} is equivalent. Typically
373 * you will use {@link Ext.core.Element#removeListener} directly on an Element in favor of calling this version.
374 * @param {String/HTMLElement} el The id or html element from which to remove the listener.
375 * @param {String} eventName The name of the event.
376 * @param {Function} fn The handler function to remove. <b>This must be a reference to the function passed into the {@link #addListener} call.</b>
377 * @param {Object} scope If a scope (<b><code>this</code></b> reference) was specified when the listener was added,
378 * then this must refer to the same object.
380 removeListener : function(element, eventName, fn, scope) {
381 // handle our listener config object syntax
382 if (Ext.isObject(eventName)) {
383 this.prepareListenerConfig(element, eventName, true);
387 var dom = Ext.getDom(element),
388 cache = this.getEventListenerCache(dom, eventName),
389 bindName = this.normalizeEvent(eventName).eventName,
391 listener, wrap, tasks;
397 if (listener && (!fn || listener.fn == fn) && (!scope || listener.scope === scope)) {
398 wrap = listener.wrap;
400 // clear buffered calls
402 clearTimeout(wrap.task);
406 // clear delayed calls
407 j = wrap.tasks && wrap.tasks.length;
410 clearTimeout(wrap.tasks[j]);
415 if (dom.detachEvent) {
416 dom.detachEvent('on' + bindName, wrap);
418 dom.removeEventListener(bindName, wrap, false);
421 if (wrap && dom == document && eventName == 'mousedown') {
422 this.stoppedMouseDownEvent.removeListener(wrap);
425 // remove listener from cache
432 * Removes all event handers from an element. Typically you will use {@link Ext.core.Element#removeAllListeners}
433 * directly on an Element in favor of calling this version.
434 * @param {String/HTMLElement} el The id or html element from which to remove all event handlers.
436 removeAll : function(element){
437 var dom = Ext.getDom(element),
442 cache = this.getElementEventCache(dom);
445 if (cache.hasOwnProperty(ev)) {
446 this.removeListener(dom, ev);
449 Ext.cache[dom.id].events = {};
453 * Recursively removes all previous added listeners from an element and its children. Typically you will use {@link Ext.core.Element#purgeAllListeners}
454 * directly on an Element in favor of calling this version.
455 * @param {String/HTMLElement} el The id or html element from which to remove all event handlers.
456 * @param {String} eventName (optional) The name of the event.
458 purgeElement : function(element, eventName) {
459 var dom = Ext.getDom(element),
463 this.removeListener(dom, eventName);
469 if(dom && dom.childNodes) {
470 for(len = element.childNodes.length; i < len; i++) {
471 this.purgeElement(element.childNodes[i], eventName);
477 * Create the wrapper function for the event
479 * @param {HTMLElement} dom The dom element
480 * @param {String} ename The event name
481 * @param {Function} fn The function to execute
482 * @param {Object} scope The scope to execute callback in
483 * @param {Object} options The options
484 * @return {Function} the wrapper function
486 createListenerWrap : function(dom, ename, fn, scope, options) {
487 options = !Ext.isObject(options) ? {} : options;
491 return function wrap(e, args) {
492 // Compile the implementation upon first firing
494 f = ['if(!Ext) {return;}'];
496 if(options.buffer || options.delay || options.freezeEvent) {
497 f.push('e = new Ext.EventObjectImpl(e, ' + (options.freezeEvent ? 'true' : 'false' ) + ');');
499 f.push('e = Ext.EventObject.setEvent(e);');
502 if (options.delegate) {
503 f.push('var t = e.getTarget("' + options.delegate + '", this);');
504 f.push('if(!t) {return;}');
506 f.push('var t = e.target;');
509 if (options.target) {
510 f.push('if(e.target !== options.target) {return;}');
513 if(options.stopEvent) {
514 f.push('e.stopEvent();');
516 if(options.preventDefault) {
517 f.push('e.preventDefault();');
519 if(options.stopPropagation) {
520 f.push('e.stopPropagation();');
524 if(options.normalized === false) {
525 f.push('e = e.browserEvent;');
529 f.push('(wrap.task && clearTimeout(wrap.task));');
530 f.push('wrap.task = setTimeout(function(){');
534 f.push('wrap.tasks = wrap.tasks || [];');
535 f.push('wrap.tasks.push(setTimeout(function(){');
538 // finally call the actual handler fn
539 f.push('fn.call(scope || dom, e, t, options);');
542 f.push('Ext.EventManager.removeListener(dom, ename, fn, scope);');
546 f.push('}, ' + options.delay + '));');
550 f.push('}, ' + options.buffer + ');');
553 gen = Ext.functionFactory('e', 'options', 'fn', 'scope', 'ename', 'dom', 'wrap', 'args', f.join('\n'));
556 gen.call(dom, e, options, fn, scope, ename, dom, wrap, args);
561 * Get the event cache for a particular element for a particular event
563 * @param {HTMLElement} element The element
564 * @param {Object} eventName The event name
565 * @return {Array} The events for the element
567 getEventListenerCache : function(element, eventName) {
568 var eventCache = this.getElementEventCache(element);
569 return eventCache[eventName] || (eventCache[eventName] = []);
573 * Gets the event cache for the object
575 * @param {HTMLElement} element The element
576 * @return {Object} The event cache for the object
578 getElementEventCache : function(element) {
579 var elementCache = Ext.cache[this.getId(element)];
580 return elementCache.events || (elementCache.events = {});
583 // --------------------- utility methods ---------------------
584 mouseLeaveRe: /(mouseout|mouseleave)/,
585 mouseEnterRe: /(mouseover|mouseenter)/,
588 * Stop the event (preventDefault and stopPropagation)
589 * @param {Event} The event to stop
591 stopEvent: function(event) {
592 this.stopPropagation(event);
593 this.preventDefault(event);
597 * Cancels bubbling of the event.
598 * @param {Event} The event to stop bubbling.
600 stopPropagation: function(event) {
601 event = event.browserEvent || event;
602 if (event.stopPropagation) {
603 event.stopPropagation();
605 event.cancelBubble = true;
610 * Prevents the browsers default handling of the event.
611 * @param {Event} The event to prevent the default
613 preventDefault: function(event) {
614 event = event.browserEvent || event;
615 if (event.preventDefault) {
616 event.preventDefault();
618 event.returnValue = false;
619 // Some keys events require setting the keyCode to -1 to be prevented
621 // all ctrl + X and F1 -> F12
622 if (event.ctrlKey || event.keyCode > 111 && event.keyCode < 124) {
626 // see this outdated document http://support.microsoft.com/kb/934364/en-us for more info
632 * Gets the related target from the event.
633 * @param {Object} event The event
634 * @return {HTMLElement} The related target.
636 getRelatedTarget: function(event) {
637 event = event.browserEvent || event;
638 var target = event.relatedTarget;
640 if (this.mouseLeaveRe.test(event.type)) {
641 target = event.toElement;
642 } else if (this.mouseEnterRe.test(event.type)) {
643 target = event.fromElement;
646 return this.resolveTextNode(target);
650 * Gets the x coordinate from the event
651 * @param {Object} event The event
652 * @return {Number} The x coordinate
654 getPageX: function(event) {
655 return this.getXY(event)[0];
659 * Gets the y coordinate from the event
660 * @param {Object} event The event
661 * @return {Number} The y coordinate
663 getPageY: function(event) {
664 return this.getXY(event)[1];
668 * Gets the x & ycoordinate from the event
669 * @param {Object} event The event
670 * @return {Array} The x/y coordinate
672 getPageXY: function(event) {
673 event = event.browserEvent || event;
676 doc = document.documentElement,
677 body = document.body;
679 // pageX/pageY not available (undefined, not null), use clientX/clientY instead
681 x = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
682 y = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
688 * Gets the target of the event.
689 * @param {Object} event The event
690 * @return {HTMLElement} target
692 getTarget: function(event) {
693 event = event.browserEvent || event;
694 return this.resolveTextNode(event.target || event.srcElement);
698 * Resolve any text nodes accounting for browser differences.
700 * @param {HTMLElement} node The node
701 * @return {HTMLElement} The resolved node
703 // technically no need to browser sniff this, however it makes no sense to check this every time, for every event, whether the string is equal.
704 resolveTextNode: Ext.isGecko ?
709 // work around firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=101197
710 var s = HTMLElement.prototype.toString.call(node);
711 if (s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]') {
714 return node.nodeType == 3 ? node.parentNode: node;
716 return node && node.nodeType == 3 ? node.parentNode: node;
719 // --------------------- custom event binding ---------------------
721 // Keep track of the current width/height
726 * Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 milliseconds),
727 * passes new viewport width and height to handlers.
728 * @param {Function} fn The handler function the window resize event invokes.
729 * @param {Object} scope The scope (<code>this</code> reference) in which the handler function executes. Defaults to the browser window.
730 * @param {boolean} options Options object as passed to {@link Ext.core.Element#addListener}
732 onWindowResize: function(fn, scope, options){
733 var resize = this.resizeEvent;
735 this.resizeEvent = resize = new Ext.util.Event();
736 this.on(window, 'resize', this.fireResize, this, {buffer: 100});
738 resize.addListener(fn, scope, options);
742 * Fire the resize event.
745 fireResize: function(){
747 w = Ext.core.Element.getViewWidth(),
748 h = Ext.core.Element.getViewHeight();
750 //whacky problem in IE where the resize event will sometimes fire even though the w/h are the same.
751 if(me.curHeight != h || me.curWidth != w){
754 me.resizeEvent.fire(w, h);
759 * Removes the passed window resize listener.
760 * @param {Function} fn The method the event invokes
761 * @param {Object} scope The scope of handler
763 removeResizeListener: function(fn, scope){
764 if (this.resizeEvent) {
765 this.resizeEvent.removeListener(fn, scope);
769 onWindowUnload: function() {
770 var unload = this.unloadEvent;
772 this.unloadEvent = unload = new Ext.util.Event();
773 this.addListener(window, 'unload', this.fireUnload, this);
778 * Fires the unload event for items bound with onWindowUnload
781 fireUnload: function() {
782 // wrap in a try catch, could have some problems during unload
784 this.removeUnloadListener();
785 // Work around FF3 remembering the last scroll position when refreshing the grid and then losing grid view
787 var gridviews = Ext.ComponentQuery.query('gridview'),
789 ln = gridviews.length;
790 for (; i < ln; i++) {
791 gridviews[i].scrollToTop();
794 // Purge all elements in the cache
798 if (cache.hasOwnProperty(el)) {
799 Ext.EventManager.removeAll(el);
807 * Removes the passed window unload listener.
808 * @param {Function} fn The method the event invokes
809 * @param {Object} scope The scope of handler
811 removeUnloadListener: function(){
812 if (this.unloadEvent) {
813 this.removeListener(window, 'unload', this.fireUnload);
818 * note 1: IE fires ONLY the keydown event on specialkey autorepeat
819 * note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on specialkey autorepeat
820 * (research done by @Jan Wolter at http://unixpapa.com/js/key.html)
823 useKeyDown: Ext.isWebKit ?
824 parseInt(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1], 10) >= 525 :
825 !((Ext.isGecko && !Ext.isWindows) || Ext.isOpera),
828 * Indicates which event to use for getting key presses.
829 * @return {String} The appropriate event name.
831 getKeyEvent: function(){
832 return this.useKeyDown ? 'keydown' : 'keypress';
837 * Alias for {@link Ext.Loader#onReady Ext.Loader.onReady} with withDomReady set to true
841 Ext.onReady = function(fn, scope, options) {
842 Ext.Loader.onReady(fn, scope, true, options);
846 * Alias for {@link Ext.EventManager#onDocumentReady Ext.EventManager.onDocumentReady}
848 * @method onDocumentReady
850 Ext.onDocumentReady = Ext.EventManager.onDocumentReady;
853 * Alias for {@link Ext.EventManager#addListener Ext.EventManager.addListener}
854 * @member Ext.EventManager
857 Ext.EventManager.on = Ext.EventManager.addListener;
860 * Alias for {@link Ext.EventManager#removeListener Ext.EventManager.removeListener}
861 * @member Ext.EventManager
864 Ext.EventManager.un = Ext.EventManager.removeListener;
867 var initExtCss = function() {
868 // find the body element
869 var bd = document.body || document.getElementsByTagName('body')[0],
870 baseCSSPrefix = Ext.baseCSSPrefix,
879 html = bd.parentNode;
881 //Let's keep this human readable!
883 cls.push(baseCSSPrefix + 'ie');
886 cls.push(baseCSSPrefix + 'ie6');
889 cls.push(baseCSSPrefix + 'ie7');
892 cls.push(baseCSSPrefix + 'ie8');
895 cls.push(baseCSSPrefix + 'ie9');
898 cls.push(baseCSSPrefix + 'gecko');
901 cls.push(baseCSSPrefix + 'gecko3');
904 cls.push(baseCSSPrefix + 'gecko4');
907 cls.push(baseCSSPrefix + 'opera');
910 cls.push(baseCSSPrefix + 'webkit');
913 cls.push(baseCSSPrefix + 'safari');
916 cls.push(baseCSSPrefix + 'safari2');
919 cls.push(baseCSSPrefix + 'safari3');
922 cls.push(baseCSSPrefix + 'safari4');
925 cls.push(baseCSSPrefix + 'chrome');
928 cls.push(baseCSSPrefix + 'mac');
931 cls.push(baseCSSPrefix + 'linux');
933 if (!Ext.supports.CSS3BorderRadius) {
934 cls.push(baseCSSPrefix + 'nbr');
936 if (!Ext.supports.CSS3LinearGradient) {
937 cls.push(baseCSSPrefix + 'nlg');
939 if (!Ext.scopeResetCSS) {
940 cls.push(baseCSSPrefix + 'reset');
943 // add to the parent to allow for selectors x-strict x-border-box, also set the isBorderBox property correctly
945 if (Ext.isStrict && (Ext.isIE6 || Ext.isIE7)) {
946 Ext.isBorderBox = false;
949 Ext.isBorderBox = true;
952 htmlCls.push(baseCSSPrefix + (Ext.isBorderBox ? 'border-box' : 'strict'));
954 htmlCls.push(baseCSSPrefix + 'quirks');
955 if (Ext.isIE && !Ext.isStrict) {
956 Ext.isIEQuirks = true;
959 Ext.fly(html, '_internal').addCls(htmlCls);
962 Ext.fly(bd, '_internal').addCls(cls);
966 Ext.onReady(initExtCss);