Title: [138207] branches/chromium/1364
Revision
138207
Author
[email protected]
Date
2012-12-19 17:34:41 -0800 (Wed, 19 Dec 2012)

Log Message

Revert 138190
> Merge 138181
> > Correct missing touch event handler de-registration for nested Documents and DOMWindows
> > https://bugs.webkit.org/show_bug.cgi?id=105384
> > 
> > Reviewed by James Robinson.
> > 
> > Source/WebCore: 
> > 
> > Correcting case by which a nested DOMWindow wouldn't clean up its event handler references
> > on its Document when removeAllEventListeners was called. Also, correctly propagating this
> > from a nested Document to its owner Document.
> > 
> > Updating fast/events/touch/touch-handler-count.html to catch this bug.
> > 
> > * dom/Document.cpp:
> > (WebCore::Document::didRemoveEventTargetNode):
> > * page/DOMWindow.cpp:
> > (WebCore::DOMWindow::removeAllEventListeners):
> > 
> > LayoutTests: 
> > 
> > * fast/events/touch/touch-handler-count-expected.txt:
> > * fast/events/touch/touch-handler-count.html: Adding case of nested DOMWindows with event handlers.
> > 
> 
> [email protected]
> Review URL: https://codereview.chromium.org/11635026

[email protected]
Review URL: https://codereview.chromium.org/11647025

Modified Paths

Diff

Modified: branches/chromium/1364/LayoutTests/fast/events/touch/touch-handler-count-expected.txt (138206 => 138207)


--- branches/chromium/1364/LayoutTests/fast/events/touch/touch-handler-count-expected.txt	2012-12-20 00:58:25 UTC (rev 138206)
+++ branches/chromium/1364/LayoutTests/fast/events/touch/touch-handler-count-expected.txt	2012-12-20 01:34:41 UTC (rev 138207)
@@ -71,8 +71,4 @@
 PASS window.internals.touchEventHandlerCount(document) is 2
 PASS window.internals.touchEventHandlerCount(document) is 2
 PASS window.internals.touchEventHandlerCount(document) is 0
-Test that nested Documents' touch handlers are properly removed from their parent Document.
-PASS window.internals.touchEventHandlerCount(document) is 0
-PASS window.internals.touchEventHandlerCount(document) is 1
-PASS window.internals.touchEventHandlerCount(document) is 0
 

Modified: branches/chromium/1364/LayoutTests/fast/events/touch/touch-handler-count.html (138206 => 138207)


--- branches/chromium/1364/LayoutTests/fast/events/touch/touch-handler-count.html	2012-12-20 00:58:25 UTC (rev 138206)
+++ branches/chromium/1364/LayoutTests/fast/events/touch/touch-handler-count.html	2012-12-20 01:34:41 UTC (rev 138207)
@@ -204,24 +204,5 @@
     shouldBe('window.internals.touchEventHandlerCount(document)', '0');
 })();
 
-debug("Test that nested Documents' touch handlers are properly removed from their parent Document.");
-(function() {
-    var iframe = document.createElement('iframe');
-    var touchtarget = document.getElementById('touchtarget');
-
-    shouldBe('window.internals.touchEventHandlerCount(document)', '0');
-
-    touchtarget.appendChild(iframe);
-
-    var nestedDocument = iframe.contentWindow.document;
-    nestedDocument.open('text/html', 'replace');
-    nestedDocument.write("<!DOCTYPE html>\n<html><body _onload_=\"window._ontouchstart_ = function() { };\"></body>");
-    nestedDocument.close();
-
-    shouldBe('window.internals.touchEventHandlerCount(document)', '1');
-
-    touchtarget.removeChild(iframe);
-    shouldBe('window.internals.touchEventHandlerCount(document)', '0');
-})();
 </script>
 </body>

Modified: branches/chromium/1364/Source/WebCore/dom/Document.cpp (138206 => 138207)


--- branches/chromium/1364/Source/WebCore/dom/Document.cpp	2012-12-20 00:58:25 UTC (rev 138206)
+++ branches/chromium/1364/Source/WebCore/dom/Document.cpp	2012-12-20 01:34:41 UTC (rev 138207)
@@ -5659,9 +5659,6 @@
 {
     if (m_touchEventTargets.get())
         m_touchEventTargets->removeAll(handler);
-    if (handler == this)
-        if (Document* parentDocument = this->parentDocument())
-            parentDocument->didRemoveEventTargetNode(this);
 }
 #endif
 

Modified: branches/chromium/1364/Source/WebCore/page/DOMWindow.cpp (138206 => 138207)


--- branches/chromium/1364/Source/WebCore/page/DOMWindow.cpp	2012-12-20 00:58:25 UTC (rev 138206)
+++ branches/chromium/1364/Source/WebCore/page/DOMWindow.cpp	2012-12-20 01:34:41 UTC (rev 138207)
@@ -1685,10 +1685,6 @@
     if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
         controller->removeAllDeviceEventListeners(this);
 #endif
-#if ENABLE(TOUCH_EVENTS)
-    if (Document* document = this->document())
-        document->didRemoveEventTargetNode(document);
-#endif
 
     removeAllUnloadEventListeners(this);
     removeAllBeforeUnloadEventListeners(this);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to