New issue
Advanced search Search tips

Issue 634005 link

Starred by 4 users

Issue metadata

Status: Duplicate
Merged: issue 441355
Owner: ----
Closed: Nov 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Compat



Sign in to add a comment

MutationObserver stops working very easily when there are nested mutations

Reported by opet...@mozilla.com, Aug 3 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0

Example URL:
	data:text/html,<script>var c = 0; var node = document.createElement('div'); var appendNode = function() { console.log(++c); document.documentElement.appendChild(node); }; var observer = new MutationObserver(appendNode); observer.observe(document.documentElement, { childList: true }); appendNode(); </script>

Steps to reproduce the problem:
1. load 	data:text/html,<script>var c = 0; var node = document.createElement('div'); var appendNode = function() { console.log(++c); document.documentElement.appendChild(node); }; var observer = new MutationObserver(appendNode); observer.observe(document.documentElement, { childList: true }); appendNode(); </script>
2. looks at the web console

What is the expected behavior?
The script should lead to endless loop, so some warning should be shown to user about slow script or the child process should be killed.

What went wrong?
MutationObserver just stops working without any exceptions or warnings.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Does this work in other browsers? N/A 

Chrome version:   Channel: n/a
OS Version: 
Flash Version:
 
Labels: M-54 OS-Mac OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Windows-7, Ubuntu 14.04 and Mac OS using chrome latest canary M54-54.0.2816.4. Observed the script stopped with no exceptions or warnings under console.

This is a non-regression issues seen from earlier version of chrome M35-35.0.1849.0, Hence marking it as untriaged.

Components: Blink>DOM
Status: Available (was: Untriaged)
FWIW Firefox does hang and show the unresponsive script dialog. Chrome counts to 4 and stops.
Labels: Hotlist-Interop
Bulk-adding Hotlist-Interop to bugs filed by other browser vendors based on the summary.  Feel free to remove if this issue doesn't actually reflect a difference in behavior between engines.

Comment 5 by tkent@chromium.org, Nov 14 2016

Mergedinto: 441355
Status: Duplicate (was: Available)
This is due to  Issue 441355 .
In the last call of appendChild callback, document.documentElement.lastChild is |node| itself.  So, documentElement.appendChild(node) do nothing because of  Issue 441355 .

Sign in to add a comment