This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14141 - Introduce a constructor for Range
Summary: Introduce a constructor for Range
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 13:31 UTC by Anne
Modified: 2013-02-11 17:36 UTC (History)
3 users (show)

See Also:


Attachments

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.