There's a setElementsRelation in VarienForm JS class. The idea of this method is quite interesting but all calls in template files are commented out.

Does anyone have any idea if it is just a sort of legacy, unfinished functionality or working code?

Same for this.elementFocus, this.elementBlur and this.highlightClass properties and elementOnFocus and elementOnBlur methods. They are just used to set a highlight class for <fieldset/> (!?) element of the form but it is not used anywhere.


My Guess is setElementsRelation was legacy and had caching issues.

There is a comment in the function:

// TODO: array of relation and caching

As for the overkill of setting every fieldset element to highlight on the blur and focus events, possibly a legacy dependency with an older stock template that would highlight fields on selection, or possibly to help facilitate the highlighting upon validation errors with prototype.js.

The real question is, how much client CPU cycles are wasted with these bindings?

  • 1
    Well, insignificant CPU usage doesn't mean this junk has to be kept for about 5 years. – Foo Bar May 30 '14 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.