Status Update
Comments
fa...@gmail.com <fa...@gmail.com> #2
Sorry the quality if the video is not the best, but you should be able to see the issue.
lu...@gmail.com <lu...@gmail.com> #3
By debugging what happens in Chrome compared to what happens in Safari, it looks like the ShadowRoot doesn't have the getSelection method and therefore falls back to the selection of the document root, which isn't correct.
There is a cross-compatible implementation of the selection polyfill at [1] we could use.
Setting priority to P1 as this is a functional regression from Gerrit v3.0. Safari is the 2nd largest browser (20% share) and we should at least have a degraded by functional user interface.
[1]https://www.npmjs.com/package/shadow-selection-polyfill
There is a cross-compatible implementation of the selection polyfill at [1] we could use.
Setting priority to P1 as this is a functional regression from Gerrit v3.0. Safari is the 2nd largest browser (20% share) and we should at least have a degraded by functional user interface.
[1]
lu...@gmail.com <lu...@gmail.com> #4
[Description Changed]
lu...@gmail.com <lu...@gmail.com> #5
Browser market share of the past 12 months shows as the top #3 browsers:
1. Chrome: 63.38%
2. Safari: 19.25%
3. Firefox: 3.77%
1. Chrome: 63.38%
2. Safari: 19.25%
3. Firefox: 3.77%
lu...@gmail.com <lu...@gmail.com> #7
The above fix solves the problem, see the attached video showing a comment from Safari and Chrome.
fa...@gmail.com <fa...@gmail.com> #8
I gave it a go an I confirm it is working for me as well on both Chrome and Safari
lu...@gmail.com <lu...@gmail.com> #11
This was already reported in the https://crbug.com/gerrit/11811 . Closing this one as duplicate.
is...@google.com <is...@google.com> #12
Edits were made to reflect the following in Monorail: auto-CCs.
Description
Affected Version: Gerrit v3.1.x or later
What steps will reproduce the problem?
1. Pick a change and go on the change detail page
2. Expand a diff
3. Select a portion of a line
4. Press 'c' to comment
What is the expected output?
* The portion of the line selected is highlighted
* The comment is relative to the selected portion
What do you see instead?
* No highlighting
* The comment is related to the whole line
What is the output of the JS console log (if applicable)?
N/A
What is the performance record (seehttps://developers.google.com/web/tools
/chrome-devtools/evaluate-performance/reference#record)(if applicable)?
N/A
Please provide any additional information below.
The problem is on:
The fallback logic isn't working on Safari, as the document.getSelection() won't return the correct selection and it will be later discarded altogether.
The functionality was fully working on Gerrit v3.0.x, hence this is a functional regression.
Attached a screencast showing the issue.
The issue has been tested with Safari Version 14.0.1 (16610.2.11.51.8) and Safari Version 14.0.2 (16610.3.7.1.9)