summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2011-02-24 12:20:18 -0500
committerCary Clark <cary@android.com>2011-02-24 12:20:18 -0500
commit1ea22c6c86bd450b047ab866b7d566600831b77c (patch)
treee670ccb81509b96766c265b6b54bb55292471f6f /WebKit/android/nav
parentae9f5f699fd7ae6cac2e90a646fa4bfa1e1412ca (diff)
downloadexternal_webkit-1ea22c6c86bd450b047ab866b7d566600831b77c.zip
external_webkit-1ea22c6c86bd450b047ab866b7d566600831b77c.tar.gz
external_webkit-1ea22c6c86bd450b047ab866b7d566600831b77c.tar.bz2
bias towards space in select text
When computing the presence or absence of a space, it's usually the case that the absense of a space case has no error. The presence of a space may have more error, since the size of the space may be adjusted by the page. When the two computed errors are equal, bias towards the space case. This fixes text selection on Google News. bug:3470564 Change-Id: I1feadd945e9faaf970bca0702a7cf79429592784
Diffstat (limited to 'WebKit/android/nav')
-rw-r--r--WebKit/android/nav/SelectText.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/WebKit/android/nav/SelectText.cpp b/WebKit/android/nav/SelectText.cpp
index 5ed5c21..1524058 100644
--- a/WebKit/android/nav/SelectText.cpp
+++ b/WebKit/android/nav/SelectText.cpp
@@ -271,7 +271,7 @@ public:
SkFixedToScalar(posNoSpace), SkFixedToScalar(diffNoSpace),
SkFixedToScalar(posWithSpace), SkFixedToScalar(diffWithSpace),
mLastPaint.getTextSize());
- return diffWithSpace < diffNoSpace;
+ return diffWithSpace <= diffNoSpace;
}
SkFixed minSpaceWidth(SkPaint& paint)