Use $.html() instead of setting innerHTML when inserting diff fragments.
Review Request #13521 — Created Feb. 5, 2024 and submitted
When loading the fragments into the diff viewer page, we used
innerHTMLin order to gain a slight performance boost. When using
rendered review UI content for binary files, the contents often contain
<script>tags, and just setting
innerHTMLdoesn't work for this.
$.html()method checks for these and changes its behavior to
do the right thing.
- Ran js-tests.
- Added a file attachment for an image file in a diff. Saw that the
image review UI was rendered into the diff entry for that file.