When a node that would normally contain data-mw info is in first encapsulation position, we drop all that info in favour of the template info.
This is fine for serialization, since the template would take precedence, but other uses of the HTML may still have a need for it.
In particular, the media post-processing pass from T153080 wants to make use of options stored there,
https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/463125/14/lib/wt2html/pp/processors/wrapTemplates.js
An earlier version of Cite extension touched on it as well,
https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/436192/
but that was refactored out in,
https://github.com/wikimedia/parsoid/commit/d8cc76c56f150966359d303884c2b25cfde249b5
@ssastry asks,
So, the question is if we should unconditionally stop clobbering the previously existing data-mw info and provide access to it in the output HTML in some other systematic way.