Seems the simplest fix here may be to add <link rel=localization> elements to the templates, then maybe move https://searchfox.org/mozilla-central/rev/89235894292ac4ab4bd7dac44bc60c2e051905f4/dom/base/Document.cpp#3452-3481 to DocumentOrShadowRoot.cpp
Bug 1553176 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Seems the simplest fix here may be to add <link rel=localization> elements to the templates, then per emilio, "change aDocument here for the composed document, https://searchfox.org/mozilla-central/rev/89235894292ac4ab4bd7dac44bc60c2e051905f4/dom/html/HTMLLinkElement.cpp#141 and ensuring UnbindFromTree does something sane about it as well of course"