<a href="http://www.whatwg.org/specs/web-apps/current-work/#dom-getselection">http://www.whatwg.org/specs/web-apps/current-work/#dom-getselection</a><div><br></div><div>Gecko returns null for a display:none iframe, but returns an empty Selection object for a visible iframe with no selection. As best I can tell, WebKit and Opera return a selection in both cases. I don't feel strongly about which behavior is correct, but the spec should deal with this case.</div>

<div><br></div><div>On the one hand, the Gecko behavior makes sense because you can't have a selection in a display:none frame, so the methods to set a selection would fail. On the other hand, you can get into a similar situation by getting a Selection and then making the iframe display:none, so that case needs to be dealt with either way.</div>

<div><br></div><div>Relevant bugs:</div><div><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=585229">https://bugzilla.mozilla.org/show_bug.cgi?id=585229</a><br><a href="https://bugs.webkit.org/show_bug.cgi?id=43655">https://bugs.webkit.org/show_bug.cgi?id=43655</a></div>

<div><br></div><div>Ojan</div>