Store form control list with RefPtr.

FormController needs to keep a list of HTMLFormControlElementWithState in the
Document. We used raw pointers, and switch to RefPtrs by this CL to avoid
crashes.

Also, we don't need to keep controls not in the Document tree and controls in
shadow trees. So we change timing to register/unregister form controls.

BUG=236556

Review URL: https://chromiumcodereview.appspot.com/15161003

git-svn-id: svn://svn.chromium.org/blink/trunk@150689 bbb929c8-8fbe-4397-9dbb-9b2b20218538
6 files changed