summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebKit/android/jni/WebHistory.cpp4
-rw-r--r--WebKit/android/nav/SelectText.cpp10
2 files changed, 6 insertions, 8 deletions
diff --git a/WebKit/android/jni/WebHistory.cpp b/WebKit/android/jni/WebHistory.cpp
index 7f3e4e3..52d9f61 100644
--- a/WebKit/android/jni/WebHistory.cpp
+++ b/WebKit/android/jni/WebHistory.cpp
@@ -168,8 +168,8 @@ static void WebHistoryInflate(JNIEnv* env, jobject obj, jint frame, jbyteArray d
// Inflate the history tree into one HistoryItem or null if the inflation
// failed.
RefPtr<WebCore::HistoryItem> newItem = WebCore::HistoryItem::create();
- RefPtr<WebHistoryItem> bridge = adoptRef(new WebHistoryItem(env, obj, newItem.get()));
- newItem->setBridge(bridge.get());
+ WebHistoryItem* bridge = new WebHistoryItem(env, obj, newItem.get());
+ newItem->setBridge(bridge);
// Inflate the item recursively. If it fails, that is ok. We'll have an
// incomplete HistoryItem but that is better than crashing due to a null
diff --git a/WebKit/android/nav/SelectText.cpp b/WebKit/android/nav/SelectText.cpp
index f2d7521..ff69ddd 100644
--- a/WebKit/android/nav/SelectText.cpp
+++ b/WebKit/android/nav/SelectText.cpp
@@ -608,11 +608,11 @@ public:
}
// cx and cy are the distances from the tested center
// The center distance is used when the test point is over the text
- int cx = INT_MAX;
- int cy = INT_MAX;
- if (ignoreColumn && dy == 0 && mDy == 0) {
- cy = std::abs(((testBounds.fTop + testBounds.fBottom) >> 1)
+ int cx = std::abs(((testBounds.fLeft + testBounds.fRight) >> 1)
+ - mFocusX);
+ int cy = std::abs(((testBounds.fTop + testBounds.fBottom) >> 1)
- mFocusY);
+ if (ignoreColumn && dy == 0 && mDy == 0) {
if (mCy < cy) {
#ifdef EXTRA_NOISY_LOGGING
DBG_NAV_LOGD("FirstCheck reject cy=%d mCy=%d", cy, mCy);
@@ -621,8 +621,6 @@ public:
}
if (mCy == cy) {
if (dx == 0 && mDx == 0) {
- cx = std::abs(((testBounds.fLeft + testBounds.fRight) >> 1)
- - mFocusX);
if (mCx < cx) {
#ifdef EXTRA_NOISY_LOGGING
DBG_NAV_LOGD("FirstCheck reject cx=%d mCx=%d", cx, mCx);