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 10691 - [Selection] Specify extend method for Selection objects
Summary: [Selection] Specify extend method for Selection objects
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on: 10798
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-22 22:47 UTC by Tim Down
Modified: 2011-12-20 19:49 UTC (History)
8 users (show)

See Also:


Attachments

Description Tim Down 2010-09-22 22:47:59 UTC
Recent versions of Mozilla, WebKit and Opera all include an extend() method of their Selection objects, implemented (as far as I can tell) identically. I suggest HTML5 should specify this method, for two reasons:

1. It is a de facto standard among the more standards-compliant browsers
2. Vitally, it provides a mechanism for programmatically creating a backwards (i.e. where the focus point comes before the anchor point within the document) selection, which otherwise can be created by the user by dragging "backwards" but not programmatically.
Comment 1 Aryeh Gregor 2011-01-13 00:04:56 UTC
I'm doing this next.  Apparently it's more complicated than it looks, but we'll see.
Comment 2 Aryeh Gregor 2011-01-28 18:28:57 UTC
Spec: http://html5.org/specs/dom-range.html#dom-selection-extend
Tests: http://aryeh.name/spec/dom-range/test/selection-extend.html

This spec isn't currently in W3C space, but that's a detail, so I'll call it FIXED.