Bugzilla – Bug 14140
Use CaretPosition for range boundary points?
Last modified: 2012-05-15 10:49:13 UTC
Should range boundary points have an object representation in the form of http://www.w3.org/TR/cssom-view/#caretposition and should that interface therefore carry a slightly different name?
The semantics of CaretPosition are slightly but significantly different. For <input> or <textarea> or such, the offset of a CaretPosition (at least as returned by caretPositionFromPoint()) is the offset into the element's value, not its children.
An object representation of a boundary point would have been great to have, because maybe it would have averted insanity like the first argument of Range.compareBoundaryPoints. But I think it's too late now to usefully add such an interface. What would we do with it? There's too much redundancy in Range as it stands.
Nobody seems to care much for this.