Avoid calling slower Node::firstChild() / Node::lastChild() when possible

Avoid calling slower Node::firstChild() / Node::lastChild() when possible by
using tighter typing. This way, we end up using ContainerNode::firstChild() /
ContainerNode::lastChild(), bypassing a useless isContainerNode() check.

R=eseidel@chromium.org, esprehn@chromium.org

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

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