[Webkit-unassigned] [Bug 25195] using keyboard to extend selection after a selection using mouse extends character selection in reverse order as FF and IE

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 14 17:57:05 PDT 2009


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





------- Comment #4 from xji at chromium.org  2009-04-14 17:57 PDT -------
The root cause seems is in SelectionController::willBeModified().

There are the following logic in SelectionController::willBeModified()
        case EXTEND:
            if (!m_lastChangeWasHorizontalExtension) {
                m_lastChangeWasHorizontalExtension = true;
                Position start = m_sel.start();
                Position end = m_sel.end();
                switch (direction) {
                    // FIXME: right for bidi?
                    case RIGHT:
                    case FORWARD:
                        m_sel.setBase(start);
                        m_sel.setExtent(end);
                        break;
                    case LEFT:
                    case BACKWARD:
                        m_sel.setBase(end);
                        m_sel.setExtent(start);
                        break;
                }
            }

If the previous selection is a mouse selection,
m_lastChangeWasHorizontalExtension is 'false', and the selection's (base,
extend) is reset.
For example, if the selection is "two" from 't' to 'o', (base, extend) and
(start, end) were both (4, 7), but extend+left (by press shift+left arrow)
reset  (base, extend) to (7, 4), then, the previous character of 'extend' is
the space between "one" and "two". 
Similar applies to the other direction of selection.

'base' and 'extend' are supposed to be where the 'first' and the 'end' click
happens. What is the rationale to reset it here?

It works fine for continuing selection using keyboard, because the
m_lastChangeWasHorizontalExtension is 'true' for keyboard selection, and the
reset never happens.


-- 
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