- return 1;
- }
- prop = Ext.core.Element.normalize(prop);
- return el.style[prop] || ((cs = el.currentStyle) ? cs[prop] : null);
- };
+
+ // the try statement does have a cost, so we avoid it unless we are
+ // on IE6
+ if (!Ext.isIE6) {
+ return el.style[prop] || ((cs = el.currentStyle) ? cs[prop] : null);
+ }
+
+ try {
+ return el.style[prop] || ((cs = el.currentStyle) ? cs[prop] : null);
+ } catch (e) {
+ // in some cases, IE6 will throw Invalid Argument for properties
+ // like fontSize (see in /examples/tabs/tabs.html).
+ }
+
+ if (!ELEMENT.inheritedProps[prop]) {
+ break;
+ }
+
+ el = el.parentNode;
+ // this is _not_ perfect, but we can only hope that the style we
+ // need is inherited from a parentNode. If not and since IE won't
+ // give us the info we need, we are never going to be 100% right.
+ } while (el);
+
+ //<debug>
+ Ext.log({
+ level: 'warn',
+ msg: 'Failed to get ' + this.dom.id + '.currentStyle.' + prop
+ });
+ //</debug>
+ return null;
+ }