[Webkit-unassigned] [Bug 23793] WebKit changes the Selection on setting with addRange, FF does not

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 6 13:27:36 PST 2009


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


eric at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hyatt at apple.com




------- Comment #6 from eric at webkit.org  2009-02-06 13:27 PDT -------
Ok, so SelectionController will need a VisibleSelection member (the current
m_selection), and a new Selection member.

What the user sees and interacts with is the VisibleSelection.  What JavaScript
and (eventually) the editing commands interact with will be Selection (a Vector
of Range objects).

VisibleSelection and Selection will both be copyable, datastorage types. 
Editing, and any other section of the code which wants to keep around multiple
copies can do so.  SelectionController maintain the official copy. :)

In order to handle keeping the stored Selection and VisibleSelection in sync,
SelectionController will need to change to return a copy of a VisibleSelection
via visibleSelection() instead of a reference like it does now.  There will be
a new setVisibleSelection method which can take a VisibleSelection and knows to
set m_selection from VisibleSelection::toSelection() or similar.

Likewise there will need to be a setSelection which takes a Selection object
and knows to create a VisibleSelection from the Selection and store it in
m_visibleSelection.

Initially all of our code will use VisibleSelection.  Over time, we will move
more and more code to use Selection instead.

To add multi-range selection (which we'll eventually need for table editing),
Selection will just store a Vector of Range objects.  VisibleSelection can hold
whatever data it needs to represent the selection, but it will probably be a
Vector of VisiblePosition pairs (or maybe VisibleRanges?).

Thoughts on this proposal are most welcome!


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



More information about the webkit-unassigned mailing list