Use $.html() instead of setting innerHTML when inserting diff fragments.

Review Request #13521 — Created Feb. 5, 2024 and submitted

Information

Review Board
master

Reviewers

When loading the fragments into the diff viewer page, we used
innerHTML in 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 innerHTML doesn't work for this.
JQuery's $.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.
Summary ID
Use $.html() instead of setting innerHTML when inserting diff fragments.
When loading the fragments into the diff viewer page, we used `innerHTML` in 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 `innerHTML` doesn't work for this. JQuery's `$.html()` method checks for these and changes its behavior to do the right thing. Testing Done: - 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.
90aa5f4593debb199de351a0e43a09d2678dea61
maubin
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-7.x (15f34ac)