If this was implemented as a Drupal behavior it might prevent the issue where the icon is not displayed after attempting to submit with validation errors.

Also it could handle potential problems where AJAX would be used to re-render the form, although I don't think that use case will come up in practice that often.