diff options
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 6 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 11 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.h | 7 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/ScrollableLayerAndroid.h | 4 | ||||
-rw-r--r-- | WebKit/android/jni/WebCoreJni.h | 4 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 77 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 5 | ||||
-rw-r--r-- | WebKit/android/nav/CachedFrame.cpp | 21 | ||||
-rw-r--r-- | WebKit/android/nav/CachedFrame.h | 2 | ||||
-rw-r--r-- | WebKit/android/nav/CachedLayer.cpp | 32 | ||||
-rw-r--r-- | WebKit/android/nav/CachedLayer.h | 4 | ||||
-rw-r--r-- | WebKit/android/nav/CachedRoot.cpp | 4 | ||||
-rw-r--r-- | WebKit/android/nav/SelectText.cpp | 44 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 6 |
14 files changed, 87 insertions, 140 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index ccc872a..f2163cc 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -122,8 +122,8 @@ GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) : m_foregroundLayer(0), m_foregroundClipLayer(0) { - m_contentLayer = new LayerAndroid(true); RenderLayer* renderLayer = renderLayerFromClient(m_client); + m_contentLayer = new LayerAndroid(renderLayer, true); if (renderLayer) { m_contentLayer->setIsRootLayer(renderLayer->isRootLayer() && !(renderLayer->renderer()->frame()->ownerElement())); @@ -487,8 +487,8 @@ void GraphicsLayerAndroid::updateScrollingLayers() ASSERT(!hasOverflowScroll); if (layerNeedsOverflow) { ASSERT(!m_foregroundLayer && !m_foregroundClipLayer); - m_foregroundLayer = new ScrollableLayerAndroid(); - m_foregroundClipLayer = new LayerAndroid(false); + m_foregroundLayer = new ScrollableLayerAndroid(layer); + m_foregroundClipLayer = new LayerAndroid(layer, false); m_foregroundClipLayer->setMasksToBounds(true); m_foregroundClipLayer->addChild(m_foregroundLayer); m_contentLayer->addChild(m_foregroundClipLayer); diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index db40856..f969999 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -61,7 +61,7 @@ class OpacityDrawFilter : public SkDrawFilter { /////////////////////////////////////////////////////////////////////////////// -LayerAndroid::LayerAndroid(bool isRootLayer) : SkLayer(), +LayerAndroid::LayerAndroid(RenderLayer* owner, bool isRootLayer) : SkLayer(), m_isRootLayer(isRootLayer), m_haveClip(false), m_isFixed(false), @@ -76,7 +76,8 @@ LayerAndroid::LayerAndroid(bool isRootLayer) : SkLayer(), m_pictureUsed(0), m_requestSent(false), m_scale(1), - m_lastComputeTextureSize(0) + m_lastComputeTextureSize(0), + m_owningLayer(owner) { m_backgroundColor = 0; @@ -95,7 +96,8 @@ LayerAndroid::LayerAndroid(const LayerAndroid& layer) : SkLayer(layer), m_uniqueId(layer.m_uniqueId), m_drawingTexture(0), m_reservedTexture(0), - m_requestSent(false) + m_requestSent(false), + m_owningLayer(layer.m_owningLayer) { m_isFixed = layer.m_isFixed; m_contentsImage = layer.m_contentsImage; @@ -150,7 +152,8 @@ LayerAndroid::LayerAndroid(SkPicture* picture) : SkLayer(), m_reservedTexture(0), m_requestSent(false), m_scale(1), - m_lastComputeTextureSize(0) + m_lastComputeTextureSize(0), + m_owningLayer(0) { m_backgroundColor = 0; m_dirty = false; diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h index 0d5a878..7d4eac9 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.h +++ b/WebCore/platform/graphics/android/LayerAndroid.h @@ -83,12 +83,13 @@ namespace WebCore { class AndroidAnimation; class BackedDoubleBufferedTexture; class LayerAndroidFindState; +class RenderLayer; class TiledPage; class LayerAndroid : public SkLayer, public TextureOwner { public: - LayerAndroid(bool isRootLayer); + LayerAndroid(RenderLayer* owner, bool isRootLayer); LayerAndroid(const LayerAndroid& layer); LayerAndroid(SkPicture*); virtual ~LayerAndroid(); @@ -245,6 +246,8 @@ public: virtual bool isMedia() const { return false; } + RenderLayer* owningLayer() const { return m_owningLayer; } + protected: virtual void onDraw(SkCanvas*, SkScalar opacity); @@ -334,6 +337,8 @@ private: // across all threads and cores. android::Mutex m_atomicSync; + RenderLayer* m_owningLayer; + typedef SkLayer INHERITED; }; diff --git a/WebCore/platform/graphics/android/ScrollableLayerAndroid.h b/WebCore/platform/graphics/android/ScrollableLayerAndroid.h index 697fe74..68fba77 100644 --- a/WebCore/platform/graphics/android/ScrollableLayerAndroid.h +++ b/WebCore/platform/graphics/android/ScrollableLayerAndroid.h @@ -26,8 +26,8 @@ namespace WebCore { class ScrollableLayerAndroid : public LayerAndroid { public: - ScrollableLayerAndroid() - : LayerAndroid(false) {} + ScrollableLayerAndroid(RenderLayer* owner) + : LayerAndroid(owner, false) {} ScrollableLayerAndroid(const ScrollableLayerAndroid& layer) : LayerAndroid(layer) , m_scrollLimits(layer.m_scrollLimits) {} diff --git a/WebKit/android/jni/WebCoreJni.h b/WebKit/android/jni/WebCoreJni.h index 6e6a486..ec25c8f 100644 --- a/WebKit/android/jni/WebCoreJni.h +++ b/WebKit/android/jni/WebCoreJni.h @@ -36,6 +36,9 @@ namespace android { // returned from getRealObject. class AutoJObject { public: + AutoJObject(const AutoJObject& other) + : m_env(other.m_env) + , m_obj(other.m_obj ? other.m_env->NewLocalRef(other.m_obj) : NULL) {} ~AutoJObject() { if (m_obj) m_env->DeleteLocalRef(m_obj); @@ -54,6 +57,7 @@ public: return m_env; } private: + AutoJObject(); // Not permitted. AutoJObject(JNIEnv* env, jobject obj) : m_env(env) , m_obj(obj) {} diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 727cce3..c277513 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -3113,51 +3113,6 @@ void WebViewCore::touchUp(int touchGeneration, handleMouseClick(frame, node, false); } -// Return the RenderLayer for the given RenderObject only if the layer is -// composited and it contains a scrollable content layer. -static WebCore::RenderLayer* getScrollingLayerFromRenderer( - WebCore::RenderObject* renderer) -{ -#if ENABLE(ANDROID_OVERFLOW_SCROLL) - if (!renderer) - return 0; - WebCore::RenderLayer* layer = renderer->enclosingSelfPaintingLayer(); - if (!layer) - return 0; - // Find the layer that actually has overflow scroll in case this renderer is - // inside a child layer. - while (layer && !layer->hasOverflowScroll()) - layer = layer->parent(); - return layer; -#endif - return 0; -} - -// Scroll the RenderLayer associated with a scrollable div element. This is -// done so that the node is visible when it is clicked. -static void scrollLayer(WebCore::RenderObject* renderer, WebCore::IntPoint* pos) -{ - WebCore::RenderLayer* layer = getScrollingLayerFromRenderer(renderer); - if (!layer) - return; - // The cache uses absolute coordinates when clicking on nodes and it assumes - // the layer is not scrolled. - layer->scrollToOffset(0, 0, true, false); - - WebCore::IntRect absBounds = renderer->absoluteBoundingBoxRect(); - // Do not include the outline when moving the node's bounds. - WebCore::IntRect layerBounds = layer->renderer()->absoluteBoundingBoxRect(); - - // Move the node's bounds into the layer's coordinates. - absBounds.move(-layerBounds.x(), -layerBounds.y()); - - // Scroll the layer to the node's position. - layer->scrollToOffset(absBounds.x(), absBounds.y(), true, true); - - // Update the mouse position to the layer offset. - pos->move(-layer->scrollXOffset(), -layer->scrollYOffset()); -} - // Common code for both clicking with the trackball and touchUp // Also used when typing into a non-focused textfield to give the textfield focus, // in which case, 'fake' is set to true @@ -3176,8 +3131,6 @@ bool WebViewCore::handleMouseClick(WebCore::Frame* framePtr, WebCore::Node* node DBG_NAV_LOG("area"); return true; } - - scrollLayer(nodePtr->renderer(), &m_mousePos); } if (!valid || !framePtr) framePtr = m_mainFrame; @@ -3689,6 +3642,27 @@ WebRequestContext* WebViewCore::webRequestContext() } #endif +void WebViewCore::scrollRenderLayer(int layer, const SkRect& rect) +{ +#if USE(ACCELERATED_COMPOSITING) + GraphicsLayerAndroid* root = graphicsRootLayer(); + if (!root) + return; + + LayerAndroid* layerAndroid = root->platformLayer(); + if (!layerAndroid) + return; + + LayerAndroid* target = layerAndroid->findById(layer); + if (!target) + return; + + RenderLayer* owner = target->owningLayer(); + if (owner) + owner->scrollToOffset(rect.fLeft, rect.fTop, true, false); +#endif +} + //---------------------------------------------------------------------- // Native JNI methods //---------------------------------------------------------------------- @@ -4370,6 +4344,13 @@ static void AutoFillForm(JNIEnv* env, jobject obj, jint queryId) #endif } +static void ScrollRenderLayer(JNIEnv* env, jobject obj, jint layer, jobject jRect) +{ + SkRect rect; + GraphicsJNI::jrect_to_rect(env, jRect, &rect); + GET_NATIVE_VIEW(env, obj)->scrollRenderLayer(layer, rect); +} + // ---------------------------------------------------------------------------- /* @@ -4477,6 +4458,8 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) GetTouchHighlightRects }, { "nativeAutoFillForm", "(I)V", (void*) AutoFillForm }, + { "nativeScrollLayer", "(ILandroid/graphics/Rect;)V", + (void*) ScrollRenderLayer }, }; int registerWebViewCore(JNIEnv* env) diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 411be1c..4ebe848 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -579,6 +579,11 @@ namespace android { void setWebRequestContextCacheMode(int mode); WebRequestContext* webRequestContext(); #endif + + // Attempts to scroll the layer to the x,y coordinates of rect. The + // layer is the id of the LayerAndroid. + void scrollRenderLayer(int layer, const SkRect& rect); + // end of shared members // internal functions diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp index 419be14..b26e24b 100644 --- a/WebKit/android/nav/CachedFrame.cpp +++ b/WebKit/android/nav/CachedFrame.cpp @@ -65,24 +65,6 @@ WebCore::IntRect CachedFrame::adjustBounds(const CachedNode* node, return rect; } -// This is for nodes inside a layer. It takes an IntRect that has been -// adjusted by the layer's position and removes the adjustment made by the -// layer. -WebCore::IntRect CachedFrame::unadjustBounds(const CachedNode* node, - const WebCore::IntRect& rect) const -{ -#if USE(ACCELERATED_COMPOSITING) - if (node->isInLayer()) { - const CachedLayer* cachedLayer = layer(node); - const WebCore::LayerAndroid* rootLayer = mRoot->rootLayer(); - const LayerAndroid* aLayer = cachedLayer->layer(rootLayer); - if (aLayer) - return cachedLayer->unadjustBounds(rootLayer, rect); - } -#endif - return rect; -} - bool CachedFrame::CheckBetween(Direction direction, const WebCore::IntRect& bestRect, const WebCore::IntRect& prior, WebCore::IntRect* result) { @@ -435,7 +417,6 @@ const CachedNode* CachedFrame::findBestAt(const WebCore::IntRect& rect, *directHit = test; *directHitFramePtr = this; IntRect r(center, IntSize(0, 0)); - r = unadjustBounds(test, r); *x = r.x(); *y = r.y(); } else { @@ -480,7 +461,6 @@ const CachedNode* CachedFrame::findBestAt(const WebCore::IntRect& rect, *inside = testInside; result = test; *framePtr = this; - both = unadjustBounds(test, both); *x = both.x() + (both.width() >> 1); *y = both.y() + (both.height() >> 1); } @@ -552,7 +532,6 @@ const CachedNode* CachedFrame::findBestHitAt(const WebCore::IntRect& rect, if (cursorRect.intersects(rect)) { WebCore::IntRect intersection(cursorRect); intersection.intersect(rect); - intersection = unadjustBounds(test, intersection); *x = intersection.x() + (intersection.width() >> 1); *y = intersection.y() + (intersection.height() >> 1); *framePtr = this; diff --git a/WebKit/android/nav/CachedFrame.h b/WebKit/android/nav/CachedFrame.h index 470f522..039a0ee 100644 --- a/WebKit/android/nav/CachedFrame.h +++ b/WebKit/android/nav/CachedFrame.h @@ -80,8 +80,6 @@ public: void addFrame(CachedFrame& child) { mCachedFrames.append(child); } WebCore::IntRect adjustBounds(const CachedNode* , const WebCore::IntRect& ) const; - WebCore::IntRect unadjustBounds(const CachedNode*, - const WebCore::IntRect& ) const; bool checkRings(const CachedNode* node, const WebCore::IntRect& testBounds) const; bool checkVisited(const CachedNode* , CachedFrame::Direction ) const; diff --git a/WebKit/android/nav/CachedLayer.cpp b/WebKit/android/nav/CachedLayer.cpp index 3321797..299f2d1 100644 --- a/WebKit/android/nav/CachedLayer.cpp +++ b/WebKit/android/nav/CachedLayer.cpp @@ -99,38 +99,6 @@ IntRect CachedLayer::adjustBounds(const LayerAndroid* root, return result; } -IntRect CachedLayer::unadjustBounds(const LayerAndroid* root, - const IntRect& bounds) const -{ - const LayerAndroid* aLayer = layer(root); - if (!aLayer) - return bounds; - - IntRect temp = bounds; - // Remove the new position (i.e. fixed position elements). - FloatPoint position = getGlobalPosition(aLayer); - - temp.move(-position.x(), -position.y()); - - // Remove any layer translation. - const FloatPoint& translation = aLayer->translation(); - temp.move(-translation.x(), -translation.y()); - - // Move it back to the original offset. - temp.move(mOffset.x(), mOffset.y()); - - DBG_NAV_LOGD("root=%p aLayer=%p [%d]" - " bounds=(%d,%d,w=%d,h=%d) trans=(%g,%g) pos=(%f,%f)" - " offset=(%d,%d)" - " result=(%d,%d,w=%d,h=%d)", - root, aLayer, aLayer->uniqueId(), - bounds.x(), bounds.y(), bounds.width(), bounds.height(), - translation.x(), translation.y(), position.x(), position.y(), - mOffset.x(), mOffset.y(), - temp.x(), temp.y(), temp.width(), temp.height()); - return temp; -} - FloatPoint CachedLayer::getGlobalPosition(const LayerAndroid* aLayer) const { SkPoint result = aLayer->getPosition(); diff --git a/WebKit/android/nav/CachedLayer.h b/WebKit/android/nav/CachedLayer.h index 0a382fd..3d963e0 100644 --- a/WebKit/android/nav/CachedLayer.h +++ b/WebKit/android/nav/CachedLayer.h @@ -48,10 +48,6 @@ public: } // FIXME: adjustBounds should be renamed globalBounds or toGlobal IntRect adjustBounds(const LayerAndroid* root, const IntRect& bounds) const; - // Moves the bounds by the layer's position. Assumes the incoming - // bounds have been adjusted by adjustBounds. - IntRect unadjustBounds(const LayerAndroid* root, - const IntRect& bounds) const; int cachedNodeIndex() const { return mCachedNodeIndex; } FloatPoint getGlobalPosition(const LayerAndroid* ) const; const LayerAndroid* layer(const LayerAndroid* root) const; diff --git a/WebKit/android/nav/CachedRoot.cpp b/WebKit/android/nav/CachedRoot.cpp index 33e7b4f..6083296 100644 --- a/WebKit/android/nav/CachedRoot.cpp +++ b/WebKit/android/nav/CachedRoot.cpp @@ -1379,9 +1379,7 @@ void CachedRoot::innerMove(const CachedNode* node, BestData* bestData, if (bestData->mNode != NULL) { mHistory->addToVisited(bestData->mNode, direction); mHistory->mNavBounds = bestData->bounds(); - mHistory->mMouseBounds = - bestData->mFrame->unadjustBounds(bestData->mNode, - bestData->mouseBounds()); + mHistory->mMouseBounds = bestData->mouseBounds(); } else if (scroll->x() != 0 || scroll->y() != 0) { WebCore::IntRect newBounds = mHistory->mNavBounds; int offsetX = scroll->x(); diff --git a/WebKit/android/nav/SelectText.cpp b/WebKit/android/nav/SelectText.cpp index fce05f7..5ed5c21 100644 --- a/WebKit/android/nav/SelectText.cpp +++ b/WebKit/android/nav/SelectText.cpp @@ -160,6 +160,7 @@ public: reset(); } + /* called only while the picture is parsed */ int base() { if (mBase == INT_MAX) { SkPoint result; @@ -168,7 +169,8 @@ public: } return mBase; } - + + /* called only while the picture is parsed */ int bottom() { if (mBottom == INT_MAX) { SkPoint result; @@ -211,12 +213,14 @@ public: { mLastGlyph = mLastCandidate; mLastUni = mLastUniCandidate; + mLastPaint = mLastPaintCandidate; } const SkIRect& getArea() const { return mArea; } + /* called only while the picture is parsed */ SkUnichar getUniChar(const SkBounder::GlyphRec& rec) { SkUnichar unichar; @@ -253,29 +257,31 @@ public: const SkBounder::GlyphRec& second = mLastGlyph.fLSB.fX < rec.fLSB.fX ? rec : mLastGlyph; uint16_t firstGlyph = first.fGlyphID; - SkScalar firstWidth = mPaint.measureText(&firstGlyph, sizeof(firstGlyph)); + SkScalar firstWidth = mLastPaint.measureText(&firstGlyph, sizeof(firstGlyph)); SkFixed ceilWidth = SkIntToFixed(SkScalarCeil(firstWidth)); SkFixed posNoSpace = first.fLSB.fX + ceilWidth; - SkFixed ceilSpace = SkIntToFixed(SkFixedCeil(minSpaceWidth())); + SkFixed ceilSpace = SkIntToFixed(SkFixedCeil(minSpaceWidth(mLastPaint))); SkFixed posWithSpace = posNoSpace + ceilSpace; SkFixed diffNoSpace = SkFixedAbs(second.fLSB.fX - posNoSpace); SkFixed diffWithSpace = SkFixedAbs(second.fLSB.fX - posWithSpace); - DBG_NAV_LOGD("second=%g width=%g (%g) noSpace=%g (%g) withSpace=%g (%g)", + DBG_NAV_LOGD("second=%g width=%g (%g) noSpace=%g (%g) withSpace=%g (%g)" + " fontSize=%g", SkFixedToScalar(second.fLSB.fX), firstWidth, SkFixedToScalar(ceilWidth), SkFixedToScalar(posNoSpace), SkFixedToScalar(diffNoSpace), - SkFixedToScalar(posWithSpace), SkFixedToScalar(diffWithSpace)); + SkFixedToScalar(posWithSpace), SkFixedToScalar(diffWithSpace), + mLastPaint.getTextSize()); return diffWithSpace < diffNoSpace; } - SkFixed minSpaceWidth() + SkFixed minSpaceWidth(SkPaint& paint) { if (mMinSpaceWidth == SK_FixedMax) { - SkPaint::TextEncoding save = mPaint.getTextEncoding(); - mPaint.setTextEncoding(SkPaint::kUTF8_TextEncoding); - SkScalar width = mPaint.measureText(" ", 1); + SkPaint::TextEncoding save = paint.getTextEncoding(); + paint.setTextEncoding(SkPaint::kUTF8_TextEncoding); + SkScalar width = paint.measureText(" ", 1); mMinSpaceWidth = SkScalarToFixed(width * mMatrix.getScaleX()); - mPaint.setTextEncoding(save); + paint.setTextEncoding(save); DBG_NAV_LOGV("width=%g matrix sx/sy=(%g, %g) tx/ty=(%g, %g)" " mMinSpaceWidth=%g", width, mMatrix.getScaleX(), mMatrix.getScaleY(), @@ -289,6 +295,7 @@ public: { mLastCandidate = rec; mLastUniCandidate = getUniChar(rec); + mLastPaintCandidate = mPaint; } void reset() @@ -302,7 +309,7 @@ public: mLastGlyph = check.mLastGlyph; mLastUni = check.mLastUni; mMatrix = check.mMatrix; - mPaint = check.mPaint; + mLastPaint = check.mLastPaint; reset(); } @@ -310,6 +317,7 @@ public: { mLastGlyph = check.mLastGlyph; mLastUni = check.mLastUni; + mLastPaint = check.mLastPaint; } void setUp(const SkPaint& paint, const SkMatrix& matrix, SkScalar y, @@ -322,6 +330,7 @@ public: reset(); } + /* called only while the picture is parsed */ int top() { if (mTop == INT_MAX) { SkPoint result; @@ -345,10 +354,12 @@ protected: SkIRect mArea; SkBounder::GlyphRec mLastCandidate; SkBounder::GlyphRec mLastGlyph; + SkPaint mLastPaint; // available after picture has been parsed + SkPaint mLastPaintCandidate; // associated with candidate glyph SkUnichar mLastUni; SkUnichar mLastUniCandidate; SkMatrix mMatrix; - SkPaint mPaint; + SkPaint mPaint; // only set up while the picture is parsed const uint16_t* mText; SkScalar mY; private: @@ -446,7 +457,7 @@ public: // assume that characters must be consecutive to describe spaces // (i.e., don't join rects drawn at different times) if (bounds.fTop != mLast.fTop || bounds.fBottom != mLast.fBottom - || bounds.fLeft > mLast.fRight + minSpaceWidth() + || bounds.fLeft > mLast.fRight + minSpaceWidth(mPaint) || bounds.fLeft < mLast.fLeft) { processLine(); mLast = bounds; @@ -477,7 +488,6 @@ protected: SkIRect mLast; SkTDArray<SkIRect> mParagraphs; SkTDArray<SkIRect> mSelected; - SkTDArray<SkIRect> mInColumn; bool mInBetween; private: typedef CommonCheck INHERITED; @@ -651,7 +661,7 @@ public: , mLast(area) , mLeft(left) { - mLast.set(last); + mLast.set(last); // CommonCheck::set() setGlyph(last); } @@ -706,7 +716,7 @@ public: mFocusX, mLeft ? "true" : "false", bounds.fLeft, bounds.fRight); reset(); mFocusX = mLeft ? bounds.fLeft : bounds.fRight; - mLast.set(*this); + mLast.set(*this); // CommonCheck::set() } protected: @@ -844,7 +854,7 @@ protected: mEndExtra.join(full); return mLastIntersects; } - int spaceGap = SkFixedRound(minSpaceWidth() * 3); + int spaceGap = SkFixedRound(minSpaceWidth(mPaint) * 3); // should text to the left of the start be added to the selection bounds? if (!mStartExtra.isEmpty()) { if (VERBOSE_LOGGING) DBG_NAV_LOGD("mSelectRect=(%d,%d,r=%d,b=%d)" diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 177a9ce..03263ef 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -936,7 +936,7 @@ void selectBestAt(const WebCore::IntRect& rect) } else { DBG_NAV_LOGD("CachedNode:%p (%d)", node, node->index()); WebCore::IntRect bounds = node->bounds(frame); - root->rootHistory()->setMouseBounds(frame->unadjustBounds(node, bounds)); + root->rootHistory()->setMouseBounds(bounds); m_viewImpl->updateCursorBounds(root, frame, node); showCursorTimed(); root->setCursor(const_cast<CachedFrame*>(frame), @@ -988,8 +988,6 @@ bool motionUp(int x, int y, int slop) } DBG_NAV_LOGD("CachedNode:%p (%d) x=%d y=%d rx=%d ry=%d", result, result->index(), x, y, rx, ry); - // No need to call unadjustBounds below. rx and ry are already adjusted to - // the absolute position of the node. WebCore::IntRect navBounds = WebCore::IntRect(rx, ry, 1, 1); history->setNavBounds(navBounds); history->setMouseBounds(navBounds); @@ -2240,7 +2238,7 @@ static bool nativeMoveCursorToNextTextInput(JNIEnv *env, jobject obj) if (!next) return false; const WebCore::IntRect& bounds = next->bounds(frame); - root->rootHistory()->setMouseBounds(frame->unadjustBounds(next, bounds)); + root->rootHistory()->setMouseBounds(bounds); view->getWebViewCore()->updateCursorBounds(root, frame, next); view->showCursorUntimed(); root->setCursor(const_cast<CachedFrame*>(frame), |