When you select text in an input field using the keyboard (using C-Space then C-b/f/p/n for instance),
C-g does not cancel text selection mode. The only way I know of to cancel text selection in this case is
to copy or cut the selected text using M-w or C-w or to press C-Space yet again. Besides this differing
from the behavior of Emacs, that behavior agrees with the overall meaning of C-g.
Exact steps to reproduce:
(1) Select a text input field on a webpage and type something.
(2) Press C-Space.
(3) Press C-b one or more times to select the last character you typed.
(4) Press C-g.
(5) Now observe that whatever cursor movement commands you execute (C-f, C-b, etc.), you are still
selecting text---even if you leave the input field and come back to it.