If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

replaceData(N, 1, "*") alters the selection

NEW
Unassigned

Status

()

Core
DOM: Core & HTML
8 years ago
5 years ago

People

(Reporter: neil@parkwaycc.co.uk, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
Assuming that a text node has the data "fubar" and that the selection consists of the "ba" substring, then:
replaceData(1, 1, "*") adds the "*" to the selection, although the "u" was not
replaceData(3, 1, "*") removes the "*" from the selection, although the "a" was
<bz> looks like a regression from bug 415860
Yeah.  This is bug 415860 comment 15 and bug 415860 comment 17 mess, in spades.  Basically, if we follow DOM spec there's no sane way to use ranges for selection in the presence of mutations.

Is it worth maybe changing the behavior of just selection ranges to handle replaceData more sanely, by not following the DOM spec (e.g. by not modeling it as an insert/remove or by not treating the two endpoints identically)?
Blocks: 415860
(Assignee)

Updated

5 years ago
Component: DOM: Traversal-Range → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.