W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2009

Re: proposal to expose word breaker through JavaScript

From: Alfonso Martínez de Lizarrondo <amla70@gmail.com>
Date: Wed, 29 Jul 2009 15:49:29 +0200
Message-ID: <af2a8eab0907290649ta592637w89472caeb3da0f9a@mail.gmail.com>
To: Anne van Kesteren <annevk@opera.com>
Cc: Xiaomei Ji <xji@chromium.org>, public-webapps@w3.org, ap@webkit.org, jshin@chromium.org
This is the Microsoft version: range.expand

2009/7/29 Anne van Kesteren <annevk@opera.com>:
> On Wed, 29 Jul 2009 02:42:04 +0200, Xiaomei Ji <xji@chromium.org> wrote:
>> We are proposing the following API to expose word breaker through
>> JavaScript.
>> document.extendRange(range, "word")
>>  It extends the passed-in range to a range in word boundary.
>>  If the passed-in range is an empty range, in which the beginning and
>> ending
>> are the same, the empty range will be extended to a one-word range covers
>> the beginning/ending of passed-in range. In the case where the
>> beginning/ending of passed-in range is at a word boundary, the logically
>> next word will be selected.
>> If the beginning and ending of the passed-in range are not the same, the
>> range is extended to word boundary on both sides. Which means the
>> beginning will be extended to the word boundary on its logically left side if it is
>> not at a word boundary, and ending will be extended to the word boundary
>> on its logically right side if it is not at a word boundary.
>> Please let us know if there is any issues, concerns with the proposal.
> Initially I did not quite understand what this API was proposing, but after reading it a few times it seems to mimic the behavior of what typically happens when you double-click a "word".
> I'm still not quite sure whether I understand the API though. Is "word" a keyword on how the range is to be extended or is it an example? Also, wouldn't it be better to put the method on Range rather than Document?
> And finally, use cases would help as well as a definition of "word boundary" and how this works/won't work in an international context.
> Cheers,
> --
> Anne van Kesteren
> http://annevankesteren.nl/
Received on Wednesday, 29 July 2009 13:50:10 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:18 UTC