From 9abf45709677b84106fec0215d84b4a65562cff3 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Fri, 25 Sep 2009 11:42:53 -0700 Subject: [PATCH] When detach the top Document, clean up the touch listeners and reset needTouchEvents. Fix http://b/issue?id=2145333 --- WebCore/dom/Document.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index e86cbc011..e4c5741b5 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -1394,6 +1394,17 @@ void Document::detach() FrameView* view = m_frame->view(); if (view) view->detachCustomScrollbars(); + +#if ENABLE(TOUCH_EVENTS) // Android + // clean up for the top document + if (!m_frame->ownerElement()) { + m_touchEventListeners.clear(); +#if PLATFORM(ANDROID) + if (view) + android::WebViewCore::getWebViewCore(view)->needTouchEvents(false); +#endif + } +#endif } // indicate destruction mode, i.e. attached() but renderer == 0 -- 2.11.0