Add renderer type checks to HTMLSelectElement event handlers.

focus() can change the renderer type.


This CL is based on a patch by jbutler@chromium.org. This CL fixed one bug in
the original CL, and added a test.
The test is only for OSX because other platforms don't use
HTMLSelectElement::platformHandleKeydownEvent.

BUG=349903
TEST=automated

Review URL: https://codereview.chromium.org/230143004

git-svn-id: svn://svn.chromium.org/blink/trunk@171216 bbb929c8-8fbe-4397-9dbb-9b2b20218538