This change adds logic that applies a CSS class whenever mouseDown
occurs inside of a comment thread that makes comment messages
highlightable. This replicates the existing functionality of GWTUI. In
addition, logic for copying the messages of multiple comments at once
is included.
Bug: Issue 4494
Change-Id: Id8e49e500c8d48dbba661b885050657dd4cfc0be
At the time that syntax highlighting DOM was introduced, the offsets of
selection ranges had been broken. In change [1] Kasper fixed this for
GR-DIFF-HIGHLIGHT with selection normalization functions. However,
selections for copying code as implemented in GR-DIFF-SELECTION were
still un-normalized.
With this change, the normalization functionality introduced in [1] is
moved to a JS library so that it can be used by both components. Tests
are updated.
[1] I26c61ca706575ea5df6e3b7b18a27225834396e8
Change-Id: I35ab0f71a46b3fc1d7356a314a0cae856f2ef28e
This change uses a new method of generating the clipboard data that
circumvents several strange issues caused by shadow/shady DOM. This
new method is much more legible and abstracts more logic away from the
DOM.
Bug: Issue 4494
Change-Id: I8c186d6cbbe9536548d934f734856b1f9ced1a26
This change fixes two minor issues in Safari.
- In gr-diff-highlight, Safari does not support NodeList.forEach.
- In gr-diff-selection_test, a test that should have been failing (a
selection class was missing) was not being run in Chrome/CI. A prior
commit modified the CSS selectors that enable text selection, and the
test was not changed to reflect this.
SHA of the offending commit: 613b49c
Change-Id: I7ef3b017be9ae731496609430e3856f58e5bd24e
The addition of syntax highlighting silently broke copy/paste
functionality due to the addition of another layer of div nesting.
Related to this bug are some issues with correct text selection in
unified diff view, so this patch addresses them as well.
Bug: Issue 4317
Change-Id: Iac7379de4131ab4e44905a54218d42fcfe67ce62