Get rid of loops looking for the first Element ancestor

Get rid of loops looking for the first Element ancestor and use
Node::parentElement() instead. There is no point going up more than one level
to find an Element ancestor.

Only non-Element nodes can have children: Document, DocumentFragment and Attr.
However, none of these can have parents.

This CL also uses Node::parentElement() instead of Node::parentNode() +
Node::isElementNode() in a couple of instances to simplify the code a bit.

R=esprehn@chromium.org

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

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