Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: Source/WebCore/dom/Document.cpp

Issue 11884035: Merge 139345 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/events/touch/nested-document-with-touch-handler-detached-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Document.cpp
===================================================================
--- Source/WebCore/dom/Document.cpp (revision 139661)
+++ Source/WebCore/dom/Document.cpp (working copy)
@@ -2138,6 +2138,11 @@
if (render)
render->destroy();
+#if ENABLE(TOUCH_EVENTS)
+ if (m_touchEventTargets && m_touchEventTargets->size() && parentDocument())
+ parentDocument()->didRemoveEventTargetNode(this);
+#endif
+
// This is required, as our Frame might delete itself as soon as it detaches
// us. However, this violates Node::detach() semantics, as it's never
// possible to re-attach. Eventually Document::detach() should be renamed,
@@ -5674,11 +5679,11 @@
#if ENABLE(TOUCH_EVENTS)
void Document::didRemoveEventTargetNode(Node* handler)
{
- if (m_touchEventTargets.get())
+ if (m_touchEventTargets) {
m_touchEventTargets->removeAll(handler);
- if (handler == this)
- if (Document* parentDocument = this->parentDocument())
- parentDocument->didRemoveEventTargetNode(this);
+ if ((handler == this || m_touchEventTargets->isEmpty()) && parentDocument())
+ parentDocument()->didRemoveEventTargetNode(this);
+ }
}
#endif
« no previous file with comments | « LayoutTests/fast/events/touch/nested-document-with-touch-handler-detached-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698