[Webkit-unassigned] [Bug 34821] should add Range.modify to match Selection.modify

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 6 16:28:03 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34821





--- Comment #7 from Darin Adler <darin at apple.com>  2010-12-06 16:28:02 PST ---
(In reply to comment #6)
> If we could design this from scratch, I would not have a Range object at all. There would just be Selection and you could instantiate a Selection object that's not the browser's actual selection.
> 
> Unfortunately, we can't start from scratch. So far we've taken the approach of trying to make Range and Selection more like each other, but maybe that's not the best way forward?
> 
> You could imagine Selection being a subclass of Range.

The existing Selection and Range are nothing like each other, though. If selection was a subclass of range they would have some functions in common, but they don't.

Who is the “we” here? Adding editing functions to the Range class sounds like a really bad idea.

Having an object that can represent a range of text for editing seems good. We could start with a subset of the API of the selection object. Perhaps we can factor out a base class of the selection object, or just make an object with a similar enough API.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list