Bug 14141 - Introduce a constructor for Range
Introduce a constructor for Range
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: DOM
unspecified
PC Windows 3.1
: P2 normal
: ---
Assigned To: Anne
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-13 13:31 UTC by Anne
Modified: 2013-02-11 17:36 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anne 2011-09-13 13:31:00 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?
Comment 1 Aryeh Gregor 2011-09-13 20:32:28 UTC
Why do we need this?  Do things like Element have constructors?  What's wrong with Document.createRange, which parallels Document.createElement?
Comment 2 Anne 2011-09-14 12:09:33 UTC
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.