Closed Bug 32481 Opened 24 years ago Closed 24 years ago

document.getSelection() needs to be implemented

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: german, Assigned: jst)

References

Details

Attachments

(1 file)

in 4.x the JS function document.getSelection() returned the currently selected
text in a window. While this was a Netscape-only feature many websites make use
of it. This does not currently work in Mozilla. This would be great thing to
have for Mozilla.
If this will not be implemented, the resolution of this bug should be a note
added the developer release notes. It should include how this feature could be
accomplished in a different way (using DOM or XPCom maybe?)
Feel free to change the component/foward to other owner if JS Engine is the
wrong one.
Keywords: 4xp
Summary: [4.x P] document.getSelection() no longer supported → document.getSelection() no longer supported
This would be a DOM 4xp enhancement. Reassigning to joki for now.

Although we terminated the Layer DOM API in particular, it would be nice if we 
could provide as much backward compatibility as possible for other Nav4 
extensions where it's possible to do so without violating standards or incurring 
major development costs.

This would should be prioritized as less important than implementing and 
debugging the W3C standards, but ideally something we'd like to get in for 
beta2. Is there an easy way to implement this by invoking the DOM2 code for 
getting the current selection?
Assignee: rogerl → joki
Summary: document.getSelection() no longer supported → document.getSelection() needs to be implemented
Attached patch Proposed fix...Splinter Review
The patch I just attached makes document.getSelection() work in mozilla very
much the same way it works in NS 4.x. Apparently the patch removes a lot of
useful debuggin code that is used by the editor so we'll probably haveto change
the patch to work better together with the editor before checkin this in.

Cc:ing akkana and myself.

cc self.
*** Bug 36343 has been marked as a duplicate of this bug. ***
reassign to jst; reset component
Assignee: joki → jst
Component: Javascript Engine → DOM Level 0
Target Milestone: --- → M16
This is finally done, document.getSelection() returns the selected text as a
string, and it puts a message in the console saying the document.getSelection()
is depricated, use window.getSelection() in stead. window.getSelection() is also
implemented but that returns a selection object in stead of a string.

Marking FIXED.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: