If you have multiple forms on a page, it's easy for an element in one form to have the same #parents as an element in another form. For example, suppose a page has 2 search forms, and each form has an element named 'search'. In this case, if one of these is submitted with a validation error, when the page is rendered, both will have the 'error' class (and therefore, be red, or however the theme styles the error class). This is clearly bad UI. Solving this isn't trivial, because what's needed is for either _form_set_class() or form_set_error() to have access to $form_state (so that in addition to matching on #parents, we also only consider an element to be eligible for the 'error' class if its form's $form_state['process_input'] is TRUE).
|FAILED: [[SimpleTest]]: [MySQL] 40,111 pass(es), 1 fail(s), and 0 exception(s).|
|PASSED: [[SimpleTest]]: [MySQL] 40,132 pass(es).|
|FAILED: [[SimpleTest]]: [MySQL] 40,118 pass(es), 1 fail(s), and 0 exception(s).|