Avoid calling context on irrelevant forms.

#6303