While working on the bug https://bugs.webkit.org/show_bug.cgi?id=50916, I noticed that this is the only element that is not calling its base class childrenChanged(). Adding code to Element::childrenChanged() will not have the desired effect on HTMLOutputElement.
Created attachment 81361 [details] Patch
Comment on attachment 81361 [details] Patch r=me
This modification actually does change behavior :) If you run the following without this change, the second alert will show 2 instead of 1. <!DOCTYPE html> <html> <head> <script> window.onload=function(){ if (window.layoutTestController) layoutTestController.dumpAsText(); var list = document.getElementsByTagName("span"); var el = document.getElementById("result"); alert("The number of spans before removal is " + list.length); document.getElementById("parentOutput").removeChild(document.getElementById("first")); alert("The number of spans after removal is " + list.length); } </script> </head> <body> <output id="parentOutput"><span class="first" id="first"></span><span class="second" id="second"></span></output> <br> Test that a live list is updated after the child of an HTMLOutputElement was removed. <br> <div id="result"></div> </body> </html>
Comment on attachment 81361 [details] Patch @Yael: Ah, beautiful! Let's add a test for it.
Created attachment 81436 [details] Patch V2
(In reply to comment #5) > Created an attachment (id=81436) [details] > Patch V2 Thank you guys for review and correcting my misunderstanding. I've added a test. Thanks!
Comment on attachment 81436 [details] Patch V2 Thank you for review. Could someone cq+?
Comment on attachment 81436 [details] Patch V2 Clearing flags on attachment: 81436 Committed r77902: <http://trac.webkit.org/changeset/77902>
All reviewed patches have been landed. Closing bug.