Fix keyboard navigation regressions in the diff viewer.

Review Request #9112 — Created July 31, 2017 and submitted

Christian Hammond
Review Board

A recent change improved performance in the diff viewer by optimizing
selectors. One of the selectors optimized was the one used to find
anchors in a diff. Unfortunately, it only looked in <tbody> tags, and
not in <thead>, skipping the file anchors. This prevented these
anchors from navigating to file headers, and for review requests
containing newly-introduced files, it wasn't possible to navigate to the

This change fixes the selector and adds a new suite of tests to ensure
that anchor loading, navigation, and key bindings all work correctly.

Tested manually that diff navigation worked for all diffs I threw at it.

Unit tests pass.

David Trowbridge
  1. Ship It!
Christian Hammond
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.5.x (f010052)