OSDN Git Service

fix select text if multiple lines are the same width
authorCary Clark <cary@android.com>
Mon, 5 Oct 2009 18:22:59 +0000 (14:22 -0400)
committerCary Clark <cary@android.com>
Mon, 5 Oct 2009 18:50:00 +0000 (14:50 -0400)
commitfe996bf0a6c5c16a852ae7484bd74421d2492e15
tree76ca1559d7c21e07c9f34ddbaa242f3eae20d51e
parent62575aed26064570189ef0852283c3fc6bb4e960
fix select text if multiple lines are the same width

Text selection works by building a region on the UI side, then
finding the text that matches the rectangles making up the
decomposed region on the webkit side.

If multiple consecutive lines of text are the same width, the
region will combine them into a single rectangle instead of
one rectangle per line.

If the rectangle chooses a single line, it's safe to pick the
center of the line in Y, and that's what the old code does. The
new code also tries the top and bottom of the rectangle, in
case the rectangle spans multiple lines of text, but falls
back to the old behavior so not to regress.

fixes http://b/issue?id=2166748
WebKit/android/jni/WebViewCore.cpp