Boris Zbarsky wrote: > On 9/20/13 11:14 AM, Patrick Brosset wrote: > >The helper is here: > >http://mxr.mozilla.org/mozilla-aurora/source/toolkit/devtools/LayoutHelpers.jsm#370 > > 379 if (docShell.isBrowserOrApp) { > ... > 389 } else { > 390 return win.frameElement; > 391 } > > So for anything on desktop it is in fact doing win.frameElement. > > But .frameElement will return null if that would cross origins. See > http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#dom-frameelement > > So if your "win" has a parent that is not same-origin, you will get > null here. > > You should be using the docshell codepath in all cases...
We would if there would be a better way to get a frame from the docshell. I believe win.frameElement is more efficient that doing a querySelectorAll() and then go through all the frames to find which one owns the window. Boris Zbarsky wrote: > On 9/20/13 12:24 PM, Paul Rouget wrote: > >@all: Is there a way to know which DOM element holds a docShell? Basically, > >which > ><iframe> owns the docshell? > > We should add one as needed. bug 918884 -- Paul _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform