Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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:


Canonical link: https://commits.webkit.org/100774@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ajklein committed Apr 6, 2012
1 parent b36b4df commit c11f7e1
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
12 changes: 12 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
2012-04-06 Adam Klein <adamk@chromium.org>

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 <zandobersek@gmail.com>

[Gtk] Unskip the video track tests
Expand Down
3 changes: 3 additions & 0 deletions LayoutTests/fast/mutation/observe-childList-expected.txt
Expand Up @@ -85,6 +85,9 @@ PASS mutations[0].addedNodes[0] is addedDiv1
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
Expand Down
25 changes: 24 additions & 1 deletion LayoutTests/fast/mutation/observe-childList.html
Expand Up @@ -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() {
Expand Down
13 changes: 13 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,16 @@
2012-04-06 Adam Klein <adamk@chromium.org>

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 <webkit.review.bot@gmail.com>

Unreviewed, rolling out r113442.
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/dom/ChildListMutationScope.cpp
Expand Up @@ -136,7 +136,6 @@ void ChildListMutationScope::MutationAccumulator::willRemoveChild(PassRefPtr<Nod

void ChildListMutationScope::MutationAccumulator::enqueueMutationRecord()
{
ASSERT(!isEmpty());
if (isEmpty()) {
clear();
return;
Expand Down

0 comments on commit c11f7e1

Please sign in to comment.