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

proposal to expose word breaker through JavaScript

From: Xiaomei Ji <xji@chromium.org>
Date: Tue, 28 Jul 2009 17:42:04 -0700
Message-ID: <a7aebc750907281742q59a69bc0yd1808d936749f9f9@mail.gmail.com>
To: public-webapps@w3.org
Cc: ap@webkit.org, jshin@chromium.org
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.

Thanks,
Xiaomei
Received on Wednesday, 29 July 2009 07:33:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:33 GMT