Bug 15134 - Please explain what the proper behavior of getSelection on a display:none iframe is
Please explain what the proper behavior of getSelection on a display:none ifr...
Status: RESOLVED WORKSFORME
Product: WebAppsWG
Classification: Unclassified
Component: HTML Editing APIs
unspecified
PC All
: P2 normal
: ---
Assigned To: Aryeh Gregor
HTML Editing APIs spec bugbot
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-09 23:46 UTC by Eric Seidel
Modified: 2012-01-10 20:15 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel 2011-12-09 23:46:03 UTC
Please explain what the proper behavior of getSelection on a display:none iframe is

See:
https://bugzilla.mozilla.org/show_bug.cgi?id=585229
https://bugs.webkit.org/show_bug.cgi?id=43655
Comment 1 Aryeh Gregor 2012-01-10 20:15:11 UTC
Sorry for the long time to respond -- I was on vacation for a while, then spent a while doing other things.

The editing spec says "Every browsing context has a selection." <http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections>  The HTML spec says "When an iframe element is first inserted into a document, the user agent must create a nested browsing context". <http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#the-iframe-element>  Thus the spec implies that any iframe in a document has a selection.  Testing, this is how IE9, Chrome 17 dev, and Opera Next 12.00 alpha behave.  Firefox 12.0a1 returns null from getSelection() if the iframe is display: none.  I don't see any advantage to Gecko's behavior, so I'll stick with the behavior of the majority of browsers -- display: none should make no difference.

Reopen if you don't think the spec is clear enough.