geckodriver icon indicating copy to clipboard operation
geckodriver copied to clipboard

Gecko driver triggers MutationObserver for unrelated events

Open rbri opened this issue 3 years ago • 2 comments

System

  • Version: 0.30.0
  • Platform: Windows 10
  • Firefox: FF 98
  • Selenium: Selenium 4.1.3
  • Java: 1.8

Testcase

Running the page below with real browsers (by clicking the button) produces only 'click' as output.

Running the same with Selenium produces 'attributes; styleattributes; styleattributes; styleattributes; styleclick' when using the gecko driver and FF.

<html>
<body>
	<button id="testButton">Click me</button>
	<div id="logArea"></div>
	
	<script>
	const button = document.getElementById('testButton');
    const div = document.getElementById('logArea');
    button.addEventListener('click', e => {
		div.innerHTML += "click ";    });
		const targetNode = document.getElementById('testButton');
		const config = { attributes: true, childList: true, subtree: true };
		const callback = function(mutationsList, observer) {
			mutationsList.forEach(function(mutation) {
				div.innerHTML += mutation.type + "; ";
				div.innerHTML += mutation.attributeName;
			});
		document.count++;
	};
	
	const observer = new MutationObserver(callback);
	observer.observe(targetNode, config);
	</script>
</body></html>

Stacktrace

None

Trace-level log

None

rbri avatar Apr 07 '22 06:04 rbri

I am surprised no one is looking at The issue, considering there is a test case available and the issue was opened by the maintainer of HtmlUnit.

skyhirider avatar Jun 13 '22 20:06 skyhirider

Thanks for the report! After talking to @rbri today I had a look at this issue, which actually slipped trough - sorry for that, and the underlying problem we track on https://bugzilla.mozilla.org/show_bug.cgi?id=1575510.

whimboo avatar Aug 25 '22 12:08 whimboo