Jonas, what do you think?
Created attachment 8726918 [details] [diff] [review] WIP Fixing this for transforms from script for the source document looks pretty hard. We'd have to give XPath treewalker a mode in which it knows about template and use that just for XSLT :-/.
I'm honestly not sure it's worth investing in this bug at all. XSLT is a dying technology and used by very few websites.
I replaced the HTML template tag with another HTML+js template technology, so that it works in Firefox, Opera and Chrome. I guess that people will rarely encounter this bug.