Improve focusin detection support

This change prevents unintentional scrolling and unfocusing of
whatever element was in focus before the feature detect in browsers
that need to do the long feature detect.

Adds test case.

Refs #17599

(cherry picked from commit 2536e5cd0935cc7356d584bab6ac2c73d3ad6164)

Conflicts:
	tests/on/on.js