HTML parser should not associate elements inside templates with forms

When parsing <form><template><input>, the previous behavior was to associate
the <input> with the <form>, even though they're not in the same tree (or
even the same document!).

This patch changes that by checking, prior to creating a form control element,
whether the element to be created lives in a document with a browsing context.

BUG=247038

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

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