-
17 Jul 2009 5:00 AM #1
[FIXED-134][3.0.0] Permission denied to access property 'dom' from non-chrome context
[FIXED-134][3.0.0] Permission denied to access property 'dom' from non-chrome context
Ext version tested:
- Ext 3.0.0
Adapter used:- ext
css used:- only default ext-all.css
Browser versions tested against:- FF3.5, FF3.5.1 (firebug 1.4.0 installed)
Operating System:- WinXP Pro
Description:- When using DataView with properties "overClass" or "trackOver" enabled, the "onMouseOut" method will trigger the "Permission denied to access property 'dom' from a non-chrome context"-error everytime the mouse enters the DataView's related scrollbar, thus preventing the DataView from removing the "overClass" from the previously hovered DataView entry.
Steps to reproduce the problem:- 1. Create a DataView with "trackOver" enabled
- 2. Make sure there are enough entries so that a scrollbar gets rendered
- 3. Move the mouse pointer over an entry in the DataView
- 4. Move the mouse pointer to the right over the scrollbar
The result that was expected:- The "overClass" gets removed from the hovered DataView entry
The result that occurs instead:- The "overClass" does not get removed from the DataView entry
Possible fix:
Override Ext.Element.contains():
Code:contains : function(el){ try { return !el ? false : Ext.lib.Dom.isAncestor(this.dom, el.dom ? el.dom : el); } catch(e) { return false; } }
-
17 Jul 2009 5:11 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
I assume that the isXUL method also works here and is preferred over a try/catch?
ps. I would fix this deeper down the call chain (e.g. in Event.getTarget/getRelatedTarget).
-
17 Jul 2009 5:15 AM #3
I have too look that up... never heard of that before - the try/catch is the quickest fix I thought of.
phew... well the error gets triggered as soon as the scrollbars (fb logs it as "slider" element) "dom" property gets accessed, which happens in this method. If there could be any check applied beforehand without too much overhead, I'd go for it.
-
17 Jul 2009 5:20 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
In this case event.getTarget() shouldn't have returned an element, because it is a inaccessible XUL element.
But the same is true for event.getRelatedTarget(), when you move the mouse from the scrollbar to the dataview again.
(isXUL is a private method in ext-base)
-
17 Jul 2009 5:24 AM #5
Well that would mean that for FF a call to isXUL would be made whenever getRelatedTarget/getTarget gets called? This could turn out into additional overhead considering all the mouseover/mouseout events in a larger application.
Anyone aware if that issue was filed for FF at their bug-tracker?
-
17 Jul 2009 5:26 AM #6Sencha - Community Support Team
- Join Date
- Nov 2008
- Location
- San Diego, Peoples' Republic of California
- Posts
- 2,040
- Vote Rating
- 7
I can trigger the same error in my app, and here's what I see that can help.
stack looks like:
contains()
within()
onMouseOut()
h
In onMouseOut(e), e.target.children[0].localName == 'HEAD'
I think you could test for that and just return in h() that's within listen() of Evt.EventManager and we won't be seeing the problem for this case anymore.
Something like:
Not tested.Code:onMouseOut : function(e){ if (Ext.isGecko() && e.target.children[0].localName == 'HEAD') { return; } if(this.lastItem){ if(!e.within(this.lastItem, true, true)){ Ext.fly(this.lastItem).removeClass(this.overClass); this.fireEvent("mouseleave", this, this.indexOf(this.lastItem), this.lastItem, e); delete this.lastItem; } } },
EDIT: fixed code to Ext.isGecko() instead of Ext.isFirefox()
-
17 Jul 2009 5:30 AM #7
Btw, same problem with FF 3.5 and Ext 2.2.1 here, too. And the try/catch solve works the same way...
-
17 Jul 2009 5:32 AM #8
-
17 Jul 2009 5:32 AM #9Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
No, that doesn't work. The removeCls method would never be called, leaving the item selected.
ps. Does the isXUL method also work for you?
Code:var isXUL = Ext.isGecko ? function(node){ return Object.prototype.toString.call(node) == '[object XULElement]'; } : function(){}; ... onMouseOut : function(e){ if(this.lastItem){ if(isXUL(e.getTarget()) || !e.within(this.lastItem, true, true)){ Ext.fly(this.lastItem).removeClass(this.overClass); this.fireEvent("mouseleave", this, this.indexOf(this.lastItem), this.lastItem, e); delete this.lastItem; } } },
-
17 Jul 2009 5:35 AM #10Sencha - Community Support Team
- Join Date
- Nov 2008
- Location
- San Diego, Peoples' Republic of California
- Posts
- 2,040
- Vote Rating
- 7
You're right. Here's a fixed version:
Code:onMouseOut : function(e){ if(this.lastItem){ if((Ext.isGecko() && e.target.children[0].localName == 'HEAD') || !e.within(this.lastItem, true, true)){ Ext.fly(this.lastItem).removeClass(this.overClass); this.fireEvent("mouseleave", this, this.indexOf(this.lastItem), this.lastItem, e); delete this.lastItem; } } },
Thank you for reporting this bug. We will make it our priority to review this report.



Reply With Quote
