[webkit-reviews] review granted: [Bug 36542] shift+click on an existing selection doesn't work right : [Attachment 55160] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 5 15:50:04 PDT 2010


Darin Adler <darin at apple.com> has granted Ojan Vafai <ojan at chromium.org>'s
request for review:
Bug 36542: shift+click on an existing selection doesn't work right
https://bugs.webkit.org/show_bug.cgi?id=36542

Attachment 55160: Patch
https://bugs.webkit.org/attachment.cgi?id=55160&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
> +	       // See <rdar://problem/3668157> REGRESSION (Mail): shift-click
deselects when selection
> +	       // was created right-to-left
> +	       Position start = newSelection.start();
> +	       Position end = newSelection.end();
> +	       int distanceToStart = textDistance(start, pos);
> +	       int distanceToEnd = textDistance(pos, end);
> +	       if (distanceToStart < distanceToEnd)
> +		   newSelection = VisibleSelection(pos, end);
> +	       else
> +		   newSelection = VisibleSelection(start, pos);

Thanks for working so hard to get the Mac behavior. But I suspect this is still
not quite right. I think it's important that the end that moved due to the
click is the "extent", so that shift-arrow keys modify that side of the
selection. I believe that means we should have VisibleSelection(end, pos)
rather than VisibleSelection(pos, end).

I'd like to see a test case that covers that part of the behavior as well. I'm
going to say r=me on this as-is, but I hope you go the extra mile and make the
refinement I mention above.


More information about the webkit-reviews mailing list