W3C home > Mailing lists > Public > www-style@w3.org > May 2011

Re: [CSSOM] CaretPosition

From: Ms2ger <ms2ger@gmail.com>
Date: Fri, 06 May 2011 23:24:18 +0200
Message-ID: <4DC46702.10106@gmail.com>
To: Ojan Vafai <ojan@chromium.org>
CC: "Olli@pettay.fi" <Olli@pettay.fi>, "www-style@w3.org" <www-style@w3.org>
On 05/06/2011 09:45 PM, Ojan Vafai wrote:
> On Tue, May 3, 2011 at 2:18 AM, Olli Pettay<Olli.Pettay@helsinki.fi>  wrote:
>
>> On 05/03/2011 12:13 PM, Olli Pettay wrote:
>>
>>> Hi all,
>>>
>>> I wonder what is the use case for CaretPosition.range.
>>> Is that mainly just a left-over from the old caretRangeFromPoint?
>>> If the range is really needed, it would be trivial to
>>> create one using CaretPosition.offsetNode and CaretPosition.offset.
>>>
>>> So, could we drop CaretPosition.range, before it gets implemented.
>>>
>>
>> especially because
>> http://dev.w3.org/csswg/cssom-view/#dom-document-caretpositionfrompoint is
>> tiny bit inconsistent because of that
>> range object. .range may or may not be null depending on which
>> coordinates are used.
>>
>
> I agree. It would be great if the next iteration of DOM Ranges could spec
> Ranges as having a startPosition/endPosition that were CaretPositions. This
> is how WebKit's implementation works under the hood and it's much better
> than dealing with node/offset pairs all the time.

I'm very reluctant to add new features that just duplicate existing 
functionality. Is range.startPosition.offsetNode really so much better 
than range.startContainer to make it worth the specification, 
implementation, and testing time that would need to be spent on it?

This might have been a good idea when ranges were first implemented, but 
I don't see a use case that would warrant adding it now.

Ms2ger
Received on Friday, 6 May 2011 21:24:52 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:40 GMT