OSDN Git Service

call hideCursor directly, avoiding a newer cache
authorCary Clark <cary@android.com>
Thu, 9 Dec 2010 16:47:01 +0000 (11:47 -0500)
committerCary Clark <cary@android.com>
Thu, 9 Dec 2010 16:47:01 +0000 (11:47 -0500)
The WebView interface hideCursor gets a newer cache if
one is available. This interface was also called when
the cursor animation completes, before the cursor is drawn.

Getting a newer cache at this time can cause the data
in m_ring to be invalid.

Pass the root cache stored as part of the ring data instead,
so that the ring is drawn consistently.

bug:3262275
Change-Id: Id205a10f96329e9d5ac794a8537f25a05918cafd

WebKit/android/nav/WebView.cpp

index e8bd0da..c5ed5e5 100644 (file)
@@ -231,6 +231,12 @@ void hideCursor()
     if (!root)
         return;
     DBG_NAV_LOG("");
+    hideCursor(root);
+}
+
+void hideCursor(CachedRoot* root)
+{
+    DBG_NAV_LOG("inner");
     m_viewImpl->m_hasCursorBounds = false;
     root->hideCursor();
     viewInvalidate();
@@ -405,7 +411,7 @@ void drawCursorPostamble()
         invalBounds.intersect(m_ring.m_absBounds);
         postInvalidateDelayed(m_ringAnimationEnd - time, invalBounds);
     } else {
-        hideCursor();
+        hideCursor(const_cast<CachedRoot*>(m_ring.m_root));
     }
 }