Title: [113449] trunk
Revision
113449
Author
[email protected]
Date
2012-04-06 10:03:09 -0700 (Fri, 06 Apr 2012)

Log Message

Remove bogus assert from ChildListMutationScope
https://bugs.webkit.org/show_bug.cgi?id=83336

Reviewed by Ryosuke Niwa.

Source/WebCore:

This assert can trivially be triggered from script, but luckily the
code already behaves correctly without it.

* dom/ChildListMutationScope.cpp:
(WebCore::ChildListMutationScope::MutationAccumulator::enqueueMutationRecord):

LayoutTests:

Added a test that would trigger the assert.

* fast/mutation/observe-childList-expected.txt:
* fast/mutation/observe-childList.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (113448 => 113449)


--- trunk/LayoutTests/ChangeLog	2012-04-06 16:39:32 UTC (rev 113448)
+++ trunk/LayoutTests/ChangeLog	2012-04-06 17:03:09 UTC (rev 113449)
@@ -1,3 +1,15 @@
+2012-04-06  Adam Klein  <[email protected]>
+
+        Remove bogus assert from ChildListMutationScope
+        https://bugs.webkit.org/show_bug.cgi?id=83336
+
+        Reviewed by Ryosuke Niwa.
+
+        Added a test that would trigger the assert.
+
+        * fast/mutation/observe-childList-expected.txt:
+        * fast/mutation/observe-childList.html:
+
 2012-04-06  Zan Dobersek  <[email protected]>
 
         [Gtk] Unskip the video track tests

Modified: trunk/LayoutTests/fast/mutation/observe-childList-expected.txt (113448 => 113449)


--- trunk/LayoutTests/fast/mutation/observe-childList-expected.txt	2012-04-06 16:39:32 UTC (rev 113448)
+++ trunk/LayoutTests/fast/mutation/observe-childList-expected.txt	2012-04-06 17:03:09 UTC (rev 113449)
@@ -85,6 +85,9 @@
 PASS mutations[0].addedNodes[1] is addedDiv2
 PASS mutations[0].removedNodes.length is 0
 
+Setting an empty childlist to the empty string with innerHTML should not assert.
+PASS mutations is null
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/mutation/observe-childList.html (113448 => 113449)


--- trunk/LayoutTests/fast/mutation/observe-childList.html	2012-04-06 16:39:32 UTC (rev 113448)
+++ trunk/LayoutTests/fast/mutation/observe-childList.html	2012-04-06 17:03:09 UTC (rev 113449)
@@ -381,7 +381,30 @@
     start();
 }
 
-var tests = [testBasic, testWrongType, testMultipleRegistration, testMultipleObservers, testInnerHTMLAndInnerText, testReplaceChild, testInsertBefore, testAppendChild];
+function testInnerHTMLEmpty() {
+    function start() {
+        debug('Setting an empty childlist to the empty string with innerHTML should not assert.');
+
+        var div = document.createElement('div');
+        mutations = null;
+        observer = new WebKitMutationObserver(function(mutations) {
+            window.mutations = mutations;
+        });
+        observer.observe(div, {childList: true});
+        div.innerHTML = '';
+        setTimeout(finish, 0);
+    }
+
+    function finish() {
+        shouldBeNull('mutations');
+        debug('');
+        runNextTest();
+    }
+
+    start();
+}
+
+var tests = [testBasic, testWrongType, testMultipleRegistration, testMultipleObservers, testInnerHTMLAndInnerText, testReplaceChild, testInsertBefore, testAppendChild, testInnerHTMLEmpty];
 var testIndex = 0;
  
 function runNextTest() {

Modified: trunk/Source/WebCore/ChangeLog (113448 => 113449)


--- trunk/Source/WebCore/ChangeLog	2012-04-06 16:39:32 UTC (rev 113448)
+++ trunk/Source/WebCore/ChangeLog	2012-04-06 17:03:09 UTC (rev 113449)
@@ -1,3 +1,16 @@
+2012-04-06  Adam Klein  <[email protected]>
+
+        Remove bogus assert from ChildListMutationScope
+        https://bugs.webkit.org/show_bug.cgi?id=83336
+
+        Reviewed by Ryosuke Niwa.
+
+        This assert can trivially be triggered from script, but luckily the
+        code already behaves correctly without it.
+
+        * dom/ChildListMutationScope.cpp:
+        (WebCore::ChildListMutationScope::MutationAccumulator::enqueueMutationRecord):
+
 2012-04-06  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r113442.

Modified: trunk/Source/WebCore/dom/ChildListMutationScope.cpp (113448 => 113449)


--- trunk/Source/WebCore/dom/ChildListMutationScope.cpp	2012-04-06 16:39:32 UTC (rev 113448)
+++ trunk/Source/WebCore/dom/ChildListMutationScope.cpp	2012-04-06 17:03:09 UTC (rev 113449)
@@ -136,7 +136,6 @@
 
 void ChildListMutationScope::MutationAccumulator::enqueueMutationRecord()
 {
-    ASSERT(!isEmpty());
     if (isEmpty()) {
         clear();
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to