Looked it up a bit. So we're indeed receiving the applicable state change, but somehow the stylesheet manager sees it as a new stylesheet, and so we do emit a new STYLESHEET resource. We should probably fix that, because in the style editor this ends up adding new stylesheets. Secondly, the rule view doesn't refresh when a new stylesheet is added, hence why we're showing out-of-date data here. I'll spawn another bug for that, with a "proper" test case (actually adding a new stylesheet)
Bug 1776831 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Looked it up a bit.
So we're indeed receiving the applicable state change, but somehow the stylesheet manager sees it as a new stylesheet, and so we do emit a new STYLESHEET resource.
We should probably fix that, because in the style editor this ends up adding new stylesheets.
Secondly, the rule view doesn't refresh when a new stylesheet is added, hence why we're showing out-of-date data here.
~~I'll spawn another bug for that, with a "proper" test case (actually adding a new stylesheet)~~
This can be seen on this page, selecting the body and clicking the button in the page: `data:text/html,<meta charset=utf8><button>Add stylesheet</button><script>document.addEventListener("click", () => { s = document.createElement("style"); s.textContent = 'body{ background: tomato }'; document.head.append(s); })</script>`