https://chromium-review.googlesource.com/c/chromium/src/+/6769684 makes it work in the Chromium prototype with an added test, but I'm not sure it's sensible.
In particular, consider the situation where element.innerHTML = '...<template patchfor=target>stuff</template>' if elements with id "target" appear both before the <template patchfor> inside the HTML being parsed, and after element. Now reverse the before/after in this situation.
I think that no matter how it's defined, there will be a surprising situation where the element patched isn't the one that's first in tree order after the parsing is done.
https://chromium-review.googlesource.com/c/chromium/src/+/6769684 makes it work in the Chromium prototype with an added test, but I'm not sure it's sensible.
In particular, consider the situation where
element.innerHTML = '...<template patchfor=target>stuff</template>'if elements with id "target" appear both before the<template patchfor>inside the HTML being parsed, and afterelement. Now reverse the before/after in this situation.I think that no matter how it's defined, there will be a surprising situation where the element patched isn't the one that's first in tree order after the parsing is done.