Use ContainerNode::hasChildren() instead of firstChild() in conditionals

Use ContainerNode::hasChildren() instead of firstChild() in conditionals to
increase code readability a bit.

R=rob.buis@samsung.com

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

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