The template element in HTML 5 is special in the sense that it does not
add its contents into the DOM tree, but instead keeps them in a separate
shadow DOM document fragment. Interacting with the DOM tree cannot touch
the elements in the document fragment.
Closes GH-14906.
GH-13516 was created before the new DOM files were added, and the PR was
never rebased to include the new DOM files, so there are three places
which were not replaced.