Closed Bug 49511 Opened 24 years ago Closed 24 years ago

Selection.toString() shouldn't need arguments

Categories

(Core :: DOM: Selection, defect, P4)

x86
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: akkzilla, Assigned: akkzilla)

References

Details

(Whiteboard: [nsbeta3+])

When the toString() method was added to Selection.idl, it was added with arguments. We talked about renaming this method, and making a toString() method which did not require arguments since that's standard JS, but apparently this never got done. It's been causing confusion among customers of selection and should be fixed before release. I propose making toString() with no arguments, and toStringWithType(mimeType, flags, wrapColumn). jst, do you know of any reason not to do this? Anybody want to propose a better name than toStringWithType?
nsbeta3. Not hard, and we don't want to ship it this way since people will write JS that depends on it.
Status: NEW → ASSIGNED
Keywords: correctness, nsbeta3
Priority: P3 → P4
Target Milestone: --- → M18
Just want to note that toString is called implicitly when you dump an nsIDOMSelecition in JS, so it has to have no args.
yep, agree -- adding to the plus list
Whiteboard: [nsbeta3+]
PDT is downgrading this to beta3-minus.
Whiteboard: [nsbeta3+] → [nsbeta3-][minus]
Anyone who uses getSelection in javascript is going to run into this (we've already had outside contributors hit it) and the fix is very straightforward. Requesting reconsideration.
Whiteboard: [nsbeta3-][minus]
akkana, can you tell PDT how often this might happen? What user action may cause this?
Whiteboard: [need info]
This isn't a user action issue: this is a content authoring issue. Any content author or JS tester who tries to do anything in Javascript involving the selection is likely to get bitten by this.
We have to redo nsIDOMselection anyway -- see bug 48575.
need to talk with sfraser and akkana
Akkana, I would like to make this minus, but move it to m19
Beth: Mike is already working on a bigger bug involving the Selection idl, which will include this. So please don't make it minus.
which bug?
Depends on: 48575
duh -- sfraser already told me -- sorry i'll plus this if you want me to
Yes, please. This is a necessary part of the API change.
+
Whiteboard: [need info] → [nsbeta3+]
This was integrated into Mike's changes, checked in last night.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
how can QA verify?
If QA can write JS, try writing something that gets the selection then dumps it or calls ToString() directly, and see if it works, or if it prints an error. If that's too elaborate, just take my word for it.
window.getSelection isn't working now (bug 48575)
You need to log in before you can comment on or make changes to this bug.