The button doesn't determine whether it has focus, the browser does. The highlighting method you mentioned is as good as any I can think of right now.
I think what you're seeing is the box-shadow
CSS property defined in your theme files; I thought you had been referring to the box that appears in Chrome when a Button is clicked.