Open Bug 1325059 Opened 9 years ago Updated 3 years ago

Enforce non-overlapping ranges in Selection harder

Categories

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

defect

Tracking

()

Tracking Status
firefox53 --- affected

People

(Reporter: MatsPalmgren_bugz, Unassigned)

Details

Bug 348681 implemented code to make sure the ranges inside a Selection are non-overlapping. It appears to only work for addRange() though, and things that goes through that same code (Selection::AddItem) like adding a new range by ctrl+drag. It appears we don't enforce the invariant when /extending/ an existing range (by calling setStart/End etc). I think we should try to do that since it simplifies editor code (and user script!) if it doesn't have to deal with overlapping ranges.
Another possible scenario to think about here is the case where the editor code itself creates overlapping range selections by modifying one of the ranges in the selection without caring about the rest of the ranges. I'm not sure how many of those bugs we still have lying around, but it's worth double checking if someone fixes this.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.