Bugzilla – Bug 14141
Introduce a constructor for Range
Last modified: 2013-02-11 17:36:21 UTC
The no argument version can be the same as the current version with some language of which Document object to use. I might add that one soonish. Should there be a version that accepts arguments for setting the boundary points?
Why do we need this? Do things like Element have constructors? What's wrong with Document.createRange, which parallels Document.createElement?
We might get constructors for specific element types, e.g. new HTMLDivElement() or some such, but that is out of scope of this bug.
This for convenience, similarly to how ev = new Event("test") is for convenience. Developers much prefer constructors over factory methods.