Open Bug 827585 Opened 10 years ago Updated 9 months ago

window.getSelection() returns null for hidden iframe

Categories

(Core :: DOM: Selection, defect)

17 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

REOPENED
Webcompat Priority P3

People

(Reporter: timdown, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: testcase)

Attachments

(2 files)

620 bytes, application/octet-stream
Details
325 bytes, text/html
Details
Attached file ffbug.zip
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
Build ID: 20121128204232

Steps to reproduce:

Created an HTML document containing another HTML document in an iframe hidden via CSS display: none and examined the result of calling window.getSelection() in the iframe's document


Actual results:

null was returned


Expected results:

Per spec, since the iframe's document has a defaultView property, a Selection object should be returned. See 

http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#dom-window-getselection
Attachment #698927 - Attachment mime type: text/plain → application/octet-stream
Attached file Reporter's testcase
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 495230
Actually, I guess we should just make the other depend on this one.

In any case, right now selection objects are tied to a presentation and there is no presentation in display:none iframes.  So fixing this bug requires revamping how selections work.  Well, or giving display:none stuff a presshell.
Blocks: 495230
Status: RESOLVED → REOPENED
Component: DOM: Core & HTML → Selection
Ever confirmed: true
Resolution: DUPLICATE → ---
Webcompat Priority: --- → ?

P3 from a WebCompat perspective. We've only seen one live site breakage, and we could probably fix this via a site intervention.

Webcompat Priority: ? → P3
You need to log in before you can comment on or make changes to this bug.