with a specific example
) is selected, the page doesn't shift
the whole page shifts ( ) is still selected but not visible anymore)

The bug is not reproducible by selecting any text, but it is when following the steps provided. I found it interesting, so I tested it a bit.
This seems to be two bugs:
1) When selecting the last word of a sentence, the selection is expanded to include the line break after the word, but it is immediately reduced to omit it and select only the word.
2) When selecting a line break between texts (I guess it happens when the texts are on different divs) the browser is scrolled so that the top left corner of the texts (I guess the parent) is inside the visible window.
Both bugs is what makes the unexpected scroll. By selecting the last word of a sentence at the end of a chunk of text, the line break is selected, the page is scrolled, and then the line break is unselected.
More info about the second bug:
-It doesn't seem to happen with all line breaks, but most of them.
-Selecting a line break by long tapping is impossible (unless there is a bug like the previous one), however it also happens when you use the blue handlers to change the selected text.
-The scrolling of the browser won't happen if the top left corner of the text is already visible, however a very easy way to ensure this doesn't happens is by zooming on the word before selecting.
To summary:
1) Zoom any page
2) Scroll to the last word of a sentence in a text, you can try with the one at the end of this comment for example.
3) Long tap to select the word
4) The browser scrolls so that the top left corner of the text is at the top left corner of the browser window.
4) If it doesn't happens try with a different word, text or page.
Test: zoom and select this
It is really annoying. You can't select text on firefox :/
Dragging selection handles should not result in panning, even if a handle or the end of selection leaves the viewport.
I think a good way to still allow panning would be to start panning once a held handle is within a certain range of a viewport edge, like how browser tab dragging is handled on desktop Firefox.
Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1683251
Change performed by the Move to Bugzilla add-on.
Most helpful comment
The bug is not reproducible by selecting any text, but it is when following the steps provided. I found it interesting, so I tested it a bit.
This seems to be two bugs:
1) When selecting the last word of a sentence, the selection is expanded to include the line break after the word, but it is immediately reduced to omit it and select only the word.
2) When selecting a line break between texts (I guess it happens when the texts are on different divs) the browser is scrolled so that the top left corner of the texts (I guess the parent) is inside the visible window.
Both bugs is what makes the unexpected scroll. By selecting the last word of a sentence at the end of a chunk of text, the line break is selected, the page is scrolled, and then the line break is unselected.
More info about the second bug:
-It doesn't seem to happen with all line breaks, but most of them.
-Selecting a line break by long tapping is impossible (unless there is a bug like the previous one), however it also happens when you use the blue handlers to change the selected text.
-The scrolling of the browser won't happen if the top left corner of the text is already visible, however a very easy way to ensure this doesn't happens is by zooming on the word before selecting.
To summary:
1) Zoom any page
2) Scroll to the last word of a sentence in a text, you can try with the one at the end of this comment for example.
3) Long tap to select the word
4) The browser scrolls so that the top left corner of the text is at the top left corner of the browser window.
4) If it doesn't happens try with a different word, text or page.
Test: zoom and select this