Open
Bug 585229
Opened 15 years ago
Updated 4 years ago
selection on a display:none iframe returns different value than WebKit/Opera
Categories
(Core :: DOM: Selection, defect, P5)
Tracking
()
NEW
People
(Reporter: ojan, Unassigned)
Details
Attachments
(2 files)
See attachment. At first glance, the WebKit/Opera behavior seems more consistent. It matches what you would get in a visible iframe that had no selection in it.
Equivalent webkit bug: https://bugs.webkit.org/show_bug.cgi?id=43655
![]() |
||
Comment 1•15 years ago
|
||
Gecko's selection objects are tied to a presentation; there simply isn't one in a display:none iframe. In particular, you can't select text in such an iframe programmatically, unlike a visible iframe.
Reporter | ||
Comment 2•15 years ago
|
||
That kind of makes sense to me, but if you get the selection and then display:none the iframe, you end up in the same situation (have a Selection object inside a display:none iframe). So you still need to deal with that case anyways.
Again, I don't feel strongly about this, but I slightly prefer the consistency of the webkit/opera approach. I'll bring this up on whatwg.
Reporter | ||
Comment 3•15 years ago
|
||
Comment 4•13 years ago
|
||
The buggy function, getSelection(), isn't mentioned anywhere in this bug, so it doesn't show up in search results.
While you are deciding what the proper behavior is, I think it would be helpful to update the mozilla developer docs on the function: https://developer.mozilla.org/en/DOM/window.getSelection asserts that the function always returns a selection object, which does not reflect the current behavior when display:none is in effect.
Reporter | ||
Comment 5•13 years ago
|
||
Comment 6•13 years ago
|
||
It appears getSelection no longer exists in HTML5. I'm not sure what the relevant spec would be.
Comment 7•13 years ago
|
||
Comment 8•13 years ago
|
||
IE, Webkit, and Opera all seem to agree that every Window has a Selection. This is what the spec says too. Gecko's behavior is more complicated and in the minority, so I haven't changed the spec.
Comment 9•4 years ago
|
||
Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority and severity.
If you have reason to believe this is wrong, please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
You need to log in
before you can comment on or make changes to this bug.
Description
•