Title: [145584] branches/safari-536.30-branch

Diff

Modified: branches/safari-536.30-branch/LayoutTests/ChangeLog (145583 => 145584)


--- branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-03-12 21:19:05 UTC (rev 145583)
+++ branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-03-12 21:29:01 UTC (rev 145584)
@@ -1,5 +1,21 @@
 2013-03-12  Lucas Forschler  <lforsch...@apple.com>
 
+        Merge r128524
+
+    2012-09-13  Tom Sepez  <tse...@chromium.org>
+
+            ASSERT(!eventDispatchForbidden()) firest when removed plugin re-inserted as part of readyStateChange.
+            https://bugs.webkit.org/show_bug.cgi?id=93639
+
+            Reviewed by Ryosuke Niwa.
+
+            Add a new testcase to cover this issue.  Test passes if assert doesn't fire in debug builds.
+
+            * plugins/plugin-remove-readystatechange-expected.txt: Added.
+            * plugins/plugin-remove-readystatechange.html: Added.
+
+2013-03-12  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r126063
 
     2012-08-20  Ken Buchanan  <ke...@chromium.org>

Copied: branches/safari-536.30-branch/LayoutTests/plugins/plugin-remove-readystatechange-expected.txt (from rev 128524, trunk/LayoutTests/plugins/plugin-remove-readystatechange-expected.txt) (0 => 145584)


--- branches/safari-536.30-branch/LayoutTests/plugins/plugin-remove-readystatechange-expected.txt	                        (rev 0)
+++ branches/safari-536.30-branch/LayoutTests/plugins/plugin-remove-readystatechange-expected.txt	2013-03-12 21:29:01 UTC (rev 145584)
@@ -0,0 +1,3 @@
+ALERT: PASS: element could not be re-appended
+This test passes if it does not trip an assert in debug builds. It ensures a readystatechange event can't get dispatched until after a plugin is fully removed.
+

Copied: branches/safari-536.30-branch/LayoutTests/plugins/plugin-remove-readystatechange.html (from rev 128524, trunk/LayoutTests/plugins/plugin-remove-readystatechange.html) (0 => 145584)


--- branches/safari-536.30-branch/LayoutTests/plugins/plugin-remove-readystatechange.html	                        (rev 0)
+++ branches/safari-536.30-branch/LayoutTests/plugins/plugin-remove-readystatechange.html	2013-03-12 21:29:01 UTC (rev 145584)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div>
+This test passes if it does not trip an assert in debug builds.
+It ensures a readystatechange event can't get dispatched until after a plugin is fully removed.
+</div>
+<embed id="viewer" src=""
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+var i = 0;
+document.addEventListener('readystatechange', function() {
+    if (i == 1) {
+        try {
+            document.body.appendChild(document.getElementById('viewer'));
+        }
+        catch (e) {
+            alert('PASS: element could not be re-appended');
+       }
+    }
+    i++;
+});
+
+window.addEventListener('DOMContentLoaded', function() {
+    document.body.removeChild(document.getElementById('viewer'));
+});
+</script>
+</body>
+</html>

Modified: branches/safari-536.30-branch/Source/WebCore/ChangeLog (145583 => 145584)


--- branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-12 21:19:05 UTC (rev 145583)
+++ branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-12 21:29:01 UTC (rev 145584)
@@ -1,5 +1,27 @@
 2013-03-12  Lucas Forschler  <lforsch...@apple.com>
 
+        Merge r128524
+
+    2012-09-13  Tom Sepez  <tse...@chromium.org>
+
+            ASSERT(!eventDispatchForbidden()) fires when removed plugin re-inserted as part of readyStateChange.
+            https://bugs.webkit.org/show_bug.cgi?id=93639
+
+            Reviewed by Ryosuke Niwa.
+
+            Removing a plugin causes a detach which can cancel the last remaining load on a page,
+            resulting in a readyStateChange event during a time when things are inconsisent. Defer
+            the detach which triggers this chain of events until after the node is fully removed
+            from the document's elementsById map.
+
+            Test: plugins/plugin-remove-readystatechange.html
+
+            * dom/ContainerNode.cpp:
+            (WebCore::ContainerNode::removeChild):
+            (WebCore::ContainerNode::removeChildren):
+
+2013-03-12  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r126063
 
     2012-08-20  Ken Buchanan  <ke...@chromium.org>

Modified: branches/safari-536.30-branch/Source/WebCore/dom/ContainerNode.cpp (145583 => 145584)


--- branches/safari-536.30-branch/Source/WebCore/dom/ContainerNode.cpp	2013-03-12 21:19:05 UTC (rev 145583)
+++ branches/safari-536.30-branch/Source/WebCore/dom/ContainerNode.cpp	2013-03-12 21:29:01 UTC (rev 145584)
@@ -40,6 +40,7 @@
 #include "Page.h"
 #include "RenderBox.h"
 #include "RenderTheme.h"
+#include "RenderWidget.h"
 #include "RootInlineBox.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/Vector.h>
@@ -410,13 +411,15 @@
         return false;
     }
 
+    RenderWidget::suspendWidgetHierarchyUpdates();
+
     Node* prev = child->previousSibling();
     Node* next = child->nextSibling();
     removeBetween(prev, next, child.get());
-
     childrenChanged(false, prev, next, -1);
+    ChildNodeRemovalNotifier(this).notify(child.get());
 
-    ChildNodeRemovalNotifier(this).notify(child.get());
+    RenderWidget::resumeWidgetHierarchyUpdates();
     dispatchSubtreeModifiedEvent();
 
     return child;
@@ -486,6 +489,7 @@
     // and remove... e.g. stop loading frames, fire unload events.
     willRemoveChildren(protect.get());
 
+    RenderWidget::suspendWidgetHierarchyUpdates();
     forbidEventDispatch();
     Vector<RefPtr<Node>, 10> removedChildren;
     removedChildren.reserveInitialCapacity(childNodeCount());
@@ -527,6 +531,8 @@
         ChildNodeRemovalNotifier(this).notify(removedChildren[i].get());
 
     allowEventDispatch();
+    RenderWidget::resumeWidgetHierarchyUpdates();
+
     dispatchSubtreeModifiedEvent();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to