geckodriver
geckodriver copied to clipboard
Gecko driver triggers MutationObserver for unrelated events
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
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.
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.