[macOS/Safari] Test "EditorView.movePos / properly handles line motion when not focused" #84
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Note: the same test code passed when the editor had focus. It is only the focus==false case that isn’t passing for Safari. And the telling code that seems to be introducing the difference takes a different branch for Safari compared to Chrome and Firefox.
At a lower level, textCoords() is coming up with a different result on Safari.
Failing Safari computes startCoords.left==28 and then posAtCoords comes up with offset 3.
Both passing Chrome and Firefox compute startCoords.left==20 (or 19.6 which is close enough) and then posAtCoords comes up with offset 2.
The value of 28 (failing case) or 20 (working cases) is coming from the call to textCoords when pos=3.
The working cases follow the if branch while the failing case follows the else branch. I added some comments to show what the variable values are at the time x is being set to 28.
Also interesting I think: if the code in textCoords is changed so all three browsers use the manual method, they all fail.
The reason the focus==true version of the test passes seems to be related to a routine higher in the call stack, movPos. The first if block in movPos is only executed for the offset==true case and only for Safari and Chrome. The little bit of logic outlined above only comes into play if the first block is not entered.
Trying to find the right level of description for the mix of browser and function and branch and result is challenging in such an analysis. Sorry if it is too long.
As of
57d0310433the tests all run again on Safari