Make form-association for <img> consistent with other form-associated elements.

Form-association for <img> was inconsistent with other form-associated elements.
 - If an <img> element was detached from the document tree, it was always
   disassociateted.
 - If an owner <form> was detached from the document tree but an associated
   <img> remained in the document tree, <img> wasn't disassociated.
This CL fixes them.

Specificatoin:
http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#association-of-controls-and-forms

Implementation:

* HTMLImageElement::formOwner:
  We need to fix this in this CL because tests made an assertion failure
in HTMLFormElement::elementFromPastNamesMap.

* HTMLImageElement::formRemovedFromTree:
  Added to fix the second bullet above.

* HTMLImageElement::removedFrom:
  Added common ancestor check to fix the first bullet above.

* HTMLImageElement::resetFormOwner:
  Added to centralize m_form handling.  This is an implementation of
'reset the form owner' steps for non-reassociateable elements.


BUG=336317
TEST=automated

Review URL: https://codereview.chromium.org/141113012

git-svn-id: svn://svn.chromium.org/blink/trunk@165436 bbb929c8-8fbe-4397-9dbb-9b2b20218538