Added a hasFocus() method to UIFormElement.