[Webkit-unassigned] [Bug 25757] Cursor gets stuck when highlighting a textarea using Shift+Up

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 30 23:59:33 PST 2011


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


Benjamin (Ben) Kalman <kalman at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kalman at chromium.org




--- Comment #6 from Benjamin (Ben) Kalman <kalman at chromium.org>  2011-01-30 23:59:33 PST ---
@Fabrizio you're looking into it?  Oops, I didn't notice, I've been looking at it today too.  Well it's all yours :-)

But for the record, I think the problem is with the UPSTREAM/DOWNSTREAM affinity and how it's used in VisiblePosition::getInlineBoxAndOffset.

Imagine that the text is "foo baaaaaaaa" and gets wrapped as

foo
baaaaaaaa

Placing the cursor at the end of "baaaaaaaa" and pressing shift+up moves the selection from

foo
baaaaaaaa|

... to

foo{
baaaaaaaa}

... but internally (within VisibleSelection) it's just seen as "foo {baaaaaaaa}" *, which is actually

foo
{baaaaaaaa}

... because the start of the selection ends up with DOWNSTREAM affinity**.

The exact same thing happens next time that shift+up is pressed because:
 - the same line is used (VisiblePosition::getInlineBoxAndOffset).
 - the same x offset is used due to the cached m_xPosForVerticalArrowNavigation being used.

I've verified that this is indeed the cause of the problem, by (in SelectionController::modifyExtendingBackward) changing
  VisiblePosition pos(m_selection.extent(), m_selection.affinity())
to
  VisiblePosition pos(m_selection.extent(), UPSTREAM)
but I don't think that that is necessarily the most "correct" solution.  What would be "correct" is that m_selection.affinity() somehow knows that last operation was to extend the selection backwards, and that the affinity should be UPSTREAM in this case... but that doesn't really make sense, since what does the affinity of a whole selection really mean?

So perhaps the shortest path to a fix would be to change that to UPSTREAM.  And for the record, the change doesn't cause any layout tests to fail.


* rather than "foo{ baaaaaaaa}" due to visible equivalence, I believe.
** or at least, it does when then re-queried; it seems that the start of a selection always has DOWNSTREAM, and the end always has UPSTREAM.

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