Update HTML parser's foster-parenting algorithm to match the current spec

The spec used to disallow DocumentFragments as foster parents, but this
restriction was removed when <template> was added. This patch rewrites
Blink's parser to mirror the current spec language, in the process fixing
the attached bug (the added html5lib test is a regression test for
that bug).

Note, however, that this change causes us to fail the test for a different
DocumentFragment case, which was added in http://trac.webkit.org/changeset/124465
back when the spec used to require the foster parent to be an element. I've
updated the test expectations to match the new behavior.

The new behavior, while it matches the spec, is no longer compatible with
Firefox (the only other browser I tested). However, it seems unlikely that
this case comes up much in practice, since it requires reparenting elements
into a fragment while the parser is running.

BUG=419762

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

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