RE: [selection] Selection.setBaseAndExtent

I don't understand the difference. setBaseAndExtent would then set all 4 of these properties of selection? Do you have a definition to use for this?

From: Ryosuke Niwa []
Sent: Wednesday, August 6, 2014 12:43 PM
To: James M. Greene
Cc: Ben Peters; public-webapps
Subject: Re: [selection] Selection.setBaseAndExtent

Focus and anchor are different concepts from base and extent. While the former always coincide with start and end, base and extent may be different from those two.

In particular, when a user selects text by double clicking on a word, base and extent stays at where the user had clicked while focus and anchor will extend to the beginning and the end of the word like start and end.

- R. Niwa

On Aug 5, 2014, at 4:58 PM, James M. Greene <<>> wrote:

For consistent terminology with the rest of the API, shouldn't it be `setAnchorAndFocus`?

    James Greene
    Sent from my [smart?]phone
On Aug 5, 2014 5:54 PM, "Ben Peters" <<>> wrote:
I have added proposed text to this bug. Any objections to this?

Proposed text, based on the text for collapse():

void setBaseAndExtent (Node baseNode, unsigned long baseOffset, Node extentNode, unsigned long extentOffset);

The method must throw an IndexSizeError exception if offset is negative or longer than node's length ([DOM4]). Otherwise, it must create a new range, set ([DOM4]) its start to (baseNode, baseOffset) and its and end to (extentNode, extentOffset), and set the context object's range to the newly-created range.

From: Ben Peters
Sent: Tuesday, May 20, 2014 11:37 AM
To: Ben Peters; Ryosuke Niwa;<>
Subject: RE: [selection] Selection.setBaseAndExtent

I have filed a bug to track this issue [1].



From: Ben Peters []
Sent: Monday, May 5, 2014 11:28 PM
To: Ryosuke Niwa;<>
Subject: [selection] Selection.setBaseAndExtent

I noticed that some websites use selection.setBaseAndExtent [1]. According to what limited documentation I could find, it works similar to selection.extend. Is there any intention to standardize this, or is it made obsolete by selection.extend?



Received on Wednesday, 6 August 2014 19:58:53 UTC